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
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NumberFormatToken } from '../../ooxml/word/numberFormat.js';
|
|
2
|
+
export interface LocaleNumberFormatters {
|
|
3
|
+
ordinal?(value: number): string | null;
|
|
4
|
+
cardinal?(value: number): string | null;
|
|
5
|
+
ordinalText?(value: number): string | null;
|
|
6
|
+
chicago?(value: number): string | null;
|
|
7
|
+
}
|
|
8
|
+
/** Register (or extend) the textual formatters for a locale. */
|
|
9
|
+
export declare function registerNumberFormatLocale(locale: string, formatters: LocaleNumberFormatters): void;
|
|
10
|
+
/** Render one value under one ST_NumberFormat token. Never returns null. */
|
|
11
|
+
export declare function formatNumberValue(value: number, token: string | undefined, locale?: string): string;
|
|
12
|
+
/** `\*` field switch for a format token (absent means decimal). */
|
|
13
|
+
export declare function numberFormatToFieldSwitch(token: NumberFormatToken | undefined): string | undefined;
|
|
14
|
+
/** Parse a `\*` switch, preserving the case-sensitive roman/alphabetic forms. */
|
|
15
|
+
export declare function fieldSwitchToNumberFormat(switchValue: string | undefined): NumberFormatToken | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EditorDocument } from '../model/types/document.js';
|
|
2
|
+
import { EditorParagraphNode } from '../model/types/nodes.js';
|
|
3
|
+
export declare const FALLBACK_NUMBERING_LOCALE = "pt-BR";
|
|
4
|
+
/**
|
|
5
|
+
* `w:lang` of the content → document default language → explicit editor
|
|
6
|
+
* setting → `pt-BR`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolveNumberingLocale(document: EditorDocument, paragraph?: EditorParagraphNode, editorLocale?: string): string;
|
|
@@ -21,6 +21,8 @@ export interface EditorState {
|
|
|
21
21
|
trackChangesEnabled?: boolean;
|
|
22
22
|
showMargins?: boolean;
|
|
23
23
|
showParagraphMarks?: boolean;
|
|
24
|
+
/** Presentation toggle: show field instructions instead of cached results. */
|
|
25
|
+
showFieldCodes?: boolean;
|
|
24
26
|
/**
|
|
25
27
|
* Display for Review: how tracked revisions render in the canvas.
|
|
26
28
|
* "all" — show markup (default)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* statements that pointed there continue to work via the barrel
|
|
7
7
|
* re-export in `src/core/model.ts`.
|
|
8
8
|
*/
|
|
9
|
-
export type { EditorUnderlineStyle, EditorLigatures, EditorNumberSpacing, EditorNumberForm, EditorTextLanguage, EditorBorderStyle, EditorEmphasisMark, EditorTabStop, EditorParagraphListStyle, EditorImageCrop, EditorImageCropShape, EditorImageCropFit, EditorImageFillMode, EditorLineDash, EditorImageBorder, EditorImageFloatingPosition, EditorImageFloatingLayout, EditorImageRunData, EditorWrapPolygonPoint, EditorFieldData, EditorFieldChar, EditorFootnoteReferenceData, EditorEndnoteReferenceData, PageNumberFormat, EditorRevision, EditorRevisionMetadata, EditorMoveRangeMarker, EditorNumberingRevision, EditorStructuralRevision, EditorPropertyRevision, EditorAsset, EditorFootnoteNumberFormat, EditorFootnoteRestart, EditorDocxWidthValue, EditorTableLayout, EditorTableRowHeightRule, EditorGradientStop, EditorTextFill, EditorTextOutline, EditorTextShadow, EditorGlow, EditorReflection, } from './types/primitives.js';
|
|
9
|
+
export type { EditorUnderlineStyle, EditorLigatures, EditorNumberSpacing, EditorNumberForm, EditorTextLanguage, EditorBorderStyle, EditorEmphasisMark, EditorTabStop, EditorParagraphListStyle, EditorPictureBullet, EditorImageCrop, EditorImageCropShape, EditorImageCropFit, EditorImageFillMode, EditorLineDash, EditorImageBorder, EditorImageFloatingPosition, EditorImageFloatingLayout, EditorImageRunData, EditorWrapPolygonPoint, EditorFieldData, EditorFieldChar, EditorLegacyFormFieldData, EditorFootnoteReferenceData, EditorEndnoteReferenceData, PageNumberFormat, EditorRevision, EditorRevisionMetadata, EditorMoveRangeMarker, EditorNumberingRevision, EditorStructuralRevision, EditorPropertyRevision, EditorAsset, EditorFootnoteNumberFormat, EditorFootnoteRestart, EditorDocxWidthValue, EditorTableLayout, EditorTableRowHeightRule, EditorGradientStop, EditorTextFill, EditorTextOutline, EditorTextShadow, EditorGlow, EditorReflection, } from './types/primitives.js';
|
|
10
10
|
export type { EditorTextStyle, EditorParagraphStyle, EditorTableStyle, EditorTableFloatingLayout, EditorTableConditionalFormat, EditorConditionalRowStyle, EditorTableConditionalType, EditorTableConditionalFlags, EditorTableCellStyle, EditorNamedStyle, } from './types/styles.js';
|
|
11
11
|
export type { EditorRunBase, EditorOpaqueRunData, EditorTextRun, EditorTextBoxShape, EditorTextBoxBody, EditorTextBoxData, EditorDropCap, EditorSdtBlockWrapper, EditorSdtPr, EditorSdtSubtype, EditorSdtListItem, EditorSdtDataBinding, EditorParagraphNode, EditorTableCellNode, EditorTableRowStyle, EditorTableRowNode, EditorTableNode, EditorBlockNode, } from './types/nodes.js';
|
|
12
12
|
export type { EditorMathNode, EditorMathText, EditorMathFraction, EditorMathRadical, EditorMathScript, EditorMathDelimiter, EditorMathAccent, EditorMathNary, EditorMathLimit, EditorMathMatrix, EditorMathBox, EditorMathGroup, EditorMathRaw, EditorMathStyle, EditorMathExpression, } from './types/math.js';
|
|
@@ -35,7 +35,7 @@ export { getDocumentSections, getDocumentSectionsCanonical, } from './documentSe
|
|
|
35
35
|
export { DocumentIndexBuilder, getDocumentParagraphIndex, getDocumentParagraphs, getDocumentParagraphsCanonical, getParagraphById, findParagraphLocation, findParagraphTableLocation, findParagraphTablePathLocation, resolveTablePath, WeakMapDocumentIndexCache, } from './documentIndex.js';
|
|
36
36
|
export type { EditorParagraphLocation, TableLocation, TablePathSegment, DocumentParagraphIndexEntry, DocumentIndexCache, } from './documentIndex.js';
|
|
37
37
|
export { getBlockParagraphs, collectSectionParagraphs, } from './paragraphWalker.js';
|
|
38
|
-
export { buildListLabels, resolveListLabel } from './listNumbering.js';
|
|
38
|
+
export { buildListLabels, resolveListLabel, resolveParagraphList, } from './listNumbering.js';
|
|
39
39
|
export { getActiveSectionIndex, getActiveZone, getEditableBlocksForZone, tryGetEditableBlocksForZone, getActiveSectionBlocks, getParagraphs, syncActiveSectionToSelection, } from './editingZones.js';
|
|
40
40
|
export { getHeaderFooterStoryKey, getSectionHeaderFooterBlocks, setSectionHeaderFooterBlocks, } from './headerFooterStories.js';
|
|
41
41
|
export type { HeaderFooterSide, HeaderFooterStoryKind, HeaderFooterStoryKey, } from './headerFooterStories.js';
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { EditorNamedStyle } from './types/styles.js';
|
|
1
2
|
import { EditorDocument } from './types/document.js';
|
|
2
3
|
import { EditorParagraphNode } from './types/nodes.js';
|
|
3
|
-
|
|
4
|
+
import { EditorParagraphListStyle } from './types/primitives.js';
|
|
5
|
+
/** Direct `w:numPr` wins; a paragraph style may supply the list instead. */
|
|
6
|
+
export declare function resolveParagraphList(paragraph: EditorParagraphNode, styles?: Record<string, EditorNamedStyle>): EditorParagraphListStyle | undefined;
|
|
7
|
+
export declare function buildListLabels(document: EditorDocument, locale?: string): Map<string, string>;
|
|
4
8
|
export declare function resolveListLabel(paragraph: EditorParagraphNode, labels: Map<string, string>): string;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Primitive building blocks shared across the editor model: borders, tabs,
|
|
3
|
-
* image run data, footnote references, revisions, fields, list styles.
|
|
4
|
-
* Kept dependency-free so it can be imported by every other model module
|
|
5
|
-
* without risk of circular imports.
|
|
6
|
-
*/
|
|
1
|
+
import { NumberFormatToken } from '../../../ooxml/word/numberFormat.js';
|
|
7
2
|
export type EditorUnderlineStyle = "single" | "double" | "thick" | "dotted" | "dottedHeavy" | "dash" | "dashedHeavy" | "dashLong" | "dashLongHeavy" | "dotDash" | "dashDotHeavy" | "dotDotDash" | "dashDotDotHeavy" | "wave" | "wavyHeavy" | "wavyDouble" | "words";
|
|
8
3
|
export type EditorLigatures = "none" | "standard" | "contextual" | "historical" | "standardContextual";
|
|
9
4
|
export type EditorNumberSpacing = "default" | "proportional" | "tabular";
|
|
@@ -77,12 +72,12 @@ export interface EditorParagraphListStyle {
|
|
|
77
72
|
level?: number;
|
|
78
73
|
/** Imported OOXML `w:numId`; paragraphs sharing it use the same counters. */
|
|
79
74
|
instanceId?: string;
|
|
80
|
-
format?:
|
|
75
|
+
format?: NumberFormatToken;
|
|
81
76
|
startAt?: number;
|
|
82
77
|
/** Effective `w:lvlText` pattern, for example `%1.%2.`. */
|
|
83
78
|
levelText?: string;
|
|
84
79
|
/** Effective formats for referenced levels in a multilevel label. */
|
|
85
|
-
levelFormats?:
|
|
80
|
+
levelFormats?: NumberFormatToken[];
|
|
86
81
|
/** `w:lvlJc`: alignment of the label inside its hanging-indent area. */
|
|
87
82
|
alignment?: "left" | "center" | "right";
|
|
88
83
|
/** `w:isLgl`: render referenced ordered levels with decimal digits. */
|
|
@@ -97,6 +92,17 @@ export interface EditorParagraphListStyle {
|
|
|
97
92
|
bulletGlyph?: string;
|
|
98
93
|
/** Font family used to render the bullet glyph (e.g. "Symbol", "Wingdings"). */
|
|
99
94
|
bulletFont?: string;
|
|
95
|
+
/** `w:lvl/w:lvlPicBulletId` resolved through `w:numPicBullet` relationships. */
|
|
96
|
+
bulletPicture?: EditorPictureBullet;
|
|
97
|
+
}
|
|
98
|
+
/** An imported picture bullet: the image payload lives in `document.assets`. */
|
|
99
|
+
export interface EditorPictureBullet {
|
|
100
|
+
numPicBulletId: string;
|
|
101
|
+
/** `asset:<id>` reference, or the source relationship id when unresolved. */
|
|
102
|
+
src: string;
|
|
103
|
+
widthPx?: number;
|
|
104
|
+
heightPx?: number;
|
|
105
|
+
altText?: string;
|
|
100
106
|
}
|
|
101
107
|
/**
|
|
102
108
|
* Image crop, mapped from DrawingML `a:srcRect`. Values are fractions of the
|
|
@@ -223,12 +229,44 @@ export interface EditorFieldData {
|
|
|
223
229
|
* {@link EditorTextRun.fieldInstruction}. A field may span multiple paragraphs
|
|
224
230
|
* (e.g. a TOC); document order reconstructs the structure on export.
|
|
225
231
|
*/
|
|
232
|
+
export interface EditorLegacyFormFieldData {
|
|
233
|
+
/** `w:ffData/w:name`; legacy form fields are addressed by this name. */
|
|
234
|
+
name: string;
|
|
235
|
+
control: "text" | "checkBox" | "dropDown";
|
|
236
|
+
/** Current cached value shown between `separate` and `end`. */
|
|
237
|
+
value: string;
|
|
238
|
+
enabled: boolean;
|
|
239
|
+
calcOnExit: boolean;
|
|
240
|
+
helpText?: string;
|
|
241
|
+
statusText?: string;
|
|
242
|
+
/** Preserved as opaque strings; never executed. */
|
|
243
|
+
entryMacro?: string;
|
|
244
|
+
exitMacro?: string;
|
|
245
|
+
textInput?: {
|
|
246
|
+
default?: string;
|
|
247
|
+
format?: string;
|
|
248
|
+
maxLength?: number;
|
|
249
|
+
type?: string;
|
|
250
|
+
};
|
|
251
|
+
checkBox?: {
|
|
252
|
+
checked: boolean;
|
|
253
|
+
default: boolean;
|
|
254
|
+
size?: number;
|
|
255
|
+
sizeAuto?: boolean;
|
|
256
|
+
};
|
|
257
|
+
ddList?: {
|
|
258
|
+
defaultResult?: string;
|
|
259
|
+
listEntries: readonly string[];
|
|
260
|
+
};
|
|
261
|
+
}
|
|
226
262
|
export interface EditorFieldChar {
|
|
227
263
|
kind: "begin" | "separate" | "end";
|
|
228
264
|
/** `w:fldChar/@w:fldLock`. */
|
|
229
265
|
fieldLock?: boolean;
|
|
230
266
|
/** `w:fldChar/@w:dirty`. */
|
|
231
267
|
dirty?: boolean;
|
|
268
|
+
/** `w:ffData` on a legacy FORMTEXT/FORMCHECKBOX/FORMDROPDOWN field. */
|
|
269
|
+
formField?: EditorLegacyFormFieldData;
|
|
232
270
|
}
|
|
233
271
|
export interface EditorFootnoteReferenceData {
|
|
234
272
|
footnoteId: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EditorBorderStyle, EditorDocxWidthValue, EditorEmphasisMark, EditorGlow, EditorLigatures, EditorNumberForm, EditorNumberSpacing, EditorPropertyRevision, EditorReflection, EditorStructuralRevision, EditorTabStop, EditorTextFill, EditorTextLanguage, EditorTextOutline, EditorTextShadow, EditorUnderlineStyle } from './primitives.js';
|
|
1
|
+
import { EditorBorderStyle, EditorDocxWidthValue, EditorEmphasisMark, EditorGlow, EditorLigatures, EditorNumberForm, EditorNumberSpacing, EditorParagraphListStyle, EditorPropertyRevision, EditorReflection, EditorStructuralRevision, EditorTabStop, EditorTextFill, EditorTextLanguage, EditorTextOutline, EditorTextShadow, EditorUnderlineStyle } from './primitives.js';
|
|
2
2
|
export interface EditorTextStyle {
|
|
3
3
|
styleId?: string;
|
|
4
4
|
bold?: boolean;
|
|
@@ -79,6 +79,8 @@ export interface EditorTextStyle {
|
|
|
79
79
|
}
|
|
80
80
|
export interface EditorParagraphStyle {
|
|
81
81
|
styleId?: string;
|
|
82
|
+
/** `w:pPr/w:numPr`: a paragraph using this style becomes a list item. */
|
|
83
|
+
list?: EditorParagraphListStyle;
|
|
82
84
|
align?: "left" | "center" | "right" | "justify";
|
|
83
85
|
spacingBefore?: number | null;
|
|
84
86
|
spacingAfter?: number | null;
|