oasis-editor 0.0.203 → 0.0.204

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- export declare const OASIS_BUILTIN_COMMANDS: readonly ["selectAll", "insertFootnote", "insertText", "insertEquation", "updateEquation", "insertTableOfContents", "updateTableOfContents", "pastePlainText", "paste", "pasteAsPlainText", "pasteMergeFormatting", "formatPainter", "formatPainterContinuous", "cancelFormatPainter", "bold", "italic", "underline", "strike", "superscript", "subscript", "link", "unlink", "alignLeft", "alignCenter", "alignRight", "alignJustify", "orderedList", "bulletList", "find", "replace", "toggleTrackChanges", "acceptRevisions", "rejectRevisions", "nextRevision", "previousRevision", "nextComment", "previousComment", "resolveComment", "reopenComment", "deleteComment", "toggleShowMargins", "toggleShowParagraphMarks", "togglePreciseFonts", "undo", "redo", "pageBreak", "lineBreak", "splitBlock", "setFontFamily", "setFontSize", "increaseFontSize", "decreaseFontSize", "changeTextCase", "clearFormatting", "setColor", "setHighlight", "setTextShading", "setStyleId", "setCharacterStyleId", "setUnderlineStyle", "documentStyles", "print", "copy", "cut", "newDocument", "exportDocx", "exportPdf", "importDocument", "insertHtml", "insertImage", "editImageAlt", "insertImageCaption", "imageContext", "imageWidthCm", "imageHeightCm", "imageCrop", "imageCropAspect", "imageCropShape", "imageCropFill", "imageCropFit", "imageCropReset", "imageBorder", "outdent", "indent", "togglePageBreakBefore", "toggleKeepWithNext", "setSpacingAfter", "setSpacingBefore", "setIndentLeft", "setIndentRight", "setIndentFirstLine", "setIndentHanging", "setSpecialIndent", "setParagraphShading", "applyParagraphBorders", "setLineHeight", "setListFormat", "setListStartAt", "toggleOrientation", "setOrientation", "sectionBreakNextPage", "sectionBreakContinuous", "setPageMargins", "applyDocumentTheme", "setDocumentColorScheme", "setDocumentFontScheme", "setDocumentParagraphSpacing", "setDocumentEffects", "setDocumentPageColor", "setDocumentWatermark", "setDocumentPageBorder", "setDocumentDesignDefault", "tableContext", "tableMerge", "tableSplit", "tableInsertColumnBefore", "tableInsertColumnAfter", "tableDeleteColumn", "tableInsertRowBefore", "tableInsertRowAfter", "tableDeleteRow", "tableCellShading", "tableCellBorders", "tableCellNoBorders", "tableApplyBorderPreset", "toggleTableDrawBorders", "toggleTableGridlines", "tableWidth100", "tableAlignLeft", "tableAlignCenter", "tableAlignRight", "tableSetCellWidth", "tableToggleHeaderRow", "tableToggleTotalRow", "tableToggleBandedRows", "tableToggleFirstColumn", "tableToggleLastColumn", "tableToggleBandedColumns", "setTableStyle", "tableToggleAutoFit", "tableDistributeColumns", "tableDistributeRows", "insertTable", "insertShape", "openSymbolDialog", "openEquationDialog"];
1
+ export declare const OASIS_BUILTIN_COMMANDS: readonly ["selectAll", "insertFootnote", "insertText", "insertEquation", "updateEquation", "insertTableOfContents", "updateTableOfContents", "pastePlainText", "paste", "pasteAsPlainText", "pasteMergeFormatting", "formatPainter", "formatPainterContinuous", "cancelFormatPainter", "bold", "italic", "underline", "strike", "superscript", "subscript", "link", "unlink", "alignLeft", "alignCenter", "alignRight", "alignJustify", "orderedList", "bulletList", "find", "replace", "toggleTrackChanges", "acceptRevisions", "rejectRevisions", "nextRevision", "previousRevision", "nextComment", "previousComment", "newComment", "replyComment", "resolveComment", "reopenComment", "deleteComment", "toggleShowMargins", "toggleShowParagraphMarks", "togglePreciseFonts", "undo", "redo", "pageBreak", "lineBreak", "splitBlock", "setFontFamily", "setFontSize", "increaseFontSize", "decreaseFontSize", "changeTextCase", "clearFormatting", "setColor", "setHighlight", "setTextShading", "setStyleId", "setCharacterStyleId", "setUnderlineStyle", "documentStyles", "print", "copy", "cut", "newDocument", "exportDocx", "exportPdf", "importDocument", "insertHtml", "insertImage", "editImageAlt", "insertImageCaption", "imageContext", "imageWidthCm", "imageHeightCm", "imageCrop", "imageCropAspect", "imageCropShape", "imageCropFill", "imageCropFit", "imageCropReset", "imageBorder", "outdent", "indent", "togglePageBreakBefore", "toggleKeepWithNext", "setSpacingAfter", "setSpacingBefore", "setIndentLeft", "setIndentRight", "setIndentFirstLine", "setIndentHanging", "setSpecialIndent", "setParagraphShading", "applyParagraphBorders", "setLineHeight", "setListFormat", "setListStartAt", "toggleOrientation", "setOrientation", "sectionBreakNextPage", "sectionBreakContinuous", "setPageMargins", "applyDocumentTheme", "setDocumentColorScheme", "setDocumentFontScheme", "setDocumentParagraphSpacing", "setDocumentEffects", "setDocumentPageColor", "setDocumentWatermark", "setDocumentPageBorder", "setDocumentDesignDefault", "tableContext", "tableMerge", "tableSplit", "tableInsertColumnBefore", "tableInsertColumnAfter", "tableDeleteColumn", "tableInsertRowBefore", "tableInsertRowAfter", "tableDeleteRow", "tableCellShading", "tableCellBorders", "tableCellNoBorders", "tableApplyBorderPreset", "toggleTableDrawBorders", "toggleTableGridlines", "tableWidth100", "tableAlignLeft", "tableAlignCenter", "tableAlignRight", "tableSetCellWidth", "tableToggleHeaderRow", "tableToggleTotalRow", "tableToggleBandedRows", "tableToggleFirstColumn", "tableToggleLastColumn", "tableToggleBandedColumns", "setTableStyle", "tableToggleAutoFit", "tableDistributeColumns", "tableDistributeRows", "insertTable", "insertShape", "openSymbolDialog", "openEquationDialog"];
2
2
  export type OasisBuiltinCommand = (typeof OASIS_BUILTIN_COMMANDS)[number];
@@ -0,0 +1,23 @@
1
+ import { EditorComment, EditorCommentAnchor, EditorState } from '../model.js';
2
+ export interface CommentContent {
3
+ id: string;
4
+ author: string;
5
+ text: string;
6
+ date: number;
7
+ }
8
+ export interface CommentRange {
9
+ start: EditorCommentAnchor;
10
+ end: EditorCommentAnchor;
11
+ }
12
+ /**
13
+ * A selection becomes a range; a caret on existing text expands to the word
14
+ * under the caret. Blank documents cannot create invisible, unselectable
15
+ * zero-width annotations.
16
+ */
17
+ export declare function getCommentRangeForSelection(state: EditorState): CommentRange | null;
18
+ /** Creates a single anchored thread; metadata and selection remain immutable. */
19
+ export declare function insertCommentAtSelection(state: EditorState, content: CommentContent): EditorState;
20
+ /** Replies deliberately have no duplicate range anchors; OOXML binds them by parent. */
21
+ export declare function replyToComment(state: EditorState, parentId: string, content: CommentContent): EditorState;
22
+ /** Render a nested discussion in document insertion order without duplicating anchors. */
23
+ export declare function collectCommentThreadReplies(comments: Readonly<Record<string, EditorComment>>, parentId: string): EditorComment[];
@@ -68,6 +68,8 @@ export interface OasisCommandPayloads {
68
68
  previousRevision: undefined;
69
69
  nextComment: undefined;
70
70
  previousComment: undefined;
71
+ newComment: undefined;
72
+ replyComment: undefined;
71
73
  resolveComment: undefined;
72
74
  reopenComment: undefined;
73
75
  deleteComment: undefined;