devexpress-richedit 25.2.5 → 25.2.6

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 (39) hide show
  1. package/bin/gulpfile.js +1 -1
  2. package/bin/index-custom.js +1 -1
  3. package/bin/localization-builder.js +1 -1
  4. package/bin/nspell-index.js +1 -1
  5. package/bin/nspell.webpack.config.js +1 -1
  6. package/bin/webpack-externals.js +1 -1
  7. package/bin/webpack.config.js +1 -1
  8. package/dist/dx.richedit.css +1 -1
  9. package/dist/dx.richedit.d.ts +1 -1
  10. package/dist/dx.richedit.js +4348 -4235
  11. package/dist/dx.richedit.min.js +3 -3
  12. package/dist/pdfkit.js +3185 -3147
  13. package/dist/pdfkit.min.js +1 -1
  14. package/index.d.ts +1 -1
  15. package/index.js +1 -1
  16. package/lib/client/client-rich-edit.d.ts +2 -1
  17. package/lib/client/client-rich-edit.js +9 -3
  18. package/lib/client/public/client-events.d.ts +2 -1
  19. package/lib/client/public/client-events.js +3 -1
  20. package/lib/client/public/events.d.ts +7 -1
  21. package/lib/client/public/events.js +8 -0
  22. package/lib/client/public/options.d.ts +2 -1
  23. package/lib/client/settings.d.ts +1 -0
  24. package/lib/client/settings.js +2 -0
  25. package/lib/common/auto-correct/auto-correct-providers.js +2 -2
  26. package/lib/common/client-side-events.d.ts +2 -0
  27. package/lib/common/client-side-events.js +3 -0
  28. package/lib/common/commands/dialogs/dialog-custom-numbering-list-command.js +3 -1
  29. package/lib/common/commands/document/print-document-on-client-command.js +3 -0
  30. package/lib/common/commands/ruler/toggle-show-horizontal-ruler-command.js +1 -2
  31. package/lib/common/formats/html/export/html-export.d.ts +4 -7
  32. package/lib/common/formats/html/export/html-export.js +102 -44
  33. package/lib/common/interfaces/i-control-owner.d.ts +2 -0
  34. package/lib/common/interfaces/i-rich-edit-core.d.ts +1 -0
  35. package/lib/common/mouse-handler/drag-floating-objects-helper.js +13 -4
  36. package/lib/common/rich-edit-core.d.ts +1 -0
  37. package/lib/common/rich-edit-core.js +6 -2
  38. package/lib/common/utils/utils.js +2 -2
  39. package/package.json +5 -5
package/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * DevExpress WebRichEdit (index.d.ts)
3
- * Version: 25.2.5
3
+ * Version: 25.2.6
4
4
  * Copyright (c) 2012 - 2026 Developer Express Inc. ALL RIGHTS RESERVED
5
5
  * License: https://www.devexpress.com/Support/EULAs",
6
6
  */
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * DevExpress WebRichEdit (index.js)
3
- * Version: 25.2.5
3
+ * Version: 25.2.6
4
4
  * Copyright (c) 2012 - 2026 Developer Express Inc. ALL RIGHTS RESERVED
5
5
  * License: https://www.devexpress.com/Support/EULAs",
6
6
  */
@@ -23,7 +23,7 @@ import { Ribbon } from './public/ribbon/ribbon';
23
23
  import { RichEdit } from './public/rich-edit';
24
24
  import { ClientQuickSearchPanel } from './ui/client-quick-search-panel';
25
25
  import { RulerSettings } from '../common/ui/ruler/settings';
26
- import { ViewSettings } from '../common/view-settings/views-settings';
26
+ import { ViewSettings, ViewType as CommonViewType } from '../common/view-settings/views-settings';
27
27
  import { InformationData } from '../common/utils/information-creator';
28
28
  interface ResizeObserverOptions {
29
29
  box?: 'content-box' | 'border-box' | 'device-pixel-content-box';
@@ -133,6 +133,7 @@ export declare class ClientRichEdit implements IControlOwner {
133
133
  raiseSelectionChanged(): void;
134
134
  raiseSaving(base64: string, fileName: string, format: DocumentFormatApi, reason: string): boolean;
135
135
  raiseHorizontalRulerVisibleChanged(horizontalRulerVisible: boolean): void;
136
+ raiseViewTypeChanged(viewType: CommonViewType): void;
136
137
  raiseSaved(success: boolean, reason: string): void;
137
138
  raiseCustomCommandExecuted(command: any, parameter: any): void;
138
139
  raiseFloatingObjectMovedObject(_arg: FloatingObjectMovedArgumentInner): void;
@@ -24,7 +24,7 @@ import { DialogManager } from './dialogs/dialog-manager';
24
24
  import { ClientFormattersOptions } from './formatters-options';
25
25
  import { LosingChangesWatcher } from './losing-changes-watcher';
26
26
  import { Events } from './public/client-events';
27
- import { AutoCorrectEventArgs, BeforeSendEventArgs, CommandStateChangedEventArgs, ContentChangedEventArgs, ContentRemovedEventArgs, CustomCommandExecutedEventArgs, DocumentFormattedEventArgs, DocumentLinkType, EventArgs, HyperlinkClickEventArgs, KeyboardEventArgs, ParagraphPropertiesChangedEventArgs, PdfExportedEventArgs, PdfExportingEventArgs, PointerEventArgs, SavedEventArgs, SavingEventArgs, HorizontalRulerVisibleChangedEventArgs } from './public/events';
27
+ import { AutoCorrectEventArgs, BeforeSendEventArgs, CommandStateChangedEventArgs, ContentChangedEventArgs, ContentRemovedEventArgs, CustomCommandExecutedEventArgs, DocumentFormattedEventArgs, DocumentLinkType, EventArgs, HyperlinkClickEventArgs, KeyboardEventArgs, ParagraphPropertiesChangedEventArgs, PdfExportedEventArgs, PdfExportingEventArgs, PointerEventArgs, SavedEventArgs, SavingEventArgs, HorizontalRulerVisibleChangedEventArgs, ViewTypeChangedEventArgs } from './public/events';
28
28
  import { Interval } from './public/rich-edit';
29
29
  import { Settings } from './settings';
30
30
  import { ClientQuickSearchPanel } from './ui/client-quick-search-panel';
@@ -61,8 +61,8 @@ export class ClientRichEdit {
61
61
  this.rawDataSource = settings.rawDataSource;
62
62
  this.contextMenuSettings = settings.contextMenuSettings;
63
63
  this.fullScreenHelper = new FullScreenHelper(element);
64
- if ("eyJsaWNlbnNlS2V5IjoiZXdvZ0lDSm1iM0p0WVhRaU9pQXhMQW9nSUNKcGJuUmxjbTVoYkZWellXZGxTV1FpT2lBaVJrdEhhMGMxYUdSVVNrVnBWRWRVYldZd09GSnZUeUlLZlE9PS5uajdxK2FZVytHUUF0K21WN2JrMjFSYk5RdkhNVjduNFNEY0lTNFc2MDdvenRWOUd0aUNjZUdtTTdUc3pEZVdJSy85NDhIVlVEaTJKVEpFdm81bjl3bjhkQnFOTVZqbCsyY1c3VFNVaWRpeVBOUmd5YkZWZlBHTnBSck5mWTBGbWJ6Y05adz09In0=")
65
- config(JSON.parse(atob("eyJsaWNlbnNlS2V5IjoiZXdvZ0lDSm1iM0p0WVhRaU9pQXhMQW9nSUNKcGJuUmxjbTVoYkZWellXZGxTV1FpT2lBaVJrdEhhMGMxYUdSVVNrVnBWRWRVYldZd09GSnZUeUlLZlE9PS5uajdxK2FZVytHUUF0K21WN2JrMjFSYk5RdkhNVjduNFNEY0lTNFc2MDdvenRWOUd0aUNjZUdtTTdUc3pEZVdJSy85NDhIVlVEaTJKVEpFdm81bjl3bjhkQnFOTVZqbCsyY1c3VFNVaWRpeVBOUmd5YkZWZlBHTnBSck5mWTBGbWJ6Y05adz09In0=")));
64
+ if ("eyJsaWNlbnNlS2V5IjoiZXdvZ0lDSm1iM0p0WVhRaU9pQXhMQW9nSUNKcGJuUmxjbTVoYkZWellXZGxTV1FpT2lBaVIySnVkMVZPY0U5VlVHRklhRTAwTjBoTk5GTjRkeUlLZlE9PS5IVXRnQjNsaVdYQVoyZUx2MDc4ZmhSa2dTSlBMT05WNnNKVW90VVc5TDdUN0hKSUt2RlJUNjVoUkV5cDY4bXNUeG80dEVwT1lKNG9veFlaSXpkbTVKZEd2ek9oMjZtazJET3BwNHNLNHVOYys5WTR5RGFmaDJ4R0pBNitud0NqeUFVN3Fpdz09In0=")
65
+ config(JSON.parse(atob("eyJsaWNlbnNlS2V5IjoiZXdvZ0lDSm1iM0p0WVhRaU9pQXhMQW9nSUNKcGJuUmxjbTVoYkZWellXZGxTV1FpT2lBaVIySnVkMVZPY0U5VlVHRklhRTAwTjBoTk5GTjRkeUlLZlE9PS5IVXRnQjNsaVdYQVoyZUx2MDc4ZmhSa2dTSlBMT05WNnNKVW90VVc5TDdUN0hKSUt2RlJUNjVoUkV5cDY4bXNUeG80dEVwT1lKNG9veFlaSXpkbTVKZEd2ek9oMjZtazJET3BwNHNLNHVOYys5WTR5RGFmaDJ4R0pBNitud0NqeUFVN3Fpdz09In0=")));
66
66
  this.prepareElement(element, settings);
67
67
  this.initDefaultFontsAndStyles();
68
68
  this.initBars(settings.ribbon, settings.fonts);
@@ -229,6 +229,8 @@ export class ClientRichEdit {
229
229
  this.events.calculateDocumentVariableAsync.addHandler(settings.onCalculateDocumentVariableAsync, this.publicRichEdit);
230
230
  if (settings.onContextMenuShowing)
231
231
  this.events.contextMenuShowing.addHandler(settings.onContextMenuShowing, this.publicRichEdit);
232
+ if (settings.onViewTypeChanged)
233
+ this.events.viewTypeChanged.addHandler(settings.onViewTypeChanged, this.publicRichEdit);
232
234
  }
233
235
  initDefaultFontsAndStyles() {
234
236
  StylesManager.populatePresetStyles(Constants.getLocalizedDefaultPresetStyles());
@@ -529,6 +531,10 @@ export class ClientRichEdit {
529
531
  const args = new HorizontalRulerVisibleChangedEventArgs(horizontalRulerVisible);
530
532
  this.events.horizontalRulerVisibleChanged._fireEvent(this.publicRichEdit, args);
531
533
  }
534
+ raiseViewTypeChanged(viewType) {
535
+ const args = new ViewTypeChangedEventArgs(viewType);
536
+ this.events.viewTypeChanged._fireEvent(this.publicRichEdit, args);
537
+ }
532
538
  raiseSaved(success, reason) {
533
539
  const args = new SavedEventArgs(success, reason);
534
540
  this.events.saved._fireEvent(this.publicRichEdit, args);
@@ -1,4 +1,4 @@
1
- import { ActiveSubDocumentChangedEvent, AutoCorrectEvent, BeforeSendEvent, CalculateDocumentVariableAsyncEvent, CalculateDocumentVariableEvent, CharacterPropertiesChangedEvent, CommandStateChangedEvent, ContentInsertedEvent, ContentRemovedEvent, CustomCommandExecutedEvent, DocumentChangedEvent, DocumentFormattedEvent, DocumentLoadedEvent, GotFocusEvent, HyperlinkClickEvent, KeyDownEvent, KeyUpEvent, LostFocusEvent, ParagraphPropertiesChangedEvent, PdfExportedEvent, PdfExportingEvent, PointerDownEvent, PointerUpEvent, ContextMenuShowingEvent, SavedEvent, SavingEvent, SelectionChangedEvent, HorizontalRulerVisibleChangedEvent } from './events';
1
+ import { ActiveSubDocumentChangedEvent, AutoCorrectEvent, BeforeSendEvent, CalculateDocumentVariableAsyncEvent, CalculateDocumentVariableEvent, CharacterPropertiesChangedEvent, CommandStateChangedEvent, ContentInsertedEvent, ContentRemovedEvent, CustomCommandExecutedEvent, DocumentChangedEvent, DocumentFormattedEvent, DocumentLoadedEvent, GotFocusEvent, HyperlinkClickEvent, KeyDownEvent, KeyUpEvent, LostFocusEvent, ParagraphPropertiesChangedEvent, PdfExportedEvent, PdfExportingEvent, PointerDownEvent, PointerUpEvent, ContextMenuShowingEvent, SavedEvent, SavingEvent, SelectionChangedEvent, HorizontalRulerVisibleChangedEvent, ViewTypeChangedEvent } from './events';
2
2
  export declare class Events {
3
3
  readonly selectionChanged: SelectionChangedEvent;
4
4
  readonly beforeSend: BeforeSendEvent;
@@ -28,6 +28,7 @@ export declare class Events {
28
28
  readonly calculateDocumentVariableAsync: CalculateDocumentVariableAsyncEvent;
29
29
  readonly contextMenuShowing: ContextMenuShowingEvent;
30
30
  readonly horizontalRulerVisibleChanged: HorizontalRulerVisibleChangedEvent;
31
+ readonly viewTypeChanged: ViewTypeChangedEvent;
31
32
  constructor();
32
33
  clear(): void;
33
34
  }
@@ -1,4 +1,4 @@
1
- import { ActiveSubDocumentChangedEvent, AutoCorrectEvent, BeforeSendEvent, CalculateDocumentVariableAsyncEvent, CalculateDocumentVariableEvent, CharacterPropertiesChangedEvent, CommandStateChangedEvent, ContentInsertedEvent, ContentRemovedEvent, CustomCommandExecutedEvent, DocumentChangedEvent, DocumentFormattedEvent, DocumentLoadedEvent, GotFocusEvent, HyperlinkClickEvent, KeyDownEvent, KeyUpEvent, LostFocusEvent, ParagraphPropertiesChangedEvent, PdfExportedEvent, PdfExportingEvent, PointerDownEvent, PointerUpEvent, ContextMenuShowingEvent, SavedEvent, SavingEvent, SelectionChangedEvent, HorizontalRulerVisibleChangedEvent } from './events';
1
+ import { ActiveSubDocumentChangedEvent, AutoCorrectEvent, BeforeSendEvent, CalculateDocumentVariableAsyncEvent, CalculateDocumentVariableEvent, CharacterPropertiesChangedEvent, CommandStateChangedEvent, ContentInsertedEvent, ContentRemovedEvent, CustomCommandExecutedEvent, DocumentChangedEvent, DocumentFormattedEvent, DocumentLoadedEvent, GotFocusEvent, HyperlinkClickEvent, KeyDownEvent, KeyUpEvent, LostFocusEvent, ParagraphPropertiesChangedEvent, PdfExportedEvent, PdfExportingEvent, PointerDownEvent, PointerUpEvent, ContextMenuShowingEvent, SavedEvent, SavingEvent, SelectionChangedEvent, HorizontalRulerVisibleChangedEvent, ViewTypeChangedEvent } from './events';
2
2
  export class Events {
3
3
  constructor() {
4
4
  this.selectionChanged = new SelectionChangedEvent();
@@ -29,6 +29,7 @@ export class Events {
29
29
  this.calculateDocumentVariableAsync = new CalculateDocumentVariableAsyncEvent();
30
30
  this.contextMenuShowing = new ContextMenuShowingEvent();
31
31
  this.horizontalRulerVisibleChanged = new HorizontalRulerVisibleChangedEvent();
32
+ this.viewTypeChanged = new ViewTypeChangedEvent();
32
33
  }
33
34
  clear() {
34
35
  this.selectionChanged.clearHandlers();
@@ -59,5 +60,6 @@ export class Events {
59
60
  this.contextMenuShowing.clearHandlers();
60
61
  this.calculateDocumentVariableAsync.clearHandlers();
61
62
  this.horizontalRulerVisibleChanged.clearHandlers();
63
+ this.viewTypeChanged.clearHandlers();
62
64
  }
63
65
  }
@@ -3,7 +3,7 @@ import { HyperlinkApi } from '../model-api/field';
3
3
  import { DocumentFormatApi } from '../model-api/formats/enum';
4
4
  import { CommandId } from './commands/enum';
5
5
  import { IContextMenu } from './context-menu/menu';
6
- import { Interval, RichEdit } from './rich-edit';
6
+ import { Interval, RichEdit, ViewType } from './rich-edit';
7
7
  export declare class Event<TSource, TEventArgs extends EventArgs> {
8
8
  protected _handlerInfoList: HandlerInfo<TSource, TEventArgs>[];
9
9
  addHandler(handler: (s?: TSource, e?: TEventArgs) => void, executionContext?: TSource): void;
@@ -63,6 +63,8 @@ export declare class SavedEvent extends RichEditEvent<SavedEventArgs> {
63
63
  }
64
64
  export declare class HorizontalRulerVisibleChangedEvent extends RichEditEvent<HorizontalRulerVisibleChangedEventArgs> {
65
65
  }
66
+ export declare class ViewTypeChangedEvent extends RichEditEvent<ViewTypeChangedEventArgs> {
67
+ }
66
68
  export declare class CustomCommandExecutedEvent extends RichEditEvent<CustomCommandExecutedEventArgs> {
67
69
  }
68
70
  export declare class PdfExportingEvent extends RichEditEvent<PdfExportingEventArgs> {
@@ -134,6 +136,10 @@ export declare class HorizontalRulerVisibleChangedEventArgs extends EventArgs {
134
136
  horizontalRulerVisible: boolean;
135
137
  constructor(horizontalRulerVisible: boolean);
136
138
  }
139
+ export declare class ViewTypeChangedEventArgs extends EventArgs {
140
+ viewType: ViewType;
141
+ constructor(viewType: ViewType);
142
+ }
137
143
  export declare class CustomCommandExecutedEventArgs extends EventArgs {
138
144
  commandName: string;
139
145
  parameter: any;
@@ -78,6 +78,8 @@ export class SavedEvent extends RichEditEvent {
78
78
  }
79
79
  export class HorizontalRulerVisibleChangedEvent extends RichEditEvent {
80
80
  }
81
+ export class ViewTypeChangedEvent extends RichEditEvent {
82
+ }
81
83
  export class CustomCommandExecutedEvent extends RichEditEvent {
82
84
  }
83
85
  export class PdfExportingEvent extends RichEditEvent {
@@ -171,6 +173,12 @@ export class HorizontalRulerVisibleChangedEventArgs extends EventArgs {
171
173
  this.horizontalRulerVisible = horizontalRulerVisible;
172
174
  }
173
175
  }
176
+ export class ViewTypeChangedEventArgs extends EventArgs {
177
+ constructor(viewType) {
178
+ super();
179
+ this.viewType = viewType;
180
+ }
181
+ }
174
182
  export class CustomCommandExecutedEventArgs extends EventArgs {
175
183
  constructor(commandName, parameter) {
176
184
  super();
@@ -5,7 +5,7 @@ import { RichEditUnit } from '../../common/utils/unit-converter';
5
5
  import { CalculateDocumentVariableAsyncEventArgs } from '../document-processor/docvar-args';
6
6
  import { DocumentFormatApi } from '../model-api/formats/enum';
7
7
  import { IContextMenu } from './context-menu/menu';
8
- import { AutoCorrectEventArgs, BeforeSendEventArgs, CalculateDocumentVariableEventArgs, CommandStateChangedEventArgs, ContentChangedEventArgs, ContentRemovedEventArgs, ContextMenuShowingEventArgs, CustomCommandExecutedEventArgs, DocumentFormattedEventArgs, EventArgs, HyperlinkClickEventArgs, KeyboardEventArgs, ParagraphPropertiesChangedEventArgs, PdfExportedEventArgs, PdfExportingEventArgs, PointerEventArgs, SavedEventArgs, SavingEventArgs } from './events';
8
+ import { AutoCorrectEventArgs, BeforeSendEventArgs, CalculateDocumentVariableEventArgs, CommandStateChangedEventArgs, ContentChangedEventArgs, ContentRemovedEventArgs, ContextMenuShowingEventArgs, CustomCommandExecutedEventArgs, DocumentFormattedEventArgs, EventArgs, HyperlinkClickEventArgs, KeyboardEventArgs, ParagraphPropertiesChangedEventArgs, PdfExportedEventArgs, PdfExportingEventArgs, PointerEventArgs, SavedEventArgs, SavingEventArgs, ViewTypeChangedEventArgs } from './events';
9
9
  import { Ribbon } from './ribbon/ribbon';
10
10
  import { PrintMode, RichEdit, ViewType } from './rich-edit';
11
11
  import { IRichEditSearchSettings } from '../i-rich-constructor-settings';
@@ -40,6 +40,7 @@ export interface EventHandlers {
40
40
  commandStateChanged?: string | ((s: RichEdit, e: CommandStateChangedEventArgs) => void);
41
41
  calculateDocumentVariableAsync?: string | ((s: RichEdit, e: CalculateDocumentVariableAsyncEventArgs) => void);
42
42
  contextMenuShowing?: string | ((s: RichEdit, e: ContextMenuShowingEventArgs) => void);
43
+ viewTypeChanged?: string | ((s: RichEdit, e: ViewTypeChangedEventArgs) => void);
43
44
  }
44
45
  export interface Options {
45
46
  width?: string;
@@ -65,6 +65,7 @@ export declare class Settings {
65
65
  onPdfExported: () => void;
66
66
  onCommandStateChanged: () => void;
67
67
  onContextMenuShowing: () => void;
68
+ onViewTypeChanged: () => void;
68
69
  static parse(settings: IRichEditSettings, subDocumentCreator: (id: number) => SubDocumentClientApi): Settings;
69
70
  private static parseCommonSettings;
70
71
  private static parseAutoCorrectSettings;
@@ -346,6 +346,8 @@ export class Settings {
346
346
  result.onCalculateDocumentVariableAsync = this.parseEventHandler(settings.calculateDocumentVariableAsync);
347
347
  if (settings.contextMenuShowing)
348
348
  result.onContextMenuShowing = this.parseEventHandler(settings.contextMenuShowing);
349
+ if (settings.viewTypeChanged)
350
+ result.onViewTypeChanged = this.parseEventHandler(settings.viewTypeChanged);
349
351
  }
350
352
  static parseEventHandler(func) {
351
353
  return convertToFunction(func);
@@ -135,8 +135,8 @@ export class BulletedListAutoCorrectProvider extends AutoCorrectProviderBase {
135
135
  export class UrlAutoCorrectProvider extends AutoCorrectProviderBase {
136
136
  constructor() {
137
137
  super(...arguments);
138
- this.urlRegex = /^(?:[a-z][\w-]+:(?:\/{1,3}([^./]*:[^./]*@){0,1})|www\d{0,3}[.]|ftp[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?=((?:[^\s()<>]+|\([^\s<>]*\))+(?:\([^\s<>]*\)|[^\s`!()\[\]{};:'"".,<>?«»“”‘’])))\2$/i;
139
- this.emailRegex = /^(mailto:)?[-\w!#$%&'*+/=?^_`{|}~]+(?:\.[-\w!#$%&'*+/=?^_`{|}~]+)*@(?:\w+([-\w]*\w)\.)[\w]+$/;
138
+ this.urlRegex = /^(?:[a-z][\w-]+:(?:\/{1,3}([^./]*:[^./]*@){0,1})|www\d{0,3}[.]|ftp[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?=((?:[^\s()<>]|\([^\s<>]*\))+(?:\([^\s<>]*\)|[^\s`!()\[\]{};:'"".,<>?«»""''])))\2$/i;
139
+ this.emailRegex = /^(mailto:)?[-\w!#$%&'*+/=?^_`{|}~]+(?:\.[-\w!#$%&'*+/=?^_`{|}~]+)*@(?:\w+(?:-\w+)*\.)[\w]+$/;
140
140
  this.localRegex = /^(([a-zA-Z][:][\\])|(\\\\))(((?![<>:"\\|?*]).)+((?![ .])\\)?)*$/;
141
141
  }
142
142
  reviseCore(text, interval) {
@@ -1,6 +1,7 @@
1
1
  import { Field } from './model/fields/field';
2
2
  import { FixedInterval } from '@devexpress/utils/lib/intervals/fixed';
3
3
  import { IControlOwner } from './interfaces/i-control-owner';
4
+ import { ViewType } from './view-settings/views-settings';
4
5
  export declare class ClientSideEvents {
5
6
  private owner;
6
7
  constructor(owner: IControlOwner);
@@ -23,4 +24,5 @@ export declare class ClientSideEvents {
23
24
  raiseGotFocus(): void;
24
25
  raiseLostFocus(): void;
25
26
  raiseHorizontalRulerVisibleChanged(horizontalRulerVisible: boolean): void;
27
+ raiseViewTypeChanged(viewType: ViewType): void;
26
28
  }
@@ -59,4 +59,7 @@ export class ClientSideEvents {
59
59
  raiseHorizontalRulerVisibleChanged(horizontalRulerVisible) {
60
60
  this.owner.raiseHorizontalRulerVisibleChanged(horizontalRulerVisible);
61
61
  }
62
+ raiseViewTypeChanged(viewType) {
63
+ this.owner.raiseViewTypeChanged(viewType);
64
+ }
62
65
  }
@@ -78,8 +78,10 @@ export class DialogCustomNumberingListCommand extends ShowDialogCommandBase {
78
78
  paragraphManipulator.firstLineIndent.setValue(model, true, abstractNumberingListIndex, i, sourceLevel.firstLineIndent, true);
79
79
  paragraphManipulator.firstLineIndentType.setValue(model, true, abstractNumberingListIndex, i, sourceLevel.firstLineIndentType, true);
80
80
  const listLevelCharacterProperties = numberingListManipulator.listLevelCharacterProperties;
81
- const fontInfo = targetLevel.getCharacterProperties().fontInfo.clone();
81
+ const targetFontInfo = targetLevel.getCharacterProperties().fontInfo;
82
+ const fontInfo = targetFontInfo.clone();
82
83
  fontInfo.name = sourceLevel.fontName;
84
+ fontInfo.measurer = targetFontInfo.measurer;
83
85
  listLevelCharacterProperties.fontName.setValue(model, true, abstractNumberingListIndex, i, fontInfo, true);
84
86
  listLevelCharacterProperties.fontSize.setValue(model, true, abstractNumberingListIndex, i, sourceLevel.fontSize, true);
85
87
  listLevelCharacterProperties.fontBold.setValue(model, true, abstractNumberingListIndex, i, sourceLevel.fontStyle == 1, true);
@@ -170,6 +170,9 @@ export class PrintDocumentOnClient extends CommandBase {
170
170
  result[".dxreTableRowCursor, .dxreTableColumnCursor, br"] = [
171
171
  ['display', 'none']
172
172
  ];
173
+ result[`.${RendererClassNames.BOX}`] = [
174
+ ['print-color-adjust', 'exact']
175
+ ];
173
176
  this.fillZIndexStyles(result);
174
177
  return result;
175
178
  }
@@ -10,8 +10,7 @@ export class ToggleShowHorizontalRulerCommand extends CommandBase {
10
10
  return false;
11
11
  const toggledVisible = !visible;
12
12
  this.control.horizontalRulerControl.setVisible(toggledVisible);
13
- this.control.owner.adjustControl();
14
- this.control.owner.raiseHorizontalRulerVisibleChanged(toggledVisible);
13
+ this.control.onHorizontalRulerVisibleChanged(toggledVisible);
15
14
  return true;
16
15
  }
17
16
  isEnabled(_options) {
@@ -5,18 +5,13 @@ import { Paragraph } from '../../../model/paragraph/paragraph';
5
5
  import { SubDocument } from '../../../model/sub-document';
6
6
  import { HtmlBuilder } from './html-builder';
7
7
  import { IExportModelOptions } from '../../i-document-exporter';
8
- interface ListInterval {
9
- listStartValue: number;
10
- start: number;
11
- end: number;
12
- }
13
8
  interface List {
14
- parentList?: List;
9
+ parentList: List | null;
15
10
  numberingListIndex: number;
16
11
  listLevelIndex: number;
17
12
  start: number;
18
13
  end: number;
19
- intervals: ListInterval[];
14
+ startAt: number;
20
15
  paragraphsCount: number;
21
16
  }
22
17
  interface IHtmlExporterOptions {
@@ -41,6 +36,8 @@ export declare class HtmlExporter {
41
36
  private addParentTableRecursively;
42
37
  startList(model: DocumentModel, subDocument: SubDocument, interval: FixedInterval, builder: HtmlBuilder, lists: List[], position: number): void;
43
38
  private endList;
39
+ private startListItem;
40
+ private endListItem;
44
41
  private getHtmlText;
45
42
  private getBorderCssString;
46
43
  private getTableWidthUnitCssString;
@@ -25,7 +25,34 @@ import { HtmlConverter } from '../../../rich-utils/html-converter';
25
25
  import { HtmlBuilder } from './html-builder';
26
26
  import { isDefined } from '@devexpress/utils/lib/utils/common';
27
27
  import { createUrlValidationOptions, UrlUtils } from '../../../../common/utils/utils';
28
- import { ListUtils } from '@devexpress/utils/lib/utils/list';
28
+ class ListStack {
29
+ constructor() {
30
+ this._stack = [];
31
+ }
32
+ update(listIndex, listLevel) {
33
+ while (this._stack.length > 0) {
34
+ const last = this.peek();
35
+ if (last.numberingListIndex !== listIndex)
36
+ this.clear();
37
+ else if (last.listLevelIndex > listLevel)
38
+ this.pop();
39
+ else
40
+ break;
41
+ }
42
+ }
43
+ push(list) {
44
+ this._stack.push(list);
45
+ }
46
+ pop() {
47
+ return this._stack.pop();
48
+ }
49
+ peek() {
50
+ return this._stack.at(-1);
51
+ }
52
+ clear() {
53
+ this._stack = [];
54
+ }
55
+ }
29
56
  export class HtmlExporter {
30
57
  get modelManager() { return this.exportModelOptions.modelManager; }
31
58
  get colorProvider() { return this.modelManager.model.colorProvider; }
@@ -41,13 +68,13 @@ export class HtmlExporter {
41
68
  this.htmlExporterOptions = htmlExporterOptions;
42
69
  }
43
70
  getHtmlElementsByInterval(model, subDocument, interval, guidLabel) {
71
+ let resultBuilder = new HtmlBuilder();
44
72
  if (interval.length === 0)
45
- return;
73
+ return resultBuilder;
46
74
  const unitTypeToString = this.unitConverter.getUnits() == RichEditUnit.Centimeter ? "cm" : "in";
47
75
  const iterator = subDocument.getConstRunIterator(interval);
48
76
  let remainLength = interval.length;
49
77
  let currentPosition = interval.start;
50
- let resultBuilder = new HtmlBuilder();
51
78
  const paragraphs = this.getParagraphsByInterval(subDocument, interval);
52
79
  const lists = this.getListsByParagraphs(paragraphs);
53
80
  let isInsideFieldCode = false;
@@ -131,12 +158,18 @@ export class HtmlExporter {
131
158
  }
132
159
  this.startList(model, subDocument, interval, resultBuilder, lists, iterator.currentInterval().start);
133
160
  if (!isContinueMergingCell) {
134
- const maskedParagraphProperties = currentParagraph.getParagraphMergedProperties();
135
161
  let paragraphStyle = "";
136
- const firstLineIndentType = maskedParagraphProperties.firstLineIndentType;
137
- if (firstLineIndentType != ParagraphFirstLineIndent.None) {
138
- paragraphStyle += "text-indent: " + (firstLineIndentType == ParagraphFirstLineIndent.Hanging ? "-" : "") +
139
- this.unitConverter.twipsToUI(maskedParagraphProperties.firstLineIndent) + unitTypeToString + ";";
162
+ const maskedParagraphProperties = currentParagraph.getParagraphMergedProperties();
163
+ if (currentParagraph.isInList())
164
+ this.startListItem(resultBuilder, maskedParagraphProperties, unitTypeToString);
165
+ else {
166
+ const firstLineIndentType = maskedParagraphProperties.firstLineIndentType;
167
+ if (firstLineIndentType != ParagraphFirstLineIndent.None) {
168
+ paragraphStyle += "text-indent: " + (firstLineIndentType == ParagraphFirstLineIndent.Hanging ? "-" : "") +
169
+ this.unitConverter.twipsToUI(maskedParagraphProperties.firstLineIndent) + unitTypeToString + ";";
170
+ }
171
+ if (maskedParagraphProperties.leftIndent)
172
+ paragraphStyle += "margin-left: " + this.unitConverter.twipsToUI(maskedParagraphProperties.leftIndent) + unitTypeToString + ";";
140
173
  }
141
174
  if (maskedParagraphProperties.alignment !== undefined) {
142
175
  paragraphStyle += "text-align: ";
@@ -187,8 +220,6 @@ export class HtmlExporter {
187
220
  }
188
221
  if (ColorUtils.getAlpha(maskedParagraphProperties.shadingInfo.getActualColor(this.colorProvider)) > 0)
189
222
  paragraphStyle += "background: " + ColorHelper.getCssStringInternal(maskedParagraphProperties.shadingInfo.getActualColor(this.colorProvider)) + ";";
190
- if (maskedParagraphProperties.leftIndent)
191
- paragraphStyle += "margin-left: " + this.unitConverter.twipsToUI(maskedParagraphProperties.leftIndent) + unitTypeToString + ";";
192
223
  if (maskedParagraphProperties.rightIndent)
193
224
  paragraphStyle += "margin-right: " + this.unitConverter.twipsToUI(maskedParagraphProperties.rightIndent) + unitTypeToString + ";";
194
225
  paragraphStyle += "margin-top: " + this.unitConverter.twipsToUI(maskedParagraphProperties.spacingBefore) + unitTypeToString + ";";
@@ -210,8 +241,6 @@ export class HtmlExporter {
210
241
  const options = { textColor: charProps.textColor.toRgb(this.colorProvider) };
211
242
  paragraphStyle += HtmlConverter.getCssRules(charProps, options).join(";");
212
243
  }
213
- if (currentParagraph.isInList())
214
- resultBuilder.startChild('li');
215
244
  resultBuilder
216
245
  .startChild('p')
217
246
  .configure((e) => {
@@ -231,7 +260,7 @@ export class HtmlExporter {
231
260
  if (!isContinueMergingCell) {
232
261
  html.addCallback((builder) => builder.endChild('p'));
233
262
  if (run.paragraph.isInList()) {
234
- html.addCallback((builder) => builder.endChild('li'));
263
+ html.addCallback((builder) => this.endListItem(builder));
235
264
  html.addCallback((builder) => this.endList(model, builder, lists, iterator.currentInterval().end));
236
265
  }
237
266
  let paragraphEndPosition = run.paragraph.getEndPosition();
@@ -469,37 +498,49 @@ export class HtmlExporter {
469
498
  }
470
499
  getListsByParagraphs(paragraphs) {
471
500
  const listsInInterval = [];
472
- let previousList = null;
501
+ let currentListStack = new ListStack();
502
+ const listIndexToListMap = {};
473
503
  for (let i = 0, paragraph; paragraph = paragraphs[i]; i++) {
474
504
  if (paragraph.isInList()) {
475
505
  const numberingListIndex = paragraph.getNumberingListIndex();
476
506
  const listLevelIndex = paragraph.getListLevelIndex();
477
507
  const start = paragraph.startLogPosition.value;
478
508
  const end = paragraph.getEndPosition();
479
- let list = ListUtils.reverseElementBy(listsInInterval, (list) => {
480
- return list.listLevelIndex <= previousList?.listLevelIndex
481
- && list.numberingListIndex === numberingListIndex
482
- && list.listLevelIndex === listLevelIndex;
483
- });
484
- if (!list) {
485
- const parentList = previousList?.numberingListIndex === numberingListIndex ? previousList : null;
486
- list = { parentList, numberingListIndex, listLevelIndex, start, end, intervals: [], paragraphsCount: 0 };
487
- listsInInterval.push(list);
509
+ currentListStack.update(numberingListIndex, listLevelIndex);
510
+ let current = currentListStack.peek();
511
+ if (!current || current.listLevelIndex < listLevelIndex) {
512
+ let parentList = current || null;
513
+ const parentLevelIndex = parentList ? parentList.listLevelIndex : -1;
514
+ for (let levelIndex = parentLevelIndex + 1; levelIndex <= listLevelIndex; levelIndex++) {
515
+ current = {
516
+ startAt: 1,
517
+ parentList,
518
+ numberingListIndex,
519
+ listLevelIndex: levelIndex,
520
+ start,
521
+ end,
522
+ paragraphsCount: 0
523
+ };
524
+ listsInInterval.push(current);
525
+ currentListStack.push(current);
526
+ parentList = current;
527
+ }
528
+ const key = `${numberingListIndex}-${listLevelIndex}`;
529
+ const prevList = listIndexToListMap[key];
530
+ if (prevList)
531
+ current.startAt = prevList.startAt + prevList.paragraphsCount;
532
+ listIndexToListMap[key] = current;
488
533
  }
489
- list.paragraphsCount++;
490
- previousList = list;
491
- this.updateListIntervals(list, start, end);
534
+ current.paragraphsCount++;
535
+ this.updateListIntervals(current, start, end);
492
536
  }
537
+ else
538
+ currentListStack.clear();
493
539
  }
494
540
  return listsInInterval;
495
541
  }
496
542
  updateListIntervals(list, start, end) {
497
543
  list.end = end;
498
- const lastInterval = list.intervals.at(-1);
499
- if (lastInterval && lastInterval.end === start)
500
- lastInterval.end = end;
501
- else
502
- list.intervals.push({ start, end, listStartValue: list.paragraphsCount });
503
544
  if (list.parentList)
504
545
  this.updateListIntervals(list.parentList, start, end);
505
546
  }
@@ -540,7 +581,7 @@ export class HtmlExporter {
540
581
  startList(model, subDocument, interval, builder, lists, position) {
541
582
  if (!lists.length)
542
583
  return;
543
- const listsToStart = lists.filter(list => list.intervals.some(interval => interval.start === position));
584
+ const listsToStart = lists.filter(list => list.start === position);
544
585
  if (!listsToStart.length && position === interval.start) {
545
586
  const firstParagraph = subDocument.getParagraphByPosition(position);
546
587
  if (firstParagraph.getNumberingListIndex() === lists[0].numberingListIndex)
@@ -552,8 +593,7 @@ export class HtmlExporter {
552
593
  const format = level.getListLevelProperties().format;
553
594
  const listType = numberingList.getListType();
554
595
  const levelStart = level.getNewStart();
555
- const intervalStart = list.intervals.find(interval => interval.start === position).listStartValue;
556
- const listStart = Math.max(levelStart, intervalStart);
596
+ const listStart = Math.max(levelStart, list.startAt);
557
597
  let listStyleType = "";
558
598
  switch (format) {
559
599
  case NumberingFormat.Bullet:
@@ -577,10 +617,13 @@ export class HtmlExporter {
577
617
  default:
578
618
  break;
579
619
  }
620
+ let listStyles = [];
621
+ listStyles.push("list-style-type:" + listStyleType);
622
+ listStyles.push("padding-inline-start: unset");
580
623
  builder
581
624
  .startChild(listType !== NumberingType.Bullet ? "ol" : "ul")
582
625
  .configure((e) => {
583
- e.style.cssText = "list-style-type:" + listStyleType;
626
+ e.style.cssText = listStyles.join("; ");
584
627
  if (listStart > 1)
585
628
  e.setAttribute("start", listStart.toString());
586
629
  });
@@ -589,17 +632,32 @@ export class HtmlExporter {
589
632
  endList(model, builder, lists, endPosition) {
590
633
  for (let i = lists.length - 1; i >= 0; i--) {
591
634
  const list = lists[i];
592
- for (let j = list.intervals.length - 1; j >= 0; j--) {
593
- const interval = list.intervals[j];
594
- if (interval.end === endPosition) {
595
- const listType = model.numberingLists[list.numberingListIndex].getListType();
596
- builder.endChild(listType !== NumberingType.Bullet ? "ol" : "ul");
597
- list.intervals.splice(j, 1);
598
- }
599
- }
600
- if (list.intervals.length === 0)
635
+ if (list.end === endPosition) {
636
+ const listType = model.numberingLists[list.numberingListIndex].getListType();
637
+ builder.endChild(listType !== NumberingType.Bullet ? "ol" : "ul");
601
638
  lists.splice(i, 1);
639
+ }
640
+ }
641
+ }
642
+ startListItem(builder, paragraphProperties, unitType) {
643
+ const listStyle = [];
644
+ const firstLineIndentType = paragraphProperties.firstLineIndentType;
645
+ const firstLineIndent = paragraphProperties.firstLineIndent;
646
+ const leftIndent = paragraphProperties.leftIndent;
647
+ if (firstLineIndentType == ParagraphFirstLineIndent.Hanging) {
648
+ listStyle.push("padding-left: " + this.unitConverter.twipsToUI(firstLineIndent) + unitType);
649
+ listStyle.push("margin-left: " + this.unitConverter.twipsToUI(leftIndent) + unitType);
602
650
  }
651
+ else
652
+ listStyle.push("margin-left: " + this.unitConverter.twipsToUI(firstLineIndent + leftIndent) + unitType);
653
+ builder
654
+ .startChild('li')
655
+ .configure((e) => {
656
+ e.style.cssText = listStyle.join("; ");
657
+ });
658
+ }
659
+ endListItem(builder) {
660
+ builder.endChild('li');
603
661
  }
604
662
  getHtmlText(text) {
605
663
  const result = new HtmlBuilder();
@@ -5,6 +5,7 @@ import { ContextMenuBarBase } from '../bars/context-menu';
5
5
  import { FloatingObjectMovedArgumentInner } from '../commands/floating-objects/floating-object-drag-drop-change-position-command';
6
6
  import { IInternalApi } from '../internal-api';
7
7
  import { InformationData } from '../utils/information-creator';
8
+ import { ViewType } from '../view-settings/views-settings';
8
9
  export interface IControlOwner {
9
10
  readonly name: string;
10
11
  syncSessionGuid(sessionGuid: string): any;
@@ -41,6 +42,7 @@ export interface IControlOwner {
41
42
  raiseCustomCommandExecuted(command: any, parameter: any): any;
42
43
  raiseFloatingObjectMovedObject(args: FloatingObjectMovedArgumentInner): any;
43
44
  raiseHorizontalRulerVisibleChanged(horizontalRulerVisible: boolean): any;
45
+ raiseViewTypeChanged(viewType: ViewType): any;
44
46
  showPopupMenu(getPoint: (contextMenuBar: ContextMenuBarBase) => Point): any;
45
47
  hidePopupMenu(): any;
46
48
  isRibbon(element: HTMLElement): boolean;
@@ -96,6 +96,7 @@ export interface IRichEditControl extends IBatchUpdatableObject, IDisposable, IR
96
96
  closeDocument(): any;
97
97
  importHtml(elements: HTMLElement[]): any;
98
98
  onViewTypeChanged(): any;
99
+ onHorizontalRulerVisibleChanged(horizontalRulerVisible: boolean): any;
99
100
  getModifiedState(): IsModified;
100
101
  getGuidParams(): {
101
102
  sguid: string;
@@ -26,20 +26,29 @@ export class DragFloatingObjectsHelper {
26
26
  const delta = this.getDelta(evt);
27
27
  if (delta.isZero() || !evt.layoutPoint)
28
28
  return;
29
- let endPageIndex = evt.layoutPoint.pageIndex;
29
+ const endPageIndex = evt.layoutPoint.pageIndex;
30
30
  const newPosition = Point.minus(evt.layoutPoint, this.clickBoxDistance);
31
31
  const args = new FloatingObjectDragDropChangePositionCommandParameters(this.control, this.startPageIndex, endPageIndex, newPosition, evt.layoutPoint.point);
32
32
  this.control.commandManager.getCommand(RichEditClientCommand.FloatingObjectDragDropChangePosition)
33
33
  .execute(this.control.commandManager.isPublicApiCall, args);
34
34
  let finder;
35
+ let prevValidPageCount = -1;
35
36
  while (true) {
36
37
  finder = new LayoutAnchorObjectFinder(this.control.layout, this.control.selection.specialRunInfo.getPosition(), this.control.selection.activeSubDocument.id);
37
38
  if (finder.page)
38
39
  break;
39
- else
40
- this.control.layoutFormatterManager.forceFormatPage(this.control.layout.validPageCount);
40
+ else {
41
+ const pageToFormat = this.control.layout.validPageCount;
42
+ const formattedPage = this.control.layoutFormatterManager.forceFormatPage(pageToFormat);
43
+ if (!formattedPage || this.control.layout.validPageCount === prevValidPageCount)
44
+ break;
45
+ prevValidPageCount = this.control.layout.validPageCount;
46
+ }
41
47
  }
42
- this.resizeBoxVisualizer.show(finder.page.index, null, null, null, finder.obj);
48
+ if (finder?.page && finder?.obj)
49
+ this.resizeBoxVisualizer.show(finder.page.index, null, null, null, finder.obj);
50
+ else
51
+ this.resizeBoxVisualizer.hide();
43
52
  }
44
53
  rollback() {
45
54
  this.resizeBoxVisualizer.showAtPos(this.startPageIndex, this.boxPoint);
@@ -105,6 +105,7 @@ export declare abstract class RichEditCore implements IRichEditControl {
105
105
  importHtml(elements: HTMLElement[]): void;
106
106
  importInnerClipboard(exportedRangeCopy: RangeCopy, selection: Selection): FixedInterval;
107
107
  onViewTypeChanged(): void;
108
+ onHorizontalRulerVisibleChanged(horizontalRulerVisible: boolean): void;
108
109
  getModifiedState(): IsModified;
109
110
  setModifiedFalse(): void;
110
111
  getGuidParams(): {