devexpress-richedit 24.1.11-build-25065-0103 → 24.1.12-build-25093-0104
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 +1 -1
- package/bin/webpack.config.js +1 -1
- package/dist/dx.richedit.d.ts +1 -1
- package/dist/dx.richedit.js +165 -85
- package/dist/dx.richedit.min.js +2 -2
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/lib/client/bars/ribbon.d.ts +1 -0
- package/lib/client/bars/ribbon.js +3 -1
- package/lib/client/client-rich-edit.js +2 -2
- package/lib/client/utils/focus-helper.d.ts +4 -0
- package/lib/client/utils/focus-helper.js +36 -0
- package/lib/common/canvas/canvas-scroll-manager.d.ts +0 -1
- package/lib/common/canvas/canvas-scroll-manager.js +1 -11
- package/lib/common/canvas/canvas-size-info.d.ts +3 -3
- package/lib/common/canvas/canvas-size-info.js +19 -13
- package/lib/common/canvas/renderes/view-manager.js +1 -5
- package/lib/common/commands/layout/apply-style-command.d.ts +12 -7
- package/lib/common/commands/layout/apply-style-command.js +44 -36
- package/lib/common/commands/toc/set-paragraph-level-command.d.ts +2 -0
- package/lib/common/commands/toc/set-paragraph-level-command.js +13 -7
- package/lib/common/layout/main-structures/layout-row.d.ts +2 -1
- package/lib/common/layout/main-structures/layout-row.js +3 -1
- package/lib/common/layout-formatter/row/result.js +2 -1
- package/lib/common/layout-formatter/row/tab-info.js +3 -1
- package/lib/common/model/paragraph/paragraph-style.js +1 -1
- package/lib/common/model/section/section-properties.js +5 -0
- package/lib/common/utils/size-utils.d.ts +8 -0
- package/lib/common/utils/size-utils.js +32 -8
- package/package.json +3 -3
package/bin/gulpfile.js
CHANGED
package/bin/index-custom.js
CHANGED
package/bin/nspell-index.js
CHANGED
package/bin/webpack-externals.js
CHANGED
package/bin/webpack.config.js
CHANGED
package/dist/dx.richedit.d.ts
CHANGED
package/dist/dx.richedit.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/**
|
2
2
|
* DevExpress WebRichEdit (dx.richedit.js)
|
3
|
-
* Version: 24.1.
|
3
|
+
* Version: 24.1.12
|
4
4
|
* Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
|
5
5
|
* License: https://www.devexpress.com/Support/EULAs
|
6
6
|
*/
|
@@ -19609,7 +19609,7 @@ class ParagraphStyle extends StyleBase {
|
|
19609
19609
|
}
|
19610
19610
|
}
|
19611
19611
|
ParagraphStyle.normalStyleName = "Normal";
|
19612
|
-
ParagraphStyle.headingStyleName = "
|
19612
|
+
ParagraphStyle.headingStyleName = "Heading";
|
19613
19613
|
ParagraphStyle.tocStyleName = "toc";
|
19614
19614
|
class TabProperties {
|
19615
19615
|
constructor() {
|
@@ -25480,6 +25480,7 @@ class LineNumberingProperties {
|
|
25480
25480
|
|
25481
25481
|
|
25482
25482
|
|
25483
|
+
|
25483
25484
|
class SectionProperties {
|
25484
25485
|
constructor() {
|
25485
25486
|
this.margins = new margins/* Margins */.m(1440, 1440, 1440, 1440);
|
@@ -25497,6 +25498,8 @@ class SectionProperties {
|
|
25497
25498
|
this.firstPageNumber = -1;
|
25498
25499
|
this.continueNumbering = true;
|
25499
25500
|
this.lineNumbering = new LineNumberingProperties();
|
25501
|
+
this.footNote = NoteProperties.createDefault();
|
25502
|
+
this.endNote = NoteProperties.createDefault();
|
25500
25503
|
}
|
25501
25504
|
static createSimpleSectionProperties(width, height) {
|
25502
25505
|
const simpleSectionProperties = new SectionProperties();
|
@@ -25539,6 +25542,8 @@ class SectionProperties {
|
|
25539
25542
|
else
|
25540
25543
|
this.columnsInfo = obj.columnsInfo;
|
25541
25544
|
this.lineNumbering.copyFrom(obj.lineNumbering);
|
25545
|
+
this.footNote.copyFrom(obj.footNote);
|
25546
|
+
this.endNote.copyFrom(obj.endNote);
|
25542
25547
|
this.equalWidthColumns = obj.equalWidthColumns;
|
25543
25548
|
this.marginBottom = obj.marginBottom;
|
25544
25549
|
this.marginLeft = obj.marginLeft;
|
@@ -92572,6 +92577,7 @@ class LayoutPageArea extends rectangle.Rectangle {
|
|
92572
92577
|
|
92573
92578
|
|
92574
92579
|
|
92580
|
+
|
92575
92581
|
var LayoutRowStateFlags;
|
92576
92582
|
(function (LayoutRowStateFlags) {
|
92577
92583
|
LayoutRowStateFlags[LayoutRowStateFlags["NormallyEnd"] = 0] = "NormallyEnd";
|
@@ -92582,6 +92588,7 @@ var LayoutRowStateFlags;
|
|
92582
92588
|
LayoutRowStateFlags[LayoutRowStateFlags["DocumentEnd"] = 16] = "DocumentEnd";
|
92583
92589
|
LayoutRowStateFlags[LayoutRowStateFlags["CellTableEnd"] = 64] = "CellTableEnd";
|
92584
92590
|
LayoutRowStateFlags[LayoutRowStateFlags["PageBreakBefore"] = 128] = "PageBreakBefore";
|
92591
|
+
LayoutRowStateFlags[LayoutRowStateFlags["InfinityWidth"] = 256] = "InfinityWidth";
|
92585
92592
|
})(LayoutRowStateFlags || (LayoutRowStateFlags = {}));
|
92586
92593
|
class layout_row_LayoutRow extends rectangle.Rectangle {
|
92587
92594
|
constructor(minY = Number.MAX_SAFE_INTEGER) {
|
@@ -92697,7 +92704,7 @@ class layout_row_LayoutRow extends rectangle.Rectangle {
|
|
92697
92704
|
return lastBoxIndexWhatCanStrikeoutAndUnderline;
|
92698
92705
|
}
|
92699
92706
|
containsSpacesOnly() {
|
92700
|
-
return this.boxes.length > 0 && utils_list.ListUtils.allOf(this.boxes, val => val.isWhitespace());
|
92707
|
+
return this.boxes.length > 0 && utils_list.ListUtils.allOf(this.boxes, val => val.isWhitespace() || val.getType() === LayoutBoxType.ParagraphMark);
|
92701
92708
|
}
|
92702
92709
|
}
|
92703
92710
|
class LayoutRowWithIndex extends (/* unused pure expression or super */ null && (layout_row_LayoutRow)) {
|
@@ -93801,7 +93808,8 @@ class RowFormatterResult {
|
|
93801
93808
|
return;
|
93802
93809
|
this.rowFormatter.tabInfo.shiftBoxesAfterLastTab();
|
93803
93810
|
const dontJustifyLinesEndingInSoftLineBreak = this.rowFormatter.manager.model.compatibilitySettings.dontJustifyLinesEndingInSoftLineBreak;
|
93804
|
-
|
93811
|
+
if (!this.row.flags.get(LayoutRowStateFlags.InfinityWidth))
|
93812
|
+
BoxAligner.align(this.row, this.rowFormatter.paragraphProps.alignment, currLogicRowEndPos, this.rowBoxIndexStart, dontJustifyLinesEndingInSoftLineBreak);
|
93805
93813
|
this.rowBoxIndexStart = this.row.boxes.length;
|
93806
93814
|
}
|
93807
93815
|
deleteSomeAnchorObjects(index, posToRestart) {
|
@@ -95501,6 +95509,7 @@ class RowEndedWithPageBreakState extends RowEndedWithParagraphMarkFormatterState
|
|
95501
95509
|
|
95502
95510
|
|
95503
95511
|
|
95512
|
+
|
95504
95513
|
class RowTabInfo {
|
95505
95514
|
constructor(rowFormatter, paragraphHorizontalBoundsStart) {
|
95506
95515
|
this.rowFormatter = rowFormatter;
|
@@ -95571,9 +95580,10 @@ class RowTabInfo {
|
|
95571
95580
|
if (tabXPosRelativePage > lastInterval.end) {
|
95572
95581
|
if (lastInterval.end < this.rowFormatter.paragraphHorizontalBounds.end) {
|
95573
95582
|
if (this.rowFormatter.manager.model.compatibilitySettings.compatibilityMode < CompatibilityMode.Word2013) {
|
95583
|
+
this.currInterval.avaliableWidth = Number.MAX_SAFE_INTEGER - this.currInterval.busyWidth;
|
95574
95584
|
this.currInterval.length = Number.MAX_SAFE_INTEGER;
|
95575
|
-
this.currInterval.avaliableWidth = Number.MAX_SAFE_INTEGER;
|
95576
95585
|
this.row.width = Number.MAX_SAFE_INTEGER;
|
95586
|
+
this.row.flags.set(LayoutRowStateFlags.InfinityWidth, true);
|
95577
95587
|
return this.addTabBox();
|
95578
95588
|
}
|
95579
95589
|
else if (tabBox.right < this.rowFormatter.paragraphHorizontalBounds.end) {
|
@@ -107634,19 +107644,33 @@ ResizeBoxListener.directionToSource = {
|
|
107634
107644
|
|
107635
107645
|
;// CONCATENATED MODULE: ./src/common/utils/size-utils.ts
|
107636
107646
|
class SizeUtils {
|
107637
|
-
static
|
107647
|
+
static getWidthInfo(element) {
|
107648
|
+
const offsetSize = SizeUtils.getOffsetWidth(element);
|
107638
107649
|
const style = getComputedStyle(element);
|
107639
|
-
const
|
107640
|
-
|
107650
|
+
const inset = parseCssValue(style.borderLeftWidth)
|
107651
|
+
+ parseCssValue(style.borderRightWidth)
|
107652
|
+
+ parseCssValue(style.paddingLeft)
|
107653
|
+
+ parseCssValue(style.paddingRight);
|
107654
|
+
const sizeWithScrollBar = offsetSize - inset;
|
107641
107655
|
const scrollBarSize = Math.round(sizeWithScrollBar) - element.clientWidth;
|
107642
|
-
return sizeWithScrollBar - scrollBarSize;
|
107656
|
+
return new DimensionInfo(offsetSize, sizeWithScrollBar - scrollBarSize, scrollBarSize);
|
107643
107657
|
}
|
107644
|
-
static
|
107658
|
+
static getClientWidth(element) {
|
107659
|
+
return this.getWidthInfo(element).clientSize;
|
107660
|
+
}
|
107661
|
+
static getHeightInfo(element) {
|
107662
|
+
const offsetSize = SizeUtils.getOffsetHeight(element);
|
107645
107663
|
const style = getComputedStyle(element);
|
107646
|
-
const
|
107647
|
-
|
107664
|
+
const inset = parseCssValue(style.borderTopWidth)
|
107665
|
+
+ parseCssValue(style.borderBottomWidth)
|
107666
|
+
+ parseCssValue(style.paddingTop)
|
107667
|
+
+ parseCssValue(style.paddingBottom);
|
107668
|
+
const sizeWithScrollBar = offsetSize - inset;
|
107648
107669
|
const scrollBarSize = Math.round(sizeWithScrollBar) - element.clientHeight;
|
107649
|
-
return sizeWithScrollBar - scrollBarSize;
|
107670
|
+
return new DimensionInfo(offsetSize, sizeWithScrollBar - scrollBarSize, scrollBarSize);
|
107671
|
+
}
|
107672
|
+
static getClientHeight(element) {
|
107673
|
+
return this.getHeightInfo(element).clientSize;
|
107650
107674
|
}
|
107651
107675
|
static getOffsetSize(element) {
|
107652
107676
|
return element.getBoundingClientRect();
|
@@ -107658,6 +107682,16 @@ class SizeUtils {
|
|
107658
107682
|
return SizeUtils.getOffsetSize(element).height;
|
107659
107683
|
}
|
107660
107684
|
}
|
107685
|
+
function parseCssValue(value) {
|
107686
|
+
return value ? parseFloat(value) : 0;
|
107687
|
+
}
|
107688
|
+
class DimensionInfo {
|
107689
|
+
constructor(offsetSize, clientSize, scrollbarSize) {
|
107690
|
+
this.offsetSize = offsetSize;
|
107691
|
+
this.clientSize = clientSize;
|
107692
|
+
this.scrollbarSize = scrollbarSize;
|
107693
|
+
}
|
107694
|
+
}
|
107661
107695
|
|
107662
107696
|
;// CONCATENATED MODULE: ./src/common/canvas/canvas-manager.ts
|
107663
107697
|
|
@@ -108135,18 +108169,8 @@ class CanvasScrollManager {
|
|
108135
108169
|
this.updateScrollVisibility();
|
108136
108170
|
}
|
108137
108171
|
updateScrollVisibility() {
|
108138
|
-
if (!this.scrollMeasurer) {
|
108139
|
-
this.scrollMeasurer = document.createElement("div");
|
108140
|
-
this.scrollMeasurer.style.position = "absolute";
|
108141
|
-
this.scrollMeasurer.style.top = "0";
|
108142
|
-
this.scrollMeasurer.style.bottom = "0";
|
108143
|
-
this.scrollMeasurer.style.right = "0";
|
108144
|
-
this.scrollMeasurer.style.left = "0";
|
108145
|
-
}
|
108146
|
-
this.canvas.appendChild(this.scrollMeasurer);
|
108147
108172
|
const prevScrollYVisibility = this.sizes.scrollYVisible;
|
108148
|
-
this.sizes.updateScrollVisibility(this.
|
108149
|
-
this.canvas.removeChild(this.scrollMeasurer);
|
108173
|
+
this.sizes.updateScrollVisibility(this.canvas);
|
108150
108174
|
if (prevScrollYVisibility !== this.sizes.scrollYVisible && this.horizontalRuler)
|
108151
108175
|
this.horizontalRuler.adjust();
|
108152
108176
|
}
|
@@ -108221,6 +108245,7 @@ class CanvasScrollManager {
|
|
108221
108245
|
|
108222
108246
|
|
108223
108247
|
|
108248
|
+
|
108224
108249
|
class CanvasSizeInfo {
|
108225
108250
|
constructor() {
|
108226
108251
|
this.topSpacing = -1;
|
@@ -108237,7 +108262,7 @@ class CanvasSizeInfo {
|
|
108237
108262
|
this.pageVerticalInfo.init(dom.DomUtils.getCurrentStyle(page));
|
108238
108263
|
this.topSpacing = this.pageVerticalInfo.topPageBorderWidth + this.pageVerticalInfo.topMargin;
|
108239
108264
|
this.betweenPageSpacing = this.pageVerticalInfo.betweenPageSpacing;
|
108240
|
-
this.setVisibleAreaSize(canvas
|
108265
|
+
this.setVisibleAreaSize(SizeUtils.getClientWidth(canvas), SizeUtils.getClientHeight(canvas));
|
108241
108266
|
}
|
108242
108267
|
findPageIndexByOffsetY(pages, offsetY) {
|
108243
108268
|
return Math.max(0, search.SearchUtils.normedInterpolationIndexOf(pages, (p) => this.getPageOffsetY(p), offsetY));
|
@@ -108250,22 +108275,27 @@ class CanvasSizeInfo {
|
|
108250
108275
|
this.visibleAreaSize.height = height;
|
108251
108276
|
}
|
108252
108277
|
getVisibleAreaWidth(includeScrollBars) {
|
108253
|
-
if (includeScrollBars)
|
108278
|
+
if (!includeScrollBars)
|
108254
108279
|
return this.visibleAreaSize.width;
|
108255
|
-
return this.scrollYVisible ? this.visibleAreaSize.width
|
108280
|
+
return this.scrollYVisible ? this.visibleAreaSize.width + this.scrollWidth : this.visibleAreaSize.width;
|
108256
108281
|
}
|
108257
108282
|
getVisibleAreaHeight(includeScrollBars) {
|
108258
|
-
if (includeScrollBars)
|
108283
|
+
if (!includeScrollBars)
|
108259
108284
|
return this.visibleAreaSize.height;
|
108260
|
-
return this.scrollXVisible ? this.visibleAreaSize.height
|
108285
|
+
return this.scrollXVisible ? this.visibleAreaSize.height + this.scrollWidth : this.visibleAreaSize.height;
|
108261
108286
|
}
|
108262
|
-
updateScrollVisibility(
|
108263
|
-
this.scrollXVisible =
|
108264
|
-
this.scrollYVisible =
|
108287
|
+
updateScrollVisibility(canvas) {
|
108288
|
+
this.scrollXVisible = SizeUtils.getHeightInfo(canvas).scrollbarSize > 0;
|
108289
|
+
this.scrollYVisible = SizeUtils.getWidthInfo(canvas).scrollbarSize > 0;
|
108265
108290
|
}
|
108266
|
-
|
108267
|
-
|
108268
|
-
|
108291
|
+
updateSize(canvas) {
|
108292
|
+
const width = SizeUtils.getClientWidth(canvas);
|
108293
|
+
const height = SizeUtils.getClientHeight(canvas);
|
108294
|
+
if (this.visibleAreaSize.width !== width || this.visibleAreaSize.height !== height) {
|
108295
|
+
this.setVisibleAreaSize(width, height);
|
108296
|
+
return true;
|
108297
|
+
}
|
108298
|
+
return false;
|
108269
108299
|
}
|
108270
108300
|
}
|
108271
108301
|
|
@@ -109529,7 +109559,6 @@ class SelectionRenderer extends SelectionRendererBase {
|
|
109529
109559
|
|
109530
109560
|
|
109531
109561
|
|
109532
|
-
|
109533
109562
|
|
109534
109563
|
|
109535
109564
|
class ViewManager {
|
@@ -109589,11 +109618,8 @@ class ViewManager {
|
|
109589
109618
|
this.canvasListener.onCanvasScroll();
|
109590
109619
|
}
|
109591
109620
|
}
|
109592
|
-
else if (this.sizes.
|
109593
|
-
const size = SizeUtils.getOffsetSize(this.canvas);
|
109594
|
-
this.sizes.setVisibleAreaSize(size.width, size.height);
|
109621
|
+
else if (this.sizes.updateSize(this.canvas))
|
109595
109622
|
this.scroll.onCanvasSizeChanged();
|
109596
|
-
}
|
109597
109623
|
}
|
109598
109624
|
NotifyPagesReady(pageChanges) {
|
109599
109625
|
this.canvasListener.onPagesReady(pageChanges);
|
@@ -122250,6 +122276,44 @@ function createInnerItems(items) {
|
|
122250
122276
|
}
|
122251
122277
|
}
|
122252
122278
|
|
122279
|
+
;// CONCATENATED MODULE: ./src/client/utils/focus-helper.ts
|
122280
|
+
class FocusHelper {
|
122281
|
+
static preventFocusOnClick(element) {
|
122282
|
+
return new FocusBlocker(element);
|
122283
|
+
}
|
122284
|
+
}
|
122285
|
+
class FocusBlocker {
|
122286
|
+
constructor(target) {
|
122287
|
+
this.target = target;
|
122288
|
+
this.onPointerDownBinded = this.onPointerDown.bind(this);
|
122289
|
+
this.addEventListeners(target);
|
122290
|
+
}
|
122291
|
+
addEventListeners(element) {
|
122292
|
+
element.addEventListener("pointerdown", this.onPointerDownBinded);
|
122293
|
+
}
|
122294
|
+
removeEventListeners(element) {
|
122295
|
+
element.removeEventListener("pointerdown", this.onPointerDownBinded);
|
122296
|
+
}
|
122297
|
+
onPointerDown(event) {
|
122298
|
+
for (const element of event.composedPath()) {
|
122299
|
+
if (!(element instanceof HTMLElement))
|
122300
|
+
continue;
|
122301
|
+
if (element === this.target) {
|
122302
|
+
event.preventDefault();
|
122303
|
+
break;
|
122304
|
+
}
|
122305
|
+
if (!this.target.contains(element) || element.tabIndex > -1)
|
122306
|
+
break;
|
122307
|
+
}
|
122308
|
+
}
|
122309
|
+
dispose() {
|
122310
|
+
if (this.target) {
|
122311
|
+
this.removeEventListeners(this.target);
|
122312
|
+
this.target = null;
|
122313
|
+
}
|
122314
|
+
}
|
122315
|
+
}
|
122316
|
+
|
122253
122317
|
;// CONCATENATED MODULE: ./src/client/bars/ribbon.ts
|
122254
122318
|
|
122255
122319
|
|
@@ -122259,6 +122323,7 @@ function createInnerItems(items) {
|
|
122259
122323
|
|
122260
122324
|
|
122261
122325
|
|
122326
|
+
|
122262
122327
|
class ClientRibbonBar extends RibbonBarBase {
|
122263
122328
|
constructor(ownerControl, ownerElement, apiRibbon, fonts) {
|
122264
122329
|
var _a;
|
@@ -122267,6 +122332,7 @@ class ClientRibbonBar extends RibbonBarBase {
|
|
122267
122332
|
this.ownerElement = ownerElement;
|
122268
122333
|
this.init(apiRibbon, fonts);
|
122269
122334
|
this.createControl((_a = apiRibbon.activeTabIndex) !== null && _a !== void 0 ? _a : 1);
|
122335
|
+
this.focusHandler = FocusHelper.preventFocusOnClick(this.ribbon.element);
|
122270
122336
|
}
|
122271
122337
|
updateContextItem(_commandKey) {
|
122272
122338
|
}
|
@@ -122292,13 +122358,13 @@ class ClientRibbonBar extends RibbonBarBase {
|
|
122292
122358
|
}
|
122293
122359
|
dispose() {
|
122294
122360
|
this.ribbon.dispose();
|
122361
|
+
this.focusHandler.dispose();
|
122295
122362
|
}
|
122296
122363
|
checkActivateHeaderFooter(_selection) {
|
122297
122364
|
return false;
|
122298
122365
|
}
|
122299
122366
|
createControl(activeTabIndex) {
|
122300
122367
|
const element = document.createElement('div');
|
122301
|
-
element.tabIndex = 0;
|
122302
122368
|
const firstChild = this.ownerElement.firstChild;
|
122303
122369
|
if (firstChild)
|
122304
122370
|
this.ownerElement.insertBefore(element, firstChild);
|
@@ -129247,7 +129313,6 @@ class LinkHeaderFooterToPreviousCommand extends HeaderFooterCommandBase {
|
|
129247
129313
|
|
129248
129314
|
|
129249
129315
|
|
129250
|
-
|
129251
129316
|
class ApplyStyleCommand extends CommandBase {
|
129252
129317
|
getState() {
|
129253
129318
|
var interval = this.selection.lastSelectedInterval.clone();
|
@@ -129284,16 +129349,19 @@ class ApplyStyleCommand extends CommandBase {
|
|
129284
129349
|
getStyleName(style) {
|
129285
129350
|
return style.styleName;
|
129286
129351
|
}
|
129352
|
+
DEPRECATEDConvertOptionsParameter(parameter) {
|
129353
|
+
return typeof parameter === 'string' ? { styleName: parameter } : parameter;
|
129354
|
+
}
|
129287
129355
|
executeCore(state, options) {
|
129288
129356
|
const parameter = options.param;
|
129289
|
-
if (utils_string.StringUtils.isNullOrEmpty(parameter))
|
129357
|
+
if (utils_string.StringUtils.isNullOrEmpty(parameter.styleName))
|
129290
129358
|
return false;
|
129291
|
-
|
129359
|
+
const subDocumentInterval = new SubDocumentInterval(options.subDocument, state.interval.clone());
|
129292
129360
|
let executed = true;
|
129293
129361
|
let isPresetStyle = false;
|
129294
129362
|
this.history.beginTransaction();
|
129295
|
-
if (StylesManager.isParagraphStyle(parameter) && state.paragraphStyleChangeEnabled) {
|
129296
|
-
const styleName = StylesManager.getStyleNameWithoutPrefix(parameter);
|
129363
|
+
if (StylesManager.isParagraphStyle(parameter.styleName) && state.paragraphStyleChangeEnabled) {
|
129364
|
+
const styleName = StylesManager.getStyleNameWithoutPrefix(parameter.styleName);
|
129297
129365
|
let paragraphStyle = this.control.modelManager.model.getParagraphStyleByName(styleName);
|
129298
129366
|
if (!paragraphStyle) {
|
129299
129367
|
const presetStyle = StylesManager.getPresetParagraphStyleByName(styleName);
|
@@ -129302,12 +129370,12 @@ class ApplyStyleCommand extends CommandBase {
|
|
129302
129370
|
paragraphStyle = StylesManager.getPresetParagraphStyleByName(styleName).clone();
|
129303
129371
|
isPresetStyle = true;
|
129304
129372
|
}
|
129305
|
-
this.applyParagraphStyle(
|
129373
|
+
this.applyParagraphStyle(subDocumentInterval, paragraphStyle, isPresetStyle, parameter.keepDirectFormatting);
|
129306
129374
|
}
|
129307
|
-
else if (!StylesManager.isParagraphStyle(parameter) && state.characterStyleChangeEnabled) {
|
129308
|
-
const styleName = StylesManager.getStyleNameWithoutPrefix(parameter);
|
129309
|
-
if (interval.length == 0)
|
129310
|
-
interval = options.subDocument.getWholeWordInterval(interval.start);
|
129375
|
+
else if (!StylesManager.isParagraphStyle(parameter.styleName) && state.characterStyleChangeEnabled) {
|
129376
|
+
const styleName = StylesManager.getStyleNameWithoutPrefix(parameter.styleName);
|
129377
|
+
if (subDocumentInterval.interval.length == 0)
|
129378
|
+
subDocumentInterval.interval = options.subDocument.getWholeWordInterval(subDocumentInterval.interval.start);
|
129311
129379
|
let characterStyle = this.control.modelManager.model.getCharacterStyleByName(styleName);
|
129312
129380
|
if (!characterStyle) {
|
129313
129381
|
const presetStyle = StylesManager.getPresetCharacterStyleByName(styleName);
|
@@ -129316,9 +129384,9 @@ class ApplyStyleCommand extends CommandBase {
|
|
129316
129384
|
characterStyle = presetStyle.clone();
|
129317
129385
|
isPresetStyle = true;
|
129318
129386
|
}
|
129319
|
-
if (interval.length == 0) {
|
129387
|
+
if (subDocumentInterval.interval.length == 0) {
|
129320
129388
|
if (isPresetStyle) {
|
129321
|
-
|
129389
|
+
const fontInfo = characterStyle.maskedCharacterProperties.fontInfo;
|
129322
129390
|
if (fontInfo && fontInfo.measurer === undefined)
|
129323
129391
|
characterStyle.maskedCharacterProperties.fontInfo = this.control.modelManager.model.cache.fontInfoCache.getItemByName(fontInfo.name);
|
129324
129392
|
}
|
@@ -129326,50 +129394,56 @@ class ApplyStyleCommand extends CommandBase {
|
|
129326
129394
|
executed = false;
|
129327
129395
|
}
|
129328
129396
|
else
|
129329
|
-
this.applyCharacterStyle(
|
129397
|
+
this.applyCharacterStyle(subDocumentInterval, characterStyle, isPresetStyle);
|
129330
129398
|
}
|
129331
129399
|
this.history.endTransaction();
|
129332
129400
|
return executed;
|
129333
129401
|
}
|
129334
|
-
applyCharacterStyle(
|
129402
|
+
applyCharacterStyle(subDocumentInterval, style, isPresetStyle) {
|
129335
129403
|
if (ControlOptions.isEnabled(this.control.modelManager.richOptions.control.characterStyle)) {
|
129336
|
-
|
129404
|
+
const characterStyle = isPresetStyle ? this.control.modelManager.model.stylesManager.addCharacterStyle(style) : style;
|
129405
|
+
this.modelManipulator.style.applyCharacterStyle(subDocumentInterval, characterStyle, false);
|
129337
129406
|
}
|
129338
129407
|
}
|
129339
|
-
applyParagraphStyle(
|
129340
|
-
|
129408
|
+
applyParagraphStyle(subDocumentInterval, style, isPresetStyle, keepDirectFormatting = false) {
|
129409
|
+
const count = this.calculateAffectedParagraphCount(subDocumentInterval);
|
129341
129410
|
if (count > 0 && ControlOptions.isEnabled(this.control.modelManager.richOptions.control.paragraphStyle)) {
|
129342
|
-
|
129343
|
-
|
129344
|
-
|
129345
|
-
|
129346
|
-
|
129347
|
-
|
129348
|
-
|
129349
|
-
|
129350
|
-
this.history.addAndRedo(new
|
129411
|
+
const { interval, subDocument } = subDocumentInterval;
|
129412
|
+
const paragraphs = subDocument.paragraphs;
|
129413
|
+
const paragraphIndex = search.SearchUtils.normedInterpolationIndexOf(paragraphs, p => p.startLogPosition.value, interval.start);
|
129414
|
+
for (let i = 0; i < count; i++) {
|
129415
|
+
const paragraph = paragraphs[paragraphIndex + i];
|
129416
|
+
const modelManipulator = this.modelManipulator;
|
129417
|
+
const paragraphSubDocumentInterval = new SubDocumentInterval(subDocument, paragraph.interval);
|
129418
|
+
style = isPresetStyle ? modelManipulator.model.stylesManager.addParagraphStyle(style) : style;
|
129419
|
+
this.history.addAndRedo(new ApplyParagraphStyleHistoryItem(modelManipulator, paragraphSubDocumentInterval, style));
|
129420
|
+
this.history.addAndRedo(new ParagraphUseValueHistoryItem(modelManipulator, paragraphSubDocumentInterval, 0));
|
129421
|
+
if (!keepDirectFormatting)
|
129422
|
+
this.history.addAndRedo(new FontUseValueHistoryItem(modelManipulator, paragraphSubDocumentInterval, 0));
|
129423
|
+
this.history.addAndRedo(new AddParagraphToListHistoryItem(modelManipulator, subDocument, paragraphIndex, NumberingList.NumberingListNotSettedIndex, -1));
|
129351
129424
|
}
|
129352
129425
|
}
|
129353
129426
|
else
|
129354
|
-
this.applyParagraphLinkedStyle(
|
129427
|
+
this.applyParagraphLinkedStyle(subDocumentInterval, style, isPresetStyle);
|
129355
129428
|
}
|
129356
|
-
applyParagraphLinkedStyle(
|
129429
|
+
applyParagraphLinkedStyle(subDocumentInterval, style, isPresetStyle) {
|
129357
129430
|
if (ControlOptions.isEnabled(this.control.modelManager.richOptions.control.characterStyle)) {
|
129358
129431
|
if (!style.linkedStyle)
|
129359
|
-
this.
|
129360
|
-
this.applyCharacterStyle(
|
129432
|
+
this.addLinkedCharacterStyle(style);
|
129433
|
+
this.applyCharacterStyle(subDocumentInterval, style.linkedStyle, isPresetStyle);
|
129361
129434
|
}
|
129362
129435
|
}
|
129363
|
-
|
129364
|
-
|
129436
|
+
addLinkedCharacterStyle(paragraphStyle) {
|
129437
|
+
const style = new CharacterStyle(paragraphStyle.styleName + " Char", paragraphStyle.localizedName + " Char", false, false, false, false, paragraphStyle.maskedCharacterProperties);
|
129365
129438
|
this.history.addAndRedo(new CreateStyleLinkHistoryItem(this.modelManipulator, style, paragraphStyle));
|
129366
129439
|
}
|
129367
|
-
calculateAffectedParagraphCount(
|
129368
|
-
|
129440
|
+
calculateAffectedParagraphCount(subDocumentInterval) {
|
129441
|
+
const { interval, subDocument } = subDocumentInterval;
|
129442
|
+
const paragraphs = subDocument.getParagraphsByInterval(interval);
|
129369
129443
|
if (paragraphs.length > 1)
|
129370
129444
|
return paragraphs.length;
|
129371
|
-
|
129372
|
-
|
129445
|
+
const paragraph = paragraphs[0];
|
129446
|
+
const lastParagraphCharSelected = interval.length >= paragraph.length - 1;
|
129373
129447
|
if (interval.start === paragraph.startLogPosition.value && lastParagraphCharSelected || interval.length === 0)
|
129374
129448
|
return 1;
|
129375
129449
|
return 0;
|
@@ -135863,24 +135937,30 @@ class RemoveNextWordCommand extends RemoveWordCommandBase {
|
|
135863
135937
|
|
135864
135938
|
|
135865
135939
|
class SetParagraphLevelCommandBase extends CommandBase {
|
135940
|
+
get commandManager() { return this.control.commandManager; }
|
135941
|
+
get modelManager() { return this.control.modelManager; }
|
135866
135942
|
isEnabled() {
|
135867
|
-
return super.isEnabled() && ControlOptions.isEnabled(this.
|
135943
|
+
return super.isEnabled() && ControlOptions.isEnabled(this.modelManager.richOptions.control.paragraphFormatting);
|
135868
135944
|
}
|
135869
135945
|
getState() {
|
135870
135946
|
const state = new SimpleCommandState(this.isEnabled());
|
135871
|
-
state.value = this.
|
135947
|
+
state.value = this.commandManager.getCommand(RichEditClientCommand.ChangeHeadingLevel).getState().value == this.getLevel(null);
|
135872
135948
|
return state;
|
135873
135949
|
}
|
135874
135950
|
executeCore(_state, options) {
|
135875
135951
|
const level = this.getLevel(options.param);
|
135876
135952
|
const styleName = level > 0 ? `${ParagraphStyle.headingStyleName} ${level}` : ParagraphStyle.normalStyleName;
|
135877
|
-
let paragraphStyle = this.
|
135953
|
+
let paragraphStyle = this.modelManager.model.getParagraphStyleByName(styleName);
|
135878
135954
|
if (!paragraphStyle)
|
135879
135955
|
paragraphStyle = StylesManager.getPresetParagraphStyleByName(styleName);
|
135880
|
-
if (paragraphStyle)
|
135881
|
-
|
135882
|
-
|
135883
|
-
|
135956
|
+
if (paragraphStyle) {
|
135957
|
+
const commandOptions = new CommandSimpleOptions(this.control, { styleName: StylesManager.paragraphPrefix + styleName, keepDirectFormatting: true });
|
135958
|
+
this.commandManager.getCommand(RichEditClientCommand.ChangeStyle).execute(this.commandManager.isPublicApiCall, commandOptions);
|
135959
|
+
}
|
135960
|
+
else {
|
135961
|
+
const commandOptions = new CommandSimpleOptions(this.control, level);
|
135962
|
+
this.commandManager.getCommand(RichEditClientCommand.ChangeHeadingLevel).execute(this.commandManager.isPublicApiCall, commandOptions);
|
135963
|
+
}
|
135884
135964
|
return true;
|
135885
135965
|
}
|
135886
135966
|
getRelatedCommands() {
|
@@ -141567,7 +141647,7 @@ class ClientRichEdit {
|
|
141567
141647
|
this.contextMenuSettings = settings.contextMenuSettings;
|
141568
141648
|
this.fullScreenHelper = new FullScreenHelper(element);
|
141569
141649
|
if (true)
|
141570
|
-
external_DevExpress_config_default()(JSON.parse(atob('
|
141650
|
+
external_DevExpress_config_default()(JSON.parse(atob('eyJsaWNlbnNlS2V5IjoiZXdvZ0lDSm1iM0p0WVhRaU9pQXhMQW9nSUNKcGJuUmxjbTVoYkZWellXZGxTV1FpT2lBaVRXOVZka0ZEZWsxcVRsTmFiMjEyTmpsYVRGbHBlQ0lLZlE9PS5WN0NsMFNmUGxxMmpzWklzVVRDYSt3bUJ5VTRwazl1OFk1OVNMUEJWdWVRL2lrZWRHd3ljZDMrakpRejZ1cG9Sa3lPTGNuOEJJSitqa3MycGkyaHhyZjBRNkJoUW5zbjdZMDF5OXY5MWpWeDVVTW5XZWZaUlR6bWllK1M4TGl5OTVoUjJIQT09In0=')));
|
141571
141651
|
this.prepareElement(element, settings);
|
141572
141652
|
this.initDefaultFontsAndStyles();
|
141573
141653
|
this.initBars(settings.ribbon, settings.fonts);
|