oasis-editor 0.0.304 → 0.0.306

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.
@@ -38,6 +38,7 @@ export interface EditorKeyboardDeps extends EditorTransactionPort, FocusInputPor
38
38
  applySelectionPreservingStructure: (selection: EditorState["selection"]) => void;
39
39
  toggleFindReplace: (open?: boolean) => void;
40
40
  toggleReplace: (open?: boolean) => void;
41
+ toggleCommandSearch: (open?: boolean) => void;
41
42
  executeCommand?: (commandName: string, payload?: unknown) => unknown;
42
43
  canExecuteCommand?: (commandName: string, payload?: unknown) => boolean;
43
44
  }
@@ -2,6 +2,12 @@ import { CommandState, OasisCommand, OasisCommandContext, OasisCommandRegistry }
2
2
  export declare class CommandRegistry implements OasisCommandRegistry {
3
3
  private commands;
4
4
  private contextProvider;
5
+ /**
6
+ * Policy-free notification hook invoked after a command executes
7
+ * successfully. Repeat-last-action tracking (Word's F4) plugs in here
8
+ * without the registry knowing anything about repeat semantics.
9
+ */
10
+ onExecuted?: (name: string, payload?: unknown) => void;
5
11
  setContextProvider(provider: () => OasisCommandContext): void;
6
12
  register<TPayload = unknown, TResult = unknown>(name: string, command: OasisCommand<TPayload, TResult>): void;
7
13
  unregister(name: string): void;
@@ -1,2 +1,2 @@
1
- export declare const OASIS_BUILTIN_COMMANDS: readonly ["selectAll", "selectWord", "selectSentence", "selectParagraph", "selectCollapse", "selectText", "selectRange", "insertFootnote", "insertText", "insertEquation", "updateEquation", "insertTableOfContents", "updateTableOfContents", "pastePlainText", "paste", "pasteAsPlainText", "pasteMergeFormatting", "formatPainter", "formatPainterContinuous", "cancelFormatPainter", "bold", "italic", "underline", "doubleUnderline", "wordUnderline", "strike", "doubleStrike", "smallCaps", "allCaps", "hidden", "noProof", "webHidden", "specVanish", "contextualAlternates", "characterBorder", "shadow", "emboss", "engrave", "outline", "superscript", "subscript", "link", "unlink", "alignLeft", "alignCenter", "alignRight", "alignJustify", "orderedList", "bulletList", "find", "replace", "replaceAll", "toggleTrackChanges", "toggleRevisionMarkup", "toggleOutlinePanel", "toggleRevisionsPanel", "acceptRevisions", "rejectRevisions", "setReviewDisplayMode", "acceptAllRevisions", "rejectAllRevisions", "requestAcceptAllRevisions", "requestRejectAllRevisions", "nextRevision", "previousRevision", "nextComment", "previousComment", "newComment", "replyComment", "editComment", "toggleCommentsPanel", "resolveComment", "reopenComment", "deleteComment", "toggleShowMargins", "toggleShowParagraphMarks", "togglePreciseFonts", "undo", "redo", "pageBreak", "lineBreak", "columnBreak", "splitBlock", "insertNonBreakingSpace", "insertNonBreakingHyphen", "insertOptionalHyphen", "insertEmDash", "insertEllipsis", "insertCopyright", "insertRegistered", "insertTrademark", "setFontFamily", "setFontSize", "increaseFontSize", "decreaseFontSize", "growFont1", "shrinkFont1", "changeTextCase", "clearFormatting", "setColor", "setHighlight", "setTextShading", "setStyleId", "setCharacterStyleId", "setUnderlineStyle", "applyUnderlineStyle", "setUnderlineColor", "setCharacterScale", "setCharacterSpacing", "setRunSnapToGrid", "setFitText", "setBaselineShift", "setEmphasisMark", "setTextEffect", "setKerning", "setLigatures", "setNumberSpacing", "setNumberForm", "setStylisticSet", "documentStyles", "print", "copy", "cut", "newDocument", "saveDocument", "exportDocx", "exportPdf", "importDocument", "insertHtml", "insertImage", "editImageAlt", "insertImageCaption", "imageContext", "imageWidthCm", "imageHeightCm", "imageCrop", "imageCropAspect", "imageCropShape", "imageCropFill", "imageCropFit", "imageCropReset", "imageFlip", "imageRotate", "imageBorder", "imageTransparency", "resetImage", "outdent", "indent", "moveParagraphsUp", "moveParagraphsDown", "togglePageBreakBefore", "toggleKeepWithNext", "toggleKeepLinesTogether", "toggleWidowControl", "toggleParagraphBidi", "setParagraphBidi", "setParagraphAlign", "sortParagraphs", "promote", "demote", "resetParagraphFormatting", "setParagraphTabStops", "setOutlineLevel", "setSpacingAfter", "setSpacingBefore", "setContextualSpacing", "setMirrorIndents", "setLineRule", "setTextDirection", "setSuppressAutoHyphens", "setSuppressLineNumbers", "setKinsoku", "setOverflowPunct", "setWordWrap", "setAutoSpaceDE", "setAutoSpaceDN", "setAdjustRightInd", "setTopLinePunct", "setPageBreakBefore", "setKeepWithNext", "setKeepLinesTogether", "setWidowControl", "setIndentLeft", "setIndentRight", "setIndentFirstLine", "setIndentHanging", "setSpecialIndent", "setParagraphShading", "applyParagraphBorders", "applyHorizontalLine", "setDropCap", "setLineHeight", "setListFormat", "setListStartAt", "setListLevel", "toggleOrientation", "setOrientation", "sectionBreakNextPage", "sectionBreakContinuous", "sectionBreakEvenPage", "sectionBreakOddPage", "sectionBreakNextColumn", "setPageMargins", "setMarginsPreset", "setSectionPageNumbering", "setPaperSize", "setPaperSizePreset", "setColumns", "setColumnsPreset", "setSectionVerticalAlign", "setSectionStart", "setSectionBidi", "setHyphenation", "editHeader", "editFooter", "editFirstPageHeader", "editEvenPageHeader", "editFirstPageFooter", "editEvenPageFooter", "insertPageNumber", "insertPageNumberXOfY", "placePageNumberTop", "placePageNumberBottom", "insertBookmark", "removeBookmark", "insertDateField", "insertDateTime", "insertCrossReference", "setNoteOptions", "exitHeaderFooter", "setDifferentFirstPage", "setDifferentOddEven", "applyDocumentTheme", "setDocumentColorScheme", "setDocumentFontScheme", "setDocumentParagraphSpacing", "setDocumentEffects", "setDocumentPageColor", "setDocumentWatermark", "setDocumentPageBorder", "setDocumentDesignDefault", "tableContext", "tableMerge", "tableSplit", "tableInsertColumnBefore", "tableInsertColumnAfter", "tableDeleteColumn", "tableDeleteCells", "tableInsertRowBefore", "tableInsertRowAfter", "tableDeleteRow", "tableCellShading", "tableCellBorders", "tableCellNoBorders", "tableApplyBorderPreset", "toggleTableDrawBorders", "toggleTableGridlines", "tableWidth100", "tableAlignLeft", "tableAlignCenter", "tableAlignRight", "tableSetCellAlignment", "tableSetCellVerticalAlign", "tableSetCellTextDirection", "tableToText", "textToTable", "tableSplitAtRow", "tableSortAscending", "tableSortDescending", "tableDelete", "tableRepeatHeaderRows", "tableSetCellMargins", "tableSetCellSpacing", "tableSetTableIndent", "tableSetAlignment", "tableFormula", "tableSelectCell", "tableSelectRow", "tableSelectColumn", "tableSelectTable", "tableSetRowHeight", "tableSetBreakAcrossPages", "tableSetHeaderRow", "tableSetColumnWidth", "tableSetTableWidth", "tableSetCellWidth", "tableSetCellNoWrap", "tableSetCellFitText", "tableToggleHeaderRow", "tableToggleTotalRow", "tableToggleBandedRows", "tableToggleFirstColumn", "tableToggleLastColumn", "tableToggleBandedColumns", "setTableStyle", "tableToggleAutoFit", "tableAutoFit", "tableDistributeColumns", "tableDistributeRows", "insertTable", "insertShape", "setShapeFill", "setShapeOutline", "setShapeOutlineWidth", "alignFloatingObject", "reorderFloatingObject", "nudgeFloatingObject", "setFloatingFixedPosition", "setFloatingRotation", "setFloatingWrapPreset", "setFloatingWrapText", "setFloatingPositionPreset", "setShapePreset", "setTextBoxTextDirection", "setTextBoxVerticalAlign", "editTextBoxAlt", "rotateTextBox", "textBoxWidthCm", "textBoxHeightCm", "openSymbolDialog", "openEquationDialog", "tableProperties", "openFontDialog", "openParagraphDialog"];
1
+ export declare const OASIS_BUILTIN_COMMANDS: readonly ["selectAll", "selectWord", "selectSentence", "selectParagraph", "selectCollapse", "selectText", "selectRange", "insertFootnote", "insertText", "insertEquation", "updateEquation", "insertTableOfContents", "updateTableOfContents", "pastePlainText", "paste", "pasteAsPlainText", "pasteMergeFormatting", "formatPainter", "formatPainterContinuous", "cancelFormatPainter", "bold", "italic", "underline", "doubleUnderline", "wordUnderline", "strike", "doubleStrike", "smallCaps", "allCaps", "hidden", "noProof", "webHidden", "specVanish", "contextualAlternates", "characterBorder", "shadow", "emboss", "engrave", "outline", "superscript", "subscript", "link", "unlink", "alignLeft", "alignCenter", "alignRight", "alignJustify", "orderedList", "bulletList", "find", "replace", "replaceAll", "toggleTrackChanges", "toggleRevisionMarkup", "toggleOutlinePanel", "toggleRevisionsPanel", "openCommandSearch", "repeatLastAction", "acceptRevisions", "rejectRevisions", "setReviewDisplayMode", "acceptAllRevisions", "rejectAllRevisions", "requestAcceptAllRevisions", "requestRejectAllRevisions", "nextRevision", "previousRevision", "nextComment", "previousComment", "newComment", "replyComment", "editComment", "toggleCommentsPanel", "resolveComment", "reopenComment", "deleteComment", "toggleShowMargins", "toggleShowParagraphMarks", "togglePreciseFonts", "undo", "redo", "pageBreak", "lineBreak", "columnBreak", "splitBlock", "insertNonBreakingSpace", "insertNonBreakingHyphen", "insertOptionalHyphen", "insertEmDash", "insertEllipsis", "insertCopyright", "insertRegistered", "insertTrademark", "setFontFamily", "setFontSize", "increaseFontSize", "decreaseFontSize", "growFont1", "shrinkFont1", "changeTextCase", "clearFormatting", "setColor", "setHighlight", "setTextShading", "setStyleId", "setCharacterStyleId", "setUnderlineStyle", "applyUnderlineStyle", "setUnderlineColor", "setCharacterScale", "setCharacterSpacing", "setRunSnapToGrid", "setFitText", "setBaselineShift", "setEmphasisMark", "setTextEffect", "setKerning", "setLigatures", "setNumberSpacing", "setNumberForm", "setStylisticSet", "documentStyles", "print", "copy", "cut", "newDocument", "saveDocument", "exportDocx", "exportPdf", "importDocument", "insertHtml", "insertImage", "editImageAlt", "insertImageCaption", "imageContext", "imageWidthCm", "imageHeightCm", "imageCrop", "imageCropAspect", "imageCropShape", "imageCropFill", "imageCropFit", "imageCropReset", "imageFlip", "imageRotate", "imageBorder", "imageTransparency", "resetImage", "outdent", "indent", "moveParagraphsUp", "moveParagraphsDown", "togglePageBreakBefore", "toggleKeepWithNext", "toggleKeepLinesTogether", "toggleWidowControl", "toggleParagraphBidi", "setParagraphBidi", "setParagraphAlign", "sortParagraphs", "promote", "demote", "resetParagraphFormatting", "setParagraphTabStops", "setOutlineLevel", "setSpacingAfter", "setSpacingBefore", "setContextualSpacing", "setMirrorIndents", "setLineRule", "setTextDirection", "setSuppressAutoHyphens", "setSuppressLineNumbers", "setKinsoku", "setOverflowPunct", "setWordWrap", "setAutoSpaceDE", "setAutoSpaceDN", "setAdjustRightInd", "setTopLinePunct", "setPageBreakBefore", "setKeepWithNext", "setKeepLinesTogether", "setWidowControl", "setIndentLeft", "setIndentRight", "setIndentFirstLine", "setIndentHanging", "setSpecialIndent", "setParagraphShading", "applyParagraphBorders", "applyHorizontalLine", "setDropCap", "setLineHeight", "setListFormat", "setListStartAt", "setListLevel", "toggleOrientation", "setOrientation", "sectionBreakNextPage", "sectionBreakContinuous", "sectionBreakEvenPage", "sectionBreakOddPage", "sectionBreakNextColumn", "setPageMargins", "setMarginsPreset", "setSectionPageNumbering", "setPaperSize", "setPaperSizePreset", "setColumns", "setColumnsPreset", "setSectionVerticalAlign", "setSectionStart", "setSectionBidi", "setHyphenation", "editHeader", "editFooter", "editFirstPageHeader", "editEvenPageHeader", "editFirstPageFooter", "editEvenPageFooter", "insertPageNumber", "insertPageNumberXOfY", "placePageNumberTop", "placePageNumberBottom", "insertBookmark", "removeBookmark", "insertDateField", "insertDateTime", "insertCrossReference", "setNoteOptions", "exitHeaderFooter", "setDifferentFirstPage", "setDifferentOddEven", "applyDocumentTheme", "setDocumentColorScheme", "setDocumentFontScheme", "setDocumentParagraphSpacing", "setDocumentEffects", "setDocumentPageColor", "setDocumentWatermark", "setDocumentPageBorder", "setDocumentDesignDefault", "tableContext", "tableMerge", "tableSplit", "tableInsertColumnBefore", "tableInsertColumnAfter", "tableDeleteColumn", "tableDeleteCells", "tableInsertRowBefore", "tableInsertRowAfter", "tableDeleteRow", "tableCellShading", "tableCellBorders", "tableCellNoBorders", "tableApplyBorderPreset", "toggleTableDrawBorders", "toggleTableGridlines", "tableWidth100", "tableAlignLeft", "tableAlignCenter", "tableAlignRight", "tableSetCellAlignment", "tableSetCellVerticalAlign", "tableSetCellTextDirection", "tableToText", "textToTable", "tableSplitAtRow", "tableSortAscending", "tableSortDescending", "tableDelete", "tableRepeatHeaderRows", "tableSetCellMargins", "tableSetCellSpacing", "tableSetTableIndent", "tableSetAlignment", "tableFormula", "tableSelectCell", "tableSelectRow", "tableSelectColumn", "tableSelectTable", "tableSetRowHeight", "tableSetBreakAcrossPages", "tableSetHeaderRow", "tableSetColumnWidth", "tableSetTableWidth", "tableSetCellWidth", "tableSetCellNoWrap", "tableSetCellFitText", "tableToggleHeaderRow", "tableToggleTotalRow", "tableToggleBandedRows", "tableToggleFirstColumn", "tableToggleLastColumn", "tableToggleBandedColumns", "setTableStyle", "tableToggleAutoFit", "tableAutoFit", "tableDistributeColumns", "tableDistributeRows", "insertTable", "insertShape", "setShapeFill", "setShapeOutline", "setShapeOutlineWidth", "alignFloatingObject", "reorderFloatingObject", "nudgeFloatingObject", "setFloatingFixedPosition", "setFloatingRotation", "setFloatingWrapPreset", "setFloatingWrapText", "setFloatingPositionPreset", "setShapePreset", "setTextBoxTextDirection", "setTextBoxVerticalAlign", "editTextBoxAlt", "rotateTextBox", "textBoxWidthCm", "textBoxHeightCm", "openSymbolDialog", "openEquationDialog", "tableProperties", "openFontDialog", "openParagraphDialog"];
2
2
  export type OasisBuiltinCommand = (typeof OASIS_BUILTIN_COMMANDS)[number];
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Command search ("Tell Me"): fuzzy subsequence matching over the executable
3
+ * command surface (Ribbon and menubar entries). Pure and dependency-free so
4
+ * the scoring can be unit-tested without the UI.
5
+ */
6
+ export interface CommandSearchEntry {
7
+ /** Stable id of the originating control (ribbon item or menu entry). */
8
+ id: string;
9
+ /** Human-readable, localized label. */
10
+ label: string;
11
+ /** Built-in command dispatched when the entry is chosen. */
12
+ command: string;
13
+ /** Optional payload for parameterized commands. */
14
+ payload?: unknown;
15
+ /** Office-style shortcut hint, e.g. "Ctrl+F". */
16
+ shortcut?: string;
17
+ /** Where the entry was surfaced from. */
18
+ source: "ribbon" | "menubar";
19
+ }
20
+ export interface CommandSearchHit extends CommandSearchEntry {
21
+ /** Higher is better; hits are returned sorted by score descending. */
22
+ score: number;
23
+ }
24
+ /**
25
+ * Score one entry against a normalized query; `null` means no match. The
26
+ * localized label is matched first; the raw command id is a fallback with a
27
+ * small penalty so English command names still resolve in other locales.
28
+ */
29
+ export declare function scoreCommandSearchEntry(query: string, entry: CommandSearchEntry): number | null;
30
+ /**
31
+ * Return the best `limit` hits for `query`, sorted by score (desc) and label
32
+ * length (asc) as a stable tie-breaker. An empty query returns every entry
33
+ * ordered alphabetically, so the palette opens with a usable surface.
34
+ */
35
+ export declare function searchCommandEntries(query: string, entries: CommandSearchEntry[], limit?: number): CommandSearchHit[];
@@ -124,6 +124,8 @@ export interface OasisCommandPayloads {
124
124
  toggleRevisionMarkup: undefined;
125
125
  toggleOutlinePanel: undefined;
126
126
  toggleRevisionsPanel: undefined;
127
+ openCommandSearch: undefined;
128
+ repeatLastAction: undefined;
127
129
  acceptRevisions: undefined;
128
130
  rejectRevisions: undefined;
129
131
  setReviewDisplayMode: "all" | "final" | "original";