oasis-editor 0.0.412 → 0.0.414

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.
Files changed (46) hide show
  1. package/dist/OasisEditorApp-BeGnnOPx.js +1 -0
  2. package/dist/assets/{importDocxWorker-Cza4hyf3.js → importDocxWorker-C4M8keWl.js} +1243 -1126
  3. package/dist/core/commands/builtinCommands.d.ts +1 -1
  4. package/dist/core/commands/fieldCode.d.ts +18 -0
  5. package/dist/core/commands/indexEntries.d.ts +27 -0
  6. package/dist/core/commands/legacyForms.d.ts +15 -0
  7. package/dist/core/commands/mailMerge.d.ts +8 -0
  8. package/dist/core/commands/publicCommandTypes.d.ts +48 -0
  9. package/dist/core/commands/tableOfAuthorities.d.ts +22 -0
  10. package/dist/core/commands/tableOfFigures.d.ts +12 -0
  11. package/dist/core/document/bookmarkScope.d.ts +6 -0
  12. package/dist/core/document/captionEntries.d.ts +24 -0
  13. package/dist/core/document/fieldCodeDisplay.d.ts +12 -0
  14. package/dist/core/document/fieldComparison.d.ts +7 -0
  15. package/dist/core/document/formulaFields.d.ts +10 -0
  16. package/dist/core/document/indexPlan.d.ts +59 -0
  17. package/dist/core/document/indexRefresh.d.ts +35 -0
  18. package/dist/core/document/mergeFields.d.ts +64 -0
  19. package/dist/core/document/tableOfFigures.d.ts +38 -0
  20. package/dist/core/document/toaEntries.d.ts +33 -0
  21. package/dist/core/document/toaPlan.d.ts +36 -0
  22. package/dist/core/document/toaRefresh.d.ts +29 -0
  23. package/dist/core/document/tocFields.d.ts +13 -0
  24. package/dist/core/document/variableFields.d.ts +58 -0
  25. package/dist/core/document/xeEntries.d.ts +50 -0
  26. package/dist/core/document/xeRanges.d.ts +16 -0
  27. package/dist/core/format/fieldResultFormat.d.ts +19 -0
  28. package/dist/core/model/editorState.d.ts +2 -0
  29. package/dist/core/model/index.d.ts +1 -1
  30. package/dist/core/model/types/primitives.d.ts +32 -0
  31. package/dist/defaultToolbar-BFmfRwzv.js +1 -0
  32. package/dist/i18n/locales/en.d.ts +37 -0
  33. package/dist/i18n/locales/pt-BR.d.ts +37 -0
  34. package/dist/oasis-editor.css +1 -1
  35. package/dist/oasis-editor.js +1 -1
  36. package/dist/oasis-editor.umd.cjs +1 -1
  37. package/dist/ooxml/word/fieldFormatSwitches.d.ts +40 -0
  38. package/dist/ooxml/word/legacyFormFields.d.ts +5 -0
  39. package/dist/plugins/internal/essentialsCapabilities.d.ts +27 -0
  40. package/dist/sourcePackage-DWdP3w1_.js +1 -0
  41. package/dist/ui/components/Toolbar/controls/FieldFamilyPanel.d.ts +9 -0
  42. package/dist/ui/components/Toolbar/controls/IndexEntryPanel.d.ts +6 -0
  43. package/package.json +1 -1
  44. package/dist/OasisEditorApp-BALWTakH.js +0 -1
  45. package/dist/defaultToolbar-DOUMCB_G.js +0 -1
  46. package/dist/sourcePackage-CHvo6ql3.js +0 -1
@@ -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", "showMarkupOptions", "applyShowMarkup", "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", "updateBodyFields", "updateSelectedFields", "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", "showMarkupOptions", "applyShowMarkup", "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", "updateBodyFields", "updateSelectedFields", "insertFieldCode", "editFieldCode", "editFieldCodeAtSelection", "toggleFieldLock", "toggleFieldCodes", "nextField", "previousField", "markAuthorityEntry", "insertTableOfAuthorities", "updateTableOfAuthorities", "insertTableOfFigures", "updateTableOfFigures", "previewMergeRecord", "mergeToNewDocuments", "updateVariableFields", "setFormFieldValue", "toggleFormCheckbox", "insertDateTime", "insertCrossReference", "markIndexEntry", "insertIndex", "updateIndex", "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,18 @@
1
+ import { EditorParagraphNode, EditorState } from '../model.js';
2
+ /** Insert an arbitrary, lexically valid field code as a complex field with an
3
+ * empty cached result. The begin marker is marked dirty so Word updates it. */
4
+ export declare function insertFieldCode(state: EditorState, raw: string): EditorState;
5
+ /** Replace the instruction of one qualified span. Locked fields are refused,
6
+ * the result is untouched, and the begin marker becomes dirty for Word. */
7
+ export declare function editFieldCode(state: EditorState, instructionRunId: string, raw: string): EditorState;
8
+ /** Toggle `w:fldLock` on the begin marker of a qualified span. */
9
+ export declare function toggleFieldLock(state: EditorState, fieldRunId: string): EditorState;
10
+ /** Move the caret to the next/previous top-level field in document order. */
11
+ export declare function navigateFields(state: EditorState, direction: "next" | "previous"): EditorState;
12
+ /** Instruction run of the top-level field containing the caret. Used by
13
+ * UI commands that edit the field under the selection without exposing run ids. */
14
+ export declare function findFieldInstructionAtSelection(state: EditorState): string | undefined;
15
+ /** Presentation-only state toggle. Does not mutate the document. */
16
+ export declare function setShowFieldCodes(state: EditorState, show: boolean): EditorState;
17
+ /** Read-only text projection for dialogs/tests: `{ CODE result }` per field. */
18
+ export declare function fieldCodeDisplayText(paragraphs: readonly EditorParagraphNode[]): string;
@@ -0,0 +1,27 @@
1
+ import { EditorState, EditorDocument, EditorLayoutDocument } from '../model.js';
2
+ export interface MarkIndexEntryOptions {
3
+ path: readonly string[];
4
+ identifier?: string;
5
+ boldPage?: boolean;
6
+ italicPage?: boolean;
7
+ }
8
+ export interface InsertIndexOptions {
9
+ locale: string;
10
+ identifier?: string;
11
+ }
12
+ /** First authoring slice: append a hidden XE at an explicit paragraph-end
13
+ * caret. Do not split runs, move anchors, edit imported paragraph XML or
14
+ * allow markers within another complex field. Caller supplies the entry text.
15
+ */
16
+ export declare function markIndexEntry(state: EditorState, options: MarkIndexEntryOptions): EditorState;
17
+ /** Insert one INDEX after an explicit paragraph-end caret. The blank
18
+ * provisional cache never becomes visible unless regeneration converges.
19
+ * Existing indexes, anchored documents and complex field boundaries are
20
+ * deliberately excluded in this first authoring slice.
21
+ */
22
+ export declare function insertIndex(state: EditorState, options: InsertIndexOptions, paginate?: (doc: EditorDocument) => EditorLayoutDocument): EditorState;
23
+ export declare function updateIndex(state: EditorState, locale?: string): EditorState;
24
+ /** Cheap capability checks; do not paginate or generate new IDs during Ribbon refresh. */
25
+ export declare function canMarkIndexEntry(state: EditorState): boolean;
26
+ export declare function canInsertIndex(state: EditorState): boolean;
27
+ export declare function canUpdateIndex(state: EditorState): boolean;
@@ -0,0 +1,15 @@
1
+ import { EditorState, EditorLegacyFormFieldData } from '../model.js';
2
+ export interface LegacyFormFieldDescriptor {
3
+ name: string;
4
+ control: EditorLegacyFormFieldData["control"];
5
+ value: string;
6
+ enabled: boolean;
7
+ paragraphId: string;
8
+ beginRunId: string;
9
+ resultRunIds: readonly string[];
10
+ }
11
+ export declare function listLegacyFormFields(state: EditorState): LegacyFormFieldDescriptor[];
12
+ /** Set a legacy form field's cached value. Unqualified names, disabled
13
+ * controls and values outside the control's domain are no-ops. */
14
+ export declare function setFormFieldValue(state: EditorState, name: string, value: string): EditorState;
15
+ export declare function toggleFormCheckbox(state: EditorState, name: string): EditorState;
@@ -0,0 +1,8 @@
1
+ import { EditorDocument, EditorState } from '../model.js';
2
+ import { MergeRecord } from '../document/mergeFields.js';
3
+ /** Preview one caller-supplied record in place. The instruction stream is
4
+ * preserved; only cached MERGEFIELD results are projected. */
5
+ export declare function previewMergeRecord(state: EditorState, records: readonly MergeRecord[], index: number): EditorState;
6
+ /** Merge explicit records into documents using NEXT/NEXTIF/SKIPIF. Never
7
+ * fetches data, never executes macros and never writes back into the editor. */
8
+ export declare function mergeToNewDocuments(state: EditorState, records: readonly MergeRecord[]): readonly EditorDocument[] | undefined;
@@ -322,9 +322,44 @@ export interface OasisCommandPayloads {
322
322
  insertDateField: undefined;
323
323
  updateBodyFields: undefined;
324
324
  updateSelectedFields: undefined;
325
+ insertFieldCode: string;
326
+ editFieldCode: {
327
+ instructionRunId: string;
328
+ code: string;
329
+ };
330
+ editFieldCodeAtSelection: string;
331
+ toggleFieldLock: string;
332
+ toggleFieldCodes: boolean | undefined;
333
+ nextField: undefined;
334
+ previousField: undefined;
335
+ markAuthorityEntry: import('./tableOfAuthorities.js').MarkAuthorityEntryOptions;
336
+ insertTableOfAuthorities: import('./tableOfAuthorities.js').InsertTableOfAuthoritiesOptions;
337
+ updateTableOfAuthorities: {
338
+ locale?: string;
339
+ } | undefined;
340
+ insertTableOfFigures: import('./tableOfFigures.js').InsertTableOfFiguresOptions;
341
+ updateTableOfFigures: undefined;
342
+ previewMergeRecord: {
343
+ records: readonly Readonly<Record<string, string>>[];
344
+ index: number;
345
+ };
346
+ mergeToNewDocuments: {
347
+ records: readonly Readonly<Record<string, string>>[];
348
+ };
349
+ updateVariableFields: undefined;
350
+ setFormFieldValue: {
351
+ name: string;
352
+ value: string;
353
+ };
354
+ toggleFormCheckbox: string;
325
355
  insertDateTime: {
326
356
  dateFormat?: string;
327
357
  } | undefined;
358
+ markIndexEntry: import('./indexEntries.js').MarkIndexEntryOptions;
359
+ insertIndex: import('./indexEntries.js').InsertIndexOptions;
360
+ updateIndex: {
361
+ locale?: string;
362
+ } | undefined;
328
363
  insertCrossReference: {
329
364
  type?: "REF" | "PAGEREF";
330
365
  bookmark: string;
@@ -431,6 +466,19 @@ export interface OasisCommandPayloads {
431
466
  }
432
467
  /** Maps commands to their typed return values. Commands not listed return `unknown`. */
433
468
  export interface OasisCommandResults {
469
+ markIndexEntry: boolean;
470
+ insertIndex: boolean;
471
+ updateIndex: boolean;
472
+ insertFieldCode: boolean;
473
+ editFieldCode: boolean;
474
+ toggleFieldLock: boolean;
475
+ markAuthorityEntry: boolean;
476
+ insertTableOfAuthorities: boolean;
477
+ updateTableOfAuthorities: boolean;
478
+ insertTableOfFigures: boolean;
479
+ updateTableOfFigures: boolean;
480
+ setFormFieldValue: boolean;
481
+ toggleFormCheckbox: boolean;
434
482
  documentStyles: unknown;
435
483
  [command: string]: unknown;
436
484
  }
@@ -0,0 +1,22 @@
1
+ import { EditorDocument, EditorLayoutDocument, EditorState } from '../model.js';
2
+ export interface MarkAuthorityEntryOptions {
3
+ long: string;
4
+ short?: string;
5
+ category?: string;
6
+ boldPage?: boolean;
7
+ italicPage?: boolean;
8
+ }
9
+ export interface InsertTableOfAuthoritiesOptions {
10
+ locale: string;
11
+ category: string;
12
+ heading?: boolean;
13
+ passim?: boolean;
14
+ }
15
+ export declare function canMarkAuthorityEntry(state: EditorState): boolean;
16
+ /** Append a hidden TA marker at an explicit paragraph-end caret. */
17
+ export declare function markAuthorityEntry(state: EditorState, options: MarkAuthorityEntryOptions): EditorState;
18
+ export declare function canInsertTableOfAuthorities(state: EditorState): boolean;
19
+ /** Insert one TOA after an explicit paragraph-end caret. */
20
+ export declare function insertTableOfAuthorities(state: EditorState, options: InsertTableOfAuthoritiesOptions, paginate?: (doc: EditorDocument) => EditorLayoutDocument): EditorState;
21
+ export declare function updateTableOfAuthorities(state: EditorState, locale?: string): EditorState;
22
+ export declare function canUpdateTableOfAuthorities(state: EditorState): boolean;
@@ -0,0 +1,12 @@
1
+ import { EditorDocument, EditorLayoutDocument, EditorState } from '../model.js';
2
+ export interface InsertTableOfFiguresOptions {
3
+ identifier: string;
4
+ unlabeled?: boolean;
5
+ entryPageSeparator?: string;
6
+ }
7
+ export declare function canInsertTableOfFigures(state: EditorState): boolean;
8
+ export declare function insertTableOfFigures(state: EditorState, options: InsertTableOfFiguresOptions, paginate?: (doc: EditorDocument) => EditorLayoutDocument): EditorState;
9
+ export declare function canUpdateTableOfFigures(state: EditorState): boolean;
10
+ export declare function updateTableOfFigures(state: EditorState): EditorState;
11
+ /** List identifiers available for a Ribbon picker (read-only, no pagination). */
12
+ export declare function listCaptionIdentifiers(state: EditorState): string[];
@@ -0,0 +1,6 @@
1
+ import { EditorDocument } from '../model.js';
2
+ /** Unique, unambiguous main-story bookmark by author-facing name. */
3
+ export declare function findNamedBookmark(document: EditorDocument, name: string): import('../model.js').EditorBookmark | undefined;
4
+ /** Whether a marker offset lies inside a bookmark's exclusive-end range.
5
+ * `undefined` means the bookmark is missing, ambiguous or malformed. */
6
+ export declare function isOffsetInBookmarkScope(document: EditorDocument, name: string, paragraphId: string, offset: number): boolean | undefined;
@@ -0,0 +1,24 @@
1
+ import { EditorDocument, EditorLayoutDocument } from '../model.js';
2
+ /** Caption source for `TOC \c "Figure"` / `\a Table`: a complete, single SEQ
3
+ * field in a plain top-level paragraph. Broken or nested fields refuse the
4
+ * inventory instead of silently losing an entry. */
5
+ export interface CaptionOccurrence {
6
+ identifier: string;
7
+ number: number;
8
+ display: string;
9
+ paragraphId: string;
10
+ offset: number;
11
+ sectionIndex: number;
12
+ }
13
+ export interface CaptionPage {
14
+ physicalPageIndex: number;
15
+ label: string;
16
+ }
17
+ export declare function collectCaptionOccurrences(document: EditorDocument, identifier: string, unlabeled?: boolean): CaptionOccurrence[] | undefined;
18
+ export declare function resolveCaptionPage(document: EditorDocument, layout: EditorLayoutDocument, entry: CaptionOccurrence, context?: {
19
+ bookmarkText: (name: string) => string | null | undefined;
20
+ bookmarkPage: (name: string) => number | null | undefined;
21
+ pageIndexAt: (paragraphId: string, offset: number) => number | undefined;
22
+ forPage: (pageIndex: number) => import('./fieldEvaluation.js').FieldEvaluationContext;
23
+ forPosition: (paragraphId: string, offset: number) => import('./fieldEvaluation.js').FieldEvaluationContext;
24
+ }): CaptionPage | undefined;
@@ -0,0 +1,12 @@
1
+ import { EditorParagraphNode } from '../model.js';
2
+ /** Paint-mode projection: complete, single-paragraph fields display their
3
+ * instruction instead of the cached result. Malformed/nested/cross-paragraph
4
+ * spans are left untouched rather than showing a misleading code. */
5
+ export interface FieldCodeOverlay {
6
+ start: number;
7
+ end: number;
8
+ text: string;
9
+ }
10
+ export declare function getFieldCodeOverlays(paragraph: EditorParagraphNode): FieldCodeOverlay[];
11
+ /** Visible offsets that must be suppressed while codes are displayed. */
12
+ export declare function fieldCodeHiddenOffsets(overlays: readonly FieldCodeOverlay[]): Set<number>;
@@ -0,0 +1,7 @@
1
+ /** Shared, bounded comparison for IF/COMPARE/NEXTIF/SKIPIF. No field
2
+ * evaluation, external lookup or regex injection; wildcards are escaped. */
3
+ export type ComparisonOperator = "=" | "<>" | ">" | "<" | ">=" | "<=";
4
+ export declare function isComparisonOperator(value: string): value is ComparisonOperator;
5
+ /** `undefined` means the operands are not comparable and the caller must
6
+ * preserve its cached result rather than inventing a boolean. */
7
+ export declare function compareOperands(left: string, right: string, operator: string): boolean | undefined;
@@ -0,0 +1,10 @@
1
+ /** Bounded arithmetic evaluator for `= (Formula)` fields. Hand-written
2
+ * recursive descent: no eval, no Function, no cell references, no table
3
+ * access, and a hard limit on tokens, nesting and numeric magnitude. */
4
+ export type FormulaValue = number | boolean;
5
+ export interface FormulaContext {
6
+ variables?: Readonly<Record<string, string>>;
7
+ record?: Readonly<Record<string, string>>;
8
+ }
9
+ /** Evaluate a bounded Word formula; undefined means "preserve cached result". */
10
+ export declare function evaluateFormula(raw: string, context?: FormulaContext, depth?: number): FormulaValue | undefined;
@@ -0,0 +1,59 @@
1
+ import { EditorDocument, EditorLayoutDocument } from '../model.js';
2
+ import { XePage } from './xeEntries.js';
3
+ import { XeRangePage } from './xeRanges.js';
4
+ export interface IndexSettings {
5
+ identifier?: string;
6
+ /** `\b` bookmark restricting the collected entries. */
7
+ bookmark?: string;
8
+ locale?: string;
9
+ entrySeparator: string;
10
+ pageSeparator: string;
11
+ crossReferenceSeparator: string;
12
+ rangeSeparator?: string;
13
+ /** `\c`: columns balanced inside the existing section, 1-4. */
14
+ columns?: number;
15
+ /** `\h`: heading text styled as Index Heading. */
16
+ heading?: string;
17
+ /** `\r`: subentries on the same line. */
18
+ runIn?: boolean;
19
+ /** `\p`: inclusive first-letter range, e.g. "a-m" or "!". */
20
+ letterRange?: string;
21
+ /** `\s`: SEQ identifier for the sequence prefix, with `\d` separator. */
22
+ seqIdentifier?: string;
23
+ seqSeparator?: string;
24
+ /** Prefix resolved from the SEQ value during plan construction. */
25
+ seqPrefix?: string;
26
+ /** `\y`: yomi is accepted but adds no display transformation. */
27
+ yomi?: boolean;
28
+ }
29
+ export interface IndexPageReference extends XePage {
30
+ bold: boolean;
31
+ italic: boolean;
32
+ }
33
+ export interface IndexRangeReference {
34
+ pages: XeRangePage[];
35
+ bold: boolean;
36
+ italic: boolean;
37
+ }
38
+ export interface IndexEntryPlan {
39
+ path: readonly string[];
40
+ pages: IndexPageReference[];
41
+ ranges?: IndexRangeReference[];
42
+ crossReferences: string[];
43
+ }
44
+ export interface IndexPlan {
45
+ settings: IndexSettings;
46
+ locale: string;
47
+ /** Preorder: parents precede descendants, even without own references. */
48
+ entries: IndexEntryPlan[];
49
+ }
50
+ /** Flat indented, one-column INDEX subset. Preserve unsupported instructions.
51
+ * Word-specific default identifier selection differs from ISO/IEC 29500.
52
+ * A locale must be explicit in the field or supplied by a qualified caller.
53
+ */
54
+ export declare function parseIndexInstruction(raw: string): IndexSettings | undefined;
55
+ /** Read-only INDEX plan. Exact authored paths are grouped; ambiguous
56
+ * case/canonical-equivalent sibling labels fail closed. Distinct physical
57
+ * pages must never be deduplicated just because printed labels repeat.
58
+ */
59
+ export declare function buildIndexPlan(document: EditorDocument, layout: EditorLayoutDocument, raw: string, documentLocale?: string): IndexPlan | undefined;
@@ -0,0 +1,35 @@
1
+ import { EditorBlockNode, EditorDocument, EditorLayoutDocument, EditorState } from '../model.js';
2
+ import { IndexPlan } from './indexPlan.js';
3
+ interface IndexRegion {
4
+ start: number;
5
+ end: number;
6
+ raw: string;
7
+ }
8
+ interface Fragment {
9
+ text: string;
10
+ bold?: boolean;
11
+ italic?: boolean;
12
+ }
13
+ interface EntryLine {
14
+ indent: number;
15
+ fragments: Fragment[];
16
+ styleId?: string;
17
+ }
18
+ /** Only a single complete flat INDEX with separate marker paragraphs. */
19
+ export declare function findQualifiedIndexRegion(blocks: readonly EditorBlockNode[]): IndexRegion | undefined;
20
+ /** Render only one-column indented plans. A range spanning section boundaries
21
+ * is kept in the read-only plan but is not compacted into a misleading label.
22
+ */
23
+ export declare function renderIndexPlan(plan: IndexPlan, mode?: "tabs" | "section"): EntryLine[] | undefined;
24
+ export interface IndexRefreshResult {
25
+ state: EditorState;
26
+ status: "updated" | "unchanged" | "unsupported" | "unresolved" | "nonconvergent";
27
+ passes: number;
28
+ updatedEntries: number;
29
+ layout?: EditorLayoutDocument;
30
+ }
31
+ /** Stage, measure and verify a fixed point before publishing any change.
32
+ * Retain original marker and source paragraph identities and selection.
33
+ */
34
+ export declare function refreshIndexConvergently(original: EditorState, documentLocale?: string, paginate?: (document: EditorDocument) => EditorLayoutDocument, maxPasses?: number): IndexRefreshResult;
35
+ export {};
@@ -0,0 +1,64 @@
1
+ import { EditorDocument, EditorParagraphNode } from '../model.js';
2
+ import { FieldFormatSwitches } from '../../ooxml/word/fieldFormatSwitches.js';
3
+ import { FieldStorySpan } from './fieldStoryGraph.js';
4
+ import { ComparisonOperator } from './fieldComparison.js';
5
+ export type MergeRecord = Readonly<Record<string, string>>;
6
+ export interface MergeDataSource {
7
+ /** Caller-supplied records only: never fetched or read from a file. */
8
+ records: readonly MergeRecord[];
9
+ }
10
+ export interface MergeFieldInstruction {
11
+ type: "MERGEFIELD";
12
+ name: string;
13
+ before?: string;
14
+ after?: string;
15
+ mapped?: boolean;
16
+ vertical?: boolean;
17
+ format?: FieldFormatSwitches;
18
+ }
19
+ export type MergeOperand = {
20
+ kind: "literal";
21
+ value: string;
22
+ quoted: boolean;
23
+ } | {
24
+ kind: "mergeField";
25
+ name: string;
26
+ };
27
+ export interface MergeControlInstruction {
28
+ type: "NEXT" | "NEXTIF" | "SKIPIF";
29
+ left?: MergeOperand;
30
+ operator?: ComparisonOperator;
31
+ right?: MergeOperand;
32
+ }
33
+ export type MergeInstruction = MergeFieldInstruction | MergeControlInstruction;
34
+ /** Strict grammar for the merge family. Unknown switches and malformed
35
+ * conditions are preserved by the caller, never coerced into a control field. */
36
+ export declare function parseMergeInstruction(raw: string): MergeInstruction | undefined;
37
+ export declare function resolveMergeField(instruction: MergeFieldInstruction, record: MergeRecord): string | undefined;
38
+ export interface MergeControlDecision {
39
+ /** Send the next record into the current document instead of a new one. */
40
+ advanceInPlace: boolean;
41
+ /** Cancel the current document and continue with the next record. */
42
+ skipDocument: boolean;
43
+ }
44
+ export declare function evaluateMergeControl(instruction: MergeControlInstruction, record: MergeRecord): MergeControlDecision | undefined;
45
+ interface MergeSpan {
46
+ span: FieldStorySpan;
47
+ paragraph: EditorParagraphNode;
48
+ instruction: MergeInstruction;
49
+ }
50
+ /** Ordered merge fields/controls in one story. A malformed story, a nested
51
+ * merge field or an unqualified instruction refuses the whole merge. */
52
+ export declare function collectMergeSpans(document: EditorDocument): MergeSpan[] | undefined;
53
+ /** Validate story restrictions documented for NEXT/NEXTIF/SKIPIF. */
54
+ export declare function isMergeControlPlacementAllowed(entry: MergeSpan): boolean;
55
+ /** Replace one record's values in a cloned document. Returns the decision of
56
+ * the first control field, or null when the record has no control. */
57
+ export declare function projectMergeRecord(document: EditorDocument, record: MergeRecord): {
58
+ document: EditorDocument;
59
+ decision: MergeControlDecision | null;
60
+ } | undefined;
61
+ /** Group caller-supplied records into merged documents using NEXT/NEXTIF/
62
+ * SKIPIF. Bounded to 1000 records; no document is emitted for skipped groups. */
63
+ export declare function planMailMerge(records: readonly MergeRecord[], document: EditorDocument): EditorDocument[] | undefined;
64
+ export {};
@@ -0,0 +1,38 @@
1
+ import { EditorBlockNode, EditorDocument, EditorLayoutDocument, EditorState } from '../model.js';
2
+ import { TocFieldSettings } from './tocFields.js';
3
+ import { CaptionPage } from './captionEntries.js';
4
+ interface Region {
5
+ start: number;
6
+ end: number;
7
+ raw: string;
8
+ settings: TocFieldSettings;
9
+ }
10
+ interface Fragment {
11
+ text: string;
12
+ bold?: boolean;
13
+ italic?: boolean;
14
+ }
15
+ interface FigureLine {
16
+ fragments: Fragment[];
17
+ }
18
+ /** A single complete caption TOC with separate marker paragraphs. */
19
+ export declare function findQualifiedFigureTocRegion(blocks: readonly EditorBlockNode[]): Region | undefined;
20
+ export interface FigureEntry {
21
+ display: string;
22
+ page?: CaptionPage;
23
+ }
24
+ export interface FigureTocPlan {
25
+ settings: TocFieldSettings;
26
+ entries: FigureEntry[];
27
+ }
28
+ export declare function buildFigureTocPlan(document: EditorDocument, layout: EditorLayoutDocument, raw: string): FigureTocPlan | undefined;
29
+ export declare function renderFigureTocPlan(plan: FigureTocPlan): FigureLine[] | undefined;
30
+ export interface FigureTocRefreshResult {
31
+ state: EditorState;
32
+ status: "updated" | "unchanged" | "unsupported" | "unresolved" | "nonconvergent";
33
+ passes: number;
34
+ updatedEntries: number;
35
+ layout?: EditorLayoutDocument;
36
+ }
37
+ export declare function refreshTableOfFigures(original: EditorState, paginate?: (document: EditorDocument) => EditorLayoutDocument, maxPasses?: number): FigureTocRefreshResult;
38
+ export {};
@@ -0,0 +1,33 @@
1
+ import { EditorDocument, EditorLayoutDocument } from '../model.js';
2
+ /** Bounded TA (table-of-authorities entry) compiler. TA is hidden marker text:
3
+ * no separator, no result and no nested field are accepted. */
4
+ export interface TaInstruction {
5
+ long: string;
6
+ short?: string;
7
+ category: string;
8
+ boldPage: boolean;
9
+ italicPage: boolean;
10
+ bookmark?: string;
11
+ }
12
+ export interface TaOccurrence extends TaInstruction {
13
+ sectionIndex: number;
14
+ paragraphId: string;
15
+ runId: string;
16
+ offset: number;
17
+ raw: string;
18
+ }
19
+ export interface ToaPage {
20
+ physicalPageIndex: number;
21
+ label: string;
22
+ }
23
+ export declare function parseTaInstruction(raw: string): TaInstruction | undefined;
24
+ /** Complete inventory of hidden TA markers in the top-level main story.
25
+ * Malformed markers refuse the whole inventory rather than dropping entries. */
26
+ export declare function collectTaOccurrences(document: EditorDocument): TaOccurrence[] | undefined;
27
+ export declare function resolveTaPointPage(document: EditorDocument, layout: EditorLayoutDocument, entry: TaOccurrence, context?: {
28
+ bookmarkText: (name: string) => string | null | undefined;
29
+ bookmarkPage: (name: string) => number | null | undefined;
30
+ pageIndexAt: (paragraphId: string, offset: number) => number | undefined;
31
+ forPage: (pageIndex: number) => import('./fieldEvaluation.js').FieldEvaluationContext;
32
+ forPosition: (paragraphId: string, offset: number) => import('./fieldEvaluation.js').FieldEvaluationContext;
33
+ }): ToaPage | undefined;
@@ -0,0 +1,36 @@
1
+ import { EditorDocument, EditorLayoutDocument } from '../model.js';
2
+ import { ToaPage } from './toaEntries.js';
3
+ import { XeRangePage } from './xeRanges.js';
4
+ export interface ToaSettings {
5
+ category: string;
6
+ bookmark?: string;
7
+ entrySeparator: string;
8
+ pageSeparator: string;
9
+ rangeSeparator: string;
10
+ seqSeparator: string;
11
+ passim: boolean;
12
+ includeHeading: boolean;
13
+ stripSourceFormatting: boolean;
14
+ seqIdentifier?: string;
15
+ }
16
+ export interface ToaEntryPlan {
17
+ label: string;
18
+ pages: ToaPage[];
19
+ /** Bookmark ranges from TA `\r`, each with its own printed page labels. */
20
+ ranges?: XeRangePage[][];
21
+ bold: boolean;
22
+ italic: boolean;
23
+ prefix?: string;
24
+ }
25
+ export interface ToaPlan {
26
+ settings: ToaSettings;
27
+ locale: string;
28
+ category: string;
29
+ entries: ToaEntryPlan[];
30
+ }
31
+ /** Strict TOA compiler. Documented switches only; duplicates and unknown
32
+ * switches refuse the field instead of being silently ignored. */
33
+ export declare function parseToaInstruction(raw: string): ToaSettings | undefined;
34
+ /** Build an immutable TOA plan from qualified point citations. Bookmark
35
+ * ranges, ambiguous locales and unresolved pages fail closed. */
36
+ export declare function buildToaPlan(document: EditorDocument, layout: EditorLayoutDocument, raw: string, locale?: string): ToaPlan | undefined;
@@ -0,0 +1,29 @@
1
+ import { EditorBlockNode, EditorDocument, EditorLayoutDocument, EditorState } from '../model.js';
2
+ import { ToaPlan } from './toaPlan.js';
3
+ interface ToaRegion {
4
+ start: number;
5
+ end: number;
6
+ raw: string;
7
+ }
8
+ interface Fragment {
9
+ text: string;
10
+ bold?: boolean;
11
+ italic?: boolean;
12
+ }
13
+ interface ToaLine {
14
+ fragments: Fragment[];
15
+ }
16
+ /** One complete flat TOA with separate marker paragraphs only. */
17
+ export declare function findQualifiedToaRegion(blocks: readonly EditorBlockNode[]): ToaRegion | undefined;
18
+ export declare function renderToaPlan(plan: ToaPlan): ToaLine[] | undefined;
19
+ export interface ToaRefreshResult {
20
+ state: EditorState;
21
+ status: "updated" | "unchanged" | "unsupported" | "unresolved" | "nonconvergent";
22
+ passes: number;
23
+ updatedEntries: number;
24
+ layout?: EditorLayoutDocument;
25
+ }
26
+ /** Bounded, transactional TOA cache regeneration. No mutation is published
27
+ * until a fixed point is reached; every refusal returns the original state. */
28
+ export declare function refreshTableOfAuthorities(original: EditorState, locale?: string, paginate?: (document: EditorDocument) => EditorLayoutDocument, maxPasses?: number): ToaRefreshResult;
29
+ export {};
@@ -16,6 +16,19 @@ export interface TocFieldSettings {
16
16
  tcIdentifier?: string;
17
17
  /** Separate TC level range for a mixed paragraph/marker TOC. */
18
18
  tcMixedRange?: readonly [number, number];
19
+ /** Caption source: `TOC \c "SEQIdentifier"`. */
20
+ captionIdentifier?: string;
21
+ /** Caption source without a SEQ label/number: `TOC \a Identifier`. */
22
+ unlabeledIdentifier?: string;
23
+ /** Restrict collection to a bookmarked range. */
24
+ scopeBookmark?: string;
25
+ /** Chapter prefix from a SEQ identifier (`\s` + `\d`). */
26
+ chapterIdentifier?: string;
27
+ chapterSeparator?: string;
28
+ entryPageSeparator?: string;
29
+ omitPages?: readonly [number, number];
30
+ preserveTabs?: true;
31
+ preserveLineBreaks?: true;
19
32
  }
20
33
  export interface QualifiedTocRegion extends TocFieldSettings {
21
34
  startBlockIndex: number;