oasis-editor 0.0.223 → 0.0.225

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.
@@ -37,6 +37,8 @@ declare function createEditorCommandsControllerImpl(deps: EditorCommandsControll
37
37
  applyToggleShowParagraphMarksCommand: () => void;
38
38
  applyAcceptRevisionsCommand: () => void;
39
39
  applyRejectRevisionsCommand: () => void;
40
+ applyAcceptAllRevisionsCommand: () => void;
41
+ applyRejectAllRevisionsCommand: () => void;
40
42
  applyLinkCommand: (href: string | null) => void;
41
43
  promptForLink: () => void;
42
44
  removeLinkCommand: () => void;
@@ -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", "newComment", "replyComment", "editComment", "toggleCommentsPanel", "resolveComment", "reopenComment", "deleteComment", "toggleShowMargins", "toggleShowParagraphMarks", "togglePreciseFonts", "undo", "redo", "pageBreak", "lineBreak", "columnBreak", "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", "sectionBreakEvenPage", "sectionBreakOddPage", "sectionBreakNextColumn", "setPageMargins", "setSectionPageNumbering", "setPaperSize", "setPaperSizePreset", "setColumns", "setColumnsPreset", "editHeader", "editFooter", "editFirstPageHeader", "editEvenPageHeader", "editFirstPageFooter", "editEvenPageFooter", "insertPageNumber", "insertPageNumberXOfY", "placePageNumberTop", "placePageNumberBottom", "insertBookmark", "removeBookmark", "insertDateField", "insertCrossReference", "exitHeaderFooter", "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", "acceptAllRevisions", "rejectAllRevisions", "nextRevision", "previousRevision", "nextComment", "previousComment", "newComment", "replyComment", "editComment", "toggleCommentsPanel", "resolveComment", "reopenComment", "deleteComment", "toggleShowMargins", "toggleShowParagraphMarks", "togglePreciseFonts", "undo", "redo", "pageBreak", "lineBreak", "columnBreak", "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", "sectionBreakEvenPage", "sectionBreakOddPage", "sectionBreakNextColumn", "setPageMargins", "setSectionPageNumbering", "setPaperSize", "setPaperSizePreset", "setColumns", "setColumnsPreset", "editHeader", "editFooter", "editFirstPageHeader", "editEvenPageHeader", "editFirstPageFooter", "editEvenPageFooter", "insertPageNumber", "insertPageNumberXOfY", "placePageNumberTop", "placePageNumberBottom", "insertBookmark", "removeBookmark", "insertDateField", "insertCrossReference", "exitHeaderFooter", "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", "tableSetCellVerticalAlign", "tableSetCellTextDirection", "tableToText", "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];
@@ -7,3 +7,16 @@ export declare function collectSelectedRevisionIds(state: EditorState): Set<stri
7
7
  export declare function hasRevisionsInSelection(state: EditorState): boolean;
8
8
  export declare function acceptRevisionsInSelection(state: EditorState): EditorState;
9
9
  export declare function rejectRevisionsInSelection(state: EditorState): EditorState;
10
+ /**
11
+ * Collect every tracked-revision id in the whole document: across all sections,
12
+ * header/footer stories, table/row/cell property revisions, section property
13
+ * revisions, and footnote/endnote stories. Unlike the selection-scoped variant
14
+ * there is no active zone: Accept All / Reject All operate on the full model.
15
+ */
16
+ export declare function collectAllRevisionIds(state: EditorState): Set<string>;
17
+ /** Whether the whole document contains any resolvable tracked revision. */
18
+ export declare function hasRevisionsInDocument(state: EditorState): boolean;
19
+ /** Accept every tracked revision in the whole document. */
20
+ export declare function acceptAllRevisions(state: EditorState): EditorState;
21
+ /** Reject every tracked revision in the whole document. */
22
+ export declare function rejectAllRevisions(state: EditorState): EditorState;
@@ -65,6 +65,8 @@ export interface OasisCommandPayloads {
65
65
  toggleTrackChanges: undefined;
66
66
  acceptRevisions: undefined;
67
67
  rejectRevisions: undefined;
68
+ acceptAllRevisions: undefined;
69
+ rejectAllRevisions: undefined;
68
70
  nextRevision: undefined;
69
71
  previousRevision: undefined;
70
72
  nextComment: undefined;
@@ -205,6 +207,9 @@ export interface OasisCommandPayloads {
205
207
  tableAlignLeft: undefined;
206
208
  tableAlignCenter: undefined;
207
209
  tableAlignRight: undefined;
210
+ tableSetCellVerticalAlign: "top" | "middle" | "bottom";
211
+ tableSetCellTextDirection: "lrTb" | "tbRl" | "btLr" | "lrTbV" | "tbRlV";
212
+ tableToText: undefined;
208
213
  tableSetCellWidth: string | number;
209
214
  tableToggleHeaderRow: undefined;
210
215
  tableToggleTotalRow: undefined;
@@ -19,4 +19,31 @@ export declare function resolveActiveTableLocation(state: EditorState): ActiveTa
19
19
  * structural sharing for every unrelated block and cell.
20
20
  */
21
21
  export declare function updateTableAtPath(blocks: EditorBlockNode[], tablePath: readonly TablePathSegment[], updateTable: (table: EditorTableNode) => EditorTableNode): EditorBlockNode[];
22
+ /**
23
+ * Reads the innermost table identified by `tablePath` from a block story
24
+ * (`getBlocksForZone` + the top-level path), following nested hops into the
25
+ * parent cell's `blocks` array as `updateTableAtPath` does.
26
+ */
27
+ export declare function readInnermostTableAtPath(blocks: readonly EditorBlockNode[] | undefined, tablePath: readonly TablePathSegment[]): EditorTableNode | null;
28
+ /**
29
+ * Splices a list of replacement blocks in place of the innermost table
30
+ * identified by `tablePath`. Mirrors `updateTableAtPath` structurally, but
31
+ * replaces the target table with `replacement` (Word's Convert Table to Text).
32
+ */
33
+ export declare function replaceInnermostTableAtPath(blocks: EditorBlockNode[], tablePath: readonly TablePathSegment[], replacement: readonly EditorBlockNode[]): EditorBlockNode[] | null;
34
+ /**
35
+ * Resolves the block story that contains the active table (the story whose
36
+ * paragraph owns the caret), based on the same zone/story-selection rules
37
+ * `updateSelectedSectionStory` uses: for main/header/footer it picks the
38
+ * section's relevant story (first page / even page / default), and for
39
+ * footnotes it picks the owning note's `blocks`.
40
+ */
41
+ export declare function getActiveTableStory(state: EditorState): EditorBlockNode[] | null;
42
+ /**
43
+ * Replaces the active table (the innermost table containing the caret) with a
44
+ * list of replacement blocks, mirroring `updateActiveTableBlocks` but for the
45
+ * Convert Table to Text splice operation. Handles footnote and all section
46
+ * stories; a no-op when no active table resolves.
47
+ */
48
+ export declare function replaceActiveTableWithBlocks(state: EditorState, replacement: readonly EditorBlockNode[]): EditorState;
22
49
  export declare function updateActiveTableBlocks(state: EditorState, updateTable: (table: EditorTableNode) => EditorTableNode): EditorState;
@@ -0,0 +1,12 @@
1
+ import { EditorParagraphNode, EditorState, EditorTableNode } from '../../model.js';
2
+ /** True when the caret sits inside an editable table that can be converted. */
3
+ export declare function canConvertActiveTableToText(state: EditorState): boolean;
4
+ /**
5
+ * Word's "Convert Table to Text": replaces the active (innermost) table with
6
+ * a run of body paragraphs, one per cell paragraph in document order, keeping
7
+ * each cell's paragraph content. The caret lands at the start of the first
8
+ * produced paragraph. A no-op when the caret is outside a table.
9
+ */
10
+ export declare function convertActiveTableToText(state: EditorState): EditorState;
11
+ /** Flattens a table's cell paragraphs, in document order, as fresh clones. */
12
+ export declare function tableToParagraphs(table: EditorTableNode): EditorParagraphNode[];
@@ -4,3 +4,4 @@ export * from './table/tableRowCommands.js';
4
4
  export * from './table/tableColumnCommands.js';
5
5
  export * from './table/insertTableCommand.js';
6
6
  export * from './table/tableFloatingCommands.js';
7
+ export * from './table/tableConvertCommands.js';
@@ -31,7 +31,10 @@ export declare const MERGE_KEYS: {
31
31
  readonly tableBorders: "tableBorders";
32
32
  readonly tableWidth: "tableWidth";
33
33
  readonly tableAlign: "tableAlign";
34
+ readonly tableCellVerticalAlign: "tableCellVerticalAlign";
35
+ readonly tableCellTextDirection: "tableCellTextDirection";
34
36
  readonly tableCellWidth: "tableCellWidth";
37
+ readonly tableToText: "tableToText";
35
38
  readonly tableStyleOptions: "tableStyleOptions";
36
39
  readonly tableStyleGallery: "tableStyleGallery";
37
40
  readonly tableDistribute: "tableDistribute";