oasis-editor 0.0.225 → 0.0.226

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", "tableSetCellVerticalAlign", "tableSetCellTextDirection", "tableToText", "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", "textToTable", "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];
@@ -210,6 +210,7 @@ export interface OasisCommandPayloads {
210
210
  tableSetCellVerticalAlign: "top" | "middle" | "bottom";
211
211
  tableSetCellTextDirection: "lrTb" | "tbRl" | "btLr" | "lrTbV" | "tbRlV";
212
212
  tableToText: undefined;
213
+ textToTable: undefined;
213
214
  tableSetCellWidth: string | number;
214
215
  tableToggleHeaderRow: undefined;
215
216
  tableToggleTotalRow: undefined;
@@ -39,6 +39,13 @@ export declare function replaceInnermostTableAtPath(blocks: EditorBlockNode[], t
39
39
  * footnotes it picks the owning note's `blocks`.
40
40
  */
41
41
  export declare function getActiveTableStory(state: EditorState): EditorBlockNode[] | null;
42
+ /**
43
+ * Table-free variant of `getActiveTableStory`: resolves the block story that
44
+ * owns the caret (from `getActiveZone`), used when the caret is not inside a
45
+ * table (e.g. Text to Table). Returns `null` when the caret sits in no
46
+ * editable story.
47
+ */
48
+ export declare function getActiveCaretStory(state: EditorState): EditorBlockNode[] | null;
42
49
  /**
43
50
  * Replaces the active table (the innermost table containing the caret) with a
44
51
  * list of replacement blocks, mirroring `updateActiveTableBlocks` but for the
@@ -47,3 +54,11 @@ export declare function getActiveTableStory(state: EditorState): EditorBlockNode
47
54
  */
48
55
  export declare function replaceActiveTableWithBlocks(state: EditorState, replacement: readonly EditorBlockNode[]): EditorState;
49
56
  export declare function updateActiveTableBlocks(state: EditorState, updateTable: (table: EditorTableNode) => EditorTableNode): EditorState;
57
+ /**
58
+ * Applies `updateBlocks` to the block story that owns the caret, regardless of
59
+ * whether the caret sits inside a table. Resolves the story from the active
60
+ * editing zone (footnote, or the section main/header/footer story), mirroring
61
+ * `updateActiveTableBlocks` but without requiring a table location. Used by the
62
+ * Text to Table conversion which splices a table into a paragraph run.
63
+ */
64
+ export declare function updateActiveCaretBlocks(state: EditorState, updateBlocks: (blocks: EditorBlockNode[]) => EditorBlockNode[]): EditorState;
@@ -0,0 +1,20 @@
1
+ import { EditorParagraphNode, EditorState, EditorTableNode } from '../../model.js';
2
+ /**
3
+ * True when the caret can be turned into a table: it must sit in an editable
4
+ * story (main/header/footer/footnote) but NOT inside an existing table.
5
+ */
6
+ export declare function canConvertActiveTextToTable(state: EditorState): boolean;
7
+ /**
8
+ * Word's "Convert Text to Table": splits the selected paragraphs on TAB into
9
+ * cells (each paragraph becomes a row, every tab-separated segment a column),
10
+ * splices the resulting table in place of the selection, and lands the caret in
11
+ * the first cell. A no-op when the caret is inside a table or outside an
12
+ * editable story.
13
+ */
14
+ export declare function convertActiveTextToTable(state: EditorState): EditorState;
15
+ /**
16
+ * Builds a table from a list of source paragraphs. Each paragraph becomes one
17
+ * row; tab-separated run segments become the row's cells. Rows shorter than the
18
+ * widest row are padded with empty cells so the grid stays rectangular.
19
+ */
20
+ export declare function buildTableFromParagraphs(paragraphs: EditorParagraphNode[]): EditorTableNode;
@@ -5,3 +5,4 @@ export * from './table/tableColumnCommands.js';
5
5
  export * from './table/insertTableCommand.js';
6
6
  export * from './table/tableFloatingCommands.js';
7
7
  export * from './table/tableConvertCommands.js';
8
+ export * from './table/tableTextToTableCommands.js';
@@ -35,6 +35,7 @@ export declare const MERGE_KEYS: {
35
35
  readonly tableCellTextDirection: "tableCellTextDirection";
36
36
  readonly tableCellWidth: "tableCellWidth";
37
37
  readonly tableToText: "tableToText";
38
+ readonly textToTable: "textToTable";
38
39
  readonly tableStyleOptions: "tableStyleOptions";
39
40
  readonly tableStyleGallery: "tableStyleGallery";
40
41
  readonly tableDistribute: "tableDistribute";