oasis-editor 0.0.413 → 0.0.415
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.
- package/dist/OasisEditorApp-Blf411AF.js +1 -0
- package/dist/assets/{importDocxWorker-Cza4hyf3.js → importDocxWorker-7COTnEu5.js} +5626 -5092
- package/dist/core/commands/builtinCommands.d.ts +1 -1
- package/dist/core/commands/fieldCode.d.ts +18 -0
- package/dist/core/commands/legacyForms.d.ts +15 -0
- package/dist/core/commands/list.d.ts +4 -0
- package/dist/core/commands/mailMerge.d.ts +8 -0
- package/dist/core/commands/publicCommandTypes.d.ts +42 -0
- package/dist/core/commands/tableOfAuthorities.d.ts +22 -0
- package/dist/core/commands/tableOfFigures.d.ts +12 -0
- package/dist/core/document/bookmarkScope.d.ts +6 -0
- package/dist/core/document/captionEntries.d.ts +24 -0
- package/dist/core/document/fieldCodeDisplay.d.ts +12 -0
- package/dist/core/document/fieldComparison.d.ts +7 -0
- package/dist/core/document/formulaFields.d.ts +10 -0
- package/dist/core/document/indexPlan.d.ts +17 -0
- package/dist/core/document/indexRefresh.d.ts +2 -1
- package/dist/core/document/listRestart.d.ts +7 -0
- package/dist/core/document/mergeFields.d.ts +64 -0
- package/dist/core/document/tableOfFigures.d.ts +38 -0
- package/dist/core/document/toaEntries.d.ts +33 -0
- package/dist/core/document/toaPlan.d.ts +36 -0
- package/dist/core/document/toaRefresh.d.ts +29 -0
- package/dist/core/document/tocFields.d.ts +13 -0
- package/dist/core/document/variableFields.d.ts +58 -0
- package/dist/core/format/fieldResultFormat.d.ts +19 -0
- package/dist/core/format/numberFormat.d.ts +15 -0
- package/dist/core/format/resolveNumberingLocale.d.ts +8 -0
- package/dist/core/model/editorState.d.ts +2 -0
- package/dist/core/model/index.d.ts +2 -2
- package/dist/core/model/listNumbering.d.ts +5 -1
- package/dist/core/model/types/primitives.d.ts +46 -8
- package/dist/core/model/types/styles.d.ts +3 -1
- package/dist/defaultToolbar-B8aZzV4B.js +1 -0
- package/dist/export/docx/docxTypes.d.ts +5 -0
- package/dist/export/docx/stylesXml.d.ts +4 -1
- package/dist/export/docx/text/paragraphPropertiesXml.d.ts +1 -1
- package/dist/export/pdf/draw/lists.d.ts +1 -1
- package/dist/i18n/locales/en.d.ts +40 -0
- package/dist/i18n/locales/pt-BR.d.ts +40 -0
- package/dist/import/docx/numbering.d.ts +14 -2
- package/dist/import/docx/stylesXml.d.ts +2 -1
- package/dist/oasis-editor.js +1 -1
- package/dist/oasis-editor.umd.cjs +1 -1
- package/dist/ooxml/word/fieldFormatSwitches.d.ts +40 -0
- package/dist/ooxml/word/legacyFormFields.d.ts +5 -0
- package/dist/ooxml/word/numberFormat.d.ts +26 -0
- package/dist/ooxml/word/numberingMetadata.d.ts +5 -1
- package/dist/ooxml/word/pictureBullets.d.ts +13 -0
- package/dist/plugins/internal/essentialsCapabilities.d.ts +25 -0
- package/dist/sourcePackage-ByCOFs8g.js +1 -0
- package/dist/ui/components/Toolbar/controls/FieldFamilyPanel.d.ts +9 -0
- package/package.json +1 -1
- package/dist/OasisEditorApp-BP3OY6PR.js +0 -1
- package/dist/defaultToolbar-BSz3ZnBB.js +0 -1
- package/dist/sourcePackage-DY2TdHmF.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", "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"];
|
|
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", "restartList", "continueList", "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,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;
|
|
@@ -6,4 +6,8 @@ export declare function indentParagraphList(state: EditorState): EditorState;
|
|
|
6
6
|
export declare function outdentParagraphList(state: EditorState): EditorState;
|
|
7
7
|
export declare function toggleParagraphList(state: EditorState, kind: ParagraphListKind): EditorState;
|
|
8
8
|
export declare function setParagraphListFormat(state: EditorState, format: EditorParagraphListStyle["format"] | null): EditorState;
|
|
9
|
+
/** Restart the selected list items at the given value (1 by default). */
|
|
10
|
+
export declare function restartListAtSelection(state: EditorState, startAt?: number): EditorState;
|
|
11
|
+
/** Drop an explicit restart so the items continue the instance counter. */
|
|
12
|
+
export declare function continueListAtSelection(state: EditorState): EditorState;
|
|
9
13
|
export declare function setParagraphListStartAt(state: EditorState, startAt: number | null): 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;
|
|
@@ -273,6 +273,8 @@ export interface OasisCommandPayloads {
|
|
|
273
273
|
setLineHeight: number | null;
|
|
274
274
|
setListFormat: string;
|
|
275
275
|
setListStartAt: number | null;
|
|
276
|
+
restartList: number | undefined;
|
|
277
|
+
continueList: undefined;
|
|
276
278
|
setListLevel: number;
|
|
277
279
|
toggleOrientation: undefined;
|
|
278
280
|
setOrientation: "portrait" | "landscape";
|
|
@@ -322,6 +324,36 @@ export interface OasisCommandPayloads {
|
|
|
322
324
|
insertDateField: undefined;
|
|
323
325
|
updateBodyFields: undefined;
|
|
324
326
|
updateSelectedFields: undefined;
|
|
327
|
+
insertFieldCode: string;
|
|
328
|
+
editFieldCode: {
|
|
329
|
+
instructionRunId: string;
|
|
330
|
+
code: string;
|
|
331
|
+
};
|
|
332
|
+
editFieldCodeAtSelection: string;
|
|
333
|
+
toggleFieldLock: string;
|
|
334
|
+
toggleFieldCodes: boolean | undefined;
|
|
335
|
+
nextField: undefined;
|
|
336
|
+
previousField: undefined;
|
|
337
|
+
markAuthorityEntry: import('./tableOfAuthorities.js').MarkAuthorityEntryOptions;
|
|
338
|
+
insertTableOfAuthorities: import('./tableOfAuthorities.js').InsertTableOfAuthoritiesOptions;
|
|
339
|
+
updateTableOfAuthorities: {
|
|
340
|
+
locale?: string;
|
|
341
|
+
} | undefined;
|
|
342
|
+
insertTableOfFigures: import('./tableOfFigures.js').InsertTableOfFiguresOptions;
|
|
343
|
+
updateTableOfFigures: undefined;
|
|
344
|
+
previewMergeRecord: {
|
|
345
|
+
records: readonly Readonly<Record<string, string>>[];
|
|
346
|
+
index: number;
|
|
347
|
+
};
|
|
348
|
+
mergeToNewDocuments: {
|
|
349
|
+
records: readonly Readonly<Record<string, string>>[];
|
|
350
|
+
};
|
|
351
|
+
updateVariableFields: undefined;
|
|
352
|
+
setFormFieldValue: {
|
|
353
|
+
name: string;
|
|
354
|
+
value: string;
|
|
355
|
+
};
|
|
356
|
+
toggleFormCheckbox: string;
|
|
325
357
|
insertDateTime: {
|
|
326
358
|
dateFormat?: string;
|
|
327
359
|
} | undefined;
|
|
@@ -439,6 +471,16 @@ export interface OasisCommandResults {
|
|
|
439
471
|
markIndexEntry: boolean;
|
|
440
472
|
insertIndex: boolean;
|
|
441
473
|
updateIndex: boolean;
|
|
474
|
+
insertFieldCode: boolean;
|
|
475
|
+
editFieldCode: boolean;
|
|
476
|
+
toggleFieldLock: boolean;
|
|
477
|
+
markAuthorityEntry: boolean;
|
|
478
|
+
insertTableOfAuthorities: boolean;
|
|
479
|
+
updateTableOfAuthorities: boolean;
|
|
480
|
+
insertTableOfFigures: boolean;
|
|
481
|
+
updateTableOfFigures: boolean;
|
|
482
|
+
setFormFieldValue: boolean;
|
|
483
|
+
toggleFormCheckbox: boolean;
|
|
442
484
|
documentStyles: unknown;
|
|
443
485
|
[command: string]: unknown;
|
|
444
486
|
}
|
|
@@ -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;
|
|
@@ -3,11 +3,28 @@ import { XePage } from './xeEntries.js';
|
|
|
3
3
|
import { XeRangePage } from './xeRanges.js';
|
|
4
4
|
export interface IndexSettings {
|
|
5
5
|
identifier?: string;
|
|
6
|
+
/** `\b` bookmark restricting the collected entries. */
|
|
7
|
+
bookmark?: string;
|
|
6
8
|
locale?: string;
|
|
7
9
|
entrySeparator: string;
|
|
8
10
|
pageSeparator: string;
|
|
9
11
|
crossReferenceSeparator: string;
|
|
10
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;
|
|
11
28
|
}
|
|
12
29
|
export interface IndexPageReference extends XePage {
|
|
13
30
|
bold: boolean;
|
|
@@ -13,13 +13,14 @@ interface Fragment {
|
|
|
13
13
|
interface EntryLine {
|
|
14
14
|
indent: number;
|
|
15
15
|
fragments: Fragment[];
|
|
16
|
+
styleId?: string;
|
|
16
17
|
}
|
|
17
18
|
/** Only a single complete flat INDEX with separate marker paragraphs. */
|
|
18
19
|
export declare function findQualifiedIndexRegion(blocks: readonly EditorBlockNode[]): IndexRegion | undefined;
|
|
19
20
|
/** Render only one-column indented plans. A range spanning section boundaries
|
|
20
21
|
* is kept in the read-only plan but is not compacted into a misleading label.
|
|
21
22
|
*/
|
|
22
|
-
export declare function renderIndexPlan(plan: IndexPlan): EntryLine[] | undefined;
|
|
23
|
+
export declare function renderIndexPlan(plan: IndexPlan, mode?: "tabs" | "section"): EntryLine[] | undefined;
|
|
23
24
|
export interface IndexRefreshResult {
|
|
24
25
|
state: EditorState;
|
|
25
26
|
status: "updated" | "unchanged" | "unsupported" | "unresolved" | "nonconvergent";
|
|
@@ -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;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { EditorState } from '../model.js';
|
|
2
|
+
import { ComparisonOperator } from './fieldComparison.js';
|
|
3
|
+
export interface SetInstruction {
|
|
4
|
+
type: "SET";
|
|
5
|
+
name: string;
|
|
6
|
+
value: string;
|
|
7
|
+
}
|
|
8
|
+
export interface AskInstruction {
|
|
9
|
+
type: "ASK";
|
|
10
|
+
name: string;
|
|
11
|
+
prompt: string;
|
|
12
|
+
defaultValue?: string;
|
|
13
|
+
once: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface FillInInstruction {
|
|
16
|
+
type: "FILLIN";
|
|
17
|
+
prompt: string;
|
|
18
|
+
defaultValue?: string;
|
|
19
|
+
once: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface CompareInstruction {
|
|
22
|
+
type: "COMPARE";
|
|
23
|
+
left: string;
|
|
24
|
+
operator: ComparisonOperator;
|
|
25
|
+
right: string;
|
|
26
|
+
quoted: [boolean, boolean];
|
|
27
|
+
}
|
|
28
|
+
export interface FormulaInstruction {
|
|
29
|
+
type: "FORMULA";
|
|
30
|
+
expression: string;
|
|
31
|
+
picture?: string;
|
|
32
|
+
}
|
|
33
|
+
export type VariableInstruction = SetInstruction | AskInstruction | FillInInstruction | CompareInstruction | FormulaInstruction;
|
|
34
|
+
export interface VariableFieldContext {
|
|
35
|
+
/** Immutable variable snapshot threaded through document order. */
|
|
36
|
+
variables?: Readonly<Record<string, string>>;
|
|
37
|
+
/** Explicit user/data callback. Absent means "preserve cached result". */
|
|
38
|
+
prompt?: (prompt: string, defaultValue?: string) => string | undefined;
|
|
39
|
+
record?: Readonly<Record<string, string>>;
|
|
40
|
+
}
|
|
41
|
+
/** Strict compiler for SET/ASK/FILLIN/COMPARE and `=`. Nested fields and
|
|
42
|
+
* unknown switches stay opaque; formulas are parsed by evaluateFormula. */
|
|
43
|
+
export declare function parseVariableFieldInstruction(raw: string): VariableInstruction | undefined;
|
|
44
|
+
export interface VariableEvaluationResult {
|
|
45
|
+
text: string;
|
|
46
|
+
variables: Readonly<Record<string, string>>;
|
|
47
|
+
status: "resolved" | "preserved";
|
|
48
|
+
}
|
|
49
|
+
/** Evaluate one instruction against an immutable variable snapshot. */
|
|
50
|
+
export declare function evaluateVariableInstruction(instruction: VariableInstruction, context: VariableFieldContext, variables: Readonly<Record<string, string>>, cachedText: string): VariableEvaluationResult;
|
|
51
|
+
export interface VariableRefreshResult {
|
|
52
|
+
state: EditorState;
|
|
53
|
+
updated: number;
|
|
54
|
+
variables: Readonly<Record<string, string>>;
|
|
55
|
+
}
|
|
56
|
+
/** Walk top-level variable fields in document order, threading their variable
|
|
57
|
+
* state. Unqualified fields and locked markers are left untouched. */
|
|
58
|
+
export declare function refreshVariableFieldCaches(original: EditorState, context?: VariableFieldContext): VariableRefreshResult;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deterministic rendering for general Word field formatting switches.
|
|
3
|
+
* All formatters are bounded and fail closed: an unsupported picture or value
|
|
4
|
+
* returns undefined so the caller preserves the cached result instead of
|
|
5
|
+
* inventing a formatted value. No locale other than the explicit en-US
|
|
6
|
+
* numeric mask is implied; date pictures are handled by temporalFieldFormat.
|
|
7
|
+
*/
|
|
8
|
+
/** `\*` switch names, duplicated here to keep the format layer independent
|
|
9
|
+
* of the OOXML parser (no import cycle). */
|
|
10
|
+
export type FormatSwitchName = "MERGEFORMAT" | "CHARFORMAT" | "Caps" | "FirstCap" | "Upper" | "Lower" | "alphabetic" | "ALPHABETIC" | "Arabic" | "ArabicDash" | "CardText" | "DollarText" | "Hex" | "OrdText" | "Ordinal" | "roman" | "ROMAN";
|
|
11
|
+
/** `\*` number words. Case-sensitive names match Word's serialized switch. */
|
|
12
|
+
export declare function formatNumberWord(value: number, name: FormatSwitchName): string | undefined;
|
|
13
|
+
/** `\*` capitalization words applied after any numeric/date rendering. */
|
|
14
|
+
export declare function formatCapitalization(text: string, name: FormatSwitchName): string;
|
|
15
|
+
/** Apply a qualified `\*` name to an already resolved result string. */
|
|
16
|
+
export declare function applyStarFormat(text: string, name: FormatSwitchName): string | undefined;
|
|
17
|
+
export declare function supportsNumericPicture(picture: string): boolean;
|
|
18
|
+
/** `\#` numeric picture. Unrepresentable inputs return undefined. */
|
|
19
|
+
export declare function formatNumericPicture(value: number, picture: string): string | undefined;
|