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.
Files changed (56) hide show
  1. package/dist/OasisEditorApp-Blf411AF.js +1 -0
  2. package/dist/assets/{importDocxWorker-Cza4hyf3.js → importDocxWorker-7COTnEu5.js} +5626 -5092
  3. package/dist/core/commands/builtinCommands.d.ts +1 -1
  4. package/dist/core/commands/fieldCode.d.ts +18 -0
  5. package/dist/core/commands/legacyForms.d.ts +15 -0
  6. package/dist/core/commands/list.d.ts +4 -0
  7. package/dist/core/commands/mailMerge.d.ts +8 -0
  8. package/dist/core/commands/publicCommandTypes.d.ts +42 -0
  9. package/dist/core/commands/tableOfAuthorities.d.ts +22 -0
  10. package/dist/core/commands/tableOfFigures.d.ts +12 -0
  11. package/dist/core/document/bookmarkScope.d.ts +6 -0
  12. package/dist/core/document/captionEntries.d.ts +24 -0
  13. package/dist/core/document/fieldCodeDisplay.d.ts +12 -0
  14. package/dist/core/document/fieldComparison.d.ts +7 -0
  15. package/dist/core/document/formulaFields.d.ts +10 -0
  16. package/dist/core/document/indexPlan.d.ts +17 -0
  17. package/dist/core/document/indexRefresh.d.ts +2 -1
  18. package/dist/core/document/listRestart.d.ts +7 -0
  19. package/dist/core/document/mergeFields.d.ts +64 -0
  20. package/dist/core/document/tableOfFigures.d.ts +38 -0
  21. package/dist/core/document/toaEntries.d.ts +33 -0
  22. package/dist/core/document/toaPlan.d.ts +36 -0
  23. package/dist/core/document/toaRefresh.d.ts +29 -0
  24. package/dist/core/document/tocFields.d.ts +13 -0
  25. package/dist/core/document/variableFields.d.ts +58 -0
  26. package/dist/core/format/fieldResultFormat.d.ts +19 -0
  27. package/dist/core/format/numberFormat.d.ts +15 -0
  28. package/dist/core/format/resolveNumberingLocale.d.ts +8 -0
  29. package/dist/core/model/editorState.d.ts +2 -0
  30. package/dist/core/model/index.d.ts +2 -2
  31. package/dist/core/model/listNumbering.d.ts +5 -1
  32. package/dist/core/model/types/primitives.d.ts +46 -8
  33. package/dist/core/model/types/styles.d.ts +3 -1
  34. package/dist/defaultToolbar-B8aZzV4B.js +1 -0
  35. package/dist/export/docx/docxTypes.d.ts +5 -0
  36. package/dist/export/docx/stylesXml.d.ts +4 -1
  37. package/dist/export/docx/text/paragraphPropertiesXml.d.ts +1 -1
  38. package/dist/export/pdf/draw/lists.d.ts +1 -1
  39. package/dist/i18n/locales/en.d.ts +40 -0
  40. package/dist/i18n/locales/pt-BR.d.ts +40 -0
  41. package/dist/import/docx/numbering.d.ts +14 -2
  42. package/dist/import/docx/stylesXml.d.ts +2 -1
  43. package/dist/oasis-editor.js +1 -1
  44. package/dist/oasis-editor.umd.cjs +1 -1
  45. package/dist/ooxml/word/fieldFormatSwitches.d.ts +40 -0
  46. package/dist/ooxml/word/legacyFormFields.d.ts +5 -0
  47. package/dist/ooxml/word/numberFormat.d.ts +26 -0
  48. package/dist/ooxml/word/numberingMetadata.d.ts +5 -1
  49. package/dist/ooxml/word/pictureBullets.d.ts +13 -0
  50. package/dist/plugins/internal/essentialsCapabilities.d.ts +25 -0
  51. package/dist/sourcePackage-ByCOFs8g.js +1 -0
  52. package/dist/ui/components/Toolbar/controls/FieldFamilyPanel.d.ts +9 -0
  53. package/package.json +1 -1
  54. package/dist/OasisEditorApp-BP3OY6PR.js +0 -1
  55. package/dist/defaultToolbar-BSz3ZnBB.js +0 -1
  56. package/dist/sourcePackage-DY2TdHmF.js +0 -1
@@ -0,0 +1,40 @@
1
+ import { FieldInstructionToken } from './fieldInstruction.js';
2
+ import { FormatSwitchName } from '../../core/format/fieldResultFormat.js';
3
+ export type TextFormatSwitch = "MERGEFORMAT" | "CHARFORMAT" | "Caps" | "FirstCap" | "Upper" | "Lower";
4
+ export type NumberFormatSwitch = "alphabetic" | "ALPHABETIC" | "Arabic" | "ArabicDash" | "CardText" | "DollarText" | "Hex" | "OrdText" | "Ordinal" | "roman" | "ROMAN";
5
+ export type { FormatSwitchName } from '../../core/format/fieldResultFormat.js';
6
+ export interface FieldFormatSwitchProfile {
7
+ /** `\*` MERGEFORMAT, CHARFORMAT and capitalization words. */
8
+ text?: boolean;
9
+ /** `\*` number words (ArabicDash only with `arabicDash`). */
10
+ number?: boolean;
11
+ arabicDash?: boolean;
12
+ /** `\#` numeric picture. */
13
+ numericPicture?: boolean;
14
+ /** `\@` date/time picture. */
15
+ datePicture?: boolean;
16
+ }
17
+ /** Per-command capabilities. A switch documented for one family is never
18
+ * silently available in another (e.g. `ArabicDash` is PAGE only). */
19
+ export declare const FIELD_FORMAT_SWITCH_PROFILES: Readonly<Record<string, FieldFormatSwitchProfile>>;
20
+ export interface FieldFormatSwitches {
21
+ mergeFormat?: true;
22
+ charFormat?: true;
23
+ capitalization?: FormatSwitchName;
24
+ numericPicture?: string;
25
+ datePicture?: string;
26
+ }
27
+ export interface ParsedFieldFormatSwitches {
28
+ switches: FieldFormatSwitches;
29
+ /** Tokens that are not general formatting switches, in original order. */
30
+ remaining: readonly FieldInstructionToken[];
31
+ }
32
+ /** Extract general formatting switches from instruction tokens. The command
33
+ * token (if present) is kept in `remaining` for the caller's own grammar. */
34
+ export declare function parseFormatSwitchesFromTokens(tokens: readonly FieldInstructionToken[], profile: FieldFormatSwitchProfile): ParsedFieldFormatSwitches | undefined;
35
+ /** Convenience for a whole instruction. A missing/unknown command uses an
36
+ * empty profile, so recognized switches are left untouched rather than
37
+ * coerced into a family that does not own them. */
38
+ export declare function parseFieldFormatSwitches(tokens: readonly FieldInstructionToken[], command: string | null): ParsedFieldFormatSwitches | undefined;
39
+ /** Canonical, deterministic serialization of qualified switches. */
40
+ export declare function serializeFieldFormatSwitches(switches: FieldFormatSwitches): string;
@@ -0,0 +1,5 @@
1
+ import { Element as XmlElement } from '@xmldom/xmldom';
2
+ import { EditorLegacyFormFieldData } from '../../core/model.js';
3
+ export declare function parseFfData(ffData: XmlElement): EditorLegacyFormFieldData | undefined;
4
+ export declare function serializeFfData(data: EditorLegacyFormFieldData): string;
5
+ export declare function isLegacyFormInstruction(raw: string): boolean;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * `ST_NumberFormat` catalogue (ECMA-376 Part 1 §17.18.41, MS-OI29500 §2.1.5.1).
3
+ *
4
+ * Kept free of DOM/UI so both the OOXML importers and the core formatter can
5
+ * classify a token before deciding whether it is preserved, rendered or
6
+ * editable. An unrecognised token is always classed as `unknown`: callers must
7
+ * keep its source spelling instead of inventing a meaning.
8
+ */
9
+ /**
10
+ * `ST_NumberFormat` tokens, kept here as the single source of truth so the
11
+ * model and the formatter cannot drift apart.
12
+ */
13
+ export type NumberFormatToken = "decimal" | "decimalZero" | "decimalFullWidth" | "decimalFullWidth2" | "decimalHalfWidth" | "decimalEnclosedCircle" | "decimalEnclosedCircleChinese" | "decimalEnclosedFullstop" | "decimalEnclosedParen" | "lowerLetter" | "upperLetter" | "lowerRoman" | "upperRoman" | "ordinal" | "ordinalText" | "cardinalText" | "chicago" | "hex" | "ideographDigital" | "ideographEnclosedCircle" | "ideographTraditional" | "ideographLegal" | "ideographZodiac" | "ideographZodiac2" | "ideographZodiac3" | "aiueo" | "aiueoFullWidth" | "iroha" | "irohaFullWidth" | "chosung" | "ganada" | "hebrew1" | "hebrew2" | "russianLower" | "russianUpper" | "koreanDigital" | "koreanDigital2" | "japaneseCounting" | "japaneseDigitalTenThousand" | "chineseCounting" | "chineseCountingThousand" | "chineseLegalSimplified" | "koreanCounting" | "koreanLegal" | "taiwaneseCounting" | "taiwaneseCountingThousand" | "taiwaneseDigital" | "thaiCounting" | "thaiLetters" | "thaiNumbers" | "vietnameseCounting" | "bullet" | "none";
14
+ export type NumberFormatClass = "counterless" | "decimal" | "enclosedDecimal" | "alphabetic" | "roman" | "ordinalText" | "cardinalText" | "chicago" | "hex" | "ideographic" | "alphabeticSequence" | "countingSystem" | "unknown";
15
+ /** Every token recognised by the pinned schema vocabulary. */
16
+ export declare const NUMBER_FORMAT_TOKENS: readonly NumberFormatToken[];
17
+ export declare function isKnownNumberFormat(token: string | undefined): token is NumberFormatToken;
18
+ export declare function classifyNumberFormat(token: string | undefined): NumberFormatClass;
19
+ /** Formats whose glyphs depend on the document language rather than on a rule. */
20
+ export declare function needsLocaleNumberFormat(token: string | undefined): boolean;
21
+ /**
22
+ * Deterministic here means "same value and same token always render the same
23
+ * label, without consulting a locale or an external oracle". Counting systems
24
+ * are excluded until their rules are sourced from official documentation.
25
+ */
26
+ export declare function isDeterministicNumberFormat(token: string | undefined): boolean;
@@ -1,4 +1,4 @@
1
- import { EditorParagraphListStyle } from '../../core/model.js';
1
+ import { EditorParagraphListStyle } from '../../core/model/types/primitives.js';
2
2
  export interface EditorListOoxmlNumberingMetadata {
3
3
  /** Original `w:num/@w:numId` for an imported list instance. */
4
4
  sourceNumId?: number;
@@ -13,6 +13,10 @@ export interface EditorListOoxmlNumberingMetadata {
13
13
  restartAfterLevel?: number;
14
14
  /** `w:pStyle/@w:val` associated with this numbering level. */
15
15
  paragraphStyleId?: string;
16
+ /** `w:abstractNum/w:numStyleLink/@w:val`. */
17
+ numStyleLink?: string;
18
+ /** `w:abstractNum/w:styleLink/@w:val`. */
19
+ styleLink?: string;
16
20
  }
17
21
  export declare function setEditorListOoxmlNumberingMetadata(list: EditorParagraphListStyle, metadata: Omit<EditorListOoxmlNumberingMetadata, "importedFormat" | "importedKind">): void;
18
22
  export declare function getEditorListOoxmlNumberingMetadata(list: EditorParagraphListStyle): EditorListOoxmlNumberingMetadata | undefined;
@@ -0,0 +1,13 @@
1
+ import { Element as XmlElement } from '@xmldom/xmldom';
2
+ import { EditorPictureBullet } from '../../core/model/types/primitives.js';
3
+ export interface ParsedPictureBullet {
4
+ numPicBulletId: string;
5
+ /** Relationship id from `r:id` / `r:embed`, unresolved at parse time. */
6
+ relationshipId?: string;
7
+ widthPx?: number;
8
+ heightPx?: number;
9
+ altText?: string;
10
+ }
11
+ export declare function parsePictureBullets(numbering: XmlElement): Map<string, ParsedPictureBullet>;
12
+ /** Attach the resolved asset reference to the parsed bullet definition. */
13
+ export declare function withResolvedPictureBullet(parsed: ParsedPictureBullet, src: string): EditorPictureBullet;
@@ -387,6 +387,10 @@ export interface EssentialsParagraphCapability {
387
387
  setLineHeight: (value: number | null) => void;
388
388
  setListFormat: (format: string) => void;
389
389
  setListStartAt: (value: number | null) => void;
390
+ /** Restart the selected list items at `value` (default 1). */
391
+ restartList: (value?: number) => void;
392
+ /** Remove an explicit restart so the items continue the instance counter. */
393
+ continueList: () => void;
390
394
  /** Set the selected list paragraphs' explicit list level (0-8, WordCraft para.listLevel). */
391
395
  setListLevel: (level: number) => void;
392
396
  outdent: () => void;
@@ -549,6 +553,27 @@ export interface EssentialsFieldsCapability {
549
553
  updateBodyFields?: () => void;
550
554
  updateSelectedFields?: () => void;
551
555
  canUpdateBodyFields?: () => boolean;
556
+ /** Generic field-code editing (preserved complex fields). */
557
+ insertFieldCode?: (code: string) => boolean;
558
+ editFieldCode?: (instructionRunId: string, code: string) => boolean;
559
+ editFieldCodeAtSelection?: (code: string) => boolean;
560
+ toggleFieldLock?: (fieldRunId: string) => boolean;
561
+ toggleFieldCodes?: (show: boolean) => void;
562
+ navigateField?: (direction: "next" | "previous") => void;
563
+ /** Table of authorities / figures. */
564
+ markAuthorityEntry?: (options: import('../../core/commands/tableOfAuthorities.js').MarkAuthorityEntryOptions) => boolean;
565
+ insertTableOfAuthorities?: (options: import('../../core/commands/tableOfAuthorities.js').InsertTableOfAuthoritiesOptions) => boolean;
566
+ updateTableOfAuthorities?: (locale?: string) => boolean;
567
+ insertTableOfFigures?: (options: import('../../core/commands/tableOfFigures.js').InsertTableOfFiguresOptions) => boolean;
568
+ updateTableOfFigures?: () => boolean;
569
+ /** Mail merge with caller-supplied records only. */
570
+ previewMergeRecord?: (records: readonly Readonly<Record<string, string>>[], index: number) => boolean;
571
+ mergeToNewDocuments?: (records: readonly Readonly<Record<string, string>>[]) => number;
572
+ /** Variable/ASK/FILLIN/formula refresh with an injected prompt resolver. */
573
+ updateVariableFields?: () => boolean;
574
+ /** Legacy form fields. */
575
+ setFormFieldValue?: (name: string, value: string) => boolean;
576
+ toggleFormCheckbox?: (name: string) => boolean;
552
577
  /** Insert a DATE field at the active caret with the current date. */
553
578
  insertDate: () => void;
554
579
  /** Insert the current date as plain text (WordCraft `insert.dateTime`, update:false). */