oasis-editor 0.0.224 → 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.
@@ -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", "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", "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];
@@ -207,6 +207,9 @@ export interface OasisCommandPayloads {
207
207
  tableAlignLeft: undefined;
208
208
  tableAlignCenter: undefined;
209
209
  tableAlignRight: undefined;
210
+ tableSetCellVerticalAlign: "top" | "middle" | "bottom";
211
+ tableSetCellTextDirection: "lrTb" | "tbRl" | "btLr" | "lrTbV" | "tbRlV";
212
+ tableToText: undefined;
210
213
  tableSetCellWidth: string | number;
211
214
  tableToggleHeaderRow: undefined;
212
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";