@docx-editor.dev/react 2.29.0 → 2.30.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/index.d.mts CHANGED
@@ -10,7 +10,7 @@
10
10
  */
11
11
  import * as react from 'react';
12
12
  import react__default, { ReactNode, CSSProperties, ReactElement, ComponentType, ForwardRefExoticComponent, RefAttributes, HTMLAttributes, Ref } from 'react';
13
- import { RevisionMarkupDialogSession, ResolvedRevisionMarkup, RevisionMarkupOptions, ChromeExportFormat, InvalidTextFormFieldSession, ContentControlWidgetSession, CalendarMonth, ContentControlListNavigation, CalendarDay, TextFormFieldDialogSession, RevisionAuthorStyle, ParagraphDialogFields, ParagraphDialogMixed, ChromeMenuId, ChromeSlotId, ChromeMenuEntry, DocxEditorInstance, FontConfigurationFragment, FontResolver, EditorModule, ReviewDisplayMode, FieldResultsMode, ImageDecodePort, ChromeGroupId, SupportedImageMime, TableChromeSlotId, ChromeExportHandlers, DocumentSearchHighlight, DocumentSearchFindOptions, SurfaceHyperlink, FontOrigin, MarkedFontResolver, ReviewAuthorInfo, EditorCommandExecute, ToolbarValueMap, HighlightSource, ParagraphFormatRead, ParagraphFormatUpdate, TextMeasurer, PaginatedSurfaceState, NavigationCommand, SurfaceFormatting, SectionProperties, RulerIndent, HistoryGroupBindingOptions } from '@docx-editor.dev/core/editor';
13
+ import { RevisionMarkupDialogSession, ResolvedRevisionMarkup, RevisionMarkupOptions, ChromeExportFormat, InvalidTextFormFieldSession, ContentControlWidgetSession, CalendarMonth, ContentControlListNavigation, CalendarDay, TextFormFieldDialogSession, RevisionAuthorStyle, ParagraphDialogFields, ParagraphDialogMixed, ChromeMenuId, ChromeSlotId, ChromeMenuEntry, DocxEditorInstance, FontConfigurationFragment, FontResolver, FontShapingOptions, EditorModule, ReviewDisplayMode, FieldResultsMode, ContentLockPolicy, LockedControlNavigation, ImageDecodePort, ChromeGroupId, SupportedImageMime, TableChromeSlotId, ChromeExportHandlers, DocumentSearchHighlight, DocumentSearchFindOptions, SurfaceHyperlink, FontOrigin, MarkedFontResolver, ReviewAuthorInfo, EditorCommandExecute, ToolbarValueMap, HighlightSource, ParagraphFormatRead, ParagraphFormatUpdate, TextMeasurer, PaginatedSurfaceState, NavigationCommand, SurfaceFormatting, SectionProperties, RulerIndent, HistoryGroupBindingOptions } from '@docx-editor.dev/core/editor';
14
14
  export { CHROME_GROUPS, CHROME_MENUS, ChromeExportFormat, ChromeExportHandlers, ChromeMenu, ChromeMenuEntry, ChromeMenuId, ChromeMenuItemEntry, ChromeMenuSeparatorEntry, ChromeMenuSubmenuEntry, ChromeSlotId, ClearRefreshHighlightsOptions, DEFAULT_FONT, DocumentRefresh, DocumentRefreshError, DocumentRefreshState, DocumentSearchFindOptions, DocumentSearchHighlight, DocumentSearchNavigateOptions, DocumentSearchOptions, FontConfigurationBase, FontConfigurationFragment, FontLoadFailure, FontLoadFailureReason, FontOrigin, FontResolutionRequest, FontResolver, FontResolverMark, FontUrlSource, HIGHLIGHT_REFRESH_MS, HighlightSource, ImageWrapTarget, LOADING_SNAPSHOT, LoadFontsRequest, LoadFontsResult, MAX_RESOLVER_FAMILIES, MarkedFontResolver, NavigateToChangeOptions, PX_PER_CM, PX_PER_INCH, ParagraphFlagState, ParagraphFormatRead, ParagraphFormatUpdate, ParagraphTabStop, RefreshChange, RefreshChangeInput, RefreshFailureCode, RefreshHighlightAnimation, RefreshHighlightOptions, RefreshLocation, RefreshResult, RefreshSubmission, RefreshUpdate, ResolvedRevisionMarkup, ReviewAuthorInfo, ReviewDisplayMode, RevisionAuthorAssignments, RevisionAuthorStyle, RevisionChangedLinesMark, RevisionDeletionMark, RevisionMarkupChromeHandlers, RevisionMarkupColor, RevisionMarkupDialogSession, RevisionMarkupMark, RevisionMarkupNamedColor, RevisionMarkupOptions, RevisionStyles, RulerTick, RulerUnit, SEARCH_DEBOUNCE_MS, SEARCH_HIGHLIGHT_PRIORITY, SEARCH_HIGHLIGHT_SET, SEARCH_MATCH_LIMIT, ToolbarCommandState, WORD_DEFAULT_FONT, chromeMenuSlots, commandForSlot, composeFontConfiguration, composeFontOrigins, createDocumentRefresh, createFontSource, defineFontResolver, generateRulerTicks, isFontResolver, loadFonts, rulerPageBox, runToolbarCommand, toolbarCommandState } from '@docx-editor.dev/core/editor';
15
15
  import { Editor, ViewScope, EditorCommand, DocumentSource, FontConfiguration, ZoomMode, DocumentChange, EditorFontError, TextMatch, DocumentHandle, EditorExecOptions, ExecResult, EditorScope, EditorSnapshot, EditorEvents, HighlightOptions, HighlightResult, HighlightRange, HighlightHit, PageSetup, IndentFormatting, ColorValue, Theme } from '@docx-editor.dev/core/contracts/editor';
16
16
  export { AnchorHighlightAnimation, AnchorHighlightOptions, ClearAnchorHighlightOptions, Editor, EditorCommand, EditorFontError, EditorFontErrorCode, EditorQuery, EditorScope, EditorSnapshot, FontConfiguration, FontFaceRequest, FontSource, FontSourceSubstitution, HighlightHit, HighlightOptions, HighlightRange, HighlightRect, HighlightResult, PageSetup, ScrollToAnchorOptions, TextMatch } from '@docx-editor.dev/core/contracts/editor';
@@ -1614,8 +1614,8 @@ interface ReviewRailRegistry {
1614
1614
  declare const ReviewRailContext: react.Context<ReviewRailRegistry | null>;
1615
1615
 
1616
1616
  /**
1617
- * Props for `DocxEditor.Root`. Only `document`, `fonts`, and `imageDecodePort` identity remounts
1618
- * the editor. Later `author`, `locale`, `mode`, `translate`, `zoom`, and `zoomMode` changes use
1617
+ * Props for `DocxEditor.Root`. `document`, `fonts` and `imageDecodePort` identity changes remount
1618
+ * the editor. Changing `fontShaping.maxFontBytes` also remounts. Later `author`, `locale`, `mode`, `translate`, `zoom`, and `zoomMode` changes use
1619
1619
  * instance setters. `modules` is sampled at mount only.
1620
1620
  *
1621
1621
  * @public
@@ -1636,6 +1636,8 @@ interface DocxEditorRootProps {
1636
1636
  * failures degrade to the fixed measurer and report through `onFontError`.
1637
1637
  */
1638
1638
  fonts?: FontConfiguration | FontConfigurationFragment | FontResolver;
1639
+ /** Explicit shaping byte ceiling; a changed maxFontBytes value remounts. */
1640
+ fontShaping?: FontShapingOptions;
1639
1641
  /** Author for later comments, replies, and tracked changes. Changes apply without a remount. */
1640
1642
  author?: string;
1641
1643
  /**
@@ -1691,6 +1693,20 @@ interface DocxEditorRootProps {
1691
1693
  * with a collaboration module.
1692
1694
  */
1693
1695
  fieldResults?: FieldResultsMode;
1696
+ /**
1697
+ * Opt-in relaxation of content-control locks. With `allowFormattingInLockedContent: true`,
1698
+ * readers can format `contentLocked` and `sdtContentLocked` controls while their text stays
1699
+ * protected. Read once, when the editor is created: a later change in value is ignored,
1700
+ * with a development warning.
1701
+ */
1702
+ contentLockPolicy?: ContentLockPolicy;
1703
+ /**
1704
+ * How the caret moves through an inline content control whose content is locked.
1705
+ * `'characters'` (the default) walks through its characters, as Word does. `'atomic'` makes
1706
+ * the control one caret unit. Read once, when the editor is created: a later change is
1707
+ * ignored, with a development warning.
1708
+ */
1709
+ lockedControlNavigation?: LockedControlNavigation;
1694
1710
  /** Fired once per instance, after it is published to the tree (and after any
1695
1711
  * `DocxEditor.Content` in the same commit has attached its mount point). A large
1696
1712
  * document mounts behind one painted frame; `onReady` fires AFTER that mount lands,
@@ -3051,6 +3067,8 @@ interface DocxEditorProps {
3051
3067
  * measured. Omit it to mount in one line; supply it when break positions matter.
3052
3068
  */
3053
3069
  fonts?: FontConfiguration | FontConfigurationFragment | FontResolver;
3070
+ /** Explicit shaping byte ceiling. A changed maxFontBytes value remounts; equal values keep the instance. */
3071
+ fontShaping?: FontShapingOptions;
3054
3072
  /**
3055
3073
  * Title-bar slots. The host owns what goes here — brand lockup, switchers, theme
3056
3074
  * toggle, Open/New/Save controls — and passes them in; the editor renders them
@@ -3239,6 +3257,20 @@ interface DocxEditorProps {
3239
3257
  * with a collaboration module.
3240
3258
  */
3241
3259
  fieldResults?: FieldResultsMode;
3260
+ /**
3261
+ * Opt-in relaxation of content-control locks. With `allowFormattingInLockedContent: true`,
3262
+ * readers can format `contentLocked` and `sdtContentLocked` controls while their text stays
3263
+ * protected. Read once, when the editor is created: a later change in value is ignored,
3264
+ * with a development warning.
3265
+ */
3266
+ contentLockPolicy?: ContentLockPolicy;
3267
+ /**
3268
+ * How the caret moves through an inline content control whose content is locked.
3269
+ * `'characters'` (the default) walks through its characters, as Word does. `'atomic'` makes
3270
+ * the control one caret unit. Read once, when the editor is created: a later change is
3271
+ * ignored, with a development warning.
3272
+ */
3273
+ lockedControlNavigation?: LockedControlNavigation;
3242
3274
  /**
3243
3275
  * BCP-47 locale for regional date input and engine-generated labels. Defaults to en-US.
3244
3276
  * Changes apply to subsequent edits without a remount; stored date formats are preserved.
package/dist/index.d.ts CHANGED
@@ -10,7 +10,7 @@
10
10
  */
11
11
  import * as react from 'react';
12
12
  import react__default, { ReactNode, CSSProperties, ReactElement, ComponentType, ForwardRefExoticComponent, RefAttributes, HTMLAttributes, Ref } from 'react';
13
- import { RevisionMarkupDialogSession, ResolvedRevisionMarkup, RevisionMarkupOptions, ChromeExportFormat, InvalidTextFormFieldSession, ContentControlWidgetSession, CalendarMonth, ContentControlListNavigation, CalendarDay, TextFormFieldDialogSession, RevisionAuthorStyle, ParagraphDialogFields, ParagraphDialogMixed, ChromeMenuId, ChromeSlotId, ChromeMenuEntry, DocxEditorInstance, FontConfigurationFragment, FontResolver, EditorModule, ReviewDisplayMode, FieldResultsMode, ImageDecodePort, ChromeGroupId, SupportedImageMime, TableChromeSlotId, ChromeExportHandlers, DocumentSearchHighlight, DocumentSearchFindOptions, SurfaceHyperlink, FontOrigin, MarkedFontResolver, ReviewAuthorInfo, EditorCommandExecute, ToolbarValueMap, HighlightSource, ParagraphFormatRead, ParagraphFormatUpdate, TextMeasurer, PaginatedSurfaceState, NavigationCommand, SurfaceFormatting, SectionProperties, RulerIndent, HistoryGroupBindingOptions } from '@docx-editor.dev/core/editor';
13
+ import { RevisionMarkupDialogSession, ResolvedRevisionMarkup, RevisionMarkupOptions, ChromeExportFormat, InvalidTextFormFieldSession, ContentControlWidgetSession, CalendarMonth, ContentControlListNavigation, CalendarDay, TextFormFieldDialogSession, RevisionAuthorStyle, ParagraphDialogFields, ParagraphDialogMixed, ChromeMenuId, ChromeSlotId, ChromeMenuEntry, DocxEditorInstance, FontConfigurationFragment, FontResolver, FontShapingOptions, EditorModule, ReviewDisplayMode, FieldResultsMode, ContentLockPolicy, LockedControlNavigation, ImageDecodePort, ChromeGroupId, SupportedImageMime, TableChromeSlotId, ChromeExportHandlers, DocumentSearchHighlight, DocumentSearchFindOptions, SurfaceHyperlink, FontOrigin, MarkedFontResolver, ReviewAuthorInfo, EditorCommandExecute, ToolbarValueMap, HighlightSource, ParagraphFormatRead, ParagraphFormatUpdate, TextMeasurer, PaginatedSurfaceState, NavigationCommand, SurfaceFormatting, SectionProperties, RulerIndent, HistoryGroupBindingOptions } from '@docx-editor.dev/core/editor';
14
14
  export { CHROME_GROUPS, CHROME_MENUS, ChromeExportFormat, ChromeExportHandlers, ChromeMenu, ChromeMenuEntry, ChromeMenuId, ChromeMenuItemEntry, ChromeMenuSeparatorEntry, ChromeMenuSubmenuEntry, ChromeSlotId, ClearRefreshHighlightsOptions, DEFAULT_FONT, DocumentRefresh, DocumentRefreshError, DocumentRefreshState, DocumentSearchFindOptions, DocumentSearchHighlight, DocumentSearchNavigateOptions, DocumentSearchOptions, FontConfigurationBase, FontConfigurationFragment, FontLoadFailure, FontLoadFailureReason, FontOrigin, FontResolutionRequest, FontResolver, FontResolverMark, FontUrlSource, HIGHLIGHT_REFRESH_MS, HighlightSource, ImageWrapTarget, LOADING_SNAPSHOT, LoadFontsRequest, LoadFontsResult, MAX_RESOLVER_FAMILIES, MarkedFontResolver, NavigateToChangeOptions, PX_PER_CM, PX_PER_INCH, ParagraphFlagState, ParagraphFormatRead, ParagraphFormatUpdate, ParagraphTabStop, RefreshChange, RefreshChangeInput, RefreshFailureCode, RefreshHighlightAnimation, RefreshHighlightOptions, RefreshLocation, RefreshResult, RefreshSubmission, RefreshUpdate, ResolvedRevisionMarkup, ReviewAuthorInfo, ReviewDisplayMode, RevisionAuthorAssignments, RevisionAuthorStyle, RevisionChangedLinesMark, RevisionDeletionMark, RevisionMarkupChromeHandlers, RevisionMarkupColor, RevisionMarkupDialogSession, RevisionMarkupMark, RevisionMarkupNamedColor, RevisionMarkupOptions, RevisionStyles, RulerTick, RulerUnit, SEARCH_DEBOUNCE_MS, SEARCH_HIGHLIGHT_PRIORITY, SEARCH_HIGHLIGHT_SET, SEARCH_MATCH_LIMIT, ToolbarCommandState, WORD_DEFAULT_FONT, chromeMenuSlots, commandForSlot, composeFontConfiguration, composeFontOrigins, createDocumentRefresh, createFontSource, defineFontResolver, generateRulerTicks, isFontResolver, loadFonts, rulerPageBox, runToolbarCommand, toolbarCommandState } from '@docx-editor.dev/core/editor';
15
15
  import { Editor, ViewScope, EditorCommand, DocumentSource, FontConfiguration, ZoomMode, DocumentChange, EditorFontError, TextMatch, DocumentHandle, EditorExecOptions, ExecResult, EditorScope, EditorSnapshot, EditorEvents, HighlightOptions, HighlightResult, HighlightRange, HighlightHit, PageSetup, IndentFormatting, ColorValue, Theme } from '@docx-editor.dev/core/contracts/editor';
16
16
  export { AnchorHighlightAnimation, AnchorHighlightOptions, ClearAnchorHighlightOptions, Editor, EditorCommand, EditorFontError, EditorFontErrorCode, EditorQuery, EditorScope, EditorSnapshot, FontConfiguration, FontFaceRequest, FontSource, FontSourceSubstitution, HighlightHit, HighlightOptions, HighlightRange, HighlightRect, HighlightResult, PageSetup, ScrollToAnchorOptions, TextMatch } from '@docx-editor.dev/core/contracts/editor';
@@ -1614,8 +1614,8 @@ interface ReviewRailRegistry {
1614
1614
  declare const ReviewRailContext: react.Context<ReviewRailRegistry | null>;
1615
1615
 
1616
1616
  /**
1617
- * Props for `DocxEditor.Root`. Only `document`, `fonts`, and `imageDecodePort` identity remounts
1618
- * the editor. Later `author`, `locale`, `mode`, `translate`, `zoom`, and `zoomMode` changes use
1617
+ * Props for `DocxEditor.Root`. `document`, `fonts` and `imageDecodePort` identity changes remount
1618
+ * the editor. Changing `fontShaping.maxFontBytes` also remounts. Later `author`, `locale`, `mode`, `translate`, `zoom`, and `zoomMode` changes use
1619
1619
  * instance setters. `modules` is sampled at mount only.
1620
1620
  *
1621
1621
  * @public
@@ -1636,6 +1636,8 @@ interface DocxEditorRootProps {
1636
1636
  * failures degrade to the fixed measurer and report through `onFontError`.
1637
1637
  */
1638
1638
  fonts?: FontConfiguration | FontConfigurationFragment | FontResolver;
1639
+ /** Explicit shaping byte ceiling; a changed maxFontBytes value remounts. */
1640
+ fontShaping?: FontShapingOptions;
1639
1641
  /** Author for later comments, replies, and tracked changes. Changes apply without a remount. */
1640
1642
  author?: string;
1641
1643
  /**
@@ -1691,6 +1693,20 @@ interface DocxEditorRootProps {
1691
1693
  * with a collaboration module.
1692
1694
  */
1693
1695
  fieldResults?: FieldResultsMode;
1696
+ /**
1697
+ * Opt-in relaxation of content-control locks. With `allowFormattingInLockedContent: true`,
1698
+ * readers can format `contentLocked` and `sdtContentLocked` controls while their text stays
1699
+ * protected. Read once, when the editor is created: a later change in value is ignored,
1700
+ * with a development warning.
1701
+ */
1702
+ contentLockPolicy?: ContentLockPolicy;
1703
+ /**
1704
+ * How the caret moves through an inline content control whose content is locked.
1705
+ * `'characters'` (the default) walks through its characters, as Word does. `'atomic'` makes
1706
+ * the control one caret unit. Read once, when the editor is created: a later change is
1707
+ * ignored, with a development warning.
1708
+ */
1709
+ lockedControlNavigation?: LockedControlNavigation;
1694
1710
  /** Fired once per instance, after it is published to the tree (and after any
1695
1711
  * `DocxEditor.Content` in the same commit has attached its mount point). A large
1696
1712
  * document mounts behind one painted frame; `onReady` fires AFTER that mount lands,
@@ -3051,6 +3067,8 @@ interface DocxEditorProps {
3051
3067
  * measured. Omit it to mount in one line; supply it when break positions matter.
3052
3068
  */
3053
3069
  fonts?: FontConfiguration | FontConfigurationFragment | FontResolver;
3070
+ /** Explicit shaping byte ceiling. A changed maxFontBytes value remounts; equal values keep the instance. */
3071
+ fontShaping?: FontShapingOptions;
3054
3072
  /**
3055
3073
  * Title-bar slots. The host owns what goes here — brand lockup, switchers, theme
3056
3074
  * toggle, Open/New/Save controls — and passes them in; the editor renders them
@@ -3239,6 +3257,20 @@ interface DocxEditorProps {
3239
3257
  * with a collaboration module.
3240
3258
  */
3241
3259
  fieldResults?: FieldResultsMode;
3260
+ /**
3261
+ * Opt-in relaxation of content-control locks. With `allowFormattingInLockedContent: true`,
3262
+ * readers can format `contentLocked` and `sdtContentLocked` controls while their text stays
3263
+ * protected. Read once, when the editor is created: a later change in value is ignored,
3264
+ * with a development warning.
3265
+ */
3266
+ contentLockPolicy?: ContentLockPolicy;
3267
+ /**
3268
+ * How the caret moves through an inline content control whose content is locked.
3269
+ * `'characters'` (the default) walks through its characters, as Word does. `'atomic'` makes
3270
+ * the control one caret unit. Read once, when the editor is created: a later change is
3271
+ * ignored, with a development warning.
3272
+ */
3273
+ lockedControlNavigation?: LockedControlNavigation;
3242
3274
  /**
3243
3275
  * BCP-47 locale for regional date input and engine-generated labels. Defaults to en-US.
3244
3276
  * Changes apply to subsequent edits without a remount; stored date formats are preserved.