oasis-editor 0.0.413 → 0.0.414

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/OasisEditorApp-BeGnnOPx.js +1 -0
  2. package/dist/assets/{importDocxWorker-Cza4hyf3.js → importDocxWorker-C4M8keWl.js} +1243 -1126
  3. package/dist/core/commands/builtinCommands.d.ts +1 -1
  4. package/dist/core/commands/fieldCode.d.ts +18 -0
  5. package/dist/core/commands/legacyForms.d.ts +15 -0
  6. package/dist/core/commands/mailMerge.d.ts +8 -0
  7. package/dist/core/commands/publicCommandTypes.d.ts +40 -0
  8. package/dist/core/commands/tableOfAuthorities.d.ts +22 -0
  9. package/dist/core/commands/tableOfFigures.d.ts +12 -0
  10. package/dist/core/document/bookmarkScope.d.ts +6 -0
  11. package/dist/core/document/captionEntries.d.ts +24 -0
  12. package/dist/core/document/fieldCodeDisplay.d.ts +12 -0
  13. package/dist/core/document/fieldComparison.d.ts +7 -0
  14. package/dist/core/document/formulaFields.d.ts +10 -0
  15. package/dist/core/document/indexPlan.d.ts +17 -0
  16. package/dist/core/document/indexRefresh.d.ts +2 -1
  17. package/dist/core/document/mergeFields.d.ts +64 -0
  18. package/dist/core/document/tableOfFigures.d.ts +38 -0
  19. package/dist/core/document/toaEntries.d.ts +33 -0
  20. package/dist/core/document/toaPlan.d.ts +36 -0
  21. package/dist/core/document/toaRefresh.d.ts +29 -0
  22. package/dist/core/document/tocFields.d.ts +13 -0
  23. package/dist/core/document/variableFields.d.ts +58 -0
  24. package/dist/core/format/fieldResultFormat.d.ts +19 -0
  25. package/dist/core/model/editorState.d.ts +2 -0
  26. package/dist/core/model/index.d.ts +1 -1
  27. package/dist/core/model/types/primitives.d.ts +32 -0
  28. package/dist/defaultToolbar-BFmfRwzv.js +1 -0
  29. package/dist/i18n/locales/en.d.ts +24 -0
  30. package/dist/i18n/locales/pt-BR.d.ts +24 -0
  31. package/dist/oasis-editor.js +1 -1
  32. package/dist/oasis-editor.umd.cjs +1 -1
  33. package/dist/ooxml/word/fieldFormatSwitches.d.ts +40 -0
  34. package/dist/ooxml/word/legacyFormFields.d.ts +5 -0
  35. package/dist/plugins/internal/essentialsCapabilities.d.ts +21 -0
  36. package/dist/sourcePackage-DWdP3w1_.js +1 -0
  37. package/dist/ui/components/Toolbar/controls/FieldFamilyPanel.d.ts +9 -0
  38. package/package.json +1 -1
  39. package/dist/OasisEditorApp-BP3OY6PR.js +0 -1
  40. package/dist/defaultToolbar-BSz3ZnBB.js +0 -1
  41. 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;
@@ -549,6 +549,27 @@ export interface EssentialsFieldsCapability {
549
549
  updateBodyFields?: () => void;
550
550
  updateSelectedFields?: () => void;
551
551
  canUpdateBodyFields?: () => boolean;
552
+ /** Generic field-code editing (preserved complex fields). */
553
+ insertFieldCode?: (code: string) => boolean;
554
+ editFieldCode?: (instructionRunId: string, code: string) => boolean;
555
+ editFieldCodeAtSelection?: (code: string) => boolean;
556
+ toggleFieldLock?: (fieldRunId: string) => boolean;
557
+ toggleFieldCodes?: (show: boolean) => void;
558
+ navigateField?: (direction: "next" | "previous") => void;
559
+ /** Table of authorities / figures. */
560
+ markAuthorityEntry?: (options: import('../../core/commands/tableOfAuthorities.js').MarkAuthorityEntryOptions) => boolean;
561
+ insertTableOfAuthorities?: (options: import('../../core/commands/tableOfAuthorities.js').InsertTableOfAuthoritiesOptions) => boolean;
562
+ updateTableOfAuthorities?: (locale?: string) => boolean;
563
+ insertTableOfFigures?: (options: import('../../core/commands/tableOfFigures.js').InsertTableOfFiguresOptions) => boolean;
564
+ updateTableOfFigures?: () => boolean;
565
+ /** Mail merge with caller-supplied records only. */
566
+ previewMergeRecord?: (records: readonly Readonly<Record<string, string>>[], index: number) => boolean;
567
+ mergeToNewDocuments?: (records: readonly Readonly<Record<string, string>>[]) => number;
568
+ /** Variable/ASK/FILLIN/formula refresh with an injected prompt resolver. */
569
+ updateVariableFields?: () => boolean;
570
+ /** Legacy form fields. */
571
+ setFormFieldValue?: (name: string, value: string) => boolean;
572
+ toggleFormCheckbox?: (name: string) => boolean;
552
573
  /** Insert a DATE field at the active caret with the current date. */
553
574
  insertDate: () => void;
554
575
  /** Insert the current date as plain text (WordCraft `insert.dateTime`, update:false). */