@aurigma/design-atoms-text
Advanced tools
Comparing version 6.20.0 to 6.20.1
@@ -21,3 +21,2 @@ import { RectangleF } from "@aurigma/design-atoms-model/Math"; | ||
measureTextFrame(useActiveText: boolean): RectangleF; | ||
private _isTextEmpty; | ||
private _getFormattedText; | ||
@@ -24,0 +23,0 @@ private _getAllText; |
@@ -5,2 +5,3 @@ import { EqualsOfFloatNumbers, RectangleF } from "@aurigma/design-atoms-model/Math"; | ||
import { StringUtils } from "../../Utils/StringUtils"; | ||
import { TextUtils } from "../../Utils/TextUtils"; | ||
/** | ||
@@ -22,3 +23,3 @@ * Handler for measuring text. | ||
isTextCropped() { | ||
if (this._isTextEmpty()) | ||
if (TextUtils.isTextEmpty(this._getFormattedText())) | ||
return false; | ||
@@ -41,3 +42,3 @@ const textRange = new TextWhizzRange(this._getAllText()); | ||
EqualsOfFloatNumbers(0, textRectangle.height) && | ||
this._isTextEmpty(); | ||
TextUtils.isTextEmpty(this._getFormattedText()); | ||
if (isShapeTextFrameFirst) { | ||
@@ -72,5 +73,2 @@ let path = this._getFrameShape(0); | ||
//#region - Private methods - | ||
_isTextEmpty() { | ||
return this._getFormattedText() === ""; | ||
} | ||
_getFormattedText() { | ||
@@ -77,0 +75,0 @@ return this._tw.engineHandler.getTextRange().getFormattedTextForDefaults(); |
@@ -275,11 +275,17 @@ import { EqualsOfFloatNumbers, PointF } from "@aurigma/design-atoms-model/Math"; | ||
if (this._currentTextInfo.isParagraphAListItem) { | ||
if (!this._currentTextInfo.isParagraphEmpty) { | ||
const initData = { | ||
previousListItemIndex: this._currentTextInfo.getParagraphIndex() | ||
}; | ||
return { type: InputCommandType.addListItemWithNewLine, initData: initData }; | ||
if (this._currentTextInfo.isParagraphEmpty) { | ||
return this._currentTextInfo.getListItemLevel() === 0 | ||
? { type: InputCommandType.deleteListItem } | ||
: { type: InputCommandType.decreaseListItemIndent }; | ||
} | ||
return this._currentTextInfo.getListItemLevel() === 0 | ||
? { type: InputCommandType.deleteListItem } | ||
: { type: InputCommandType.decreaseListItemIndent }; | ||
let previousListItemIndex; | ||
const selection = this._currentTextInfo.getSelection(); | ||
if (selection != null && !selection.isEmpty) | ||
previousListItemIndex = selection.getParagraphIndexes()[0]; | ||
else | ||
previousListItemIndex = this._currentTextInfo.getParagraphIndex(); | ||
const initData = { | ||
previousListItemIndex: previousListItemIndex | ||
}; | ||
return { type: InputCommandType.addListItemWithNewLine, initData: initData }; | ||
} | ||
@@ -286,0 +292,0 @@ } |
@@ -124,3 +124,7 @@ import { EventObject } from "@aurigma/design-atoms-model/EventObject"; | ||
highlightInEditingModeEnabled: boolean; | ||
/** | ||
* Indicates if the editor needs to redraw ActiveText when it is edited. | ||
*/ | ||
redrawActiveTextInEditMode: boolean; | ||
redraw(): void; | ||
} |
@@ -74,2 +74,6 @@ import { EventObject } from "@aurigma/design-atoms-model/EventObject"; | ||
/** | ||
* Indicates if the editor needs to redraw ActiveText when it is edited. | ||
*/ | ||
get redrawActiveTextInEditMode(): boolean; | ||
/** | ||
* Indicates if the editor is in editing mode. | ||
@@ -76,0 +80,0 @@ */ |
@@ -125,2 +125,8 @@ import { EventObject } from "@aurigma/design-atoms-model/EventObject"; | ||
/** | ||
* Indicates if the editor needs to redraw ActiveText when it is edited. | ||
*/ | ||
get redrawActiveTextInEditMode() { | ||
return true; | ||
} | ||
/** | ||
* Indicates if the editor is in editing mode. | ||
@@ -127,0 +133,0 @@ */ |
@@ -27,3 +27,8 @@ export class CurrentTextInfo { | ||
get isParagraphAListItem() { | ||
return this._textManager.isParagraphAListItem(this.getParagraphIndex()); | ||
const selection = this.getSelection(); | ||
if (selection == null || selection.isEmpty) { | ||
return this._textManager.isParagraphAListItem(this.getParagraphIndex()); | ||
} | ||
const startIndex = this.getSelection().getParagraphIndexes()[0]; | ||
return this._textManager.isParagraphAListItem(startIndex); | ||
} | ||
@@ -30,0 +35,0 @@ ; |
{ | ||
"name": "@aurigma/design-atoms-text", | ||
"version": "6.20.0", | ||
"version": "6.20.1", | ||
"description": "", | ||
@@ -38,3 +38,3 @@ "main": "dist/index.js", | ||
"@aurigma/design-atoms-model": "6.5.29", | ||
"@aurigma/text-whizz": "1.5.56", | ||
"@aurigma/text-whizz": "1.5.58", | ||
"xmldom": "^0.6.0" | ||
@@ -41,0 +41,0 @@ }, |
@@ -7,2 +7,3 @@ import {EqualsOfFloatNumbers, RectangleF} from "@aurigma/design-atoms-model/Math"; | ||
import {StringUtils} from "../../Utils/StringUtils"; | ||
import {TextUtils} from "../../Utils/TextUtils"; | ||
@@ -33,3 +34,3 @@ /** | ||
isTextCropped(): boolean { | ||
if (this._isTextEmpty()) | ||
if (TextUtils.isTextEmpty(this._getFormattedText())) | ||
return false; | ||
@@ -60,3 +61,3 @@ | ||
EqualsOfFloatNumbers(0, textRectangle.height) && | ||
this._isTextEmpty(); | ||
TextUtils.isTextEmpty(this._getFormattedText()); | ||
@@ -103,6 +104,2 @@ if (isShapeTextFrameFirst) { | ||
private _isTextEmpty(): boolean { | ||
return this._getFormattedText() === ""; | ||
} | ||
private _getFormattedText(): string { | ||
@@ -109,0 +106,0 @@ return this._tw.engineHandler.getTextRange().getFormattedTextForDefaults(); |
@@ -311,12 +311,20 @@ import {EqualsOfFloatNumbers, PointF} from "@aurigma/design-atoms-model/Math"; | ||
if (this._currentTextInfo.isParagraphAListItem) { | ||
if (!this._currentTextInfo.isParagraphEmpty) { | ||
const initData: AddListItemCmdData = { | ||
previousListItemIndex: this._currentTextInfo.getParagraphIndex() | ||
} | ||
return {type: InputCommandType.addListItemWithNewLine, initData: initData}; | ||
if (this._currentTextInfo.isParagraphEmpty) { | ||
return this._currentTextInfo.getListItemLevel() === 0 | ||
? {type: InputCommandType.deleteListItem} | ||
: {type: InputCommandType.decreaseListItemIndent}; | ||
} | ||
return this._currentTextInfo.getListItemLevel() === 0 | ||
? {type: InputCommandType.deleteListItem} | ||
: {type: InputCommandType.decreaseListItemIndent}; | ||
let previousListItemIndex; | ||
const selection = this._currentTextInfo.getSelection(); | ||
if (selection != null && !selection.isEmpty) | ||
previousListItemIndex = selection.getParagraphIndexes()[0]; | ||
else | ||
previousListItemIndex = this._currentTextInfo.getParagraphIndex(); | ||
const initData: AddListItemCmdData = { | ||
previousListItemIndex: previousListItemIndex | ||
} | ||
return {type: InputCommandType.addListItemWithNewLine, initData: initData}; | ||
} | ||
@@ -323,0 +331,0 @@ } |
@@ -180,3 +180,8 @@ import {EventObject} from "@aurigma/design-atoms-model/EventObject"; | ||
/** | ||
* Indicates if the editor needs to redraw ActiveText when it is edited. | ||
*/ | ||
redrawActiveTextInEditMode: boolean; | ||
redraw(): void; | ||
} |
@@ -161,2 +161,9 @@ import {EventObject} from "@aurigma/design-atoms-model/EventObject"; | ||
/** | ||
* Indicates if the editor needs to redraw ActiveText when it is edited. | ||
*/ | ||
get redrawActiveTextInEditMode(): boolean{ | ||
return true; | ||
} | ||
/** | ||
* Indicates if the editor is in editing mode. | ||
@@ -163,0 +170,0 @@ */ |
@@ -34,3 +34,10 @@ import {NewTextManager} from "../NewTextManager"; | ||
get isParagraphAListItem(): boolean { | ||
return this._textManager.isParagraphAListItem(this.getParagraphIndex()); | ||
const selection = this.getSelection(); | ||
if (selection == null || selection.isEmpty) { | ||
return this._textManager.isParagraphAListItem(this.getParagraphIndex()); | ||
} | ||
const startIndex = this.getSelection().getParagraphIndexes()[0]; | ||
return this._textManager.isParagraphAListItem(startIndex); | ||
}; | ||
@@ -37,0 +44,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
849896
541
20931
+ Added@aurigma/text-whizz@1.5.58(transitive)
- Removed@aurigma/text-whizz@1.5.56(transitive)
Updated@aurigma/text-whizz@1.5.58