ooxml-core 0.17.0 → 0.18.0
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/docx/document-stats.d.ts +18 -0
- package/dist/docx/document-stats.d.ts.map +1 -0
- package/dist/docx/index.cjs +34 -0
- package/dist/docx/index.d.ts +1 -0
- package/dist/docx/index.d.ts.map +1 -1
- package/dist/docx/index.mjs +33 -1
- package/dist/xlsx/formula/editor-text.d.ts +60 -0
- package/dist/xlsx/formula/editor-text.d.ts.map +1 -0
- package/dist/xlsx/formula/index.d.ts +1 -0
- package/dist/xlsx/formula/index.d.ts.map +1 -1
- package/dist/xlsx/index.cjs +171 -0
- package/dist/xlsx/index.mjs +158 -1
- package/package.json +2 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DocumentModel } from './model.js';
|
|
2
|
+
export interface DocumentStats {
|
|
3
|
+
paragraphs: number;
|
|
4
|
+
tables: number;
|
|
5
|
+
sections: number;
|
|
6
|
+
characters: number;
|
|
7
|
+
charactersWithSpaces: number;
|
|
8
|
+
comments: number;
|
|
9
|
+
revisions: number;
|
|
10
|
+
}
|
|
11
|
+
/** Facts for the File > Info page: counts of what the model holds, not layout results. */
|
|
12
|
+
export declare function documentStats(model: DocumentModel): DocumentStats;
|
|
13
|
+
/**
|
|
14
|
+
* The document as plain text for File > Export: one line per paragraph, table cells separated by
|
|
15
|
+
* tabs. Formatting, pictures and notes are not exported.
|
|
16
|
+
*/
|
|
17
|
+
export declare function plainText(model: DocumentModel): string;
|
|
18
|
+
//# sourceMappingURL=document-stats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-stats.d.ts","sourceRoot":"","sources":["../../src/docx/document-stats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAS,aAAa,EAAE,MAAM,YAAY,CAAC;AAGvD,MAAM,WAAW,aAAa;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CAClB;AAmBD,0FAA0F;AAC1F,wBAAgB,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,aAAa,CAmBjE;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAUtD"}
|
package/dist/docx/index.cjs
CHANGED
|
@@ -9631,6 +9631,38 @@ function resolveCellVisuals(table, cell, placement, styles) {
|
|
|
9631
9631
|
return { borders, ...shadingFill ? { shadingFill } : {} };
|
|
9632
9632
|
}
|
|
9633
9633
|
|
|
9634
|
+
// src/docx/document-stats.ts
|
|
9635
|
+
function visibleText(paragraph) {
|
|
9636
|
+
return paragraph.runs.filter((run) => !run.fieldCode && !run.fieldChar).filter((run) => run.revision?.kind !== "delete" && run.revision?.kind !== "moveFrom").map((run) => run.text).join("");
|
|
9637
|
+
}
|
|
9638
|
+
function paragraphsOf3(blocks) {
|
|
9639
|
+
return blocks.flatMap(
|
|
9640
|
+
(block) => block.type === "paragraph" ? [block] : block.rows.flatMap((row) => row.flatMap((cell) => cell.paragraphs))
|
|
9641
|
+
);
|
|
9642
|
+
}
|
|
9643
|
+
function documentStats(model) {
|
|
9644
|
+
const paragraphs = paragraphsOf3(model.blocks);
|
|
9645
|
+
const text = paragraphs.map(visibleText).join("");
|
|
9646
|
+
const revisions = paragraphs.reduce(
|
|
9647
|
+
(count, paragraph) => count + paragraph.runs.filter((run) => run.revision).length + (paragraph.markRevision ? 1 : 0),
|
|
9648
|
+
0
|
|
9649
|
+
);
|
|
9650
|
+
return {
|
|
9651
|
+
paragraphs: paragraphs.length,
|
|
9652
|
+
tables: model.blocks.filter((block) => block.type === "table").length,
|
|
9653
|
+
sections: model.sections?.length ?? 1,
|
|
9654
|
+
characters: [...text.replace(/\s/g, "")].length,
|
|
9655
|
+
charactersWithSpaces: [...text].length,
|
|
9656
|
+
comments: model.comments?.length ?? 0,
|
|
9657
|
+
revisions
|
|
9658
|
+
};
|
|
9659
|
+
}
|
|
9660
|
+
function plainText2(model) {
|
|
9661
|
+
return model.blocks.map(
|
|
9662
|
+
(block) => block.type === "paragraph" ? visibleText(block) : block.rows.map((row) => row.map((cell) => cell.paragraphs.map(visibleText).join(" ")).join(" ")).join("\n")
|
|
9663
|
+
).join("\n");
|
|
9664
|
+
}
|
|
9665
|
+
|
|
9634
9666
|
exports.DEFAULT_STYLES_XML = DEFAULT_STYLES_XML;
|
|
9635
9667
|
exports.DEFAULT_TABLE_BORDERS = DEFAULT_TABLE_BORDERS;
|
|
9636
9668
|
exports.DEFAULT_TOC_INSTRUCTION = DEFAULT_TOC_INSTRUCTION;
|
|
@@ -9764,6 +9796,7 @@ exports.defaultStyleCatalogs = defaultStyleCatalogs;
|
|
|
9764
9796
|
exports.diagramColorTheme = diagramColorTheme;
|
|
9765
9797
|
exports.diagramsIn = diagramsIn;
|
|
9766
9798
|
exports.displayListLabel = displayListLabel;
|
|
9799
|
+
exports.documentStats = documentStats;
|
|
9767
9800
|
exports.eighthPoints = eighthPoints;
|
|
9768
9801
|
exports.eighthPointsFromPoints = eighthPointsFromPoints;
|
|
9769
9802
|
exports.eighthPointsToPoints = eighthPointsToPoints;
|
|
@@ -9914,6 +9947,7 @@ exports.parseTheme = parseTheme;
|
|
|
9914
9947
|
exports.parseTintShade = parseTintShade;
|
|
9915
9948
|
exports.parseTwips = parseTwips;
|
|
9916
9949
|
exports.parseUnsignedInteger = parseUnsignedInteger;
|
|
9950
|
+
exports.plainText = plainText2;
|
|
9917
9951
|
exports.rejectAllRevisions = rejectAllRevisions;
|
|
9918
9952
|
exports.rejectRevision = rejectRevision;
|
|
9919
9953
|
exports.reportParseWarning = reportParseWarning;
|
package/dist/docx/index.d.ts
CHANGED
|
@@ -37,4 +37,5 @@ export type { ParagraphAlign, ParsedJustification } from './paragraph-alignment.
|
|
|
37
37
|
export { withParseWarnings, enumValue, reportParseWarning } from './parse-diagnostics.js';
|
|
38
38
|
export { PROPERTY_FIELDS, type DocumentProperties } from './core-properties.js';
|
|
39
39
|
export { captionParagraphs, isCaptionOf, tableOfFiguresInstruction, tocCaptionLabel, } from './table-of-figures.js';
|
|
40
|
+
export * from './document-stats.js';
|
|
40
41
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/docx/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/docx/index.ts"],"names":[],"mappings":"AACA,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC9E,cAAc,eAAe,CAAC;AAC9B,OAAO,EACN,0BAA0B,EAC1B,0BAA0B,EAC1B,qBAAqB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EACN,sBAAsB,EACtB,0BAA0B,EAC1B,cAAc,EACd,eAAe,EACf,iBAAiB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EACN,mBAAmB,EACnB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,o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B,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,cAAc,iCAAiC,CAAC;AAChD,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACtF,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,KAAK,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EACN,iBAAiB,EACjB,WAAW,EACX,yBAAyB,EACzB,eAAe,GACf,MAAM,uBAAuB,CAAC;AAC/B,cAAc,qBAAqB,CAAC"}
|
package/dist/docx/index.mjs
CHANGED
|
@@ -9625,4 +9625,36 @@ function resolveCellVisuals(table, cell, placement, styles) {
|
|
|
9625
9625
|
return { borders, ...shadingFill ? { shadingFill } : {} };
|
|
9626
9626
|
}
|
|
9627
9627
|
|
|
9628
|
-
|
|
9628
|
+
// src/docx/document-stats.ts
|
|
9629
|
+
function visibleText(paragraph) {
|
|
9630
|
+
return paragraph.runs.filter((run) => !run.fieldCode && !run.fieldChar).filter((run) => run.revision?.kind !== "delete" && run.revision?.kind !== "moveFrom").map((run) => run.text).join("");
|
|
9631
|
+
}
|
|
9632
|
+
function paragraphsOf3(blocks) {
|
|
9633
|
+
return blocks.flatMap(
|
|
9634
|
+
(block) => block.type === "paragraph" ? [block] : block.rows.flatMap((row) => row.flatMap((cell) => cell.paragraphs))
|
|
9635
|
+
);
|
|
9636
|
+
}
|
|
9637
|
+
function documentStats(model) {
|
|
9638
|
+
const paragraphs = paragraphsOf3(model.blocks);
|
|
9639
|
+
const text = paragraphs.map(visibleText).join("");
|
|
9640
|
+
const revisions = paragraphs.reduce(
|
|
9641
|
+
(count, paragraph) => count + paragraph.runs.filter((run) => run.revision).length + (paragraph.markRevision ? 1 : 0),
|
|
9642
|
+
0
|
|
9643
|
+
);
|
|
9644
|
+
return {
|
|
9645
|
+
paragraphs: paragraphs.length,
|
|
9646
|
+
tables: model.blocks.filter((block) => block.type === "table").length,
|
|
9647
|
+
sections: model.sections?.length ?? 1,
|
|
9648
|
+
characters: [...text.replace(/\s/g, "")].length,
|
|
9649
|
+
charactersWithSpaces: [...text].length,
|
|
9650
|
+
comments: model.comments?.length ?? 0,
|
|
9651
|
+
revisions
|
|
9652
|
+
};
|
|
9653
|
+
}
|
|
9654
|
+
function plainText2(model) {
|
|
9655
|
+
return model.blocks.map(
|
|
9656
|
+
(block) => block.type === "paragraph" ? visibleText(block) : block.rows.map((row) => row.map((cell) => cell.paragraphs.map(visibleText).join(" ")).join(" ")).join("\n")
|
|
9657
|
+
).join("\n");
|
|
9658
|
+
}
|
|
9659
|
+
|
|
9660
|
+
export { DEFAULT_STYLES_XML, DEFAULT_TABLE_BORDERS, DEFAULT_TOC_INSTRUCTION, DIAGRAM_GRAPHIC_URI, DocxModelValidationError, EMPTY_FIGURES_TEXT, EMPTY_TOC_TEXT, EMU_PER_INCH, EMU_PER_PIXEL, EMU_PER_POINT, LIGATURE_VALUES, PIXELS_PER_INCH, PROPERTY_FIELDS, ST_AlgClass, ST_AlgType, ST_AnnotationVMerge, ST_Border, ST_BrClear, ST_BrType, ST_CalendarType, ST_CaptionPos, ST_ChapterSep, ST_CharacterSpacing, ST_CombineBrackets, ST_ConformanceClass, ST_CryptProv, ST_Direction, ST_DisplacedByCustomXml, ST_DocGrid, ST_DocPartBehavior, ST_DocPartGallery, ST_DocPartType, ST_DocProtect, ST_DropCap, ST_EdGrp, ST_EdnPos, ST_Em, ST_FFTextType, ST_FldCharType, ST_FontFamily, ST_FrameLayout, ST_FrameScrollbar, ST_FtnEdn, ST_FtnPos, ST_HAnchor, ST_HdrFtr, ST_HeightRule, ST_HexColorAuto, ST_HighlightColor, ST_Hint, ST_InfoTextType, ST_Jc, ST_JcTable, ST_LevelSuffix, ST_LineNumberRestart, ST_LineSpacingRule, ST_Lock, ST_MailMergeDest, ST_MailMergeDocType, ST_MailMergeOdsoFMDFieldType, ST_MailMergeSourceType, ST_Merge, ST_MultiLevelType, ST_NumberFormat, ST_ObjectDrawAspect, ST_ObjectUpdateMode, ST_OnOff1, ST_PTabAlignment, ST_PTabLeader, ST_PTabRelativeTo, ST_PageBorderDisplay, ST_PageBorderOffset, ST_PageBorderZOrder, ST_PageOrientation, ST_Pitch, ST_Proof, ST_ProofErr, ST_RelFromH, ST_RelFromV, ST_RestartNumber, ST_RubyAlign, ST_SchemeColorVal, ST_SdtDateMappingType, ST_SectionMark, ST_Shd, ST_StyleSort, ST_StyleType, ST_TabJc, ST_TabTlc, ST_TargetScreenSz, ST_TblLayoutType, ST_TblOverlap, ST_TblStyleOverrideType, ST_TblWidth, ST_TextAlignment, ST_TextDirection, ST_TextEffect, ST_TextboxTightWrap, ST_Theme, ST_ThemeColor, ST_TrueFalse, ST_TrueFalseBlank, ST_Underline, ST_VAnchor, ST_VerticalAlignRun, ST_VerticalJc, ST_View, ST_WmlColorSchemeIndex, ST_Wrap, ST_XAlign, ST_YAlign, ST_Zoom, TWIPS_PER_INCH, TWIPS_PER_POINT, WORD_HIGHLIGHT_TOKENS, WORD_UNDERLINE_TOKENS, acceptAllRevisions, acceptRevision, alignFromJustification, applyThemeShade, applyThemeTint, assertValidDocumentModel, buildTableOfContents, captionParagraphs, computeListLabels, createDocument, createListDefinition, dateFieldResult, datePicture, defaultStyleCatalogs, diagramColorTheme, diagramsIn, displayListLabel, documentStats, eighthPoints, eighthPointsFromPoints, eighthPointsToPoints, emu, emuFromPixels, emuToPixels, ensureListDefinition, enumValue, fieldName, findRevision, findTableOfContents, formatListNumber, formatNoteNumber, formatWordDate, halfPoints, halfPointsFromPoints, halfPointsToPoints, headingLevel, headingListLevels, isCaptionOf, isHeadingListKind, isLigatures, isStAlgClass, isStAlgType, isStAnnotationVMerge, isStBorder, isStBrClear, isStBrType, isStCalendarType, isStCaptionPos, isStChapterSep, isStCharacterSpacing, isStCombineBrackets, isStConformanceClass, isStCryptProv, isStDirection, isStDisplacedByCustomXml, isStDocGrid, isStDocPartBehavior, isStDocPartGallery, isStDocPartType, isStDocProtect, isStDropCap, isStEdGrp, isStEdnPos, isStEm, isStFFTextType, isStFldCharType, isStFontFamily, isStFrameLayout, isStFrameScrollbar, isStFtnEdn, isStFtnPos, isStHAnchor, isStHdrFtr, isStHeightRule, isStHexColorAuto, isStHighlightColor, isStHint, isStInfoTextType, isStJc, isStJcTable, isStLevelSuffix, isStLineNumberRestart, isStLineSpacingRule, isStLock, isStMailMergeDest, isStMailMergeDocType, isStMailMergeOdsoFMDFieldType, isStMailMergeSourceType, isStMerge, isStMultiLevelType, isStNumberFormat, isStObjectDrawAspect, isStObjectUpdateMode, isStOnOff1, isStPTabAlignment, isStPTabLeader, isStPTabRelativeTo, isStPageBorderDisplay, isStPageBorderOffset, isStPageBorderZOrder, isStPageOrientation, isStPitch, isStProof, isStProofErr, isStRelFromH, isStRelFromV, isStRestartNumber, isStRubyAlign, isStSchemeColorVal, isStSdtDateMappingType, isStSectionMark, isStShd, isStStyleSort, isStStyleType, isStTabJc, isStTabTlc, isStTargetScreenSz, isStTblLayoutType, isStTblOverlap, isStTblStyleOverrideType, isStTblWidth, isStTextAlignment, isStTextDirection, isStTextEffect, isStTextboxTightWrap, isStTheme, isStThemeColor, isStTrueFalse, isStTrueFalseBlank, isStUnderline, isStVAnchor, isStVerticalAlignRun, isStVerticalJc, isStView, isStWmlColorSchemeIndex, isStWrap, isStXAlign, isStYAlign, isStZoom, isThemeColorToken, isValidLanguageTag, isWordHighlightToken, isWordUnderlineStyle, linkStylesToList, listRevisions, loadDocx, numberNotesInOrder, onOffAttribute, onOffElement, parseColorSchemeMapping, parseEighthPoints, parseHalfPoints, parseHexColor, parseInteger, parseJustification, parseNumberingCatalog, parseOnOff, parseParagraphStyleCatalog, parseRgbColor, parseRunStyleCatalog, parseSignedHalfPoints, parseSignedTwips, parseTableStyleCatalog, parseTextScale, parseTheme, parseTintShade, parseTwips, parseUnsignedInteger, plainText2 as plainText, rejectAllRevisions, rejectRevision, reportParseWarning, resolveCellVisuals, resolveDiagramColor, resolveNumberingLevel, resolveParagraphFormatting, resolveParagraphNumbering, resolveRunFormatting, resolveStyleNumbering, resolveTableStyleFormatting, resolveThemeColorReference, resolveThemeColorToken, roundEighthPoints, roundEmu, roundHalfPoints, roundSignedTwips, roundTwips, saveDocx, signedTwips, signedTwipsFromPixels, signedTwipsFromPoints, tableOfFiguresInstruction, tocBookmarks, tocCaptionLabel, tocEntries, tocHyperlinks, tocLevels, twips, twipsFromInches, twipsFromPixels, twipsFromPoints, twipsToInches, twipsToPixels, twipsToPoints, universalMeasureToTwips, updateTableOfContents, validateDocumentModel, withParseWarnings, withTocBookmarks };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type CellRange } from '../address.js';
|
|
2
|
+
import type { FunctionInfo } from './functions/types.js';
|
|
3
|
+
/** Excel-like colours for references in a formula, in order of first appearance. */
|
|
4
|
+
export declare const REFERENCE_COLORS: readonly ['#2a6ad8', '#d24726', '#7d3fbf', '#0f8a3b', '#c0399f', '#946d00', '#d1102b', '#00788a'];
|
|
5
|
+
export declare const isFormulaText: (text: string) => boolean;
|
|
6
|
+
export interface ColoredReference {
|
|
7
|
+
/** Offsets into the formula text (which includes '='). */
|
|
8
|
+
start: number;
|
|
9
|
+
end: number;
|
|
10
|
+
text: string;
|
|
11
|
+
color: string;
|
|
12
|
+
/** Same reference text shares a colour (and a colour index). */
|
|
13
|
+
index: number;
|
|
14
|
+
}
|
|
15
|
+
/** The references of a formula with their colours (offsets into `text`, which includes '='). */
|
|
16
|
+
export declare function coloredReferences(text: string): ColoredReference[];
|
|
17
|
+
/** Whether typing a reference at `caret` makes sense (point mode may start). */
|
|
18
|
+
export declare function acceptsReference(text: string, caret: number): boolean;
|
|
19
|
+
/** True when `caret` is inside a "string literal". */
|
|
20
|
+
export declare function insideString(text: string, caret: number): boolean;
|
|
21
|
+
export interface NameToken {
|
|
22
|
+
start: number;
|
|
23
|
+
prefix: string;
|
|
24
|
+
}
|
|
25
|
+
/** The function-name prefix ending at the caret (`=SU|` -> `SU`), for autocomplete. */
|
|
26
|
+
export declare function nameAtCaret(text: string, caret: number): NameToken | undefined;
|
|
27
|
+
/** Catalog functions starting with `prefix` (case-insensitive), at most `limit`. */
|
|
28
|
+
export declare function functionMatches(prefix: string, limit?: number, catalog?: readonly FunctionInfo[]): FunctionInfo[];
|
|
29
|
+
export interface CallContext {
|
|
30
|
+
name: string;
|
|
31
|
+
/** Zero-based argument the caret is in. */
|
|
32
|
+
argIndex: number;
|
|
33
|
+
}
|
|
34
|
+
/** The innermost function call around the caret (`=IF(A1>0,|` -> IF, argument 1). */
|
|
35
|
+
export declare function callAtCaret(text: string, caret: number): CallContext | undefined;
|
|
36
|
+
/** Splits `SUM(number1, [number2], ...)` into its parameter texts. */
|
|
37
|
+
export declare function syntaxParams(syntax: string): {
|
|
38
|
+
name: string;
|
|
39
|
+
params: string[];
|
|
40
|
+
};
|
|
41
|
+
/** The parameter to highlight for an argument index (a trailing `...` repeats the last one). */
|
|
42
|
+
export declare function activeParam(params: string[], argIndex: number): number;
|
|
43
|
+
/** Replaces `text[start, end)` with `insert`; returns the new text and caret. */
|
|
44
|
+
export declare function splice(text: string, start: number, end: number, insert: string): {
|
|
45
|
+
text: string;
|
|
46
|
+
caret: number;
|
|
47
|
+
};
|
|
48
|
+
/** The sheet name and range a reference token names (`'My sheet'!$A$1:B2`, `A:C`, `2:5`). */
|
|
49
|
+
export declare function referenceTarget(text: string): {
|
|
50
|
+
sheet?: string;
|
|
51
|
+
range: CellRange;
|
|
52
|
+
} | undefined;
|
|
53
|
+
/** F4: cycles the absolute/relative form of the reference at the caret. */
|
|
54
|
+
export declare function toggleAbsolute(text: string, caret: number): {
|
|
55
|
+
text: string;
|
|
56
|
+
caret: number;
|
|
57
|
+
} | undefined;
|
|
58
|
+
/** Excel's commit-time autocorrect: appends the closing parentheses a formula is missing. */
|
|
59
|
+
export declare function closeParens(text: string): string;
|
|
60
|
+
//# sourceMappingURL=editor-text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-text.d.ts","sourceRoot":"","sources":["../../../src/xlsx/formula/editor-text.ts"],"names":[],"mappings":"AAGA,OAAO,EAA6C,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGzD,oFAAoF;AACpF,eAAO,MAAM,gBAAgB,YAC5B,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,CACA,CAAC;AAEX,eAAO,MAAM,aAAa,SAAU,MAAM,KAAG,OACA,CAAC;AAE9C,MAAM,WAAW,gBAAgB;IAChC,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;CACd;AAED,gGAAgG;AAChG,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAkBlE;AAKD,gFAAgF;AAChF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAOrE;AAED,sDAAsD;AACtD,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAIjE;AAED,MAAM,WAAW,SAAS;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CACf;AAED,uFAAuF;AACvF,wBAAgB,WAAW,CAAC,IAAI,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7F,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAUhD"}
|
|
@@ -11,4 +11,5 @@ export { deleteSheetInFormula, moveReferencesInFormula, type MoveSpec } from './
|
|
|
11
11
|
export { renameTableInFormula } from './table-refs.js';
|
|
12
12
|
export { structuredToA1, type StructuredTarget } from './structured-to-a1.js';
|
|
13
13
|
export { needsArrayEvaluation } from './array-context.js';
|
|
14
|
+
export * from './editor-text.js';
|
|
14
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/xlsx/formula/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,YAAY,EACZ,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,iBAAiB,GACtB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,KAAK,KAAK,EAAE,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EACN,0BAA0B,EAC1B,gBAAgB,EAChB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,YAAY,GACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,KAAK,aAAa,EAClB,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EAChB,KAAK,SAAS,GACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,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AuB,EAAE,KAAK,QAAQ,EAAE,MAAM,WAAW,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,cAAc,kBAAkB,CAAC"}
|
package/dist/xlsx/index.cjs
CHANGED
|
@@ -12893,6 +12893,163 @@ function needsArrayEvaluation(formula) {
|
|
|
12893
12893
|
return result2.needs || result2.multi;
|
|
12894
12894
|
}
|
|
12895
12895
|
|
|
12896
|
+
// src/xlsx/formula/editor-text.ts
|
|
12897
|
+
var REFERENCE_COLORS = [
|
|
12898
|
+
"#2a6ad8",
|
|
12899
|
+
"#d24726",
|
|
12900
|
+
"#7d3fbf",
|
|
12901
|
+
"#0f8a3b",
|
|
12902
|
+
"#c0399f",
|
|
12903
|
+
"#946d00",
|
|
12904
|
+
"#d1102b",
|
|
12905
|
+
"#00788a"
|
|
12906
|
+
];
|
|
12907
|
+
var isFormulaText = (text2) => text2.startsWith("=") || text2.startsWith("+");
|
|
12908
|
+
function coloredReferences(text2) {
|
|
12909
|
+
if (!isFormulaText(text2)) return [];
|
|
12910
|
+
const seen = /* @__PURE__ */ new Map();
|
|
12911
|
+
return referenceSpans(text2.slice(1), "").map((span3) => {
|
|
12912
|
+
const key = span3.text.replace(/\$/g, "").toUpperCase();
|
|
12913
|
+
let index2 = seen.get(key);
|
|
12914
|
+
if (index2 === void 0) {
|
|
12915
|
+
index2 = seen.size;
|
|
12916
|
+
seen.set(key, index2);
|
|
12917
|
+
}
|
|
12918
|
+
return {
|
|
12919
|
+
start: span3.start + 1,
|
|
12920
|
+
end: span3.end + 1,
|
|
12921
|
+
text: span3.text,
|
|
12922
|
+
index: index2,
|
|
12923
|
+
color: REFERENCE_COLORS[index2 % REFERENCE_COLORS.length] ?? REFERENCE_COLORS[0]
|
|
12924
|
+
};
|
|
12925
|
+
});
|
|
12926
|
+
}
|
|
12927
|
+
var POINT_AFTER = /* @__PURE__ */ new Set(["=", "(", ",", "+", "-", "*", "/", "^", "&", "<", ">", ":", ";", "%"]);
|
|
12928
|
+
function acceptsReference(text2, caret) {
|
|
12929
|
+
if (!isFormulaText(text2)) return false;
|
|
12930
|
+
if (text2.slice(caret).trimStart() !== "" && !/^[\s),;&+\-*/^<>=]/.test(text2.slice(caret)))
|
|
12931
|
+
return false;
|
|
12932
|
+
const before = text2.slice(0, caret).trimEnd();
|
|
12933
|
+
const last = before[before.length - 1];
|
|
12934
|
+
return last !== void 0 && POINT_AFTER.has(last) && !insideString(text2, caret);
|
|
12935
|
+
}
|
|
12936
|
+
function insideString(text2, caret) {
|
|
12937
|
+
let open = false;
|
|
12938
|
+
for (let i = 0; i < caret && i < text2.length; i++) if (text2[i] === '"') open = !open;
|
|
12939
|
+
return open;
|
|
12940
|
+
}
|
|
12941
|
+
function nameAtCaret(text2, caret) {
|
|
12942
|
+
if (!isFormulaText(text2) || insideString(text2, caret)) return void 0;
|
|
12943
|
+
const match2 = /[A-Za-z_][A-Za-z0-9_.]*$/.exec(text2.slice(0, caret));
|
|
12944
|
+
if (!match2) return void 0;
|
|
12945
|
+
const start = caret - match2[0].length;
|
|
12946
|
+
const prev = text2[start - 1] ?? "";
|
|
12947
|
+
if (start === 0 || /[A-Za-z0-9_$!'".:]/.test(prev)) return void 0;
|
|
12948
|
+
if (/^[A-Za-z0-9_.]/.test(text2.slice(caret))) return void 0;
|
|
12949
|
+
return { start, prefix: match2[0] };
|
|
12950
|
+
}
|
|
12951
|
+
function functionMatches(prefix, limit2 = 12, catalog = FUNCTION_CATALOG) {
|
|
12952
|
+
const upper2 = prefix.toUpperCase();
|
|
12953
|
+
if (!upper2) return [];
|
|
12954
|
+
const out = [];
|
|
12955
|
+
for (const info of catalog) {
|
|
12956
|
+
if (info.name.startsWith(upper2)) out.push(info);
|
|
12957
|
+
if (out.length >= limit2) break;
|
|
12958
|
+
}
|
|
12959
|
+
return out;
|
|
12960
|
+
}
|
|
12961
|
+
function callAtCaret(text2, caret) {
|
|
12962
|
+
if (!isFormulaText(text2)) return void 0;
|
|
12963
|
+
const stack2 = [];
|
|
12964
|
+
let inString = false;
|
|
12965
|
+
for (let i = 1; i < caret && i < text2.length; i++) {
|
|
12966
|
+
const ch = text2[i];
|
|
12967
|
+
if (ch === '"') inString = !inString;
|
|
12968
|
+
if (inString) continue;
|
|
12969
|
+
if (ch === "(") {
|
|
12970
|
+
const name = /([A-Za-z_][A-Za-z0-9_.]*)\s*$/.exec(text2.slice(0, i))?.[1];
|
|
12971
|
+
stack2.push({ name: (name ?? "").toUpperCase(), argIndex: 0 });
|
|
12972
|
+
} else if (ch === ")") stack2.pop();
|
|
12973
|
+
else if (ch === "," || ch === ";") {
|
|
12974
|
+
const top = stack2[stack2.length - 1];
|
|
12975
|
+
if (top) top.argIndex++;
|
|
12976
|
+
} else if (ch === "{") stack2.push({ name: "", argIndex: 0 });
|
|
12977
|
+
else if (ch === "}") stack2.pop();
|
|
12978
|
+
}
|
|
12979
|
+
for (let i = stack2.length - 1; i >= 0; i--) {
|
|
12980
|
+
const entry = stack2[i];
|
|
12981
|
+
if (entry?.name) return entry;
|
|
12982
|
+
if (entry && !entry.name) return void 0;
|
|
12983
|
+
}
|
|
12984
|
+
return void 0;
|
|
12985
|
+
}
|
|
12986
|
+
function syntaxParams(syntax) {
|
|
12987
|
+
const open = syntax.indexOf("(");
|
|
12988
|
+
const close = syntax.lastIndexOf(")");
|
|
12989
|
+
if (open < 0) return { name: syntax, params: [] };
|
|
12990
|
+
const inner2 = syntax.slice(open + 1, close < 0 ? void 0 : close).trim();
|
|
12991
|
+
const params = inner2 ? inner2.split(",").map((p) => p.trim()) : [];
|
|
12992
|
+
return { name: syntax.slice(0, open), params };
|
|
12993
|
+
}
|
|
12994
|
+
function activeParam(params, argIndex) {
|
|
12995
|
+
if (argIndex < params.length) {
|
|
12996
|
+
if (params[argIndex] === "...") return Math.max(0, argIndex - 1);
|
|
12997
|
+
return argIndex;
|
|
12998
|
+
}
|
|
12999
|
+
return params[params.length - 1] === "..." ? params.length - 2 : params.length - 1;
|
|
13000
|
+
}
|
|
13001
|
+
function splice(text2, start, end, insert) {
|
|
13002
|
+
return { text: text2.slice(0, start) + insert + text2.slice(end), caret: start + insert.length };
|
|
13003
|
+
}
|
|
13004
|
+
function referenceTarget(text2) {
|
|
13005
|
+
const bang = text2.lastIndexOf("!");
|
|
13006
|
+
const sheet = bang >= 0 ? text2.slice(0, bang).replace(/^'|'$/g, "").replace(/''/g, "'") : void 0;
|
|
13007
|
+
const body = text2.slice(bang + 1).replace(/\$/g, "").toUpperCase();
|
|
13008
|
+
let range;
|
|
13009
|
+
const cols = /^([A-Z]{1,3}):([A-Z]{1,3})$/.exec(body);
|
|
13010
|
+
const rows = /^(\d+):(\d+)$/.exec(body);
|
|
13011
|
+
if (cols) {
|
|
13012
|
+
const a = columnIndex(cols[1] ?? "A");
|
|
13013
|
+
const b = columnIndex(cols[2] ?? "A");
|
|
13014
|
+
range = { start: { row: 0, col: Math.min(a, b) }, end: { row: MAX_ROW, col: Math.max(a, b) } };
|
|
13015
|
+
} else if (rows) {
|
|
13016
|
+
const a = Number(rows[1]) - 1;
|
|
13017
|
+
const b = Number(rows[2]) - 1;
|
|
13018
|
+
range = { start: { row: Math.min(a, b), col: 0 }, end: { row: Math.max(a, b), col: MAX_COL } };
|
|
13019
|
+
} else range = parseRange(body);
|
|
13020
|
+
if (!range) return void 0;
|
|
13021
|
+
return sheet === void 0 ? { range } : { sheet, range };
|
|
13022
|
+
}
|
|
13023
|
+
var cycleCell = (cell) => {
|
|
13024
|
+
const m = /^(\$?)([A-Za-z]{1,3})(\$?)(\d+)$/.exec(cell);
|
|
13025
|
+
if (!m) return cell;
|
|
13026
|
+
const [, c2, col, r, row2] = m;
|
|
13027
|
+
if (!c2 && !r) return `$${col}$${row2}`;
|
|
13028
|
+
if (c2 && r) return `${col}$${row2}`;
|
|
13029
|
+
if (!c2 && r) return `$${col}${row2}`;
|
|
13030
|
+
return `${col}${row2}`;
|
|
13031
|
+
};
|
|
13032
|
+
function toggleAbsolute(text2, caret) {
|
|
13033
|
+
const ref = coloredReferences(text2).find((r) => caret >= r.start && caret <= r.end);
|
|
13034
|
+
if (!ref) return void 0;
|
|
13035
|
+
const bang = ref.text.lastIndexOf("!");
|
|
13036
|
+
const prefix = ref.text.slice(0, bang + 1);
|
|
13037
|
+
const body = ref.text.slice(bang + 1).split(":").map(cycleCell).join(":");
|
|
13038
|
+
const next = splice(text2, ref.start, ref.end, prefix + body);
|
|
13039
|
+
return next;
|
|
13040
|
+
}
|
|
13041
|
+
function closeParens(text2) {
|
|
13042
|
+
if (!isFormulaText(text2)) return text2;
|
|
13043
|
+
let depth = 0;
|
|
13044
|
+
let inString = false;
|
|
13045
|
+
for (const ch of text2) {
|
|
13046
|
+
if (ch === '"') inString = !inString;
|
|
13047
|
+
else if (!inString && ch === "(") depth++;
|
|
13048
|
+
else if (!inString && ch === ")") depth = Math.max(0, depth - 1);
|
|
13049
|
+
}
|
|
13050
|
+
return depth > 0 && !inString ? text2 + ")".repeat(depth) : text2;
|
|
13051
|
+
}
|
|
13052
|
+
|
|
12896
13053
|
// src/opc/relationship-types.ts
|
|
12897
13054
|
var BASE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
|
12898
13055
|
var RELATIONSHIP_TYPES = {
|
|
@@ -26056,8 +26213,11 @@ exports.MAX_ROW = MAX_ROW;
|
|
|
26056
26213
|
exports.MIN_TWO_CELL_PIXELS = MIN_TWO_CELL_PIXELS;
|
|
26057
26214
|
exports.OVERFLOW_TEXT = OVERFLOW_TEXT;
|
|
26058
26215
|
exports.PERCENT_SCALE = PERCENT_SCALE;
|
|
26216
|
+
exports.REFERENCE_COLORS = REFERENCE_COLORS;
|
|
26059
26217
|
exports.THEME_SLOTS = THEME_SLOTS;
|
|
26060
26218
|
exports.TIME_PERIODS = TIME_PERIODS;
|
|
26219
|
+
exports.acceptsReference = acceptsReference;
|
|
26220
|
+
exports.activeParam = activeParam;
|
|
26061
26221
|
exports.addFuturePrefixes = addFuturePrefixes;
|
|
26062
26222
|
exports.anchorKind = anchorKind;
|
|
26063
26223
|
exports.anchorToPixelBox = anchorToPixelBox;
|
|
@@ -26073,6 +26233,7 @@ exports.bordersView = bordersView;
|
|
|
26073
26233
|
exports.builtinCellStyle = builtinCellStyle;
|
|
26074
26234
|
exports.builtinFormatId = builtinFormatId;
|
|
26075
26235
|
exports.calcModeOf = calcModeOf;
|
|
26236
|
+
exports.callAtCaret = callAtCaret;
|
|
26076
26237
|
exports.categoryTotals = categoryTotals;
|
|
26077
26238
|
exports.cellError = cellError;
|
|
26078
26239
|
exports.cellInputText = cellInputText;
|
|
@@ -26082,6 +26243,8 @@ exports.cellsFromText = cellsFromText;
|
|
|
26082
26243
|
exports.charactersToColumnWidth = charactersToColumnWidth;
|
|
26083
26244
|
exports.charactersToPixels = charactersToPixels;
|
|
26084
26245
|
exports.chartView = chartView;
|
|
26246
|
+
exports.closeParens = closeParens;
|
|
26247
|
+
exports.coloredReferences = coloredReferences;
|
|
26085
26248
|
exports.columnIndex = columnIndex;
|
|
26086
26249
|
exports.columnLabel = columnLabel;
|
|
26087
26250
|
exports.columnWidthToPixels = columnWidthToPixels;
|
|
@@ -26114,17 +26277,20 @@ exports.formatRange = formatRange;
|
|
|
26114
26277
|
exports.formatRefSpec = formatRefSpec;
|
|
26115
26278
|
exports.formatValue = formatValue;
|
|
26116
26279
|
exports.formulaBarText = formulaBarText;
|
|
26280
|
+
exports.functionMatches = functionMatches;
|
|
26117
26281
|
exports.generalAlignment = generalAlignment;
|
|
26118
26282
|
exports.getCell = getCell;
|
|
26119
26283
|
exports.getCellAt = getCellAt;
|
|
26120
26284
|
exports.getValue = getValue;
|
|
26121
26285
|
exports.hls240ToRgb = hls240ToRgb;
|
|
26122
26286
|
exports.inTimePeriod = inTimePeriod;
|
|
26287
|
+
exports.insideString = insideString;
|
|
26123
26288
|
exports.internStyle = internStyle;
|
|
26124
26289
|
exports.isCellError = isCellError;
|
|
26125
26290
|
exports.isDateFormat = isDateFormat;
|
|
26126
26291
|
exports.isEmptyCell = isEmptyCell;
|
|
26127
26292
|
exports.isErrorCode = isErrorCode;
|
|
26293
|
+
exports.isFormulaText = isFormulaText;
|
|
26128
26294
|
exports.isOverflowTarget = isOverflowTarget;
|
|
26129
26295
|
exports.isSpilledCell = isSpilledCell;
|
|
26130
26296
|
exports.keyToAddress = keyToAddress;
|
|
@@ -26140,6 +26306,7 @@ exports.mixColors = mixColors;
|
|
|
26140
26306
|
exports.modernPasswordHash = modernPasswordHash;
|
|
26141
26307
|
exports.modulateLuminance = modulateLuminance;
|
|
26142
26308
|
exports.moveReferencesInFormula = moveReferencesInFormula;
|
|
26309
|
+
exports.nameAtCaret = nameAtCaret;
|
|
26143
26310
|
exports.navigate = navigate;
|
|
26144
26311
|
exports.needsArrayEvaluation = needsArrayEvaluation;
|
|
26145
26312
|
exports.newMediaPart = newMediaPart;
|
|
@@ -26175,6 +26342,7 @@ exports.rangeContains = rangeContains;
|
|
|
26175
26342
|
exports.rangeSize = rangeSize;
|
|
26176
26343
|
exports.rangesIntersect = rangesIntersect;
|
|
26177
26344
|
exports.referenceSpans = referenceSpans;
|
|
26345
|
+
exports.referenceTarget = referenceTarget;
|
|
26178
26346
|
exports.referencedRanges = referencedRanges;
|
|
26179
26347
|
exports.renameSheetInFormula = renameSheetInFormula;
|
|
26180
26348
|
exports.renameTableInFormula = renameTableInFormula;
|
|
@@ -26193,17 +26361,20 @@ exports.shiftFormula = shiftFormula;
|
|
|
26193
26361
|
exports.shiftRange = shiftRange;
|
|
26194
26362
|
exports.shiftSpan = shiftSpan;
|
|
26195
26363
|
exports.spillAnchorOf = spillAnchorOf;
|
|
26364
|
+
exports.splice = splice;
|
|
26196
26365
|
exports.stepDecimals = stepDecimals;
|
|
26197
26366
|
exports.stripFuturePrefixes = stripFuturePrefixes;
|
|
26198
26367
|
exports.structuredToA1 = structuredToA1;
|
|
26199
26368
|
exports.styleAt = styleAt;
|
|
26200
26369
|
exports.styleKey = styleKey;
|
|
26201
26370
|
exports.subtractRange = subtractRange;
|
|
26371
|
+
exports.syntaxParams = syntaxParams;
|
|
26202
26372
|
exports.themeColor = themeColor;
|
|
26203
26373
|
exports.timePeriodFormula = timePeriodFormula;
|
|
26204
26374
|
exports.toHexColor = toHexColor;
|
|
26205
26375
|
exports.toHtml = toHtml;
|
|
26206
26376
|
exports.toTsv = toTsv;
|
|
26377
|
+
exports.toggleAbsolute = toggleAbsolute;
|
|
26207
26378
|
exports.tokenize = tokenize;
|
|
26208
26379
|
exports.translateFormula = translateFormula;
|
|
26209
26380
|
exports.translateReferences = translateReferences;
|
package/dist/xlsx/index.mjs
CHANGED
|
@@ -12887,6 +12887,163 @@ function needsArrayEvaluation(formula) {
|
|
|
12887
12887
|
return result2.needs || result2.multi;
|
|
12888
12888
|
}
|
|
12889
12889
|
|
|
12890
|
+
// src/xlsx/formula/editor-text.ts
|
|
12891
|
+
var REFERENCE_COLORS = [
|
|
12892
|
+
"#2a6ad8",
|
|
12893
|
+
"#d24726",
|
|
12894
|
+
"#7d3fbf",
|
|
12895
|
+
"#0f8a3b",
|
|
12896
|
+
"#c0399f",
|
|
12897
|
+
"#946d00",
|
|
12898
|
+
"#d1102b",
|
|
12899
|
+
"#00788a"
|
|
12900
|
+
];
|
|
12901
|
+
var isFormulaText = (text2) => text2.startsWith("=") || text2.startsWith("+");
|
|
12902
|
+
function coloredReferences(text2) {
|
|
12903
|
+
if (!isFormulaText(text2)) return [];
|
|
12904
|
+
const seen = /* @__PURE__ */ new Map();
|
|
12905
|
+
return referenceSpans(text2.slice(1), "").map((span3) => {
|
|
12906
|
+
const key = span3.text.replace(/\$/g, "").toUpperCase();
|
|
12907
|
+
let index2 = seen.get(key);
|
|
12908
|
+
if (index2 === void 0) {
|
|
12909
|
+
index2 = seen.size;
|
|
12910
|
+
seen.set(key, index2);
|
|
12911
|
+
}
|
|
12912
|
+
return {
|
|
12913
|
+
start: span3.start + 1,
|
|
12914
|
+
end: span3.end + 1,
|
|
12915
|
+
text: span3.text,
|
|
12916
|
+
index: index2,
|
|
12917
|
+
color: REFERENCE_COLORS[index2 % REFERENCE_COLORS.length] ?? REFERENCE_COLORS[0]
|
|
12918
|
+
};
|
|
12919
|
+
});
|
|
12920
|
+
}
|
|
12921
|
+
var POINT_AFTER = /* @__PURE__ */ new Set(["=", "(", ",", "+", "-", "*", "/", "^", "&", "<", ">", ":", ";", "%"]);
|
|
12922
|
+
function acceptsReference(text2, caret) {
|
|
12923
|
+
if (!isFormulaText(text2)) return false;
|
|
12924
|
+
if (text2.slice(caret).trimStart() !== "" && !/^[\s),;&+\-*/^<>=]/.test(text2.slice(caret)))
|
|
12925
|
+
return false;
|
|
12926
|
+
const before = text2.slice(0, caret).trimEnd();
|
|
12927
|
+
const last = before[before.length - 1];
|
|
12928
|
+
return last !== void 0 && POINT_AFTER.has(last) && !insideString(text2, caret);
|
|
12929
|
+
}
|
|
12930
|
+
function insideString(text2, caret) {
|
|
12931
|
+
let open = false;
|
|
12932
|
+
for (let i = 0; i < caret && i < text2.length; i++) if (text2[i] === '"') open = !open;
|
|
12933
|
+
return open;
|
|
12934
|
+
}
|
|
12935
|
+
function nameAtCaret(text2, caret) {
|
|
12936
|
+
if (!isFormulaText(text2) || insideString(text2, caret)) return void 0;
|
|
12937
|
+
const match2 = /[A-Za-z_][A-Za-z0-9_.]*$/.exec(text2.slice(0, caret));
|
|
12938
|
+
if (!match2) return void 0;
|
|
12939
|
+
const start = caret - match2[0].length;
|
|
12940
|
+
const prev = text2[start - 1] ?? "";
|
|
12941
|
+
if (start === 0 || /[A-Za-z0-9_$!'".:]/.test(prev)) return void 0;
|
|
12942
|
+
if (/^[A-Za-z0-9_.]/.test(text2.slice(caret))) return void 0;
|
|
12943
|
+
return { start, prefix: match2[0] };
|
|
12944
|
+
}
|
|
12945
|
+
function functionMatches(prefix, limit2 = 12, catalog = FUNCTION_CATALOG) {
|
|
12946
|
+
const upper2 = prefix.toUpperCase();
|
|
12947
|
+
if (!upper2) return [];
|
|
12948
|
+
const out = [];
|
|
12949
|
+
for (const info of catalog) {
|
|
12950
|
+
if (info.name.startsWith(upper2)) out.push(info);
|
|
12951
|
+
if (out.length >= limit2) break;
|
|
12952
|
+
}
|
|
12953
|
+
return out;
|
|
12954
|
+
}
|
|
12955
|
+
function callAtCaret(text2, caret) {
|
|
12956
|
+
if (!isFormulaText(text2)) return void 0;
|
|
12957
|
+
const stack2 = [];
|
|
12958
|
+
let inString = false;
|
|
12959
|
+
for (let i = 1; i < caret && i < text2.length; i++) {
|
|
12960
|
+
const ch = text2[i];
|
|
12961
|
+
if (ch === '"') inString = !inString;
|
|
12962
|
+
if (inString) continue;
|
|
12963
|
+
if (ch === "(") {
|
|
12964
|
+
const name = /([A-Za-z_][A-Za-z0-9_.]*)\s*$/.exec(text2.slice(0, i))?.[1];
|
|
12965
|
+
stack2.push({ name: (name ?? "").toUpperCase(), argIndex: 0 });
|
|
12966
|
+
} else if (ch === ")") stack2.pop();
|
|
12967
|
+
else if (ch === "," || ch === ";") {
|
|
12968
|
+
const top = stack2[stack2.length - 1];
|
|
12969
|
+
if (top) top.argIndex++;
|
|
12970
|
+
} else if (ch === "{") stack2.push({ name: "", argIndex: 0 });
|
|
12971
|
+
else if (ch === "}") stack2.pop();
|
|
12972
|
+
}
|
|
12973
|
+
for (let i = stack2.length - 1; i >= 0; i--) {
|
|
12974
|
+
const entry = stack2[i];
|
|
12975
|
+
if (entry?.name) return entry;
|
|
12976
|
+
if (entry && !entry.name) return void 0;
|
|
12977
|
+
}
|
|
12978
|
+
return void 0;
|
|
12979
|
+
}
|
|
12980
|
+
function syntaxParams(syntax) {
|
|
12981
|
+
const open = syntax.indexOf("(");
|
|
12982
|
+
const close = syntax.lastIndexOf(")");
|
|
12983
|
+
if (open < 0) return { name: syntax, params: [] };
|
|
12984
|
+
const inner2 = syntax.slice(open + 1, close < 0 ? void 0 : close).trim();
|
|
12985
|
+
const params = inner2 ? inner2.split(",").map((p) => p.trim()) : [];
|
|
12986
|
+
return { name: syntax.slice(0, open), params };
|
|
12987
|
+
}
|
|
12988
|
+
function activeParam(params, argIndex) {
|
|
12989
|
+
if (argIndex < params.length) {
|
|
12990
|
+
if (params[argIndex] === "...") return Math.max(0, argIndex - 1);
|
|
12991
|
+
return argIndex;
|
|
12992
|
+
}
|
|
12993
|
+
return params[params.length - 1] === "..." ? params.length - 2 : params.length - 1;
|
|
12994
|
+
}
|
|
12995
|
+
function splice(text2, start, end, insert) {
|
|
12996
|
+
return { text: text2.slice(0, start) + insert + text2.slice(end), caret: start + insert.length };
|
|
12997
|
+
}
|
|
12998
|
+
function referenceTarget(text2) {
|
|
12999
|
+
const bang = text2.lastIndexOf("!");
|
|
13000
|
+
const sheet = bang >= 0 ? text2.slice(0, bang).replace(/^'|'$/g, "").replace(/''/g, "'") : void 0;
|
|
13001
|
+
const body = text2.slice(bang + 1).replace(/\$/g, "").toUpperCase();
|
|
13002
|
+
let range;
|
|
13003
|
+
const cols = /^([A-Z]{1,3}):([A-Z]{1,3})$/.exec(body);
|
|
13004
|
+
const rows = /^(\d+):(\d+)$/.exec(body);
|
|
13005
|
+
if (cols) {
|
|
13006
|
+
const a = columnIndex(cols[1] ?? "A");
|
|
13007
|
+
const b = columnIndex(cols[2] ?? "A");
|
|
13008
|
+
range = { start: { row: 0, col: Math.min(a, b) }, end: { row: MAX_ROW, col: Math.max(a, b) } };
|
|
13009
|
+
} else if (rows) {
|
|
13010
|
+
const a = Number(rows[1]) - 1;
|
|
13011
|
+
const b = Number(rows[2]) - 1;
|
|
13012
|
+
range = { start: { row: Math.min(a, b), col: 0 }, end: { row: Math.max(a, b), col: MAX_COL } };
|
|
13013
|
+
} else range = parseRange(body);
|
|
13014
|
+
if (!range) return void 0;
|
|
13015
|
+
return sheet === void 0 ? { range } : { sheet, range };
|
|
13016
|
+
}
|
|
13017
|
+
var cycleCell = (cell) => {
|
|
13018
|
+
const m = /^(\$?)([A-Za-z]{1,3})(\$?)(\d+)$/.exec(cell);
|
|
13019
|
+
if (!m) return cell;
|
|
13020
|
+
const [, c2, col, r, row2] = m;
|
|
13021
|
+
if (!c2 && !r) return `$${col}$${row2}`;
|
|
13022
|
+
if (c2 && r) return `${col}$${row2}`;
|
|
13023
|
+
if (!c2 && r) return `$${col}${row2}`;
|
|
13024
|
+
return `${col}${row2}`;
|
|
13025
|
+
};
|
|
13026
|
+
function toggleAbsolute(text2, caret) {
|
|
13027
|
+
const ref = coloredReferences(text2).find((r) => caret >= r.start && caret <= r.end);
|
|
13028
|
+
if (!ref) return void 0;
|
|
13029
|
+
const bang = ref.text.lastIndexOf("!");
|
|
13030
|
+
const prefix = ref.text.slice(0, bang + 1);
|
|
13031
|
+
const body = ref.text.slice(bang + 1).split(":").map(cycleCell).join(":");
|
|
13032
|
+
const next = splice(text2, ref.start, ref.end, prefix + body);
|
|
13033
|
+
return next;
|
|
13034
|
+
}
|
|
13035
|
+
function closeParens(text2) {
|
|
13036
|
+
if (!isFormulaText(text2)) return text2;
|
|
13037
|
+
let depth = 0;
|
|
13038
|
+
let inString = false;
|
|
13039
|
+
for (const ch of text2) {
|
|
13040
|
+
if (ch === '"') inString = !inString;
|
|
13041
|
+
else if (!inString && ch === "(") depth++;
|
|
13042
|
+
else if (!inString && ch === ")") depth = Math.max(0, depth - 1);
|
|
13043
|
+
}
|
|
13044
|
+
return depth > 0 && !inString ? text2 + ")".repeat(depth) : text2;
|
|
13045
|
+
}
|
|
13046
|
+
|
|
12890
13047
|
// src/opc/relationship-types.ts
|
|
12891
13048
|
var BASE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
|
12892
13049
|
var RELATIONSHIP_TYPES = {
|
|
@@ -26023,4 +26180,4 @@ function createRefEvaluator(workbook, calc, options = {}) {
|
|
|
26023
26180
|
};
|
|
26024
26181
|
}
|
|
26025
26182
|
|
|
26026
|
-
export { AxisMetrics, BORDER_STYLES, BUILTIN_CELL_STYLES, BUILTIN_NUMBER_FORMATS, CIRCULAR_REFERENCE_WARNING, COLUMN_PADDING_PX, DEFAULT_ANCHOR_EXTENT_EMU, DEFAULT_BASE_COL_WIDTH, DEFAULT_COL_WIDTH, DEFAULT_MAX_DIGIT_WIDTH, DEFAULT_ROW_HEIGHT, DEFAULT_THEME, DEFAULT_VALIDATION_MESSAGE, ERROR_CODES, FORMAT_PRESETS, FUNCTION_CATALOG, FormulaError, IMAGE_EXTENSIONS, INDENT_PX_PER_LEVEL, INDEXED_COLORS, MAX_COL, MAX_DATE_SERIAL, MAX_OUTLINE_LEVEL, MAX_ROW, MIN_TWO_CELL_PIXELS, OVERFLOW_TEXT, PERCENT_SCALE, THEME_SLOTS, TIME_PERIODS, addFuturePrefixes, anchorKind, anchorToPixelBox, applyBuiltinStyle, applyStylePatch, applyTint, approximateMeasure, autoFitColumnWidth, autoFitRowHeight, autoGrowRows, autoSeriesColor, bordersView, builtinCellStyle, builtinFormatId, calcModeOf, categoryTotals, cellError, cellInputText, cellKey, cellView, cellsFromText, charactersToColumnWidth, charactersToPixels, chartView, columnIndex, columnLabel, columnWidthToPixels, compareCellValues, compareValues, createCalcEngine, createConditionalFormatEvaluator, createEditSession, createGridMetrics, createRefEvaluator, createWorkbook, createWorksheet, currentRegion, dateToSerial, defaultCellStyle, defaultColumnPixels, deleteCell, deleteSheetInFormula, detectSeries, edgeView, effectiveStyleId, fillView, fontView, forEachCell, forEachCellInRange, formatAddress, formatAxisValue, formatGeneral, formatRange, formatRefSpec, formatValue, formulaBarText, generalAlignment, getCell, getCellAt, getValue, hls240ToRgb, inTimePeriod, internStyle, isCellError, isDateFormat, isEmptyCell, isErrorCode, isOverflowTarget, isSpilledCell, keyToAddress, legacyPasswordHash, lineHeightPoints, listValidationOptions, loadXlsx, mergeAt, mergeFont, mergeView, mergeWouldDiscard, mixColors, modernPasswordHash, modulateLuminance, moveReferencesInFormula, navigate, needsArrayEvaluation, newMediaPart, nextSheetId, nextSheetName, niceScale, normalizeRange, numberInputText, numberToText, overflowExtent, parseAddress, parseCellInput, parseFormula, parseHex, parseHtmlTable, parseNumberText, parseRange, parseTsv, patchStyle, percentile, pictureAnchorAt, pixelBoxToAnchor, pixelSizeToExtent, pixelsToCharacters, pixelsToColumnWidth, pixelsToPoints, pointsToPixels, presetEdges, putCell, queryPattern, quoteSheetName, rangeContains, rangeSize, rangesIntersect, referenceSpans, referencedRanges, renameSheetInFormula, renameTableInFormula, renderChartSvg, replaceText, resolveColor, rgbToHls240, rotationDegrees, rowsToRefit, saveXlsx, scaleColor, selectionStats, serialToDate, sheetByName, shiftFormula, shiftRange, shiftSpan, spillAnchorOf, stepDecimals, stripFuturePrefixes, structuredToA1, styleAt, styleKey, subtractRange, themeColor, timePeriodFormula, toHexColor, toHtml, toTsv, tokenize, translateFormula, translateReferences, uniqueHeaders, usedRange, validateCellInput, validateDefinedName, validateSheetName, validateTableName, validationAt, verifySheetPassword, verifySheetPasswordAsync, verifyWorkbookPassword, visibleCells, wrappedLineCount, zoomPercent };
|
|
26183
|
+
export { AxisMetrics, BORDER_STYLES, BUILTIN_CELL_STYLES, BUILTIN_NUMBER_FORMATS, CIRCULAR_REFERENCE_WARNING, COLUMN_PADDING_PX, DEFAULT_ANCHOR_EXTENT_EMU, DEFAULT_BASE_COL_WIDTH, DEFAULT_COL_WIDTH, DEFAULT_MAX_DIGIT_WIDTH, DEFAULT_ROW_HEIGHT, DEFAULT_THEME, DEFAULT_VALIDATION_MESSAGE, ERROR_CODES, FORMAT_PRESETS, FUNCTION_CATALOG, FormulaError, IMAGE_EXTENSIONS, INDENT_PX_PER_LEVEL, INDEXED_COLORS, MAX_COL, MAX_DATE_SERIAL, MAX_OUTLINE_LEVEL, MAX_ROW, MIN_TWO_CELL_PIXELS, OVERFLOW_TEXT, PERCENT_SCALE, REFERENCE_COLORS, THEME_SLOTS, TIME_PERIODS, acceptsReference, activeParam, addFuturePrefixes, anchorKind, anchorToPixelBox, applyBuiltinStyle, applyStylePatch, applyTint, approximateMeasure, autoFitColumnWidth, autoFitRowHeight, autoGrowRows, autoSeriesColor, bordersView, builtinCellStyle, builtinFormatId, calcModeOf, callAtCaret, categoryTotals, cellError, cellInputText, cellKey, cellView, cellsFromText, charactersToColumnWidth, charactersToPixels, chartView, closeParens, coloredReferences, columnIndex, columnLabel, columnWidthToPixels, compareCellValues, compareValues, createCalcEngine, createConditionalFormatEvaluator, createEditSession, createGridMetrics, createRefEvaluator, createWorkbook, createWorksheet, currentRegion, dateToSerial, defaultCellStyle, defaultColumnPixels, deleteCell, deleteSheetInFormula, detectSeries, edgeView, effectiveStyleId, fillView, fontView, forEachCell, forEachCellInRange, formatAddress, formatAxisValue, formatGeneral, formatRange, formatRefSpec, formatValue, formulaBarText, functionMatches, generalAlignment, getCell, getCellAt, getValue, hls240ToRgb, inTimePeriod, insideString, internStyle, isCellError, isDateFormat, isEmptyCell, isErrorCode, isFormulaText, isOverflowTarget, isSpilledCell, keyToAddress, legacyPasswordHash, lineHeightPoints, listValidationOptions, loadXlsx, mergeAt, mergeFont, mergeView, mergeWouldDiscard, mixColors, modernPasswordHash, modulateLuminance, moveReferencesInFormula, nameAtCaret, navigate, needsArrayEvaluation, newMediaPart, nextSheetId, nextSheetName, niceScale, normalizeRange, numberInputText, numberToText, overflowExtent, parseAddress, parseCellInput, parseFormula, parseHex, parseHtmlTable, parseNumberText, parseRange, parseTsv, patchStyle, percentile, pictureAnchorAt, pixelBoxToAnchor, pixelSizeToExtent, pixelsToCharacters, pixelsToColumnWidth, pixelsToPoints, pointsToPixels, presetEdges, putCell, queryPattern, quoteSheetName, rangeContains, rangeSize, rangesIntersect, referenceSpans, referenceTarget, referencedRanges, renameSheetInFormula, renameTableInFormula, renderChartSvg, replaceText, resolveColor, rgbToHls240, rotationDegrees, rowsToRefit, saveXlsx, scaleColor, selectionStats, serialToDate, sheetByName, shiftFormula, shiftRange, shiftSpan, spillAnchorOf, splice, stepDecimals, stripFuturePrefixes, structuredToA1, styleAt, styleKey, subtractRange, syntaxParams, themeColor, timePeriodFormula, toHexColor, toHtml, toTsv, toggleAbsolute, tokenize, translateFormula, translateReferences, uniqueHeaders, usedRange, validateCellInput, validateDefinedName, validateSheetName, validateTableName, validationAt, verifySheetPassword, verifySheetPasswordAsync, verifyWorkbookPassword, visibleCells, wrappedLineCount, zoomPercent };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ooxml-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "Shared OOXML logic for the Word, PowerPoint and Excel viewers: everything except the UI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"charts",
|
|
@@ -204,6 +204,7 @@
|
|
|
204
204
|
"test:package": "node scripts/package-smoke.mjs",
|
|
205
205
|
"test:scripts": "node --test 'scripts/*.test.mjs'",
|
|
206
206
|
"check:changelog": "node scripts/check-changelog-sections.mjs",
|
|
207
|
+
"fleet": "node scripts/fleet.mjs",
|
|
207
208
|
"release:plan": "node scripts/release-plan.mjs",
|
|
208
209
|
"release:publish": "node scripts/publish-released.mjs",
|
|
209
210
|
"changelog:unreleased": "bunx git-cliff --config cliff.toml --tag-pattern \"^ooxml-core@\" --unreleased",
|