devexpress-richedit 24.1.1-alpha-24085-0102 → 24.1.2-beta
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/bin/gulpfile.js +1 -1
- package/bin/index-custom.js +1 -1
- package/bin/localization-builder.js +1 -1
- package/bin/nspell-index.js +1 -1
- package/bin/nspell.webpack.config.js +1 -1
- package/bin/webpack-externals.js +3 -1
- package/bin/webpack.config.js +1 -1
- package/dist/dx.richedit.css +1 -0
- package/dist/dx.richedit.d.ts +17 -10
- package/dist/dx.richedit.js +52855 -51531
- package/dist/dx.richedit.min.js +2 -2
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/lib/client/bars/ribbon.js +2 -1
- package/lib/client/bars/rich-edit-ribbon/ribbon-items-data.js +2 -1
- package/lib/client/client-rich-edit.js +2 -1
- package/lib/client/commands/client-command-manager.js +2 -1
- package/lib/client/commands/commands.js +3 -0
- package/lib/client/commands/download-document-command.d.ts +3 -0
- package/lib/client/commands/download-document-command.js +13 -2
- package/lib/client/commands/export-document-command.js +4 -4
- package/lib/client/commands/mail-merge-command.js +7 -4
- package/lib/client/commands/open-document-command.d.ts +2 -1
- package/lib/client/commands/open-document-command.js +17 -12
- package/lib/client/default-localization.js +2 -1
- package/lib/client/dialogs/finish-and-merge-dialog.js +1 -0
- package/lib/client/document-processor/processor.d.ts +9 -2
- package/lib/client/document-processor/processor.js +18 -6
- package/lib/client/formats/docx/export/data.d.ts +4 -0
- package/lib/client/formats/docx/export/data.js +12 -0
- package/lib/client/formats/docx/export/exporter.d.ts +2 -0
- package/lib/client/formats/docx/export/exporter.js +15 -0
- package/lib/client/formats/docx/export/exporters/base/sections.js +5 -0
- package/lib/client/formats/docx/export/exporters/note-properties.d.ts +18 -0
- package/lib/client/formats/docx/export/exporters/note-properties.js +83 -0
- package/lib/client/formats/docx/export/exporters/settings.d.ts +2 -0
- package/lib/client/formats/docx/export/exporters/settings.js +11 -0
- package/lib/client/formats/docx/export/exporters/sub-document/base-sub-document.d.ts +15 -1
- package/lib/client/formats/docx/export/exporters/sub-document/base-sub-document.js +85 -3
- package/lib/client/formats/docx/export/exporters/sub-document/header-footer-sub-document-exporter.d.ts +2 -2
- package/lib/client/formats/docx/export/exporters/sub-document/header-footer-sub-document-exporter.js +2 -2
- package/lib/client/formats/docx/export/exporters/sub-document/main-sub-document.d.ts +2 -2
- package/lib/client/formats/docx/export/exporters/sub-document/main-sub-document.js +2 -2
- package/lib/client/formats/docx/export/exporters/sub-document/note-sub-document-exporter.d.ts +37 -0
- package/lib/client/formats/docx/export/exporters/sub-document/note-sub-document-exporter.js +71 -0
- package/lib/client/formats/docx/export/exporters/sub-document/text-box-content-exporter.d.ts +2 -2
- package/lib/client/formats/docx/export/exporters/sub-document/text-box-content-exporter.js +2 -2
- package/lib/client/formats/docx/import/destination/notes/endnotes/endnote-properties-destination.d.ts +16 -0
- package/lib/client/formats/docx/import/destination/notes/endnotes/endnote-properties-destination.js +48 -0
- package/lib/client/formats/docx/import/destination/notes/endnotes/endnote-reference-destination.d.ts +5 -0
- package/lib/client/formats/docx/import/destination/notes/endnotes/endnote-reference-destination.js +9 -0
- package/lib/client/formats/docx/import/destination/notes/endnotes/endnotes-destination.d.ts +5 -0
- package/lib/client/formats/docx/import/destination/notes/endnotes/endnotes-destination.js +39 -0
- package/lib/client/formats/docx/import/destination/notes/footnotes/footnote-properties-destination.d.ts +18 -0
- package/lib/client/formats/docx/import/destination/notes/footnotes/footnote-properties-destination.js +49 -0
- package/lib/client/formats/docx/import/destination/notes/footnotes/footnote-reference-destination.d.ts +5 -0
- package/lib/client/formats/docx/import/destination/notes/footnotes/footnote-reference-destination.js +9 -0
- package/lib/client/formats/docx/import/destination/notes/footnotes/footnotes-destination.d.ts +5 -0
- package/lib/client/formats/docx/import/destination/notes/footnotes/footnotes-destination.js +39 -0
- package/lib/client/formats/docx/import/destination/notes/note-destination.d.ts +18 -0
- package/lib/client/formats/docx/import/destination/notes/note-destination.js +45 -0
- package/lib/client/formats/docx/import/destination/notes/note-properties-destination.d.ts +32 -0
- package/lib/client/formats/docx/import/destination/notes/note-properties-destination.js +81 -0
- package/lib/client/formats/docx/import/destination/notes/note-reference-destination.d.ts +8 -0
- package/lib/client/formats/docx/import/destination/notes/note-reference-destination.js +21 -0
- package/lib/client/formats/docx/import/destination/notes/note-self-reference-destination.d.ts +5 -0
- package/lib/client/formats/docx/import/destination/notes/note-self-reference-destination.js +12 -0
- package/lib/client/formats/docx/import/destination/notes/note-separator-destination.d.ts +8 -0
- package/lib/client/formats/docx/import/destination/notes/note-separator-destination.js +20 -0
- package/lib/client/formats/docx/import/destination/paragraph-properties/paragraph-numbering-reference-destination.js +1 -1
- package/lib/client/formats/docx/import/destination/runs/run-destination.js +11 -5
- package/lib/client/formats/docx/import/destination/section/section-destination.js +5 -2
- package/lib/client/formats/docx/import/destination/settings/settings.js +4 -0
- package/lib/client/formats/docx/import/importer.d.ts +2 -0
- package/lib/client/formats/docx/import/importer.js +26 -0
- package/lib/client/formats/docx/import/importers/character-importer.d.ts +3 -0
- package/lib/client/formats/docx/import/importers/character-importer.js +12 -1
- package/lib/client/formats/docx/import/importers/end-notes-importer.d.ts +3 -4
- package/lib/client/formats/docx/import/importers/end-notes-importer.js +8 -3
- package/lib/client/formats/docx/import/importers/foot-notes-importer.d.ts +3 -5
- package/lib/client/formats/docx/import/importers/foot-notes-importer.js +8 -5
- package/lib/client/formats/docx/import/importers/notes-importer.d.ts +8 -0
- package/lib/client/formats/docx/import/importers/notes-importer.js +7 -0
- package/lib/client/formats/docx/translation-table/translation-tables.d.ts +7 -0
- package/lib/client/formats/docx/translation-table/translation-tables.js +27 -0
- package/lib/client/formats/docx/utils/constants.d.ts +2 -0
- package/lib/client/formats/docx/utils/constants.js +2 -0
- package/lib/client/model-api/formats/enum.d.ts +1 -0
- package/lib/client/model-api/formats/enum.js +1 -0
- package/lib/client/model-api/formats/exporter.d.ts +3 -4
- package/lib/client/model-api/formats/exporter.js +9 -6
- package/lib/client/model-api/formats/importer.js +2 -0
- package/lib/client/model-api/sub-document.d.ts +6 -2
- package/lib/client/model-api/sub-document.js +37 -35
- package/lib/client/model-api/table/table-borders.d.ts +1 -1
- package/lib/client/public/commands/enum.d.ts +1 -0
- package/lib/client/public/commands/enum.js +1 -0
- package/lib/client/public/document-processor.d.ts +3 -1
- package/lib/client/public/document-processor.js +2 -2
- package/lib/client/public/ribbon/item-ids.d.ts +1 -0
- package/lib/client/public/ribbon/item-ids.js +1 -0
- package/lib/client/public/rich-edit.d.ts +2 -1
- package/lib/client/public/rich-edit.js +16 -9
- package/lib/common/canvas/canvas-manager.js +2 -1
- package/lib/common/canvas/picture-renderer.d.ts +1 -1
- package/lib/common/canvas/renderes/common/document-renderer.d.ts +1 -1
- package/lib/common/canvas/renderes/common/document-renderer.js +6 -2
- package/lib/common/canvas/renderes/view-manager.js +3 -1
- package/lib/common/clipboard-content-inserter.js +2 -1
- package/lib/common/commands/client-command.d.ts +3 -1
- package/lib/common/commands/client-command.js +2 -0
- package/lib/common/commands/document/print-document-on-client-command.js +1 -1
- package/lib/common/commands/text/clipboard-commands.js +7 -5
- package/lib/common/document-format.d.ts +2 -0
- package/lib/common/document-format.js +2 -0
- package/lib/common/formats/document-importer-errors.d.ts +3 -1
- package/lib/common/formats/document-importer-errors.js +2 -0
- package/lib/common/formats/file-name-helper.d.ts +1 -0
- package/lib/common/formats/file-name-helper.js +7 -1
- package/lib/common/formats/html/export/get-html.d.ts +4 -0
- package/lib/common/formats/html/export/get-html.js +12 -0
- package/lib/common/formats/html/export/html-builder.d.ts +16 -0
- package/lib/common/formats/html/export/html-builder.js +98 -0
- package/lib/common/formats/html/export/html-document-exporter.d.ts +13 -0
- package/lib/common/formats/html/export/html-document-exporter.js +29 -0
- package/lib/common/formats/html/export/html-export.d.ts +25 -0
- package/lib/common/{html-export.js → formats/html/export/html-export.js} +115 -192
- package/lib/common/formats/html/import/html-document-importer.d.ts +15 -0
- package/lib/common/formats/html/import/html-document-importer.js +84 -0
- package/lib/common/formats/html/import/html-importer.d.ts +1 -0
- package/lib/common/formats/html/import/html-importer.js +13 -1
- package/lib/common/formats/html/import/insert-html.d.ts +4 -0
- package/lib/common/formats/html/import/insert-html.js +5 -0
- package/lib/common/formats/html/import/utils/paragraph-properties-utils.d.ts +1 -0
- package/lib/common/formats/html/import/utils/paragraph-properties-utils.js +17 -4
- package/lib/common/formats/i-document-exporter.d.ts +14 -0
- package/lib/common/formats/rtf/export/exporter.d.ts +1 -1
- package/lib/common/formats/rtf/export/exporter.js +1 -1
- package/lib/common/formats/rtf/importer-in-subdocument.d.ts +1 -1
- package/lib/common/formats/rtf/importer-in-subdocument.js +1 -1
- package/lib/common/formats/txt/txt-exporter.js +2 -1
- package/lib/common/input-controller.d.ts +2 -1
- package/lib/common/input-controller.js +5 -2
- package/lib/common/interfaces/i-rich-edit-core.d.ts +2 -0
- package/lib/common/layout/main-structures/layout-boxes/layout-anchored-picture-box.d.ts +2 -1
- package/lib/common/layout/main-structures/layout-boxes/layout-anchored-picture-box.js +4 -3
- package/lib/common/layout/main-structures/layout-boxes/layout-picture-box.d.ts +2 -1
- package/lib/common/layout/main-structures/layout-boxes/layout-picture-box.js +5 -4
- package/lib/common/layout/main-structures/layout-page.d.ts +1 -0
- package/lib/common/layout/main-structures/layout-page.js +5 -2
- package/lib/common/layout-formatter/box/generator/box-infos-generator.d.ts +1 -0
- package/lib/common/layout-formatter/box/generator/box-infos-generator.js +12 -2
- package/lib/common/layout-formatter/floating/page-anchored-object-holder.d.ts +5 -3
- package/lib/common/layout-formatter/floating/page-anchored-object-holder.js +7 -4
- package/lib/common/layout-formatter/formatter/base-formatter.js +0 -1
- package/lib/common/layout-formatter/formatter/main-formatter.js +1 -0
- package/lib/common/layout-formatter/managers/formatter-manager.d.ts +6 -2
- package/lib/common/layout-formatter/managers/formatter-manager.js +3 -1
- package/lib/common/layout-formatter/row/size-engine/row-sizes-manager.js +20 -4
- package/lib/common/measurer/measurer.js +2 -1
- package/lib/common/model/chunk.d.ts +1 -0
- package/lib/common/model/chunk.js +27 -2
- package/lib/common/model/document-model.d.ts +4 -0
- package/lib/common/model/document-model.js +4 -1
- package/lib/common/model/enums.d.ts +3 -1
- package/lib/common/model/enums.js +2 -0
- package/lib/common/model/footnotes/footnote.d.ts +46 -0
- package/lib/common/model/footnotes/footnote.js +100 -0
- package/lib/common/model/json/importers/sub-document/json-sub-document-importer.js +3 -3
- package/lib/common/model/json/importers/sub-document/run-importers.d.ts +6 -0
- package/lib/common/model/json/importers/sub-document/run-importers.js +9 -0
- package/lib/common/model/model-checks/position.d.ts +2 -1
- package/lib/common/model/model-checks/position.js +11 -2
- package/lib/common/model/numbering-lists/numbering-helper.d.ts +2 -1
- package/lib/common/model/numbering-lists/numbering-helper.js +3 -0
- package/lib/common/model/paragraph/paragraph-style.d.ts +1 -0
- package/lib/common/model/paragraph/paragraph-style.js +6 -2
- package/lib/common/model/properties-merger/paragraph-properties-merger.js +1 -1
- package/lib/common/model/runs/run-base.d.ts +1 -0
- package/lib/common/model/runs/simple-runs.d.ts +8 -2
- package/lib/common/model/runs/simple-runs.js +12 -6
- package/lib/common/model/section/section-properties.d.ts +3 -0
- package/lib/common/model/special-characters.d.ts +3 -0
- package/lib/common/model/special-characters.js +3 -0
- package/lib/common/model/sub-document-infos.d.ts +18 -0
- package/lib/common/model/sub-document-infos.js +39 -0
- package/lib/common/model/sub-document.d.ts +2 -0
- package/lib/common/model/sub-document.js +18 -16
- package/lib/common/mouse-handler/touch-handler/touch-handler-state-base.d.ts +1 -0
- package/lib/common/mouse-handler/touch-handler/touch-handler-state-base.js +21 -13
- package/lib/common/processor.d.ts +2 -0
- package/lib/common/rich-edit-core.d.ts +6 -2
- package/lib/common/rich-edit-core.js +20 -1
- package/lib/common/selection/selection-intervals-info.js +1 -1
- package/lib/common/utils/_license.d.ts +1 -0
- package/lib/common/utils/_license.js +2 -0
- package/lib/common/utils/size-utils.d.ts +3 -0
- package/lib/common/utils/size-utils.js +17 -4
- package/package.json +3 -3
- package/lib/common/html-export.d.ts +0 -32
@@ -37,6 +37,12 @@ export class SubDocument {
|
|
37
37
|
getFirstChunk() {
|
38
38
|
return this.chunks[0];
|
39
39
|
}
|
40
|
+
getLastParagraph() {
|
41
|
+
return this.paragraphs[this.paragraphs.length - 1];
|
42
|
+
}
|
43
|
+
getFirstParagraph() {
|
44
|
+
return this.paragraphs[0];
|
45
|
+
}
|
40
46
|
getText(interval = new FixedInterval(0, this.getDocumentEndPosition())) {
|
41
47
|
var buffer = "";
|
42
48
|
var chunkIndex = SearchUtils.normedInterpolationIndexOf(this.chunks, (c) => c.startLogPosition.value, interval.start);
|
@@ -407,8 +413,8 @@ export class SubDocumentPosition {
|
|
407
413
|
this.position = position;
|
408
414
|
}
|
409
415
|
validateInterval() {
|
410
|
-
const
|
411
|
-
this.position = Math.min(
|
416
|
+
const documentEndPosition = this.subDocument.getDocumentEndPosition();
|
417
|
+
this.position = Math.min(this.position, documentEndPosition - 1);
|
412
418
|
}
|
413
419
|
clone() {
|
414
420
|
return new SubDocumentPosition(this.subDocument, this.position);
|
@@ -431,11 +437,7 @@ export class SubDocumentInterval {
|
|
431
437
|
return new SubDocumentInterval(this.subDocument, this.interval.clone());
|
432
438
|
}
|
433
439
|
validateInterval() {
|
434
|
-
|
435
|
-
if (this.interval.start == 0 && this.interval.end == docEnd)
|
436
|
-
return;
|
437
|
-
this.interval.start = Math.min(docEnd, this.interval.start);
|
438
|
-
this.interval.end = Math.min(docEnd, this.interval.end);
|
440
|
+
internalValidateInterval(this.subDocument, this.interval);
|
439
441
|
}
|
440
442
|
equals(obj) {
|
441
443
|
return obj &&
|
@@ -450,15 +452,8 @@ export class SubDocumentIntervals {
|
|
450
452
|
}
|
451
453
|
get multiselection() { return this.intervals.length > 1; }
|
452
454
|
validateInterval() {
|
453
|
-
|
454
|
-
|
455
|
-
if (curr.start == 0 && curr.end == docEnd)
|
456
|
-
continue;
|
457
|
-
const start = Math.min(docEnd - 1, curr.start);
|
458
|
-
const end = Math.min(docEnd - 1, curr.end);
|
459
|
-
curr.start = start;
|
460
|
-
curr.end = end;
|
461
|
-
}
|
455
|
+
for (let interval of this.intervals)
|
456
|
+
internalValidateInterval(this.subDocument, interval);
|
462
457
|
}
|
463
458
|
clone() {
|
464
459
|
return new SubDocumentIntervals(this.subDocument, ListUtils.deepCopy(this.intervals));
|
@@ -472,3 +467,10 @@ export class SubDocumentIntervals {
|
|
472
467
|
return new SubDocumentIntervals(subDocument, [new FixedInterval(pos, 0)]);
|
473
468
|
}
|
474
469
|
}
|
470
|
+
function internalValidateInterval(subDocument, interval) {
|
471
|
+
const documentEndPosition = subDocument.getDocumentEndPosition();
|
472
|
+
if (interval.start == 0 && interval.end == documentEndPosition)
|
473
|
+
return;
|
474
|
+
interval.start = Math.min(interval.start, documentEndPosition - 1);
|
475
|
+
interval.end = Math.min(interval.end, documentEndPosition);
|
476
|
+
}
|
@@ -15,6 +15,7 @@ export declare class TouchHandlerStateBase extends ManipulatorHandlerStateBase<T
|
|
15
15
|
showPopupMenu(): void;
|
16
16
|
setEditableDocumentContent(): void;
|
17
17
|
setLastLayoutPosition(): void;
|
18
|
+
private createLayoutPosition;
|
18
19
|
}
|
19
20
|
export declare class TouchHandlerBeginDragHelperState extends TouchHandlerStateBase {
|
20
21
|
dragState: TouchHandlerStateBase;
|
@@ -4,6 +4,8 @@ import { LayoutWordBounds } from '../../word-bounds-engine/layout-word-bounds';
|
|
4
4
|
import { Browser } from '@devexpress/utils/lib/browser';
|
5
5
|
import { FixedInterval } from '@devexpress/utils/lib/intervals/fixed';
|
6
6
|
import { ManipulatorHandlerStateBase } from '../base/manipulator-handler-state-base';
|
7
|
+
import { SubDocumentPosition } from '../../../common/model/sub-document';
|
8
|
+
import { LayoutBoxType } from '../../../common/layout/main-structures/layout-boxes/layout-box';
|
7
9
|
export class TouchHandlerStateBase extends ManipulatorHandlerStateBase {
|
8
10
|
constructor() {
|
9
11
|
super(...arguments);
|
@@ -27,15 +29,15 @@ export class TouchHandlerStateBase extends ManipulatorHandlerStateBase {
|
|
27
29
|
if (!Browser.IE && !Browser.Edge) {
|
28
30
|
var subDocument = this.handler.control.selection.activeSubDocument;
|
29
31
|
let position = this.handler.control.selection.lastSelectedInterval.start;
|
30
|
-
let startInterval = LayoutWordBounds.getLayoutWordStartBound(this.handler.control.layout,
|
31
|
-
let startIntervalLayoutPosition = (subDocument.
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
let endInterval = LayoutWordBounds.getLayoutWordEndBound(this.handler.control.layout,
|
38
|
-
let textUnderCursor = position >= startInterval && position <= endInterval ?
|
32
|
+
let startInterval = LayoutWordBounds.getLayoutWordStartBound(this.handler.control.layout, subDocument, this.handler.control.selection, position);
|
33
|
+
let startIntervalLayoutPosition = this.createLayoutPosition(new SubDocumentPosition(subDocument, startInterval), DocumentLayoutDetailsLevel.Box);
|
34
|
+
if (startIntervalLayoutPosition.isLastBoxInRow()) {
|
35
|
+
const prevPosition = this.createLayoutPosition(new SubDocumentPosition(subDocument, position - 1), DocumentLayoutDetailsLevel.Box);
|
36
|
+
if (prevPosition.detailsLevel !== DocumentLayoutDetailsLevel.Box || prevPosition.box.getType() !== LayoutBoxType.PageBreak)
|
37
|
+
startInterval = LayoutWordBounds.getLayoutWordStartBound(this.handler.control.layout, subDocument, this.handler.control.selection, position - 1);
|
38
|
+
}
|
39
|
+
let endInterval = LayoutWordBounds.getLayoutWordEndBound(this.handler.control.layout, subDocument, this.handler.control.selection, startInterval, false);
|
40
|
+
let textUnderCursor = position >= startInterval && position <= endInterval ? subDocument.getText(new FixedInterval(startInterval, endInterval - startInterval)) : "";
|
39
41
|
this.handler.control.inputController.setEditableDocumentContent(textUnderCursor);
|
40
42
|
if (textUnderCursor.length)
|
41
43
|
this.handler.control.inputController.setEditableDocumentCursorPosition(position - startInterval);
|
@@ -44,10 +46,16 @@ export class TouchHandlerStateBase extends ManipulatorHandlerStateBase {
|
|
44
46
|
setLastLayoutPosition() {
|
45
47
|
var subDocument = this.handler.control.selection.activeSubDocument;
|
46
48
|
var logPosition = this.handler.control.selection.lastSelectedInterval.start;
|
47
|
-
this.lastLayoutPosition = (subDocument.
|
48
|
-
|
49
|
-
|
50
|
-
|
49
|
+
this.lastLayoutPosition = this.createLayoutPosition(new SubDocumentPosition(subDocument, logPosition), DocumentLayoutDetailsLevel.Character, true);
|
50
|
+
}
|
51
|
+
createLayoutPosition(subDocPos, detailsLevel, useNextBoxBounds = false) {
|
52
|
+
const subDocument = subDocPos.subDocument;
|
53
|
+
const position = subDocPos.position;
|
54
|
+
const endRowConflictFlags = new LayoutPositionCreatorConflictFlags().setDefault(this.handler.control.selection.endOfLine);
|
55
|
+
const middleRowConflictFlags = new LayoutPositionCreatorConflictFlags().setDefault(useNextBoxBounds);
|
56
|
+
return (subDocument.isMain()
|
57
|
+
? new LayoutPositionMainSubDocumentCreator(this.handler.control.layout, subDocument, position, detailsLevel)
|
58
|
+
: new LayoutPositionOtherSubDocumentCreator(this.handler.control.layout, subDocument, position, this.handler.control.selection.pageIndex, detailsLevel)).create(endRowConflictFlags, middleRowConflictFlags);
|
51
59
|
}
|
52
60
|
}
|
53
61
|
export class TouchHandlerBeginDragHelperState extends TouchHandlerStateBase {
|
@@ -3,10 +3,12 @@ import { FormatterManager } from './layout-formatter/managers/formatter-manager'
|
|
3
3
|
import { IModelManager } from './model-manager';
|
4
4
|
import { FieldRequestManager } from './model/fields/field-request-manager';
|
5
5
|
import { ISelectionBase } from './selection/selection-base';
|
6
|
+
import { IExportModelOptions } from './formats/i-document-exporter';
|
6
7
|
export interface IProcessor extends IBatchUpdatableObject {
|
7
8
|
selection: ISelectionBase;
|
8
9
|
modelManager: IModelManager;
|
9
10
|
layoutFormatterManager: FormatterManager;
|
11
|
+
getExportModelOptions(initOptions?: Partial<IExportModelOptions>): IExportModelOptions;
|
10
12
|
createFieldRequestManager(): FieldRequestManager;
|
11
13
|
invalidateLayoutAfterFontsLoaded(): any;
|
12
14
|
}
|
@@ -36,6 +36,7 @@ import { SelectionModelChangesListener } from './selection/selection-model-chang
|
|
36
36
|
import { IRulerControl } from './ui/ruler/ruler';
|
37
37
|
import { RulerSettings } from './ui/ruler/settings';
|
38
38
|
import { SearchManager } from './ui/search-manager';
|
39
|
+
import { IExportModelOptions } from './formats/i-document-exporter';
|
39
40
|
export declare abstract class RichEditCore implements IRichEditControl {
|
40
41
|
modelManager: IModelManager;
|
41
42
|
barHolder: IBarHolder;
|
@@ -113,6 +114,7 @@ export declare abstract class RichEditCore implements IRichEditControl {
|
|
113
114
|
isRibbon(element: HTMLElement): boolean;
|
114
115
|
isClosed(): boolean;
|
115
116
|
invalidateLayoutAfterFontsLoaded(): void;
|
117
|
+
getExportModelOptions(initOptions?: Partial<IExportModelOptions>): IExportModelOptions;
|
116
118
|
protected abstract createSpellChecker(): any;
|
117
119
|
protected createViewElement(id: string, element: HTMLElement): HTMLDivElement;
|
118
120
|
private isUsedInnerClipboard;
|
@@ -122,12 +124,14 @@ export declare class DocumentInfo {
|
|
122
124
|
static defaultDocumentName: string;
|
123
125
|
static defaultDocumentFormat: DocumentFormat;
|
124
126
|
private _fileName;
|
125
|
-
private _documentFormat
|
127
|
+
private _documentFormat?;
|
128
|
+
private _documentExtension;
|
126
129
|
readonly documentHasSource: boolean;
|
127
130
|
get fileName(): string;
|
128
131
|
set fileName(val: string);
|
129
132
|
get documentFormat(): DocumentFormat;
|
130
133
|
set documentFormat(val: DocumentFormat);
|
131
|
-
|
134
|
+
get documentExtension(): string;
|
135
|
+
constructor(fileName: string, documentHasSource: boolean, documentFormat?: DocumentFormat, documentExtension?: string);
|
132
136
|
getFileNameForDownload(fileName?: string): string;
|
133
137
|
}
|
@@ -43,6 +43,7 @@ import { SelectionModelChangesListener } from './selection/selection-model-chang
|
|
43
43
|
import { SpellCheckerSelectionChangesListener } from './spelling/spell-checker-selection-changes-listener';
|
44
44
|
import { HorizontalRulerControl } from './ui/ruler/ruler';
|
45
45
|
import { SearchManager } from './ui/search-manager';
|
46
|
+
import { isDefined } from '@devexpress/utils/lib/utils/common';
|
46
47
|
export class RichEditCore {
|
47
48
|
constructor(owner, name, element, clientGuid, readOnly, barHolder, unitsType, rulerSettings, richOptions, viewsSettings, stringResources) {
|
48
49
|
this.isLoadingPictureFromClipboard = false;
|
@@ -167,6 +168,7 @@ export class RichEditCore {
|
|
167
168
|
this.registerActiveContextTabManager();
|
168
169
|
this.modelManager.modelManipulator.modelListeners.push(this.globalEventDispatcher);
|
169
170
|
this.modelManager.modelManipulator.modelListeners.push(this.barHolder.publicUiChangesListener);
|
171
|
+
this.inputController.initExporter();
|
170
172
|
}
|
171
173
|
dispose() {
|
172
174
|
var _a, _b;
|
@@ -376,10 +378,24 @@ export class RichEditCore {
|
|
376
378
|
this.layoutFormatterManager.invalidator.onChangedAllLayout();
|
377
379
|
}
|
378
380
|
}
|
381
|
+
getExportModelOptions(initOptions = {}) {
|
382
|
+
return {
|
383
|
+
modelManager: isDefined(initOptions.modelManager) ? initOptions.modelManager : this.modelManager,
|
384
|
+
pictureRenderer: this.viewManager.renderer,
|
385
|
+
uiUnitConverter: this.uiUnitConverter,
|
386
|
+
lastMaxNumPages: this.layout.lastMaxNumPages,
|
387
|
+
pageIndex: this.selection.pageIndex,
|
388
|
+
sessionGuid: this.sessionGuid,
|
389
|
+
clientGuid: this.clientGuid,
|
390
|
+
documentFormat: isDefined(initOptions.documentFormat) ? initOptions.documentFormat : this.getExportDocumentFormat(),
|
391
|
+
};
|
392
|
+
}
|
379
393
|
createViewElement(id, element) {
|
380
394
|
const viewElement = document.createElement("DIV");
|
381
395
|
viewElement.id = id + "_View";
|
382
396
|
viewElement.className = "dxreView";
|
397
|
+
viewElement.tabIndex = 0;
|
398
|
+
viewElement.setAttribute("role", "document");
|
383
399
|
element.appendChild(viewElement);
|
384
400
|
return viewElement;
|
385
401
|
}
|
@@ -393,9 +409,10 @@ export class RichEditCore {
|
|
393
409
|
}
|
394
410
|
}
|
395
411
|
export class DocumentInfo {
|
396
|
-
constructor(fileName, documentHasSource, documentFormat = DocumentInfo.defaultDocumentFormat) {
|
412
|
+
constructor(fileName, documentHasSource, documentFormat = DocumentInfo.defaultDocumentFormat, documentExtension = FileNameHelper.convertToString(documentFormat)) {
|
397
413
|
this._fileName = fileName;
|
398
414
|
this._documentFormat = documentFormat;
|
415
|
+
this._documentExtension = documentExtension;
|
399
416
|
this.documentHasSource = documentHasSource;
|
400
417
|
}
|
401
418
|
get fileName() { return this._fileName; }
|
@@ -406,7 +423,9 @@ export class DocumentInfo {
|
|
406
423
|
this._documentFormat = FileNameHelper.convertExtensionToDocumentFormat(val);
|
407
424
|
else
|
408
425
|
this._documentFormat = val;
|
426
|
+
this._documentExtension = FileNameHelper.convertToString(val);
|
409
427
|
}
|
428
|
+
get documentExtension() { return this._documentExtension; }
|
410
429
|
getFileNameForDownload(fileName) {
|
411
430
|
if (!StringUtils.isNullOrEmpty(fileName))
|
412
431
|
return fileName;
|
@@ -47,7 +47,7 @@ export class SelectionIntervalsInfo {
|
|
47
47
|
const docEnd = this.subDocument.getDocumentEndPosition();
|
48
48
|
for (let curr of this.intervals) {
|
49
49
|
curr.start = Math.max(docEnd - 1, curr.start);
|
50
|
-
curr.end = Math.max(docEnd
|
50
|
+
curr.end = Math.max(docEnd, curr.end);
|
51
51
|
}
|
52
52
|
}
|
53
53
|
equals(obj) {
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -1,4 +1,7 @@
|
|
1
1
|
export declare class SizeUtils {
|
2
2
|
static getClientWidth(element: Element): number;
|
3
3
|
static getClientHeight(element: Element): number;
|
4
|
+
static getOffsetSize(element: Element): DOMRect;
|
5
|
+
static getOffsetWidth(element: Element): number;
|
6
|
+
static getOffsetHeight(element: Element): number;
|
4
7
|
}
|
@@ -1,12 +1,25 @@
|
|
1
1
|
export class SizeUtils {
|
2
2
|
static getClientWidth(element) {
|
3
|
-
const width = element.getBoundingClientRect().width;
|
4
3
|
const style = getComputedStyle(element);
|
5
|
-
|
4
|
+
const offset = parseFloat(style.borderLeftWidth) + parseFloat(style.borderRightWidth) + parseFloat(style.paddingLeft) + parseFloat(style.paddingRight);
|
5
|
+
const sizeWithScrollBar = SizeUtils.getOffsetWidth(element) - offset;
|
6
|
+
const scrollBarSize = Math.round(sizeWithScrollBar) - element.clientWidth;
|
7
|
+
return sizeWithScrollBar - scrollBarSize;
|
6
8
|
}
|
7
9
|
static getClientHeight(element) {
|
8
|
-
const width = element.getBoundingClientRect().height;
|
9
10
|
const style = getComputedStyle(element);
|
10
|
-
|
11
|
+
const offset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth) + parseFloat(style.paddingTop) + parseFloat(style.paddingBottom);
|
12
|
+
const sizeWithScrollBar = SizeUtils.getOffsetHeight(element) - offset;
|
13
|
+
const scrollBarSize = Math.round(sizeWithScrollBar) - element.clientHeight;
|
14
|
+
return sizeWithScrollBar - scrollBarSize;
|
15
|
+
}
|
16
|
+
static getOffsetSize(element) {
|
17
|
+
return element.getBoundingClientRect();
|
18
|
+
}
|
19
|
+
static getOffsetWidth(element) {
|
20
|
+
return SizeUtils.getOffsetSize(element).width;
|
21
|
+
}
|
22
|
+
static getOffsetHeight(element) {
|
23
|
+
return SizeUtils.getOffsetSize(element).height;
|
11
24
|
}
|
12
25
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "devexpress-richedit",
|
3
|
-
"version": "24.1.
|
3
|
+
"version": "24.1.2-beta",
|
4
4
|
"homepage": "https://www.devexpress.com/",
|
5
5
|
"bugs": "https://www.devexpress.com/support/",
|
6
6
|
"author": "Developer Express Inc.",
|
@@ -14,8 +14,8 @@
|
|
14
14
|
"build-nspell": "webpack --mode production --config=bin/nspell.webpack.config.js"
|
15
15
|
},
|
16
16
|
"peerDependencies": {
|
17
|
-
"devextreme": "24.1.
|
18
|
-
"devextreme-dist": "24.1.
|
17
|
+
"devextreme": "24.1.2-beta",
|
18
|
+
"devextreme-dist": "24.1.2-beta"
|
19
19
|
},
|
20
20
|
"dependencies": {
|
21
21
|
"jszip": "~3.10.1",
|
@@ -1,32 +0,0 @@
|
|
1
|
-
import { DocumentModel } from './model/document-model';
|
2
|
-
import { RangeCopy } from './model/manipulators/range/create-range-copy-operation';
|
3
|
-
import { SubDocument } from './model/sub-document';
|
4
|
-
import { FixedInterval } from '@devexpress/utils/lib/intervals/fixed';
|
5
|
-
import { IRichEditControl } from './interfaces/i-rich-edit-core';
|
6
|
-
export declare class HtmlBuilder {
|
7
|
-
_getHtmlString(): string;
|
8
|
-
private _currentElement;
|
9
|
-
childElements: Array<Element | string>;
|
10
|
-
callbacks: Array<(target: HtmlBuilder) => void>;
|
11
|
-
isEmpty(): boolean;
|
12
|
-
clear(): this;
|
13
|
-
startChild(tagName: string, namespaceUri?: string): this;
|
14
|
-
configure<T extends Element = HTMLElement>(config: (element: T) => void): this;
|
15
|
-
addCallback(callback: (target: HtmlBuilder) => void): void;
|
16
|
-
assignFrom(builder: HtmlBuilder | string): this;
|
17
|
-
addElement(element: Element | string): this;
|
18
|
-
endChild(tagName: string): this;
|
19
|
-
}
|
20
|
-
export declare class HtmlExporter {
|
21
|
-
control: IRichEditControl;
|
22
|
-
rangeCopy: RangeCopy;
|
23
|
-
private get colorProvider();
|
24
|
-
constructor(control: IRichEditControl);
|
25
|
-
getHtmlElementsByInterval(model: DocumentModel, subDocument: SubDocument, interval: FixedInterval, guidLabel: string): HtmlBuilder;
|
26
|
-
private getHtmlText;
|
27
|
-
private getBorderCssString;
|
28
|
-
private getTableWidthUnitCssString;
|
29
|
-
private getTableStyle;
|
30
|
-
private getCellStyle;
|
31
|
-
private getTextBoxStyleString;
|
32
|
-
}
|