@univerjs/engine-render 0.21.1 → 0.22.0-insiders.20260513-09bbeca
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/README.md +25 -18
- package/lib/cjs/index.js +755 -939
- package/lib/es/index.js +755 -939
- package/lib/umd/index.js +2 -3
- package/package.json +14 -10
- package/LICENSE +0 -176
package/lib/es/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as EnUs } from "./en-us-ClVoWMyT.js";
|
|
2
|
-
import { AlignTypeH, AlignTypeV, BaselineOffset, BooleanNumber, BorderStyleTypes, BulletAlignment, COLORS, CellValueType, ColorKit, ColumnSeparatorType, CustomDecorationType, CustomRangeType, DEFAULT_EMPTY_DOCUMENT_VALUE, DEFAULT_STYLES, DataStreamTreeNodeType, DataStreamTreeTokenType, Disposable, DisposableCollection, DocumentDataModel, DocumentFlavor, EventSubject, FontStyleType, GridType, HorizontalAlign, IConfigService, IContextService, IUniverInstanceService, Inject, Injector, ListGlyphType, LocaleService, MOVE_BUFFER_VALUE, NAMED_STYLE_MAP, NAMED_STYLE_SPACE_MAP, NumberUnitType, ObjectMatrix, ObjectRelativeFromH, ObjectRelativeFromV, PRESET_LIST_TYPE, PageOrientType, Plugin, PositionedObjectLayoutType, Range, Rectangle, Registry, SectionType, SheetSkeleton, Skeleton, SpacingRule, TableAlignmentType, TableRowHeightRule, TableTextWrapType, TextDecoration, ThemeService, Tools, UniverInstanceType, VerticalAlign, VerticalAlignmentType, WrapStrategy, WrapTextType, addLinkToDocumentModel, checkParagraphHasIndentByStyle, createIdentifier, deleteContent, extractPureTextFromCell, getCellInfoInMergeData, getColorStyle, horizontalLineSegmentsSubtraction, insertTextToContent, invertColorByMatrix, isClassDependencyItem, isNullCell, isWhiteColor, merge, mergeWith, numberToABC, numberToListABC, registerDependencies, remove, requestImmediateMacroTask, searchArray, sortRules, sortRulesByDesc, toDisposable } from "@univerjs/core";
|
|
2
|
+
import { AlignTypeH, AlignTypeV, BaselineOffset, BooleanNumber, BorderStyleTypes, BulletAlignment, COLORS, CellValueType, ColorKit, ColumnSeparatorType, CustomDecorationType, CustomRangeType, DEFAULT_EMPTY_DOCUMENT_VALUE, DEFAULT_STYLES, DataStreamTreeNodeType, DataStreamTreeTokenType, Disposable, DisposableCollection, DocumentDataModel, DocumentFlavor, EventSubject, FontStyleType, GridType, HorizontalAlign, IConfigService, IContextService, IUniverInstanceService, Inject, Injector, ListGlyphType, LocaleService, MOVE_BUFFER_VALUE, NAMED_STYLE_MAP, NAMED_STYLE_SPACE_MAP, NumberUnitType, ObjectMatrix, ObjectRelativeFromH, ObjectRelativeFromV, PRESET_LIST_TYPE, PageOrientType, Plugin, PositionedObjectLayoutType, Range, Rectangle, Registry, SectionType, SheetSkeleton, Skeleton, SpacingRule, TableAlignmentType, TableRowHeightRule, TableTextWrapType, TextDecoration, ThemeService, Tools, UniverInstanceType, VerticalAlign, VerticalAlignmentType, WrapStrategy, WrapTextType, addLinkToDocumentModel, checkParagraphHasIndentByStyle, createIdentifier, deleteContent, extractPureTextFromCell, getCellInfoInMergeData, getColorStyle, getDisplayValueFromCell, horizontalLineSegmentsSubtraction, insertTextToContent, invertColorByMatrix, isClassDependencyItem, isNullCell, isWhiteColor, merge, mergeWith, numberToABC, numberToListABC, registerDependencies, remove, requestImmediateMacroTask, searchArray, sortRules, sortRulesByDesc, toDisposable } from "@univerjs/core";
|
|
3
3
|
import * as cjk from "cjk-regex";
|
|
4
4
|
import { BehaviorSubject, Observable, Subject, Subscription, debounceTime, distinctUntilChanged, shareReplay, startWith } from "rxjs";
|
|
5
|
-
import { parse } from "opentype.js
|
|
5
|
+
import { parse } from "opentype.js";
|
|
6
6
|
import { franc } from "franc-min";
|
|
7
7
|
import { getOverflowAncestors } from "@floating-ui/dom";
|
|
8
8
|
import { floor, max, min } from "@floating-ui/utils";
|
|
@@ -621,7 +621,7 @@ function getSystemHighlightColor() {
|
|
|
621
621
|
}
|
|
622
622
|
|
|
623
623
|
//#endregion
|
|
624
|
-
//#region \0@oxc-project+runtime@0.
|
|
624
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/typeof.js
|
|
625
625
|
function _typeof(o) {
|
|
626
626
|
"@babel/helpers - typeof";
|
|
627
627
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -632,7 +632,7 @@ function _typeof(o) {
|
|
|
632
632
|
}
|
|
633
633
|
|
|
634
634
|
//#endregion
|
|
635
|
-
//#region \0@oxc-project+runtime@0.
|
|
635
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/toPrimitive.js
|
|
636
636
|
function toPrimitive(t, r) {
|
|
637
637
|
if ("object" != _typeof(t) || !t) return t;
|
|
638
638
|
var e = t[Symbol.toPrimitive];
|
|
@@ -645,14 +645,14 @@ function toPrimitive(t, r) {
|
|
|
645
645
|
}
|
|
646
646
|
|
|
647
647
|
//#endregion
|
|
648
|
-
//#region \0@oxc-project+runtime@0.
|
|
648
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/toPropertyKey.js
|
|
649
649
|
function toPropertyKey(t) {
|
|
650
650
|
var i = toPrimitive(t, "string");
|
|
651
651
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
652
652
|
}
|
|
653
653
|
|
|
654
654
|
//#endregion
|
|
655
|
-
//#region \0@oxc-project+runtime@0.
|
|
655
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/defineProperty.js
|
|
656
656
|
function _defineProperty(e, r, t) {
|
|
657
657
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
658
658
|
value: t,
|
|
@@ -793,7 +793,10 @@ var FontCache = class {
|
|
|
793
793
|
* @returns IMeasureTextCache
|
|
794
794
|
*/
|
|
795
795
|
static getMeasureText(content, fontString) {
|
|
796
|
-
if (!this._context)
|
|
796
|
+
if (!this._context) {
|
|
797
|
+
const canvas = document.createElement("canvas");
|
|
798
|
+
this._context = canvas.getContext("2d");
|
|
799
|
+
}
|
|
797
800
|
if (!this._context) return {
|
|
798
801
|
width: 0,
|
|
799
802
|
fontBoundingBoxAscent: 0,
|
|
@@ -961,7 +964,7 @@ function hasListGlyph(glyph) {
|
|
|
961
964
|
var _glyphGroup$;
|
|
962
965
|
const divide = glyph === null || glyph === void 0 ? void 0 : glyph.parent;
|
|
963
966
|
if (divide == null) return false;
|
|
964
|
-
return ((_glyphGroup$ = divide.glyphGroup[0]) === null || _glyphGroup$ === void 0 ? void 0 : _glyphGroup$.glyphType) ===
|
|
967
|
+
return ((_glyphGroup$ = divide.glyphGroup[0]) === null || _glyphGroup$ === void 0 ? void 0 : _glyphGroup$.glyphType) === 2;
|
|
965
968
|
}
|
|
966
969
|
function isIndentByGlyph(glyph, body) {
|
|
967
970
|
const paragraph = getParagraphByGlyph(glyph, body);
|
|
@@ -990,7 +993,7 @@ function isFirstGlyph(glyph) {
|
|
|
990
993
|
const glyphIndex = glyphGroup.indexOf(glyph);
|
|
991
994
|
const divideIndex = divides.indexOf(divide);
|
|
992
995
|
if (divideIndex === 0 && glyphIndex === 0) return true;
|
|
993
|
-
if (divideIndex === 0 && glyphIndex === 1 && glyphGroup[0].glyphType ===
|
|
996
|
+
if (divideIndex === 0 && glyphIndex === 1 && glyphGroup[0].glyphType === 2) return true;
|
|
994
997
|
}
|
|
995
998
|
return false;
|
|
996
999
|
}
|
|
@@ -1682,22 +1685,22 @@ function drawLineByBorderType(ctx, type, lineWidthBuffer, position) {
|
|
|
1682
1685
|
let drawEndX = 0;
|
|
1683
1686
|
let drawEndY = 0;
|
|
1684
1687
|
const { startX, startY, endX, endY } = position;
|
|
1685
|
-
if (type ===
|
|
1688
|
+
if (type === "t") {
|
|
1686
1689
|
drawStartX = startX - lineWidthBuffer;
|
|
1687
1690
|
drawStartY = startY;
|
|
1688
1691
|
drawEndX = endX + lineWidthBuffer;
|
|
1689
1692
|
drawEndY = startY;
|
|
1690
|
-
} else if (type ===
|
|
1693
|
+
} else if (type === "b") {
|
|
1691
1694
|
drawStartX = startX - lineWidthBuffer;
|
|
1692
1695
|
drawStartY = endY;
|
|
1693
1696
|
drawEndX = endX - lineWidthBuffer;
|
|
1694
1697
|
drawEndY = endY;
|
|
1695
|
-
} else if (type ===
|
|
1698
|
+
} else if (type === "l") {
|
|
1696
1699
|
drawStartX = startX;
|
|
1697
1700
|
drawStartY = startY - lineWidthBuffer;
|
|
1698
1701
|
drawEndX = startX;
|
|
1699
1702
|
drawEndY = endY + lineWidthBuffer;
|
|
1700
|
-
} else if (type ===
|
|
1703
|
+
} else if (type === "r") {
|
|
1701
1704
|
drawStartX = endX;
|
|
1702
1705
|
drawStartY = startY - lineWidthBuffer;
|
|
1703
1706
|
drawEndX = endX;
|
|
@@ -1716,37 +1719,37 @@ function drawDiagonalSingleLineByBorderType(ctx, type, position) {
|
|
|
1716
1719
|
let drawEndY = 0;
|
|
1717
1720
|
const { startX, startY, endX, endY } = position;
|
|
1718
1721
|
switch (type) {
|
|
1719
|
-
case
|
|
1722
|
+
case "tl_br":
|
|
1720
1723
|
drawStartX = startX;
|
|
1721
1724
|
drawStartY = startY;
|
|
1722
1725
|
drawEndX = endX;
|
|
1723
1726
|
drawEndY = endY;
|
|
1724
1727
|
break;
|
|
1725
|
-
case
|
|
1728
|
+
case "tl_bc":
|
|
1726
1729
|
drawStartX = startX;
|
|
1727
1730
|
drawStartY = startY;
|
|
1728
1731
|
drawEndX = (startX + endX) / 2;
|
|
1729
1732
|
drawEndY = endY;
|
|
1730
1733
|
break;
|
|
1731
|
-
case
|
|
1734
|
+
case "tl_mr":
|
|
1732
1735
|
drawStartX = startX;
|
|
1733
1736
|
drawStartY = startY;
|
|
1734
1737
|
drawEndX = endX;
|
|
1735
1738
|
drawEndY = (startY + endY) / 2;
|
|
1736
1739
|
break;
|
|
1737
|
-
case
|
|
1740
|
+
case "bl_tr":
|
|
1738
1741
|
drawStartX = startX;
|
|
1739
1742
|
drawStartY = endY;
|
|
1740
1743
|
drawEndX = endX;
|
|
1741
1744
|
drawEndY = startY;
|
|
1742
1745
|
break;
|
|
1743
|
-
case
|
|
1746
|
+
case "ml_tr":
|
|
1744
1747
|
drawStartX = startX;
|
|
1745
1748
|
drawStartY = (startY + endY) / 2;
|
|
1746
1749
|
drawEndX = endX;
|
|
1747
1750
|
drawEndY = startY;
|
|
1748
1751
|
break;
|
|
1749
|
-
case
|
|
1752
|
+
case "bc_tr":
|
|
1750
1753
|
drawStartX = (startX + endX) / 2;
|
|
1751
1754
|
drawStartY = endY;
|
|
1752
1755
|
drawEndX = endX;
|
|
@@ -1770,7 +1773,7 @@ function drawDiagonalDoubleLineByBorderType(ctx, type, position) {
|
|
|
1770
1773
|
let drawSecondEndY = 0;
|
|
1771
1774
|
const { startX, startY, endX, endY } = position;
|
|
1772
1775
|
switch (type) {
|
|
1773
|
-
case
|
|
1776
|
+
case "tl_br":
|
|
1774
1777
|
drawFirstStartX = startX;
|
|
1775
1778
|
drawFirstStartY = startY + 1.5;
|
|
1776
1779
|
drawFirstEndX = endX - 1.5;
|
|
@@ -1780,7 +1783,7 @@ function drawDiagonalDoubleLineByBorderType(ctx, type, position) {
|
|
|
1780
1783
|
drawSecondEndX = endX;
|
|
1781
1784
|
drawSecondEndY = endY - 1.5;
|
|
1782
1785
|
break;
|
|
1783
|
-
case
|
|
1786
|
+
case "bl_tr":
|
|
1784
1787
|
drawFirstStartX = startX;
|
|
1785
1788
|
drawFirstStartY = endY - 1.5;
|
|
1786
1789
|
drawFirstEndX = endX - 1.5;
|
|
@@ -1803,7 +1806,7 @@ function drawDiagonalDoubleLineByBorderType(ctx, type, position) {
|
|
|
1803
1806
|
ctx.stroke();
|
|
1804
1807
|
}
|
|
1805
1808
|
function drawDiagonalLineByBorderType(ctx, style, type, position) {
|
|
1806
|
-
if (style === BorderStyleTypes.DOUBLE && (type ===
|
|
1809
|
+
if (style === BorderStyleTypes.DOUBLE && (type === "tl_br" || type === "bl_tr")) drawDiagonalDoubleLineByBorderType(ctx, type, position);
|
|
1807
1810
|
else drawDiagonalSingleLineByBorderType(ctx, type, position);
|
|
1808
1811
|
}
|
|
1809
1812
|
function clearLineByBorderType(ctx, type, position) {
|
|
@@ -1813,25 +1816,25 @@ function clearLineByBorderType(ctx, type, position) {
|
|
|
1813
1816
|
let drawEndY = 0;
|
|
1814
1817
|
const { startX, startY, endX, endY } = position;
|
|
1815
1818
|
switch (type) {
|
|
1816
|
-
case
|
|
1819
|
+
case "t":
|
|
1817
1820
|
drawStartX = startX;
|
|
1818
1821
|
drawStartY = startY;
|
|
1819
1822
|
drawEndX = endX;
|
|
1820
1823
|
drawEndY = startY;
|
|
1821
1824
|
break;
|
|
1822
|
-
case
|
|
1825
|
+
case "b":
|
|
1823
1826
|
drawStartX = startX;
|
|
1824
1827
|
drawStartY = endY;
|
|
1825
1828
|
drawEndX = endX;
|
|
1826
1829
|
drawEndY = endY;
|
|
1827
1830
|
break;
|
|
1828
|
-
case
|
|
1831
|
+
case "l":
|
|
1829
1832
|
drawStartX = startX;
|
|
1830
1833
|
drawStartY = startY;
|
|
1831
1834
|
drawEndX = startX;
|
|
1832
1835
|
drawEndY = endY;
|
|
1833
1836
|
break;
|
|
1834
|
-
case
|
|
1837
|
+
case "r":
|
|
1835
1838
|
drawStartX = endX;
|
|
1836
1839
|
drawStartY = startY;
|
|
1837
1840
|
drawEndX = endX;
|
|
@@ -1879,7 +1882,7 @@ function calculateRectRotate(startPoint, centerPoint, radiusCenter, radiusVertex
|
|
|
1879
1882
|
return newVector.rotateByPoint(finalAngle, rotationVector).add(offsetPoint).transformCoordinateOnRotate(finalAngle);
|
|
1880
1883
|
}
|
|
1881
1884
|
function getRotateOrientation(angle) {
|
|
1882
|
-
return angle > 0 ?
|
|
1885
|
+
return angle > 0 ? 1 : 0;
|
|
1883
1886
|
}
|
|
1884
1887
|
function getRotateOffsetAndFarthestHypotenuse(lines, rectWidth, vertexAngle) {
|
|
1885
1888
|
const rotateTranslateXList = [];
|
|
@@ -1894,7 +1897,7 @@ function getRotateOffsetAndFarthestHypotenuse(lines, rectWidth, vertexAngle) {
|
|
|
1894
1897
|
const tanTheta = Math.tan(vertexAngle);
|
|
1895
1898
|
const sinTheta = Math.sin(vertexAngle);
|
|
1896
1899
|
const cosTheta = Math.cos(vertexAngle);
|
|
1897
|
-
if (orientation ===
|
|
1900
|
+
if (orientation === 0) {
|
|
1898
1901
|
let cumRectHeight = 0;
|
|
1899
1902
|
for (let i = 0; i < linesCount; i++) {
|
|
1900
1903
|
const { lineHeight: rectHeight = 0 } = lines[i];
|
|
@@ -2953,7 +2956,7 @@ var BaseObject = class extends Disposable {
|
|
|
2953
2956
|
_defineProperty(this, "groupKey", void 0);
|
|
2954
2957
|
_defineProperty(this, "isInGroup", false);
|
|
2955
2958
|
_defineProperty(this, "isDrawingObject", false);
|
|
2956
|
-
_defineProperty(this, "objectType",
|
|
2959
|
+
_defineProperty(this, "objectType", 0);
|
|
2957
2960
|
_defineProperty(this, "onTransformChange$", new EventSubject());
|
|
2958
2961
|
_defineProperty(this, "onPointerDown$", new EventSubject());
|
|
2959
2962
|
_defineProperty(this, "onPointerMove$", new EventSubject());
|
|
@@ -2999,7 +3002,7 @@ var BaseObject = class extends Disposable {
|
|
|
2999
3002
|
_defineProperty(this, "_visible", true);
|
|
3000
3003
|
_defineProperty(this, "_debounceParentDirty", true);
|
|
3001
3004
|
_defineProperty(this, "_transform", new Transform());
|
|
3002
|
-
_defineProperty(this, "_cursor",
|
|
3005
|
+
_defineProperty(this, "_cursor", "default");
|
|
3003
3006
|
_defineProperty(this, "_transformerConfig", void 0);
|
|
3004
3007
|
_defineProperty(this, "_forceRender", false);
|
|
3005
3008
|
_defineProperty(this, "_layer", void 0);
|
|
@@ -3040,7 +3043,7 @@ var BaseObject = class extends Disposable {
|
|
|
3040
3043
|
return this._heightOrigin;
|
|
3041
3044
|
}
|
|
3042
3045
|
get classType() {
|
|
3043
|
-
return
|
|
3046
|
+
return "BaseObject";
|
|
3044
3047
|
}
|
|
3045
3048
|
get top() {
|
|
3046
3049
|
return this._top;
|
|
@@ -3086,15 +3089,15 @@ var BaseObject = class extends Disposable {
|
|
|
3086
3089
|
}
|
|
3087
3090
|
get ancestorTransform() {
|
|
3088
3091
|
const parent = this.getParent();
|
|
3089
|
-
if (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) ===
|
|
3092
|
+
if (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) === "Group") return parent === null || parent === void 0 ? void 0 : parent.ancestorTransform.multiply(this.transform);
|
|
3090
3093
|
return this.transform;
|
|
3091
3094
|
}
|
|
3092
3095
|
get ancestorGroup() {
|
|
3093
3096
|
let group = null;
|
|
3094
3097
|
let parent = this.getParent();
|
|
3095
3098
|
while (parent != null && parent) {
|
|
3096
|
-
if (parent.classType ===
|
|
3097
|
-
if (parent.classType ===
|
|
3099
|
+
if (parent.classType === "Group") group = parent;
|
|
3100
|
+
if (parent.classType === "Group") parent = parent.getParent();
|
|
3098
3101
|
else parent = null;
|
|
3099
3102
|
}
|
|
3100
3103
|
return group;
|
|
@@ -3241,7 +3244,7 @@ var BaseObject = class extends Disposable {
|
|
|
3241
3244
|
if (x !== void 0) this.left = x;
|
|
3242
3245
|
this._setTransForm();
|
|
3243
3246
|
this.onTransformChange$.emitEvent({
|
|
3244
|
-
type:
|
|
3247
|
+
type: 0,
|
|
3245
3248
|
value: {
|
|
3246
3249
|
top: this._top,
|
|
3247
3250
|
left: this._left
|
|
@@ -3260,7 +3263,7 @@ var BaseObject = class extends Disposable {
|
|
|
3260
3263
|
if (height !== void 0) this.height = height;
|
|
3261
3264
|
this._setTransForm();
|
|
3262
3265
|
this.onTransformChange$.emitEvent({
|
|
3263
|
-
type:
|
|
3266
|
+
type: 1,
|
|
3264
3267
|
value: {
|
|
3265
3268
|
width: this._width,
|
|
3266
3269
|
height: this._height
|
|
@@ -3279,7 +3282,7 @@ var BaseObject = class extends Disposable {
|
|
|
3279
3282
|
if (scaleY !== void 0) this.scaleY = scaleY;
|
|
3280
3283
|
this._setTransForm();
|
|
3281
3284
|
this.onTransformChange$.emitEvent({
|
|
3282
|
-
type:
|
|
3285
|
+
type: 2,
|
|
3283
3286
|
value: {
|
|
3284
3287
|
scaleX: this._scaleX,
|
|
3285
3288
|
scaleY: this._scaleY
|
|
@@ -3298,7 +3301,7 @@ var BaseObject = class extends Disposable {
|
|
|
3298
3301
|
if (skewY !== void 0) this.skewY = skewY;
|
|
3299
3302
|
this._setTransForm();
|
|
3300
3303
|
this.onTransformChange$.emitEvent({
|
|
3301
|
-
type:
|
|
3304
|
+
type: 3,
|
|
3302
3305
|
value: {
|
|
3303
3306
|
skewX: this._skewX,
|
|
3304
3307
|
skewY: this._skewY
|
|
@@ -3317,7 +3320,7 @@ var BaseObject = class extends Disposable {
|
|
|
3317
3320
|
if (flipY !== void 0) this.flipY = flipY;
|
|
3318
3321
|
this._setTransForm();
|
|
3319
3322
|
this.onTransformChange$.emitEvent({
|
|
3320
|
-
type:
|
|
3323
|
+
type: 4,
|
|
3321
3324
|
value: {
|
|
3322
3325
|
flipX: this._flipX,
|
|
3323
3326
|
flipY: this._flipY
|
|
@@ -3345,7 +3348,7 @@ var BaseObject = class extends Disposable {
|
|
|
3345
3348
|
});
|
|
3346
3349
|
this._setTransForm();
|
|
3347
3350
|
this.onTransformChange$.emitEvent({
|
|
3348
|
-
type:
|
|
3351
|
+
type: 5,
|
|
3349
3352
|
value: option,
|
|
3350
3353
|
preValue: preKeys
|
|
3351
3354
|
});
|
|
@@ -3377,7 +3380,7 @@ var BaseObject = class extends Disposable {
|
|
|
3377
3380
|
var _this$parent, _this$parent2;
|
|
3378
3381
|
let { width: realWidth, height: realHeight, left: realLeft, top: realTop } = this;
|
|
3379
3382
|
let baseBound;
|
|
3380
|
-
if (this.isInGroup && ((_this$parent = this.parent) === null || _this$parent === void 0 ? void 0 : _this$parent.classType) ===
|
|
3383
|
+
if (this.isInGroup && ((_this$parent = this.parent) === null || _this$parent === void 0 ? void 0 : _this$parent.classType) === "Group" && ((_this$parent2 = this.parent) === null || _this$parent2 === void 0 ? void 0 : _this$parent2.getBaseBound)) baseBound = this.parent.getBaseBound();
|
|
3381
3384
|
if (baseBound) {
|
|
3382
3385
|
const parentState = this.getParent();
|
|
3383
3386
|
const parentBound = {
|
|
@@ -3609,7 +3612,7 @@ var BaseObject = class extends Disposable {
|
|
|
3609
3612
|
getScene() {
|
|
3610
3613
|
let parent = this.parent;
|
|
3611
3614
|
while (parent) {
|
|
3612
|
-
if (parent.classType ===
|
|
3615
|
+
if (parent.classType === "Scene") return parent;
|
|
3613
3616
|
parent = parent.getParent();
|
|
3614
3617
|
}
|
|
3615
3618
|
return null;
|
|
@@ -3626,7 +3629,7 @@ var BaseObject = class extends Disposable {
|
|
|
3626
3629
|
getEngine() {
|
|
3627
3630
|
let parent = this.getParent();
|
|
3628
3631
|
while (parent != null) {
|
|
3629
|
-
if (parent.classType ===
|
|
3632
|
+
if (parent.classType === "Engine") return parent;
|
|
3630
3633
|
parent = parent.getParent();
|
|
3631
3634
|
}
|
|
3632
3635
|
return null;
|
|
@@ -3650,7 +3653,7 @@ var BaseObject = class extends Disposable {
|
|
|
3650
3653
|
return this.ancestorTransform.invert().applyPoint(coord);
|
|
3651
3654
|
}
|
|
3652
3655
|
_setTransForm() {
|
|
3653
|
-
|
|
3656
|
+
const composeResult = Transform.create().composeMatrix({
|
|
3654
3657
|
left: this.left + this.strokeWidth / 2,
|
|
3655
3658
|
top: this.top + this.strokeWidth / 2,
|
|
3656
3659
|
scaleX: this.scaleX,
|
|
@@ -3661,6 +3664,7 @@ var BaseObject = class extends Disposable {
|
|
|
3661
3664
|
flipX: this.flipX,
|
|
3662
3665
|
flipY: this.flipY
|
|
3663
3666
|
});
|
|
3667
|
+
this.transform = composeResult;
|
|
3664
3668
|
this._makeDirtyMix();
|
|
3665
3669
|
}
|
|
3666
3670
|
_makeDirtyMix() {
|
|
@@ -4424,7 +4428,7 @@ var Canvas = class {
|
|
|
4424
4428
|
this._canvasEle.style.outline = "0";
|
|
4425
4429
|
const context = this._canvasEle.getContext("2d");
|
|
4426
4430
|
if (context == null) throw new Error("context is not support");
|
|
4427
|
-
if (props.mode ===
|
|
4431
|
+
if (props.mode === 1) this._context = new UniverPrintingContext(context);
|
|
4428
4432
|
else this._context = new UniverRenderingContext(context, { canvasColorService: props.colorService });
|
|
4429
4433
|
this.setSize(props.width, props.height, props.pixelRatio);
|
|
4430
4434
|
}
|
|
@@ -4624,7 +4628,7 @@ var SheetComponent = class extends RenderComponent {
|
|
|
4624
4628
|
}
|
|
4625
4629
|
getParentScale() {
|
|
4626
4630
|
let { scaleX = 1, scaleY = 1 } = this.parent;
|
|
4627
|
-
if (this.parent.classType ===
|
|
4631
|
+
if (this.parent.classType === "SceneViewer") {
|
|
4628
4632
|
scaleX = this.parent.ancestorScaleX || 1;
|
|
4629
4633
|
scaleY = this.parent.ancestorScaleY || 1;
|
|
4630
4634
|
}
|
|
@@ -4733,38 +4737,23 @@ let SHEET_VIEWPORT_KEY = /* @__PURE__ */ function(SHEET_VIEWPORT_KEY) {
|
|
|
4733
4737
|
|
|
4734
4738
|
//#endregion
|
|
4735
4739
|
//#region src/components/sheets/constants.ts
|
|
4736
|
-
/**
|
|
4737
|
-
* Copyright 2023-present DreamNum Co., Ltd.
|
|
4738
|
-
*
|
|
4739
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4740
|
-
* you may not use this file except in compliance with the License.
|
|
4741
|
-
* You may obtain a copy of the License at
|
|
4742
|
-
*
|
|
4743
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
4744
|
-
*
|
|
4745
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
4746
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
4747
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4748
|
-
* See the License for the specific language governing permissions and
|
|
4749
|
-
* limitations under the License.
|
|
4750
|
-
*/
|
|
4751
4740
|
const BORDER_Z_INDEX = 50;
|
|
4752
4741
|
const FONT_EXTENSION_Z_INDEX = 45;
|
|
4753
4742
|
const BG_Z_INDEX = 21;
|
|
4754
4743
|
const PRINTING_BG_Z_INDEX = 21;
|
|
4755
4744
|
const EXPAND_SIZE_FOR_RENDER_OVERFLOW = 20;
|
|
4756
4745
|
const sheetContentViewportKeys = [
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4746
|
+
"viewMain",
|
|
4747
|
+
"viewMainLeftTop",
|
|
4748
|
+
"viewMainTop",
|
|
4749
|
+
"viewMainLeft"
|
|
4761
4750
|
];
|
|
4762
4751
|
const sheetHeaderViewportKeys = [
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
4767
|
-
|
|
4752
|
+
"viewRowTop",
|
|
4753
|
+
"viewRowBottom",
|
|
4754
|
+
"viewColumnLeft",
|
|
4755
|
+
"viewColumnRight",
|
|
4756
|
+
"viewLeftTop"
|
|
4768
4757
|
];
|
|
4769
4758
|
const MEASURE_EXTENT = 1e4;
|
|
4770
4759
|
const MEASURE_EXTENT_FOR_PARAGRAPH = MEASURE_EXTENT / 10;
|
|
@@ -4782,7 +4771,7 @@ const SHEET_EXTENSION_PREFIX = "sheet-ext-";
|
|
|
4782
4771
|
var SheetExtension = class extends ComponentExtension {
|
|
4783
4772
|
constructor(..._args) {
|
|
4784
4773
|
super(..._args);
|
|
4785
|
-
_defineProperty(this, "type",
|
|
4774
|
+
_defineProperty(this, "type", 0);
|
|
4786
4775
|
}
|
|
4787
4776
|
isRenderDiffRangesByCell(rangeP, diffRanges) {
|
|
4788
4777
|
if (diffRanges == null || diffRanges.length === 0) return true;
|
|
@@ -5052,7 +5041,7 @@ var Border = class extends SheetExtension {
|
|
|
5052
5041
|
let endY = cellEndY;
|
|
5053
5042
|
let startX = cellStartX;
|
|
5054
5043
|
let endX = cellEndX;
|
|
5055
|
-
if (type !==
|
|
5044
|
+
if (type !== "t" && type !== "b" && type !== "l" && type !== "r") {
|
|
5056
5045
|
if (isMerged) return true;
|
|
5057
5046
|
if (isMergedMainCell) {
|
|
5058
5047
|
startY = mergeInfo.startY;
|
|
@@ -5078,7 +5067,7 @@ var Border = class extends SheetExtension {
|
|
|
5078
5067
|
endX,
|
|
5079
5068
|
endY
|
|
5080
5069
|
});
|
|
5081
|
-
if (style === BorderStyleTypes.DOUBLE && (type ===
|
|
5070
|
+
if (style === BorderStyleTypes.DOUBLE && (type === "l" || type === "r" || type === "t" || type === "b")) this._renderDoubleBorder({
|
|
5082
5071
|
renderBorderContext,
|
|
5083
5072
|
row,
|
|
5084
5073
|
col,
|
|
@@ -5093,16 +5082,16 @@ var Border = class extends SheetExtension {
|
|
|
5093
5082
|
}
|
|
5094
5083
|
_getOverflowExclusion(overflowCache, type, borderRow, borderColumn) {
|
|
5095
5084
|
let isDraw = false;
|
|
5096
|
-
if (type ===
|
|
5085
|
+
if (type === "t" || type === "b") return isDraw;
|
|
5097
5086
|
overflowCache === null || overflowCache === void 0 || overflowCache.forRow((row, rowArray) => {
|
|
5098
5087
|
if (row !== borderRow) return true;
|
|
5099
5088
|
rowArray.forEach((column) => {
|
|
5100
5089
|
const { startColumn, endColumn } = overflowCache.getValue(row, column);
|
|
5101
|
-
if (type ===
|
|
5090
|
+
if (type === "l" && borderColumn > startColumn && borderColumn <= endColumn) {
|
|
5102
5091
|
isDraw = true;
|
|
5103
5092
|
return false;
|
|
5104
5093
|
}
|
|
5105
|
-
if (type ===
|
|
5094
|
+
if (type === "r" && borderColumn >= startColumn && borderColumn < endColumn) {
|
|
5106
5095
|
isDraw = true;
|
|
5107
5096
|
return false;
|
|
5108
5097
|
}
|
|
@@ -5162,7 +5151,7 @@ var Border = class extends SheetExtension {
|
|
|
5162
5151
|
endXOffset: defaultOffset,
|
|
5163
5152
|
endYOffset: defaultOffset
|
|
5164
5153
|
};
|
|
5165
|
-
if (type ===
|
|
5154
|
+
if (type === "l" || type === "r") {
|
|
5166
5155
|
if (topCellBorder.bottom && topCellBorder.bottom.style !== BorderStyleTypes.DOUBLE) {
|
|
5167
5156
|
outerLineOffsets.startYOffset = 0;
|
|
5168
5157
|
innerLineOffsets.startYOffset = 0;
|
|
@@ -5170,8 +5159,8 @@ var Border = class extends SheetExtension {
|
|
|
5170
5159
|
var _leftCellBorder$top, _leftTopCellBorder$bo, _rightCellBorder$top, _rightTopCellBorder$b;
|
|
5171
5160
|
const leftTopCellBorder = this._getSpecificCellBorder(borderCache, row - 1, col - 1);
|
|
5172
5161
|
const rightTopCellBorder = this._getSpecificCellBorder(borderCache, row - 1, col + 1);
|
|
5173
|
-
if (type ===
|
|
5174
|
-
else if (type ===
|
|
5162
|
+
if (type === "l" && (((_leftCellBorder$top = leftCellBorder.top) === null || _leftCellBorder$top === void 0 ? void 0 : _leftCellBorder$top.style) === BorderStyleTypes.DOUBLE || ((_leftTopCellBorder$bo = leftTopCellBorder.bottom) === null || _leftTopCellBorder$bo === void 0 ? void 0 : _leftTopCellBorder$bo.style) === BorderStyleTypes.DOUBLE) || type === "r" && (((_rightCellBorder$top = rightCellBorder.top) === null || _rightCellBorder$top === void 0 ? void 0 : _rightCellBorder$top.style) === BorderStyleTypes.DOUBLE || ((_rightTopCellBorder$b = rightTopCellBorder.bottom) === null || _rightTopCellBorder$b === void 0 ? void 0 : _rightTopCellBorder$b.style) === BorderStyleTypes.DOUBLE)) outerLineOffsets.startYOffset = -defaultOffset;
|
|
5163
|
+
else if (type === "l" && leftTopCellBorder.bottom && leftTopCellBorder.bottom.style !== BorderStyleTypes.DOUBLE || type === "r" && rightTopCellBorder.bottom && rightTopCellBorder.bottom.style !== BorderStyleTypes.DOUBLE) outerLineOffsets.startYOffset = 0;
|
|
5175
5164
|
else outerLineOffsets.startYOffset = defaultOffset;
|
|
5176
5165
|
innerLineOffsets.startYOffset = defaultOffset;
|
|
5177
5166
|
}
|
|
@@ -5182,17 +5171,17 @@ var Border = class extends SheetExtension {
|
|
|
5182
5171
|
var _leftCellBorder$botto, _leftBottomCellBorder, _rightCellBorder$bott, _rightBottomCellBorde;
|
|
5183
5172
|
const leftBottomCellBorder = this._getSpecificCellBorder(borderCache, row + 1, col - 1);
|
|
5184
5173
|
const rightBottomCellBorder = this._getSpecificCellBorder(borderCache, row + 1, col + 1);
|
|
5185
|
-
if (type ===
|
|
5186
|
-
else if (type ===
|
|
5174
|
+
if (type === "l" && (((_leftCellBorder$botto = leftCellBorder.bottom) === null || _leftCellBorder$botto === void 0 ? void 0 : _leftCellBorder$botto.style) === BorderStyleTypes.DOUBLE || ((_leftBottomCellBorder = leftBottomCellBorder.top) === null || _leftBottomCellBorder === void 0 ? void 0 : _leftBottomCellBorder.style) === BorderStyleTypes.DOUBLE) || type === "r" && (((_rightCellBorder$bott = rightCellBorder.bottom) === null || _rightCellBorder$bott === void 0 ? void 0 : _rightCellBorder$bott.style) === BorderStyleTypes.DOUBLE || ((_rightBottomCellBorde = rightBottomCellBorder.top) === null || _rightBottomCellBorde === void 0 ? void 0 : _rightBottomCellBorde.style) === BorderStyleTypes.DOUBLE)) outerLineOffsets.endYOffset = -defaultOffset;
|
|
5175
|
+
else if (type === "l" && leftBottomCellBorder.top && leftBottomCellBorder.top.style !== BorderStyleTypes.DOUBLE || type === "r" && rightBottomCellBorder.top && rightBottomCellBorder.top.style !== BorderStyleTypes.DOUBLE) outerLineOffsets.endYOffset = 0;
|
|
5187
5176
|
else outerLineOffsets.endYOffset = defaultOffset;
|
|
5188
5177
|
innerLineOffsets.endYOffset = defaultOffset;
|
|
5189
5178
|
}
|
|
5190
5179
|
clearLine.startY = startY - defaultOffset;
|
|
5191
5180
|
clearLine.endY = endY + defaultOffset;
|
|
5192
5181
|
clearMiddleLine(clearLine);
|
|
5193
|
-
if (type ===
|
|
5182
|
+
if (type === "l" && !leftCellBorder.right || type === "r" && !rightCellBorder.left) drawOuterLine(outerLineOffsets);
|
|
5194
5183
|
drawInnerLine(innerLineOffsets);
|
|
5195
|
-
} else if (type ===
|
|
5184
|
+
} else if (type === "t" || type === "b") {
|
|
5196
5185
|
if (leftCellBorder.right && leftCellBorder.right.style !== BorderStyleTypes.DOUBLE) {
|
|
5197
5186
|
outerLineOffsets.startXOffset = 0;
|
|
5198
5187
|
innerLineOffsets.startXOffset = 0;
|
|
@@ -5200,8 +5189,8 @@ var Border = class extends SheetExtension {
|
|
|
5200
5189
|
var _topCellBorder$left, _topLeftCellBorder$ri, _bottomCellBorder$lef, _bottomLeftCellBorder;
|
|
5201
5190
|
const topLeftCellBorder = this._getSpecificCellBorder(borderCache, row - 1, col - 1);
|
|
5202
5191
|
const bottomLeftCellBorder = this._getSpecificCellBorder(borderCache, row + 1, col - 1);
|
|
5203
|
-
if (type ===
|
|
5204
|
-
else if (type ===
|
|
5192
|
+
if (type === "t" && (((_topCellBorder$left = topCellBorder.left) === null || _topCellBorder$left === void 0 ? void 0 : _topCellBorder$left.style) === BorderStyleTypes.DOUBLE || ((_topLeftCellBorder$ri = topLeftCellBorder.right) === null || _topLeftCellBorder$ri === void 0 ? void 0 : _topLeftCellBorder$ri.style) === BorderStyleTypes.DOUBLE) || type === "b" && (((_bottomCellBorder$lef = bottomCellBorder.left) === null || _bottomCellBorder$lef === void 0 ? void 0 : _bottomCellBorder$lef.style) === BorderStyleTypes.DOUBLE || ((_bottomLeftCellBorder = bottomLeftCellBorder.right) === null || _bottomLeftCellBorder === void 0 ? void 0 : _bottomLeftCellBorder.style) === BorderStyleTypes.DOUBLE)) outerLineOffsets.startXOffset = -defaultOffset;
|
|
5193
|
+
else if (type === "t" && topLeftCellBorder.right && topLeftCellBorder.right.style !== BorderStyleTypes.DOUBLE || type === "b" && bottomLeftCellBorder.right && bottomLeftCellBorder.right.style !== BorderStyleTypes.DOUBLE) outerLineOffsets.startXOffset = 0;
|
|
5205
5194
|
else outerLineOffsets.startXOffset = defaultOffset;
|
|
5206
5195
|
innerLineOffsets.startXOffset = defaultOffset;
|
|
5207
5196
|
}
|
|
@@ -5212,15 +5201,15 @@ var Border = class extends SheetExtension {
|
|
|
5212
5201
|
var _topCellBorder$right, _topRightCellBorder$l, _bottomCellBorder$rig, _bottomRightCellBorde;
|
|
5213
5202
|
const topRightCellBorder = this._getSpecificCellBorder(borderCache, row - 1, col + 1);
|
|
5214
5203
|
const bottomRightCellBorder = this._getSpecificCellBorder(borderCache, row + 1, col + 1);
|
|
5215
|
-
if (type ===
|
|
5216
|
-
else if (type ===
|
|
5204
|
+
if (type === "t" && (((_topCellBorder$right = topCellBorder.right) === null || _topCellBorder$right === void 0 ? void 0 : _topCellBorder$right.style) === BorderStyleTypes.DOUBLE || ((_topRightCellBorder$l = topRightCellBorder.left) === null || _topRightCellBorder$l === void 0 ? void 0 : _topRightCellBorder$l.style) === BorderStyleTypes.DOUBLE) || type === "b" && (((_bottomCellBorder$rig = bottomCellBorder.right) === null || _bottomCellBorder$rig === void 0 ? void 0 : _bottomCellBorder$rig.style) === BorderStyleTypes.DOUBLE || ((_bottomRightCellBorde = bottomRightCellBorder.left) === null || _bottomRightCellBorde === void 0 ? void 0 : _bottomRightCellBorde.style) === BorderStyleTypes.DOUBLE)) outerLineOffsets.endXOffset = -defaultOffset;
|
|
5205
|
+
else if (type === "t" && topRightCellBorder.left && topRightCellBorder.left.style !== BorderStyleTypes.DOUBLE || type === "b" && bottomRightCellBorder.left && bottomRightCellBorder.left.style !== BorderStyleTypes.DOUBLE) outerLineOffsets.endXOffset = 0;
|
|
5217
5206
|
else outerLineOffsets.endXOffset = defaultOffset;
|
|
5218
5207
|
innerLineOffsets.endXOffset = defaultOffset;
|
|
5219
5208
|
}
|
|
5220
5209
|
clearLine.startX = startX - defaultOffset;
|
|
5221
5210
|
clearLine.endX = endX + defaultOffset;
|
|
5222
5211
|
clearMiddleLine(clearLine);
|
|
5223
|
-
if (type ===
|
|
5212
|
+
if (type === "t" && !topCellBorder.bottom || type === "b" && !bottomCellBorder.top) drawOuterLine(outerLineOffsets);
|
|
5224
5213
|
drawInnerLine(innerLineOffsets);
|
|
5225
5214
|
}
|
|
5226
5215
|
}
|
|
@@ -5231,10 +5220,10 @@ var Border = class extends SheetExtension {
|
|
|
5231
5220
|
let top = null;
|
|
5232
5221
|
let bottom = null;
|
|
5233
5222
|
if (cellBorder) {
|
|
5234
|
-
if (cellBorder[
|
|
5235
|
-
if (cellBorder[
|
|
5236
|
-
if (cellBorder[
|
|
5237
|
-
if (cellBorder[
|
|
5223
|
+
if (cellBorder["l"] && Object.prototype.hasOwnProperty.call(cellBorder["l"], "type")) left = cellBorder["l"];
|
|
5224
|
+
if (cellBorder["r"] && Object.prototype.hasOwnProperty.call(cellBorder["r"], "type")) right = cellBorder["r"];
|
|
5225
|
+
if (cellBorder["t"] && Object.prototype.hasOwnProperty.call(cellBorder["t"], "type")) top = cellBorder["t"];
|
|
5226
|
+
if (cellBorder["b"] && Object.prototype.hasOwnProperty.call(cellBorder["b"], "type")) bottom = cellBorder["b"];
|
|
5238
5227
|
}
|
|
5239
5228
|
return {
|
|
5240
5229
|
left,
|
|
@@ -5493,30 +5482,8 @@ SpreadsheetExtensionRegistry.add(Custom);
|
|
|
5493
5482
|
|
|
5494
5483
|
//#endregion
|
|
5495
5484
|
//#region src/components/docs/layout/line-breaker/break.ts
|
|
5496
|
-
/**
|
|
5497
|
-
* Copyright 2023-present DreamNum Co., Ltd.
|
|
5498
|
-
*
|
|
5499
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5500
|
-
* you may not use this file except in compliance with the License.
|
|
5501
|
-
* You may obtain a copy of the License at
|
|
5502
|
-
*
|
|
5503
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5504
|
-
*
|
|
5505
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
5506
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
5507
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
5508
|
-
* See the License for the specific language governing permissions and
|
|
5509
|
-
* limitations under the License.
|
|
5510
|
-
*/
|
|
5511
|
-
let BreakPointType = /* @__PURE__ */ function(BreakPointType) {
|
|
5512
|
-
BreakPointType["Normal"] = "Normal";
|
|
5513
|
-
BreakPointType["Mandatory"] = "Mandatory";
|
|
5514
|
-
BreakPointType["Hyphen"] = "Hyphen";
|
|
5515
|
-
BreakPointType["Link"] = "Link";
|
|
5516
|
-
return BreakPointType;
|
|
5517
|
-
}({});
|
|
5518
5485
|
var Break = class {
|
|
5519
|
-
constructor(position, type =
|
|
5486
|
+
constructor(position, type = "Normal") {
|
|
5520
5487
|
this.position = position;
|
|
5521
5488
|
this.type = type;
|
|
5522
5489
|
}
|
|
@@ -11194,7 +11161,7 @@ var LineBreaker = class {
|
|
|
11194
11161
|
this._nextClass = this._nextCharClass();
|
|
11195
11162
|
if (this._curClass === 34 || this._curClass === 36 && this._nextClass !== 37) {
|
|
11196
11163
|
this._curClass = mapFirst(mapClass(this._nextClass));
|
|
11197
|
-
return new Break(this._lastPos,
|
|
11164
|
+
return new Break(this._lastPos, "Mandatory");
|
|
11198
11165
|
}
|
|
11199
11166
|
if (this._rule.shouldBreak(this._codePoint, this._lastCodePoint, this._nextClass)) {
|
|
11200
11167
|
this._curClass = mapFirst(mapClass(this._nextClass));
|
|
@@ -11344,100 +11311,115 @@ var DocSimpleSkeleton = class {
|
|
|
11344
11311
|
while (true) {
|
|
11345
11312
|
const breakPoint = this._lineBreaker.nextBreakPoint();
|
|
11346
11313
|
if (!breakPoint) break;
|
|
11347
|
-
const { position } = breakPoint;
|
|
11348
|
-
const
|
|
11349
|
-
const
|
|
11350
|
-
|
|
11351
|
-
|
|
11314
|
+
const { position, type } = breakPoint;
|
|
11315
|
+
const rawText = this._text.slice(lastPosition, position);
|
|
11316
|
+
const isMandatoryBreak = type === "Mandatory";
|
|
11317
|
+
const text = isMandatoryBreak ? rawText.replace(/[\r\n]+$/, "") : rawText;
|
|
11318
|
+
if (text.length > 0) {
|
|
11319
|
+
const textSize = FontCache.getMeasureText(text, this._fontStyle);
|
|
11320
|
+
if (textSize.width + currentLine.width > this._width) if (textSize.width > this._width) {
|
|
11321
|
+
if (currentLine.text.length > 0) {
|
|
11322
|
+
this._lines.push(currentLine);
|
|
11323
|
+
totalHeight += currentLine.height;
|
|
11324
|
+
if (totalHeight > this._height) break;
|
|
11325
|
+
currentLine = {
|
|
11326
|
+
text: "",
|
|
11327
|
+
width: 0,
|
|
11328
|
+
height: 0,
|
|
11329
|
+
baseline: 0
|
|
11330
|
+
};
|
|
11331
|
+
}
|
|
11332
|
+
let remainingText = text;
|
|
11333
|
+
while (remainingText.length > 0) {
|
|
11334
|
+
let charCount = 0;
|
|
11335
|
+
let lineText = "";
|
|
11336
|
+
let lineWidth = 0;
|
|
11337
|
+
let startGuess = Math.min(this._lastBreakLength, remainingText.length);
|
|
11338
|
+
if (startGuess === 0) startGuess = Math.min(10, remainingText.length);
|
|
11339
|
+
let testText = remainingText.slice(0, startGuess);
|
|
11340
|
+
let testSize = FontCache.getMeasureText(testText, this._fontStyle);
|
|
11341
|
+
if (testSize.width + currentLine.width <= this._width) {
|
|
11342
|
+
charCount = startGuess;
|
|
11343
|
+
for (let i = startGuess + 1; i <= remainingText.length; i++) {
|
|
11344
|
+
testText = remainingText.slice(0, i);
|
|
11345
|
+
testSize = FontCache.getMeasureText(testText, this._fontStyle);
|
|
11346
|
+
if (testSize.width + currentLine.width <= this._width) charCount = i;
|
|
11347
|
+
else break;
|
|
11348
|
+
}
|
|
11349
|
+
} else {
|
|
11350
|
+
charCount = 0;
|
|
11351
|
+
for (let i = startGuess - 1; i >= 1; i--) {
|
|
11352
|
+
testText = remainingText.slice(0, i);
|
|
11353
|
+
testSize = FontCache.getMeasureText(testText, this._fontStyle);
|
|
11354
|
+
if (testSize.width + currentLine.width <= this._width) {
|
|
11355
|
+
charCount = i;
|
|
11356
|
+
break;
|
|
11357
|
+
}
|
|
11358
|
+
}
|
|
11359
|
+
}
|
|
11360
|
+
if (charCount > 0) this._lastBreakLength = charCount;
|
|
11361
|
+
if (charCount > 0) {
|
|
11362
|
+
lineText = remainingText.slice(0, charCount);
|
|
11363
|
+
lineWidth = FontCache.getMeasureText(lineText, this._fontStyle).width;
|
|
11364
|
+
}
|
|
11365
|
+
if (charCount === 0 && currentLine.text.length === 0) {
|
|
11366
|
+
charCount = 1;
|
|
11367
|
+
lineText = remainingText[0];
|
|
11368
|
+
lineWidth = FontCache.getMeasureText(lineText, this._fontStyle).width;
|
|
11369
|
+
}
|
|
11370
|
+
if (charCount > 0) {
|
|
11371
|
+
currentLine.text += lineText;
|
|
11372
|
+
currentLine.width += lineWidth;
|
|
11373
|
+
const textSize = FontCache.getMeasureText(currentLine.text, this._fontStyle);
|
|
11374
|
+
currentLine.height = textSize.fontBoundingBoxAscent + textSize.fontBoundingBoxDescent;
|
|
11375
|
+
currentLine.baseline = textSize.fontBoundingBoxAscent;
|
|
11376
|
+
remainingText = remainingText.slice(charCount);
|
|
11377
|
+
if (remainingText.length > 0) {
|
|
11378
|
+
this._lines.push(currentLine);
|
|
11379
|
+
totalHeight += currentLine.height;
|
|
11380
|
+
if (totalHeight > this._height) break;
|
|
11381
|
+
currentLine = {
|
|
11382
|
+
text: "",
|
|
11383
|
+
width: 0,
|
|
11384
|
+
height: 0,
|
|
11385
|
+
baseline: 0
|
|
11386
|
+
};
|
|
11387
|
+
}
|
|
11388
|
+
} else break;
|
|
11389
|
+
}
|
|
11390
|
+
} else if (currentLine.text.length > 0) {
|
|
11352
11391
|
this._lines.push(currentLine);
|
|
11353
11392
|
totalHeight += currentLine.height;
|
|
11354
11393
|
if (totalHeight > this._height) break;
|
|
11355
11394
|
currentLine = {
|
|
11356
|
-
text
|
|
11357
|
-
width:
|
|
11358
|
-
height:
|
|
11359
|
-
baseline:
|
|
11395
|
+
text,
|
|
11396
|
+
width: textSize.width,
|
|
11397
|
+
height: textSize.fontBoundingBoxAscent + textSize.fontBoundingBoxDescent,
|
|
11398
|
+
baseline: textSize.fontBoundingBoxAscent
|
|
11360
11399
|
};
|
|
11400
|
+
} else currentLine = {
|
|
11401
|
+
text,
|
|
11402
|
+
width: textSize.width,
|
|
11403
|
+
height: textSize.fontBoundingBoxAscent + textSize.fontBoundingBoxDescent,
|
|
11404
|
+
baseline: textSize.fontBoundingBoxAscent
|
|
11405
|
+
};
|
|
11406
|
+
else {
|
|
11407
|
+
currentLine.text = currentLine.text + text;
|
|
11408
|
+
currentLine.width = currentLine.width + textSize.width;
|
|
11409
|
+
currentLine.baseline = textSize.fontBoundingBoxAscent;
|
|
11410
|
+
currentLine.height = textSize.fontBoundingBoxAscent + textSize.fontBoundingBoxDescent;
|
|
11361
11411
|
}
|
|
11362
|
-
|
|
11363
|
-
|
|
11364
|
-
let charCount = 0;
|
|
11365
|
-
let lineText = "";
|
|
11366
|
-
let lineWidth = 0;
|
|
11367
|
-
let startGuess = Math.min(this._lastBreakLength, remainingText.length);
|
|
11368
|
-
if (startGuess === 0) startGuess = Math.min(10, remainingText.length);
|
|
11369
|
-
let testText = remainingText.slice(0, startGuess);
|
|
11370
|
-
let testSize = FontCache.getMeasureText(testText, this._fontStyle);
|
|
11371
|
-
if (testSize.width + currentLine.width <= this._width) {
|
|
11372
|
-
charCount = startGuess;
|
|
11373
|
-
for (let i = startGuess + 1; i <= remainingText.length; i++) {
|
|
11374
|
-
testText = remainingText.slice(0, i);
|
|
11375
|
-
testSize = FontCache.getMeasureText(testText, this._fontStyle);
|
|
11376
|
-
if (testSize.width + currentLine.width <= this._width) charCount = i;
|
|
11377
|
-
else break;
|
|
11378
|
-
}
|
|
11379
|
-
} else {
|
|
11380
|
-
charCount = 0;
|
|
11381
|
-
for (let i = startGuess - 1; i >= 1; i--) {
|
|
11382
|
-
testText = remainingText.slice(0, i);
|
|
11383
|
-
testSize = FontCache.getMeasureText(testText, this._fontStyle);
|
|
11384
|
-
if (testSize.width + currentLine.width <= this._width) {
|
|
11385
|
-
charCount = i;
|
|
11386
|
-
break;
|
|
11387
|
-
}
|
|
11388
|
-
}
|
|
11389
|
-
}
|
|
11390
|
-
if (charCount > 0) this._lastBreakLength = charCount;
|
|
11391
|
-
if (charCount > 0) {
|
|
11392
|
-
lineText = remainingText.slice(0, charCount);
|
|
11393
|
-
lineWidth = FontCache.getMeasureText(lineText, this._fontStyle).width;
|
|
11394
|
-
}
|
|
11395
|
-
if (charCount === 0 && currentLine.text.length === 0) {
|
|
11396
|
-
charCount = 1;
|
|
11397
|
-
lineText = remainingText[0];
|
|
11398
|
-
lineWidth = FontCache.getMeasureText(lineText, this._fontStyle).width;
|
|
11399
|
-
}
|
|
11400
|
-
if (charCount > 0) {
|
|
11401
|
-
currentLine.text += lineText;
|
|
11402
|
-
currentLine.width += lineWidth;
|
|
11403
|
-
const textSize = FontCache.getMeasureText(currentLine.text, this._fontStyle);
|
|
11404
|
-
currentLine.height = textSize.fontBoundingBoxAscent + textSize.fontBoundingBoxDescent;
|
|
11405
|
-
currentLine.baseline = textSize.fontBoundingBoxAscent;
|
|
11406
|
-
remainingText = remainingText.slice(charCount);
|
|
11407
|
-
if (remainingText.length > 0) {
|
|
11408
|
-
this._lines.push(currentLine);
|
|
11409
|
-
totalHeight += currentLine.height;
|
|
11410
|
-
if (totalHeight > this._height) break;
|
|
11411
|
-
currentLine = {
|
|
11412
|
-
text: "",
|
|
11413
|
-
width: 0,
|
|
11414
|
-
height: 0,
|
|
11415
|
-
baseline: 0
|
|
11416
|
-
};
|
|
11417
|
-
}
|
|
11418
|
-
} else break;
|
|
11419
|
-
}
|
|
11420
|
-
} else if (currentLine.text.length > 0) {
|
|
11412
|
+
}
|
|
11413
|
+
if (isMandatoryBreak) {
|
|
11421
11414
|
this._lines.push(currentLine);
|
|
11422
11415
|
totalHeight += currentLine.height;
|
|
11423
11416
|
if (totalHeight > this._height) break;
|
|
11424
11417
|
currentLine = {
|
|
11425
|
-
text,
|
|
11426
|
-
width:
|
|
11427
|
-
height:
|
|
11428
|
-
baseline:
|
|
11418
|
+
text: "",
|
|
11419
|
+
width: 0,
|
|
11420
|
+
height: 0,
|
|
11421
|
+
baseline: 0
|
|
11429
11422
|
};
|
|
11430
|
-
} else currentLine = {
|
|
11431
|
-
text,
|
|
11432
|
-
width: textSize.width,
|
|
11433
|
-
height: textSize.fontBoundingBoxAscent + textSize.fontBoundingBoxDescent,
|
|
11434
|
-
baseline: textSize.fontBoundingBoxAscent
|
|
11435
|
-
};
|
|
11436
|
-
else {
|
|
11437
|
-
currentLine.text = currentLine.text + text;
|
|
11438
|
-
currentLine.width = currentLine.width + textSize.width;
|
|
11439
|
-
currentLine.baseline = textSize.fontBoundingBoxAscent;
|
|
11440
|
-
currentLine.height = textSize.fontBoundingBoxAscent + textSize.fontBoundingBoxDescent;
|
|
11441
11423
|
}
|
|
11442
11424
|
lastPosition = position;
|
|
11443
11425
|
}
|
|
@@ -11513,8 +11495,8 @@ var Shape = class extends BaseObject {
|
|
|
11513
11495
|
_defineProperty(this, "_strokeDashArray", void 0);
|
|
11514
11496
|
_defineProperty(this, "_strokeDashOffset", 0);
|
|
11515
11497
|
_defineProperty(this, "_strokeMiterLimit", 0);
|
|
11516
|
-
_defineProperty(this, "_type",
|
|
11517
|
-
_defineProperty(this, "objectType",
|
|
11498
|
+
_defineProperty(this, "_type", "rect");
|
|
11499
|
+
_defineProperty(this, "objectType", 2);
|
|
11518
11500
|
this._initialProps(props);
|
|
11519
11501
|
}
|
|
11520
11502
|
get hoverCursor() {
|
|
@@ -11978,12 +11960,12 @@ var Liquid = class {
|
|
|
11978
11960
|
const { marginTop: pagePaddingTop = 0, marginBottom: _pagePaddingBottom = 0, marginLeft: pagePaddingLeft = 0, marginRight: _pagePaddingRight = 0 } = page;
|
|
11979
11961
|
this.translate(-pagePaddingLeft, -pagePaddingTop);
|
|
11980
11962
|
}
|
|
11981
|
-
translatePage(page, type =
|
|
11963
|
+
translatePage(page, type = 0, left = 0, top = 0, _right = 0, _bottom = 0) {
|
|
11982
11964
|
const { pageWidth, pageHeight } = page;
|
|
11983
11965
|
let pageTop = 0;
|
|
11984
11966
|
let pageLeft = 0;
|
|
11985
|
-
if (type ===
|
|
11986
|
-
else if (type ===
|
|
11967
|
+
if (type === 0) pageTop += pageHeight + top;
|
|
11968
|
+
else if (type === 1) pageLeft += pageWidth + left;
|
|
11987
11969
|
this.translate(pageLeft, pageTop);
|
|
11988
11970
|
return {
|
|
11989
11971
|
x: pageLeft,
|
|
@@ -12288,7 +12270,7 @@ var DocumentViewModel = class DocumentViewModel {
|
|
|
12288
12270
|
_defineProperty(this, "_tableCache", /* @__PURE__ */ new Map());
|
|
12289
12271
|
_defineProperty(this, "_tableNodeCache", /* @__PURE__ */ new Map());
|
|
12290
12272
|
_defineProperty(this, "_children", []);
|
|
12291
|
-
_defineProperty(this, "_editArea",
|
|
12273
|
+
_defineProperty(this, "_editArea", "BODY");
|
|
12292
12274
|
_defineProperty(this, "_editAreaChange$", new BehaviorSubject(null));
|
|
12293
12275
|
_defineProperty(this, "editAreaChange$", this._editAreaChange$.asObservable());
|
|
12294
12276
|
_defineProperty(this, "_headerTreeMap", /* @__PURE__ */ new Map());
|
|
@@ -12528,16 +12510,16 @@ function baseAdjustability(content, width) {
|
|
|
12528
12510
|
};
|
|
12529
12511
|
}
|
|
12530
12512
|
function createSkeletonWordGlyph(content, config, glyphWidth) {
|
|
12531
|
-
return _createSkeletonWordOrLetter(
|
|
12513
|
+
return _createSkeletonWordOrLetter(1, content, config, glyphWidth);
|
|
12532
12514
|
}
|
|
12533
12515
|
function createSkeletonLetterGlyph(content, config, glyphWidth, glyphInfo) {
|
|
12534
|
-
return _createSkeletonWordOrLetter(
|
|
12516
|
+
return _createSkeletonWordOrLetter(0, content, config, glyphWidth, glyphInfo);
|
|
12535
12517
|
}
|
|
12536
12518
|
function createSkeletonTabGlyph(config, glyphWidth) {
|
|
12537
|
-
return _createSkeletonWordOrLetter(
|
|
12519
|
+
return _createSkeletonWordOrLetter(4, DataStreamTreeTokenType.TAB, config, glyphWidth);
|
|
12538
12520
|
}
|
|
12539
12521
|
function createHyphenDashGlyph(config) {
|
|
12540
|
-
const dashLetterGlyph = _createSkeletonWordOrLetter(
|
|
12522
|
+
const dashLetterGlyph = _createSkeletonWordOrLetter(0, "-", config);
|
|
12541
12523
|
dashLetterGlyph.count = 0;
|
|
12542
12524
|
return dashLetterGlyph;
|
|
12543
12525
|
}
|
|
@@ -12566,7 +12548,7 @@ function createSkeletonCustomBlockGlyph(config, glyphWidth = 0, glyphHeight = 0,
|
|
|
12566
12548
|
left: 0,
|
|
12567
12549
|
isJustifiable: false,
|
|
12568
12550
|
adjustability: baseAdjustability(content, 0),
|
|
12569
|
-
glyphType:
|
|
12551
|
+
glyphType: 3,
|
|
12570
12552
|
streamType: content,
|
|
12571
12553
|
count: 1,
|
|
12572
12554
|
drawingId
|
|
@@ -12612,7 +12594,7 @@ function _createSkeletonWordOrLetter(glyphType, content, config, glyphWidth, gly
|
|
|
12612
12594
|
left: 0,
|
|
12613
12595
|
isJustifiable: false,
|
|
12614
12596
|
adjustability: baseAdjustability(content, 0),
|
|
12615
|
-
glyphType:
|
|
12597
|
+
glyphType: 3,
|
|
12616
12598
|
streamType: content,
|
|
12617
12599
|
count: 1
|
|
12618
12600
|
};
|
|
@@ -12680,7 +12662,7 @@ function createSkeletonBulletGlyph(glyph, bulletSkeleton, charSpaceApply) {
|
|
|
12680
12662
|
left,
|
|
12681
12663
|
isJustifiable: isJustifiable(content),
|
|
12682
12664
|
adjustability: baseAdjustability(content, width),
|
|
12683
|
-
glyphType:
|
|
12665
|
+
glyphType: 2,
|
|
12684
12666
|
streamType: DataStreamTreeTokenType.LETTER,
|
|
12685
12667
|
count: 0,
|
|
12686
12668
|
raw: content
|
|
@@ -12718,17 +12700,6 @@ function glyphShrinkLeft(glyph, amount) {
|
|
|
12718
12700
|
|
|
12719
12701
|
//#endregion
|
|
12720
12702
|
//#region src/components/docs/layout/model/line.ts
|
|
12721
|
-
var WrapTextRuler = /* @__PURE__ */ function(WrapTextRuler) {
|
|
12722
|
-
WrapTextRuler[WrapTextRuler["BOTH"] = 0] = "BOTH";
|
|
12723
|
-
WrapTextRuler[WrapTextRuler["LEFT"] = 1] = "LEFT";
|
|
12724
|
-
WrapTextRuler[WrapTextRuler["RIGHT"] = 2] = "RIGHT";
|
|
12725
|
-
return WrapTextRuler;
|
|
12726
|
-
}(WrapTextRuler || {});
|
|
12727
|
-
var AxisType = /* @__PURE__ */ function(AxisType) {
|
|
12728
|
-
AxisType[AxisType["X"] = 0] = "X";
|
|
12729
|
-
AxisType[AxisType["Y"] = 1] = "Y";
|
|
12730
|
-
return AxisType;
|
|
12731
|
-
}(AxisType || {});
|
|
12732
12703
|
function createSkeletonLine(paragraphIndex, lineType, lineBoundingBox, columnWidth, lineIndex = 0, isParagraphStart = false, paragraphConfig, page, headerPage, footerPage) {
|
|
12733
12704
|
var _page$skeDrawings, _page$skeTables;
|
|
12734
12705
|
const { lineHeight = 15.6, lineTop = 0, contentHeight = 0, paddingLeft = 0, paddingRight = 0, paddingTop = 0, paddingBottom = 0, marginTop = 0, spaceBelowApply = 0 } = lineBoundingBox;
|
|
@@ -12920,11 +12891,11 @@ function __getCrossPoint(points, lineTop, lineHeight, columnWidth) {
|
|
|
12920
12891
|
width: range.max
|
|
12921
12892
|
};
|
|
12922
12893
|
}
|
|
12923
|
-
function ___getMaxAndMinAxis(points, axis =
|
|
12894
|
+
function ___getMaxAndMinAxis(points, axis = 0) {
|
|
12924
12895
|
const result = [];
|
|
12925
12896
|
for (let i = 0; i < points.length; i++) {
|
|
12926
12897
|
const point = points[i];
|
|
12927
|
-
if (axis ===
|
|
12898
|
+
if (axis === 0) result.push(point.x);
|
|
12928
12899
|
else result.push(point.y);
|
|
12929
12900
|
}
|
|
12930
12901
|
return {
|
|
@@ -12939,8 +12910,8 @@ function __getSplitWidthNoAngle(top, height, left, width, lineTop, lineHeight, c
|
|
|
12939
12910
|
let resultLeft = left - distL;
|
|
12940
12911
|
let resultWidth = width + distL + distR;
|
|
12941
12912
|
const ruler = ___getWrapTextRuler(wrapText, resultLeft, resultWidth, columnWidth);
|
|
12942
|
-
if (ruler ===
|
|
12943
|
-
else if (ruler ===
|
|
12913
|
+
if (ruler === 1) resultWidth = columnWidth - resultLeft;
|
|
12914
|
+
else if (ruler === 2) {
|
|
12944
12915
|
resultLeft = 0;
|
|
12945
12916
|
resultWidth = left + width + distR;
|
|
12946
12917
|
}
|
|
@@ -12950,11 +12921,11 @@ function __getSplitWidthNoAngle(top, height, left, width, lineTop, lineHeight, c
|
|
|
12950
12921
|
};
|
|
12951
12922
|
}
|
|
12952
12923
|
function ___getWrapTextRuler(wrapText, resultLeft, resultWidth, columnWidth) {
|
|
12953
|
-
let ruler =
|
|
12954
|
-
if (wrapText === WrapTextType.LEFT) ruler =
|
|
12955
|
-
else if (wrapText === WrapTextType.RIGHT) ruler =
|
|
12956
|
-
else if (wrapText === WrapTextType.LARGEST) if (resultLeft > columnWidth - resultLeft - resultWidth) ruler =
|
|
12957
|
-
else ruler =
|
|
12924
|
+
let ruler = 0;
|
|
12925
|
+
if (wrapText === WrapTextType.LEFT) ruler = 1;
|
|
12926
|
+
else if (wrapText === WrapTextType.RIGHT) ruler = 2;
|
|
12927
|
+
else if (wrapText === WrapTextType.LARGEST) if (resultLeft > columnWidth - resultLeft - resultWidth) ruler = 1;
|
|
12928
|
+
else ruler = 2;
|
|
12958
12929
|
return ruler;
|
|
12959
12930
|
}
|
|
12960
12931
|
function _calculateDivideByDrawings(columnWidth, drawingSplit) {
|
|
@@ -13361,7 +13332,7 @@ function getTableIdAndSliceIndex(tableSliceId) {
|
|
|
13361
13332
|
|
|
13362
13333
|
//#endregion
|
|
13363
13334
|
//#region src/components/docs/layout/block/paragraph/layout-ruler.ts
|
|
13364
|
-
function layoutParagraph(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType =
|
|
13335
|
+
function layoutParagraph(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType = "Normal") {
|
|
13365
13336
|
if (isParagraphFirstShapedText) if (paragraphConfig.bulletSkeleton) {
|
|
13366
13337
|
const { bulletSkeleton, paragraphStyle = {} } = paragraphConfig;
|
|
13367
13338
|
const { gridType = GridType.LINES, charSpace = 0, defaultTabStop = 10.5 } = sectionBreakConfig;
|
|
@@ -13408,7 +13379,7 @@ function _getConsecutiveHyphenLineCount(divide) {
|
|
|
13408
13379
|
let count = 0;
|
|
13409
13380
|
for (let i = column.lines.length - 1; i >= 0; i--) {
|
|
13410
13381
|
const line = column.lines[i];
|
|
13411
|
-
if (line.divides[line.divides.length - 1].breakType ===
|
|
13382
|
+
if (line.divides[line.divides.length - 1].breakType === "Hyphen") count++;
|
|
13412
13383
|
else break;
|
|
13413
13384
|
}
|
|
13414
13385
|
return count;
|
|
@@ -13426,7 +13397,7 @@ function _popHyphenSlice(divide) {
|
|
|
13426
13397
|
}
|
|
13427
13398
|
return glyphGroup;
|
|
13428
13399
|
}
|
|
13429
|
-
function _divideOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType =
|
|
13400
|
+
function _divideOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType = "Normal", defaultSpanLineHeight) {
|
|
13430
13401
|
const divideInfo = getLastNotFullDivideInfo(getLastPage(pages));
|
|
13431
13402
|
if (divideInfo) {
|
|
13432
13403
|
var _divide$glyphGroup;
|
|
@@ -13455,12 +13426,12 @@ function _divideOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphCo
|
|
|
13455
13426
|
} else if (hyphenLineCount > consecutiveHyphenLimit) {
|
|
13456
13427
|
const hyphenSliceGlyphGroup = _popHyphenSlice(divide);
|
|
13457
13428
|
if (hyphenSliceGlyphGroup.length > 0) {
|
|
13458
|
-
updateDivideInfo(divide, { breakType:
|
|
13459
|
-
_divideOperator(ctx, hyphenSliceGlyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText,
|
|
13429
|
+
updateDivideInfo(divide, { breakType: "Normal" });
|
|
13430
|
+
_divideOperator(ctx, hyphenSliceGlyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, "Hyphen");
|
|
13460
13431
|
}
|
|
13461
13432
|
_divideOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType, defaultSpanLineHeight);
|
|
13462
13433
|
} else _divideOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType, defaultSpanLineHeight);
|
|
13463
|
-
} else if (isLast && hyphenationZone && hyphenationZone > 0 && preOffsetLeft >= divide.width - hyphenationZone && breakPointType ===
|
|
13434
|
+
} else if (isLast && hyphenationZone && hyphenationZone > 0 && preOffsetLeft >= divide.width - hyphenationZone && breakPointType === "Hyphen" && divide.breakType === "Normal") {
|
|
13464
13435
|
updateDivideInfo(divide, { isFull: true });
|
|
13465
13436
|
_divideOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType, defaultSpanLineHeight);
|
|
13466
13437
|
} else {
|
|
@@ -13475,7 +13446,7 @@ function _divideOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphCo
|
|
|
13475
13446
|
const spanGroupCachedLen = spanGroupCached.length;
|
|
13476
13447
|
let newGlyphGroup = [];
|
|
13477
13448
|
let startIndex = 1;
|
|
13478
|
-
if (spanGroupCachedLen > 2 && spanGroupCached[0].glyphType ===
|
|
13449
|
+
if (spanGroupCachedLen > 2 && spanGroupCached[0].glyphType === 2) {
|
|
13479
13450
|
newGlyphGroup = [spanGroupCached[0], spanGroupCached[1]];
|
|
13480
13451
|
startIndex = 2;
|
|
13481
13452
|
} else newGlyphGroup = [spanGroupCached[0]];
|
|
@@ -13491,7 +13462,7 @@ function _divideOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphCo
|
|
|
13491
13462
|
}
|
|
13492
13463
|
} else _lineOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType, defaultSpanLineHeight);
|
|
13493
13464
|
}
|
|
13494
|
-
function _lineOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType =
|
|
13465
|
+
function _lineOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType = "Normal", defaultGlyphLineHeight) {
|
|
13495
13466
|
var _originParagraphStyle, _originParagraphStyle2, _skeHeaders$get, _skeFooters$get;
|
|
13496
13467
|
let lastPage = getLastPage(pages);
|
|
13497
13468
|
let columnInfo = getLastNotFullColumnInfo(lastPage);
|
|
@@ -13568,7 +13539,7 @@ function _lineOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConf
|
|
|
13568
13539
|
paddingLeft = column.width * leftPercent - .5;
|
|
13569
13540
|
paddingRight = column.width - paddingLeft - .5;
|
|
13570
13541
|
}
|
|
13571
|
-
const newLine = createSkeletonLine(paragraphIndex,
|
|
13542
|
+
const newLine = createSkeletonLine(paragraphIndex, 0, {
|
|
13572
13543
|
lineHeight,
|
|
13573
13544
|
contentHeight,
|
|
13574
13545
|
lineTop: newLineTop,
|
|
@@ -13601,7 +13572,7 @@ function __updateAndPositionDrawings(ctx, lineTop, lineHeight, column, targetDra
|
|
|
13601
13572
|
width,
|
|
13602
13573
|
height,
|
|
13603
13574
|
angle,
|
|
13604
|
-
type:
|
|
13575
|
+
type: "IMAGE",
|
|
13605
13576
|
positionV
|
|
13606
13577
|
};
|
|
13607
13578
|
}), column, paragraphIndex);
|
|
@@ -13619,7 +13590,7 @@ function __updateWrapTablePosition(ctx, table, lineTop, lineHeight, column, para
|
|
|
13619
13590
|
width,
|
|
13620
13591
|
height,
|
|
13621
13592
|
angle: 0,
|
|
13622
|
-
type:
|
|
13593
|
+
type: "TABLE",
|
|
13623
13594
|
positionV: tableSource.position.positionV
|
|
13624
13595
|
}], column, paragraphIndex);
|
|
13625
13596
|
table.top = top;
|
|
@@ -13775,11 +13746,11 @@ function checkRelativeDrawingNeedRePosition(ctx, floatObject) {
|
|
|
13775
13746
|
}
|
|
13776
13747
|
return false;
|
|
13777
13748
|
}
|
|
13778
|
-
function _columnOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType =
|
|
13749
|
+
function _columnOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType = "Normal", defaultSpanLineHeight) {
|
|
13779
13750
|
if (isColumnFull(getLastPage(pages)) === true) _pageOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType, defaultSpanLineHeight);
|
|
13780
13751
|
else _lineOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType, defaultSpanLineHeight);
|
|
13781
13752
|
}
|
|
13782
|
-
function _pageOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType =
|
|
13753
|
+
function _pageOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType = "Normal", defaultSpanLineHeight) {
|
|
13783
13754
|
const curSkeletonPage = getLastPage(pages);
|
|
13784
13755
|
const { skeHeaders, skeFooters } = paragraphConfig;
|
|
13785
13756
|
pages.push(createSkeletonPage(ctx, sectionBreakConfig, {
|
|
@@ -14136,7 +14107,7 @@ function updateBlockIndex(pages, start = -1) {
|
|
|
14136
14107
|
const divStartIndex = preDivideStartIndex;
|
|
14137
14108
|
let divEndIndex = divStartIndex;
|
|
14138
14109
|
for (const glyph of glyphGroup) {
|
|
14139
|
-
const increaseValue = glyph.glyphType ===
|
|
14110
|
+
const increaseValue = glyph.glyphType === 2 ? 0 : glyph.count;
|
|
14140
14111
|
divEndIndex += increaseValue;
|
|
14141
14112
|
const { ba, bd } = glyph.bBox;
|
|
14142
14113
|
maxLineAsc = Math.max(maxLineAsc, ba);
|
|
@@ -14402,11 +14373,6 @@ function getNullSkeleton() {
|
|
|
14402
14373
|
function setPageParent(pages, parent) {
|
|
14403
14374
|
for (const page of pages) page.parent = parent;
|
|
14404
14375
|
}
|
|
14405
|
-
let FloatObjectType = /* @__PURE__ */ function(FloatObjectType) {
|
|
14406
|
-
FloatObjectType["IMAGE"] = "IMAGE";
|
|
14407
|
-
FloatObjectType["TABLE"] = "TABLE";
|
|
14408
|
-
return FloatObjectType;
|
|
14409
|
-
}({});
|
|
14410
14376
|
const DEFAULT_SECTION_BREAK = {
|
|
14411
14377
|
columnProperties: [],
|
|
14412
14378
|
columnSeparatorType: ColumnSeparatorType.NONE,
|
|
@@ -14554,7 +14520,7 @@ function getPageFromPath(skeletonData, path) {
|
|
|
14554
14520
|
function getHeaderFooterMaxHeight(pageHeight) {
|
|
14555
14521
|
return (pageHeight - 100) / 2;
|
|
14556
14522
|
}
|
|
14557
|
-
function createSkeletonPage(ctx, sectionBreakConfig, skeletonResourceReference, pageNumber = 1, breakType =
|
|
14523
|
+
function createSkeletonPage(ctx, sectionBreakConfig, skeletonResourceReference, pageNumber = 1, breakType = 0) {
|
|
14558
14524
|
const page = _getNullPage();
|
|
14559
14525
|
const { pageNumberStart = 1, pageSize = {
|
|
14560
14526
|
width: Number.POSITIVE_INFINITY,
|
|
@@ -14624,7 +14590,7 @@ function createSkeletonPage(ctx, sectionBreakConfig, skeletonResourceReference,
|
|
|
14624
14590
|
sections.push(newSection);
|
|
14625
14591
|
return page;
|
|
14626
14592
|
}
|
|
14627
|
-
function _getNullPage(type =
|
|
14593
|
+
function _getNullPage(type = 0, segmentId = "") {
|
|
14628
14594
|
return {
|
|
14629
14595
|
sections: [],
|
|
14630
14596
|
headerId: "",
|
|
@@ -14645,7 +14611,7 @@ function _getNullPage(type = DocumentSkeletonPageType.BODY, segmentId = "") {
|
|
|
14645
14611
|
marginTop: 0,
|
|
14646
14612
|
originMarginBottom: 0,
|
|
14647
14613
|
marginBottom: 0,
|
|
14648
|
-
breakType:
|
|
14614
|
+
breakType: 0,
|
|
14649
14615
|
st: 0,
|
|
14650
14616
|
ed: 0,
|
|
14651
14617
|
skeDrawings: /* @__PURE__ */ new Map(),
|
|
@@ -14671,7 +14637,7 @@ function _createSkeletonHeaderFooter(ctx, headerOrFooterViewModel, sectionBreakC
|
|
|
14671
14637
|
};
|
|
14672
14638
|
if (areaPage == null) {
|
|
14673
14639
|
areaPage = createSkeletonPage(ctx, headerFooterConfig, skeletonResourceReference);
|
|
14674
|
-
areaPage.type = isHeader ?
|
|
14640
|
+
areaPage.type = isHeader ? 1 : 2;
|
|
14675
14641
|
areaPage.segmentId = segmentId;
|
|
14676
14642
|
}
|
|
14677
14643
|
const layoutAnchor = ctx.layoutStartPointer[segmentId];
|
|
@@ -14720,7 +14686,7 @@ function createNullCellPage(ctx, sectionBreakConfig, tableConfig, row, col, avai
|
|
|
14720
14686
|
width: pageWidth,
|
|
14721
14687
|
height: Number.isFinite(availableHeight) ? availableHeight : pageHeight
|
|
14722
14688
|
} }), skeletonResourceReference);
|
|
14723
|
-
areaPage.type =
|
|
14689
|
+
areaPage.type = 3;
|
|
14724
14690
|
areaPage.segmentId = tableId;
|
|
14725
14691
|
return {
|
|
14726
14692
|
page: areaPage,
|
|
@@ -14732,7 +14698,7 @@ function createSkeletonCellPages(ctx, viewModel, cellNode, sectionBreakConfig, t
|
|
|
14732
14698
|
const { page: areaPage, sectionBreakConfig: cellSectionBreakConfig } = createNullCellPage(ctx, sectionBreakConfig, tableConfig, row, col, availableHeight, maxCellPageHeight);
|
|
14733
14699
|
const { pages } = dealWithSection(ctx, viewModel, sectionNode, areaPage, cellSectionBreakConfig);
|
|
14734
14700
|
for (const p of pages) {
|
|
14735
|
-
p.type =
|
|
14701
|
+
p.type = 3;
|
|
14736
14702
|
p.segmentId = tableConfig.tableId;
|
|
14737
14703
|
}
|
|
14738
14704
|
updateBlockIndex(pages, cellNode.startIndex);
|
|
@@ -14931,7 +14897,7 @@ function addHyphenDash(line, viewModel, paragraphNode, sectionBreakConfig, parag
|
|
|
14931
14897
|
for (const divide of line.divides) {
|
|
14932
14898
|
const { glyphGroup, breakType } = divide;
|
|
14933
14899
|
const lastGlyph = glyphGroup[glyphGroup.length - 1];
|
|
14934
|
-
if (lastGlyph && isLetter(lastGlyph.content) && breakType ===
|
|
14900
|
+
if (lastGlyph && isLetter(lastGlyph.content) && breakType === "Hyphen") {
|
|
14935
14901
|
const hyphenDashGlyph = createHyphenDashGlyph(getFontConfigFromLastGlyph(lastGlyph, sectionBreakConfig, paragraphStyle));
|
|
14936
14902
|
hyphenDashGlyph.parent = lastGlyph.parent;
|
|
14937
14903
|
hyphenDashGlyph.left = lastGlyph.left + lastGlyph.width;
|
|
@@ -15256,7 +15222,7 @@ function lineBreaking(ctx, viewModel, shapedTextList, curPage, paragraphNode, se
|
|
|
15256
15222
|
};
|
|
15257
15223
|
if (text.endsWith(DataStreamTreeTokenType.PAGE_BREAK)) {
|
|
15258
15224
|
pushPending();
|
|
15259
|
-
allPages.push(createSkeletonPage(ctx, sectionBreakConfig, skeletonResourceReference, _getNextPageNumber(allPages[allPages.length - 1]),
|
|
15225
|
+
allPages.push(createSkeletonPage(ctx, sectionBreakConfig, skeletonResourceReference, _getNextPageNumber(allPages[allPages.length - 1]), 1));
|
|
15260
15226
|
paragraphNonInlineSkeDrawings.clear();
|
|
15261
15227
|
paragraphInlineSkeDrawings.clear();
|
|
15262
15228
|
continue;
|
|
@@ -15265,7 +15231,7 @@ function lineBreaking(ctx, viewModel, shapedTextList, curPage, paragraphNode, se
|
|
|
15265
15231
|
const lastPage = allPages[allPages.length - 1];
|
|
15266
15232
|
const columnInfo = getLastNotFullColumnInfo(lastPage);
|
|
15267
15233
|
if (columnInfo && !columnInfo.isLast) setColumnFullState(columnInfo.column, true);
|
|
15268
|
-
else allPages.push(createSkeletonPage(ctx, sectionBreakConfig, skeletonResourceReference, _getNextPageNumber(lastPage),
|
|
15234
|
+
else allPages.push(createSkeletonPage(ctx, sectionBreakConfig, skeletonResourceReference, _getNextPageNumber(lastPage), 2));
|
|
15269
15235
|
continue;
|
|
15270
15236
|
}
|
|
15271
15237
|
pushPending();
|
|
@@ -15273,106 +15239,6 @@ function lineBreaking(ctx, viewModel, shapedTextList, curPage, paragraphNode, se
|
|
|
15273
15239
|
return allPages;
|
|
15274
15240
|
}
|
|
15275
15241
|
|
|
15276
|
-
//#endregion
|
|
15277
|
-
//#region src/components/docs/layout/hyphenation/lang.ts
|
|
15278
|
-
/**
|
|
15279
|
-
* Copyright 2023-present DreamNum Co., Ltd.
|
|
15280
|
-
*
|
|
15281
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
15282
|
-
* you may not use this file except in compliance with the License.
|
|
15283
|
-
* You may obtain a copy of the License at
|
|
15284
|
-
*
|
|
15285
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
15286
|
-
*
|
|
15287
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
15288
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15289
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15290
|
-
* See the License for the specific language governing permissions and
|
|
15291
|
-
* limitations under the License.
|
|
15292
|
-
*/
|
|
15293
|
-
let Lang = /* @__PURE__ */ function(Lang) {
|
|
15294
|
-
Lang["Af"] = "af";
|
|
15295
|
-
Lang["As"] = "as";
|
|
15296
|
-
Lang["Be"] = "be";
|
|
15297
|
-
Lang["Bg"] = "bg";
|
|
15298
|
-
Lang["Bn"] = "bn";
|
|
15299
|
-
Lang["Ca"] = "ca";
|
|
15300
|
-
Lang["Cop"] = "cop";
|
|
15301
|
-
Lang["Cs"] = "cs";
|
|
15302
|
-
Lang["Cu"] = "cu";
|
|
15303
|
-
Lang["Cy"] = "cy";
|
|
15304
|
-
Lang["Da"] = "da";
|
|
15305
|
-
Lang["De1901"] = "de-1901";
|
|
15306
|
-
Lang["De1996"] = "de-1996";
|
|
15307
|
-
Lang["DeCh1901"] = "de-ch-1901";
|
|
15308
|
-
Lang["ElMonoton"] = "el-monoton";
|
|
15309
|
-
Lang["ElPolyton"] = "el-polyton";
|
|
15310
|
-
Lang["EnGb"] = "en-gb";
|
|
15311
|
-
Lang["EnUs"] = "en-us";
|
|
15312
|
-
Lang["Es"] = "es";
|
|
15313
|
-
Lang["Et"] = "et";
|
|
15314
|
-
Lang["Eu"] = "eu";
|
|
15315
|
-
Lang["Fi"] = "fi";
|
|
15316
|
-
Lang["Fr"] = "fr";
|
|
15317
|
-
Lang["Fur"] = "fur";
|
|
15318
|
-
Lang["Ga"] = "ga";
|
|
15319
|
-
Lang["Gl"] = "gl";
|
|
15320
|
-
Lang["Grc"] = "grc";
|
|
15321
|
-
Lang["Gu"] = "gu";
|
|
15322
|
-
Lang["Hi"] = "hi";
|
|
15323
|
-
Lang["Hr"] = "hr";
|
|
15324
|
-
Lang["Hsb"] = "hsb";
|
|
15325
|
-
Lang["Hu"] = "hu";
|
|
15326
|
-
Lang["Hy"] = "hy";
|
|
15327
|
-
Lang["Ia"] = "ia";
|
|
15328
|
-
Lang["Id"] = "id";
|
|
15329
|
-
Lang["Is"] = "is";
|
|
15330
|
-
Lang["It"] = "it";
|
|
15331
|
-
Lang["Ka"] = "ka";
|
|
15332
|
-
Lang["Kmr"] = "kmr";
|
|
15333
|
-
Lang["Kn"] = "kn";
|
|
15334
|
-
Lang["LaXClassic"] = "la-x-classic";
|
|
15335
|
-
Lang["LaXLiturgic"] = "la-x-liturgic";
|
|
15336
|
-
Lang["La"] = "la";
|
|
15337
|
-
Lang["Lt"] = "lt";
|
|
15338
|
-
Lang["Lv"] = "lv";
|
|
15339
|
-
Lang["Ml"] = "ml";
|
|
15340
|
-
Lang["MnCyrlXLmc"] = "mn-cyrl-x-lmc";
|
|
15341
|
-
Lang["MnCyrl"] = "mn-cyrl";
|
|
15342
|
-
Lang["Mr"] = "mr";
|
|
15343
|
-
Lang["MulEthi"] = "mul-ethi";
|
|
15344
|
-
Lang["Nb"] = "nb";
|
|
15345
|
-
Lang["Nl"] = "nl";
|
|
15346
|
-
Lang["Nn"] = "nn";
|
|
15347
|
-
Lang["No"] = "no";
|
|
15348
|
-
Lang["Oc"] = "oc";
|
|
15349
|
-
Lang["Or"] = "or";
|
|
15350
|
-
Lang["Pa"] = "pa";
|
|
15351
|
-
Lang["Pi"] = "pi";
|
|
15352
|
-
Lang["Pl"] = "pl";
|
|
15353
|
-
Lang["Pms"] = "pms";
|
|
15354
|
-
Lang["Pt"] = "pt";
|
|
15355
|
-
Lang["Rm"] = "rm";
|
|
15356
|
-
Lang["Ro"] = "ro";
|
|
15357
|
-
Lang["Ru"] = "ru";
|
|
15358
|
-
Lang["Sa"] = "sa";
|
|
15359
|
-
Lang["ShCyrl"] = "sh-cyrl";
|
|
15360
|
-
Lang["ShLatn"] = "sh-latn";
|
|
15361
|
-
Lang["Sk"] = "sk";
|
|
15362
|
-
Lang["Sl"] = "sl";
|
|
15363
|
-
Lang["SrCyrl"] = "sr-cyrl";
|
|
15364
|
-
Lang["Sv"] = "sv";
|
|
15365
|
-
Lang["Ta"] = "ta";
|
|
15366
|
-
Lang["Te"] = "te";
|
|
15367
|
-
Lang["Th"] = "th";
|
|
15368
|
-
Lang["Tk"] = "tk";
|
|
15369
|
-
Lang["Tr"] = "tr";
|
|
15370
|
-
Lang["Uk"] = "uk";
|
|
15371
|
-
Lang["ZhLatnPinyin"] = "zh-latn-pinyin";
|
|
15372
|
-
Lang["UNKNOWN"] = "unknown";
|
|
15373
|
-
return Lang;
|
|
15374
|
-
}({});
|
|
15375
|
-
|
|
15376
15242
|
//#endregion
|
|
15377
15243
|
//#region src/components/docs/layout/line-breaker/enhancers/hyphen-enhancer.ts
|
|
15378
15244
|
function isUpperCase(word) {
|
|
@@ -15399,7 +15265,7 @@ var LineBreakerHyphenEnhancer = class {
|
|
|
15399
15265
|
this._nextBreak = this._lineBreaker.nextBreakPoint();
|
|
15400
15266
|
if (this._nextBreak == null || this._curBreak == null) return null;
|
|
15401
15267
|
const word = getWord(this.content.slice(this._curBreak.position, this._nextBreak.position));
|
|
15402
|
-
if (word.length && !(isUpperCase(word) && this._doNotHyphenateCaps) && this._nextBreak.type !==
|
|
15268
|
+
if (word.length && !(isUpperCase(word) && this._doNotHyphenateCaps) && this._nextBreak.type !== "Link") {
|
|
15403
15269
|
this._isInWord = true;
|
|
15404
15270
|
this._word = word;
|
|
15405
15271
|
this._hyphenSlice = this._hyphen.hyphenate(this._word, this._lang);
|
|
@@ -15409,7 +15275,7 @@ var LineBreakerHyphenEnhancer = class {
|
|
|
15409
15275
|
} else if (this._hyphenIndex < this._hyphenSlice.length - 1) {
|
|
15410
15276
|
const position = getSlicePosition(this._curBreak.position, this._hyphenSlice, this._hyphenIndex);
|
|
15411
15277
|
this._hyphenIndex++;
|
|
15412
|
-
return new Break(position,
|
|
15278
|
+
return new Break(position, "Hyphen");
|
|
15413
15279
|
} else {
|
|
15414
15280
|
this._isInWord = false;
|
|
15415
15281
|
this._word = "";
|
|
@@ -15422,27 +15288,20 @@ var LineBreakerHyphenEnhancer = class {
|
|
|
15422
15288
|
|
|
15423
15289
|
//#endregion
|
|
15424
15290
|
//#region src/components/docs/layout/line-breaker/enhancers/link-enhancer.ts
|
|
15425
|
-
var LinkCharType = /* @__PURE__ */ function(LinkCharType) {
|
|
15426
|
-
LinkCharType["Alphabetic"] = "Alphabetic";
|
|
15427
|
-
LinkCharType["Digit"] = "Digit";
|
|
15428
|
-
LinkCharType["Open"] = "Open";
|
|
15429
|
-
LinkCharType["Other"] = "Other";
|
|
15430
|
-
return LinkCharType;
|
|
15431
|
-
}(LinkCharType || {});
|
|
15432
15291
|
function ofLinkCharType(char) {
|
|
15433
|
-
if (/[a-z]/i.test(char)) return
|
|
15434
|
-
else if (/[0-9]/.test(char)) return
|
|
15435
|
-
else if (char === "(" || char === "[") return
|
|
15436
|
-
else return
|
|
15292
|
+
if (/[a-z]/i.test(char)) return "Alphabetic";
|
|
15293
|
+
else if (/[0-9]/.test(char)) return "Digit";
|
|
15294
|
+
else if (char === "(" || char === "[") return "Open";
|
|
15295
|
+
else return "Other";
|
|
15437
15296
|
}
|
|
15438
15297
|
function linebreakLink(link) {
|
|
15439
15298
|
const pieces = [];
|
|
15440
15299
|
let offset = 0;
|
|
15441
|
-
let prevCharType =
|
|
15300
|
+
let prevCharType = "Other";
|
|
15442
15301
|
for (let i = 0; i < link.length; i++) {
|
|
15443
15302
|
const char = link[i];
|
|
15444
15303
|
const charType = ofLinkCharType(char);
|
|
15445
|
-
if (i > 0 && prevCharType !==
|
|
15304
|
+
if (i > 0 && prevCharType !== "Open" && (charType === "Other" ? charType === "Other" : charType !== prevCharType)) {
|
|
15446
15305
|
const piece = link.slice(offset, i);
|
|
15447
15306
|
if (piece.length < 16) pieces.push(piece);
|
|
15448
15307
|
else for (let j = 0; j < piece.length; j++) pieces.push(piece[j]);
|
|
@@ -15493,7 +15352,7 @@ var LineBreakerLinkEnhancer = class {
|
|
|
15493
15352
|
} else if (this._index < this._linkSlice.length - 1) {
|
|
15494
15353
|
const position = getSlicePosition(this._curBreak.position, this._linkSlice, this._index);
|
|
15495
15354
|
this._index++;
|
|
15496
|
-
return new Break(position,
|
|
15355
|
+
return new Break(position, "Link");
|
|
15497
15356
|
} else {
|
|
15498
15357
|
this._isInLink = false;
|
|
15499
15358
|
this._link = "";
|
|
@@ -15524,59 +15383,35 @@ function tabLineBreakExtension(breaker) {
|
|
|
15524
15383
|
|
|
15525
15384
|
//#endregion
|
|
15526
15385
|
//#region src/components/docs/layout/shaping-engine/font-library.ts
|
|
15527
|
-
var CompareResult = /* @__PURE__ */ function(CompareResult) {
|
|
15528
|
-
CompareResult[CompareResult["EQUAL"] = 0] = "EQUAL";
|
|
15529
|
-
CompareResult[CompareResult["GREATER"] = 1] = "GREATER";
|
|
15530
|
-
CompareResult[CompareResult["LESS"] = 2] = "LESS";
|
|
15531
|
-
return CompareResult;
|
|
15532
|
-
}(CompareResult || {});
|
|
15533
|
-
var FontStyle = /* @__PURE__ */ function(FontStyle) {
|
|
15534
|
-
FontStyle[FontStyle["Normal"] = 0] = "Normal";
|
|
15535
|
-
FontStyle[FontStyle["Italic"] = 1] = "Italic";
|
|
15536
|
-
FontStyle[FontStyle["Oblique"] = 2] = "Oblique";
|
|
15537
|
-
return FontStyle;
|
|
15538
|
-
}(FontStyle || {});
|
|
15539
|
-
var FontWeight = /* @__PURE__ */ function(FontWeight) {
|
|
15540
|
-
FontWeight[FontWeight["THIN"] = 100] = "THIN";
|
|
15541
|
-
FontWeight[FontWeight["EXTRALIGHT"] = 200] = "EXTRALIGHT";
|
|
15542
|
-
FontWeight[FontWeight["LIGHT"] = 300] = "LIGHT";
|
|
15543
|
-
FontWeight[FontWeight["REGULAR"] = 400] = "REGULAR";
|
|
15544
|
-
FontWeight[FontWeight["MEDIUM"] = 500] = "MEDIUM";
|
|
15545
|
-
FontWeight[FontWeight["SEMIBOLD"] = 600] = "SEMIBOLD";
|
|
15546
|
-
FontWeight[FontWeight["BOLD"] = 700] = "BOLD";
|
|
15547
|
-
FontWeight[FontWeight["EXTRABOLD"] = 800] = "EXTRABOLD";
|
|
15548
|
-
FontWeight[FontWeight["BLACK"] = 900] = "BLACK";
|
|
15549
|
-
return FontWeight;
|
|
15550
|
-
}(FontWeight || {});
|
|
15551
15386
|
function getFontInfoFromFontData(fontData) {
|
|
15552
15387
|
const { family, style: styleString } = fontData;
|
|
15553
|
-
let style =
|
|
15554
|
-
let weight =
|
|
15555
|
-
if (/italic/i.test(styleString)) style =
|
|
15388
|
+
let style = 0;
|
|
15389
|
+
let weight = 400;
|
|
15390
|
+
if (/italic/i.test(styleString)) style = 1;
|
|
15556
15391
|
switch (true) {
|
|
15557
15392
|
case /thin|hairline/i.test(styleString):
|
|
15558
|
-
weight =
|
|
15393
|
+
weight = 100;
|
|
15559
15394
|
break;
|
|
15560
15395
|
case /(extra|ultra) *light/i.test(styleString):
|
|
15561
|
-
weight =
|
|
15396
|
+
weight = 200;
|
|
15562
15397
|
break;
|
|
15563
15398
|
case /light/i.test(styleString):
|
|
15564
|
-
weight =
|
|
15399
|
+
weight = 300;
|
|
15565
15400
|
break;
|
|
15566
15401
|
case /medium/i.test(styleString):
|
|
15567
|
-
weight =
|
|
15402
|
+
weight = 500;
|
|
15568
15403
|
break;
|
|
15569
15404
|
case /(semi|demi) *bold/i.test(styleString):
|
|
15570
|
-
weight =
|
|
15405
|
+
weight = 600;
|
|
15571
15406
|
break;
|
|
15572
15407
|
case /bold/i.test(styleString):
|
|
15573
|
-
weight =
|
|
15408
|
+
weight = 700;
|
|
15574
15409
|
break;
|
|
15575
15410
|
case /(extra|ultra) *bold/i.test(styleString):
|
|
15576
|
-
weight =
|
|
15411
|
+
weight = 800;
|
|
15577
15412
|
break;
|
|
15578
15413
|
case /black|heavy/i.test(styleString):
|
|
15579
|
-
weight =
|
|
15414
|
+
weight = 900;
|
|
15580
15415
|
break;
|
|
15581
15416
|
}
|
|
15582
15417
|
return {
|
|
@@ -15592,23 +15427,23 @@ function getFontInfoFromTextStyle(style) {
|
|
|
15592
15427
|
return {
|
|
15593
15428
|
family: ff !== null && ff !== void 0 ? ff : "Arial",
|
|
15594
15429
|
variant: {
|
|
15595
|
-
style: it === BooleanNumber.TRUE ?
|
|
15596
|
-
weight: bl === BooleanNumber.TRUE ?
|
|
15430
|
+
style: it === BooleanNumber.TRUE ? 1 : 0,
|
|
15431
|
+
weight: bl === BooleanNumber.TRUE ? 700 : 400
|
|
15597
15432
|
}
|
|
15598
15433
|
};
|
|
15599
15434
|
}
|
|
15600
15435
|
function fontInfoDistance(a, b) {
|
|
15601
15436
|
let styleDistance = Number.POSITIVE_INFINITY;
|
|
15602
15437
|
if (a.variant.style === b.variant.style) styleDistance = 0;
|
|
15603
|
-
else if (a.variant.style !==
|
|
15438
|
+
else if (a.variant.style !== 0 && b.variant.style !== 0) styleDistance = 1;
|
|
15604
15439
|
else styleDistance = 2;
|
|
15605
15440
|
const weightDistance = Math.abs(a.variant.weight - b.variant.weight);
|
|
15606
15441
|
return [styleDistance, weightDistance];
|
|
15607
15442
|
}
|
|
15608
15443
|
function compareFontInfoDistance(a, b) {
|
|
15609
|
-
if (a[0] === b[0] && a[1] === b[1]) return
|
|
15610
|
-
if (a[0] === b[0]) return a[1] > b[1] ?
|
|
15611
|
-
return a[0] > b[0] ?
|
|
15444
|
+
if (a[0] === b[0] && a[1] === b[1]) return 0;
|
|
15445
|
+
if (a[0] === b[0]) return a[1] > b[1] ? 1 : 2;
|
|
15446
|
+
return a[0] > b[0] ? 1 : 2;
|
|
15612
15447
|
}
|
|
15613
15448
|
async function checkLocalFontsPermission() {
|
|
15614
15449
|
var _window$navigator;
|
|
@@ -15663,7 +15498,7 @@ var FontLibrary = class {
|
|
|
15663
15498
|
if (bestFont == null) {
|
|
15664
15499
|
bestFont = fontWithBuffer;
|
|
15665
15500
|
bestDistance = distance;
|
|
15666
|
-
} else if (compareFontInfoDistance(bestDistance, distance) ===
|
|
15501
|
+
} else if (compareFontInfoDistance(bestDistance, distance) === 1) {
|
|
15667
15502
|
bestFont = fontWithBuffer;
|
|
15668
15503
|
bestDistance = distance;
|
|
15669
15504
|
}
|
|
@@ -15964,7 +15799,7 @@ function shaping(ctx, content, viewModel, paragraphNode, sectionBreakConfig, use
|
|
|
15964
15799
|
const lang = languageDetector.detect(content);
|
|
15965
15800
|
const needHyphen = hyphenConfig(paragraphStyle, sectionBreakConfig);
|
|
15966
15801
|
const doNotHyphenateCaps = sectionBreakConfig.doNotHyphenateCaps === BooleanNumber.TRUE;
|
|
15967
|
-
if (lang !==
|
|
15802
|
+
if (lang !== "unknown" && needHyphen) if (hyphen.hasPattern(lang)) breaker = new LineBreakerHyphenEnhancer(breaker, hyphen, lang, doNotHyphenateCaps);
|
|
15968
15803
|
else hyphen.loadPattern(lang);
|
|
15969
15804
|
while (bk = breaker.nextBreakPoint()) {
|
|
15970
15805
|
const word = content.slice(last, bk.position);
|
|
@@ -16069,7 +15904,7 @@ function shaping(ctx, content, viewModel, paragraphNode, sectionBreakConfig, use
|
|
|
16069
15904
|
shapedTextList.push({
|
|
16070
15905
|
text: word,
|
|
16071
15906
|
glyphs: shapedGlyphs,
|
|
16072
|
-
breakPointType: shapedGlyphs === lastShapedGlyphs ? bk.type :
|
|
15907
|
+
breakPointType: shapedGlyphs === lastShapedGlyphs ? bk.type : "Normal"
|
|
16073
15908
|
});
|
|
16074
15909
|
}
|
|
16075
15910
|
last = bk.position;
|
|
@@ -16168,84 +16003,84 @@ function _pushPage(allCurrentSkeletonPages, blockSkeletonPages) {
|
|
|
16168
16003
|
//#endregion
|
|
16169
16004
|
//#region src/components/docs/layout/hyphenation/pattern-loaders.gen.ts
|
|
16170
16005
|
const PATTERN_LOADERS = {
|
|
16171
|
-
[
|
|
16172
|
-
[
|
|
16173
|
-
[
|
|
16174
|
-
[
|
|
16175
|
-
[
|
|
16176
|
-
[
|
|
16177
|
-
[
|
|
16178
|
-
[
|
|
16179
|
-
[
|
|
16180
|
-
[
|
|
16181
|
-
[
|
|
16182
|
-
[
|
|
16183
|
-
[
|
|
16184
|
-
[
|
|
16185
|
-
[
|
|
16186
|
-
[
|
|
16187
|
-
[
|
|
16188
|
-
[
|
|
16189
|
-
[
|
|
16190
|
-
[
|
|
16191
|
-
[
|
|
16192
|
-
[
|
|
16193
|
-
[
|
|
16194
|
-
[
|
|
16195
|
-
[
|
|
16196
|
-
[
|
|
16197
|
-
[
|
|
16198
|
-
[
|
|
16199
|
-
[
|
|
16200
|
-
[
|
|
16201
|
-
[
|
|
16202
|
-
[
|
|
16203
|
-
[
|
|
16204
|
-
[
|
|
16205
|
-
[
|
|
16206
|
-
[
|
|
16207
|
-
[
|
|
16208
|
-
[
|
|
16209
|
-
[
|
|
16210
|
-
[
|
|
16211
|
-
[
|
|
16212
|
-
[
|
|
16213
|
-
[
|
|
16214
|
-
[
|
|
16215
|
-
[
|
|
16216
|
-
[
|
|
16217
|
-
[
|
|
16218
|
-
[
|
|
16219
|
-
[
|
|
16220
|
-
[
|
|
16221
|
-
[
|
|
16222
|
-
[
|
|
16223
|
-
[
|
|
16224
|
-
[
|
|
16225
|
-
[
|
|
16226
|
-
[
|
|
16227
|
-
[
|
|
16228
|
-
[
|
|
16229
|
-
[
|
|
16230
|
-
[
|
|
16231
|
-
[
|
|
16232
|
-
[
|
|
16233
|
-
[
|
|
16234
|
-
[
|
|
16235
|
-
[
|
|
16236
|
-
[
|
|
16237
|
-
[
|
|
16238
|
-
[
|
|
16239
|
-
[
|
|
16240
|
-
[
|
|
16241
|
-
[
|
|
16242
|
-
[
|
|
16243
|
-
[
|
|
16244
|
-
[
|
|
16245
|
-
[
|
|
16246
|
-
[
|
|
16247
|
-
[
|
|
16248
|
-
[
|
|
16006
|
+
["af"]: () => import("./af-I8XQee0A.js"),
|
|
16007
|
+
["as"]: () => import("./as-DPw4kbfa.js"),
|
|
16008
|
+
["be"]: () => import("./be-hSu5_2AE.js"),
|
|
16009
|
+
["bg"]: () => import("./bg-eIV91Ges.js"),
|
|
16010
|
+
["bn"]: () => import("./bn-CF0YbkEW.js"),
|
|
16011
|
+
["ca"]: () => import("./ca-D0fayQwW.js"),
|
|
16012
|
+
["cop"]: () => import("./cop-gnNw8zDV.js"),
|
|
16013
|
+
["cs"]: () => import("./cs-cUOdqXi9.js"),
|
|
16014
|
+
["cu"]: () => import("./cu-CJJk_6p3.js"),
|
|
16015
|
+
["cy"]: () => import("./cy-he1_O-US.js"),
|
|
16016
|
+
["da"]: () => import("./da-C_Tc6C75.js"),
|
|
16017
|
+
["de-1901"]: () => import("./de-1901-D9yvXEO8.js"),
|
|
16018
|
+
["de-1996"]: () => import("./de-1996-DIBM3qkD.js"),
|
|
16019
|
+
["de-ch-1901"]: () => import("./de-ch-1901-BEDgpl3-.js"),
|
|
16020
|
+
["el-monoton"]: () => import("./el-monoton-BvjPOyvW.js"),
|
|
16021
|
+
["el-polyton"]: () => import("./el-polyton-DfJ9Eeih.js"),
|
|
16022
|
+
["en-gb"]: () => import("./en-gb-DYXoK50H.js"),
|
|
16023
|
+
["en-us"]: () => import("./en-us-ClVoWMyT.js").then((n) => n.n),
|
|
16024
|
+
["es"]: () => import("./es-48latgZ8.js"),
|
|
16025
|
+
["et"]: () => import("./et-UzX1rSXY.js"),
|
|
16026
|
+
["eu"]: () => import("./eu-ijD7H63T.js"),
|
|
16027
|
+
["fi"]: () => import("./fi-DDuxAHu5.js"),
|
|
16028
|
+
["fr"]: () => import("./fr-6wTrAsbK.js"),
|
|
16029
|
+
["fur"]: () => import("./fur-CcIOY8A9.js"),
|
|
16030
|
+
["ga"]: () => import("./ga-B4Qvh5qS.js"),
|
|
16031
|
+
["gl"]: () => import("./gl-D8H7uN6B.js"),
|
|
16032
|
+
["grc"]: () => import("./grc-DFNi6G6p.js"),
|
|
16033
|
+
["gu"]: () => import("./gu-0EahmEdu.js"),
|
|
16034
|
+
["hi"]: () => import("./hi-C2ih9xmB.js"),
|
|
16035
|
+
["hr"]: () => import("./hr-CSbbBNUu.js"),
|
|
16036
|
+
["hsb"]: () => import("./hsb-hKsDwaW_.js"),
|
|
16037
|
+
["hu"]: () => import("./hu-BPixuxjf.js"),
|
|
16038
|
+
["hy"]: () => import("./hy-CTtThTdl.js"),
|
|
16039
|
+
["ia"]: () => import("./ia-CYCjbabb.js"),
|
|
16040
|
+
["id"]: () => import("./id-Cgsp-bEu.js"),
|
|
16041
|
+
["is"]: () => import("./is-D_Awtowh.js"),
|
|
16042
|
+
["it"]: () => import("./it-C2qJSkm3.js"),
|
|
16043
|
+
["ka"]: () => import("./ka-DpGw5nvd.js"),
|
|
16044
|
+
["kmr"]: () => import("./kmr-CCdNyB20.js"),
|
|
16045
|
+
["kn"]: () => import("./kn-B4tAUtFU.js"),
|
|
16046
|
+
["la"]: () => import("./la-DIUYl8Yo.js"),
|
|
16047
|
+
["la-x-classic"]: () => import("./la-x-classic-DsbLrq-C.js"),
|
|
16048
|
+
["la-x-liturgic"]: () => import("./la-x-liturgic-Ggenbcb5.js"),
|
|
16049
|
+
["lt"]: () => import("./lt-BcizI7gZ.js"),
|
|
16050
|
+
["lv"]: () => import("./lv-BOgrbf6v.js"),
|
|
16051
|
+
["ml"]: () => import("./ml-CTD7giel.js"),
|
|
16052
|
+
["mn-cyrl"]: () => import("./mn-cyrl-CDxGttkw.js"),
|
|
16053
|
+
["mn-cyrl-x-lmc"]: () => import("./mn-cyrl-x-lmc-kjrnm3ii.js"),
|
|
16054
|
+
["mr"]: () => import("./mr-DttMNydl.js"),
|
|
16055
|
+
["mul-ethi"]: () => import("./mul-ethi-mmW8ZEm0.js"),
|
|
16056
|
+
["nb"]: () => import("./nb-DCiD6jLz.js"),
|
|
16057
|
+
["nl"]: () => import("./nl-BKWsn_4x.js"),
|
|
16058
|
+
["nn"]: () => import("./nn-b0W3mz5j.js"),
|
|
16059
|
+
["no"]: () => import("./no-B3l46gib.js"),
|
|
16060
|
+
["oc"]: () => import("./oc-zkqkXjNo.js"),
|
|
16061
|
+
["or"]: () => import("./or-DEnI_Cls.js"),
|
|
16062
|
+
["pa"]: () => import("./pa-Sh-QSMIs.js"),
|
|
16063
|
+
["pi"]: () => import("./pi-DxMx4Uwd.js"),
|
|
16064
|
+
["pl"]: () => import("./pl-CISKU0vg.js"),
|
|
16065
|
+
["pms"]: () => import("./pms-DUga94hR.js"),
|
|
16066
|
+
["pt"]: () => import("./pt-CzW61i2q.js"),
|
|
16067
|
+
["rm"]: () => import("./rm-C1U6i4AB.js"),
|
|
16068
|
+
["ro"]: () => import("./ro-DSU53KfM.js"),
|
|
16069
|
+
["ru"]: () => import("./ru-gduZDLhv.js"),
|
|
16070
|
+
["sa"]: () => import("./sa-Bney0xbB.js"),
|
|
16071
|
+
["sh-cyrl"]: () => import("./sh-cyrl-CCByyO89.js"),
|
|
16072
|
+
["sh-latn"]: () => import("./sh-latn-CTIiTfzt.js"),
|
|
16073
|
+
["sk"]: () => import("./sk-DK-iy-nO.js"),
|
|
16074
|
+
["sl"]: () => import("./sl-BvzIjkCq.js"),
|
|
16075
|
+
["sr-cyrl"]: () => import("./sr-cyrl-7T4T5Th1.js"),
|
|
16076
|
+
["sv"]: () => import("./sv-BynygC4t.js"),
|
|
16077
|
+
["ta"]: () => import("./ta-CglfOvwm.js"),
|
|
16078
|
+
["te"]: () => import("./te-Bec4xJud.js"),
|
|
16079
|
+
["th"]: () => import("./th-B67OcLue.js"),
|
|
16080
|
+
["tk"]: () => import("./tk-CYfVPVLR.js"),
|
|
16081
|
+
["tr"]: () => import("./tr-BxhGLs2f.js"),
|
|
16082
|
+
["uk"]: () => import("./uk-CnWqKnI0.js"),
|
|
16083
|
+
["zh-latn-pinyin"]: () => import("./zh-latn-pinyin-CKxTJrac.js")
|
|
16249
16084
|
};
|
|
16250
16085
|
|
|
16251
16086
|
//#endregion
|
|
@@ -16295,11 +16130,11 @@ var Hyphen = class Hyphen {
|
|
|
16295
16130
|
_defineProperty(this, "_patterns", /* @__PURE__ */ new Map());
|
|
16296
16131
|
_defineProperty(this, "_hyphenCache", /* @__PURE__ */ new Map());
|
|
16297
16132
|
this._preloadPatterns();
|
|
16298
|
-
this.loadPattern(
|
|
16133
|
+
this.loadPattern("en-gb");
|
|
16299
16134
|
}
|
|
16300
16135
|
_preloadPatterns() {
|
|
16301
|
-
this._patterns.set(
|
|
16302
|
-
this._loadExceptionsToCache(
|
|
16136
|
+
this._patterns.set("en-us", parsePattern(EnUs));
|
|
16137
|
+
this._loadExceptionsToCache("en-us", EnUs);
|
|
16303
16138
|
}
|
|
16304
16139
|
_loadExceptionsToCache(lang, pattern) {
|
|
16305
16140
|
if (pattern.length < 3) return;
|
|
@@ -16390,40 +16225,40 @@ _defineProperty(Hyphen, "_instance", null);
|
|
|
16390
16225
|
//#endregion
|
|
16391
16226
|
//#region src/components/docs/layout/hyphenation/language-detector.ts
|
|
16392
16227
|
const LANG_MAP_TO_HYPHEN_LANG = {
|
|
16393
|
-
spa:
|
|
16394
|
-
eng:
|
|
16395
|
-
rus:
|
|
16396
|
-
ben:
|
|
16397
|
-
hin:
|
|
16398
|
-
por:
|
|
16399
|
-
ind:
|
|
16400
|
-
fra:
|
|
16401
|
-
deu:
|
|
16402
|
-
tel:
|
|
16403
|
-
mar:
|
|
16404
|
-
ita:
|
|
16405
|
-
tam:
|
|
16406
|
-
tur:
|
|
16407
|
-
guj:
|
|
16408
|
-
pol:
|
|
16409
|
-
ukr:
|
|
16410
|
-
kan:
|
|
16411
|
-
mal:
|
|
16412
|
-
ron:
|
|
16413
|
-
pan:
|
|
16414
|
-
hrv:
|
|
16415
|
-
nld:
|
|
16416
|
-
srp:
|
|
16417
|
-
tha:
|
|
16418
|
-
uzn:
|
|
16419
|
-
zlm:
|
|
16420
|
-
hun:
|
|
16421
|
-
ell:
|
|
16422
|
-
ces:
|
|
16423
|
-
bel:
|
|
16424
|
-
bul:
|
|
16425
|
-
swe:
|
|
16426
|
-
und:
|
|
16228
|
+
spa: "es",
|
|
16229
|
+
eng: "en-us",
|
|
16230
|
+
rus: "ru",
|
|
16231
|
+
ben: "bn",
|
|
16232
|
+
hin: "hi",
|
|
16233
|
+
por: "pt",
|
|
16234
|
+
ind: "id",
|
|
16235
|
+
fra: "fr",
|
|
16236
|
+
deu: "de-1901",
|
|
16237
|
+
tel: "te",
|
|
16238
|
+
mar: "mr",
|
|
16239
|
+
ita: "it",
|
|
16240
|
+
tam: "ta",
|
|
16241
|
+
tur: "tr",
|
|
16242
|
+
guj: "gu",
|
|
16243
|
+
pol: "pl",
|
|
16244
|
+
ukr: "uk",
|
|
16245
|
+
kan: "kn",
|
|
16246
|
+
mal: "ml",
|
|
16247
|
+
ron: "ro",
|
|
16248
|
+
pan: "pa",
|
|
16249
|
+
hrv: "hr",
|
|
16250
|
+
nld: "nl",
|
|
16251
|
+
srp: "sr-cyrl",
|
|
16252
|
+
tha: "th",
|
|
16253
|
+
uzn: "kmr",
|
|
16254
|
+
zlm: "ml",
|
|
16255
|
+
hun: "hu",
|
|
16256
|
+
ell: "el-monoton",
|
|
16257
|
+
ces: "cs",
|
|
16258
|
+
bel: "be",
|
|
16259
|
+
bul: "bg",
|
|
16260
|
+
swe: "sv",
|
|
16261
|
+
und: "unknown"
|
|
16427
16262
|
};
|
|
16428
16263
|
var LanguageDetector = class LanguageDetector {
|
|
16429
16264
|
constructor() {
|
|
@@ -16437,7 +16272,7 @@ var LanguageDetector = class LanguageDetector {
|
|
|
16437
16272
|
var _LANG_MAP_TO_HYPHEN_L;
|
|
16438
16273
|
let lang = this._detectCache.get(text);
|
|
16439
16274
|
if (lang) return lang;
|
|
16440
|
-
lang = (_LANG_MAP_TO_HYPHEN_L = LANG_MAP_TO_HYPHEN_LANG[franc(text)]) !== null && _LANG_MAP_TO_HYPHEN_L !== void 0 ? _LANG_MAP_TO_HYPHEN_L :
|
|
16275
|
+
lang = (_LANG_MAP_TO_HYPHEN_L = LANG_MAP_TO_HYPHEN_LANG[franc(text)]) !== null && _LANG_MAP_TO_HYPHEN_L !== void 0 ? _LANG_MAP_TO_HYPHEN_L : "unknown";
|
|
16441
16276
|
this._detectCache.set(text, lang);
|
|
16442
16277
|
return lang;
|
|
16443
16278
|
}
|
|
@@ -16563,14 +16398,14 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
|
|
|
16563
16398
|
let pageIndex = -1;
|
|
16564
16399
|
const path = getPagePath(page);
|
|
16565
16400
|
switch (pageType) {
|
|
16566
|
-
case
|
|
16567
|
-
case
|
|
16401
|
+
case 1:
|
|
16402
|
+
case 2:
|
|
16568
16403
|
pageIndex = 0;
|
|
16569
16404
|
break;
|
|
16570
|
-
case
|
|
16405
|
+
case 0:
|
|
16571
16406
|
pageIndex = skeletonData.pages.indexOf(page);
|
|
16572
16407
|
break;
|
|
16573
|
-
case
|
|
16408
|
+
case 3:
|
|
16574
16409
|
pageIndex = path[1];
|
|
16575
16410
|
break;
|
|
16576
16411
|
default: throw new Error("Invalid page type");
|
|
@@ -16609,14 +16444,14 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
|
|
|
16609
16444
|
const path = getPagePath(page);
|
|
16610
16445
|
let pageIndex = -1;
|
|
16611
16446
|
switch (pageType) {
|
|
16612
|
-
case
|
|
16613
|
-
case
|
|
16447
|
+
case 1:
|
|
16448
|
+
case 2:
|
|
16614
16449
|
pageIndex = 0;
|
|
16615
16450
|
break;
|
|
16616
|
-
case
|
|
16451
|
+
case 0:
|
|
16617
16452
|
pageIndex = pages.indexOf(page);
|
|
16618
16453
|
break;
|
|
16619
|
-
case
|
|
16454
|
+
case 3:
|
|
16620
16455
|
pageIndex = path[1];
|
|
16621
16456
|
break;
|
|
16622
16457
|
default: throw new Error("Invalid page type");
|
|
@@ -16646,15 +16481,15 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
|
|
|
16646
16481
|
const { divide, line, column, section, segmentPage, pageType, path, isBack } = position;
|
|
16647
16482
|
let { glyph } = position;
|
|
16648
16483
|
let skePage = null;
|
|
16649
|
-
if (pageType ===
|
|
16484
|
+
if (pageType === 1 || pageType === 2) {
|
|
16650
16485
|
skePage = pages[segmentPage];
|
|
16651
16486
|
const { headerId, footerId, pageWidth } = skePage;
|
|
16652
|
-
if (pageType ===
|
|
16487
|
+
if (pageType === 1) {
|
|
16653
16488
|
var _skeHeaders$get;
|
|
16654
16489
|
const skeHeader = (_skeHeaders$get = skeHeaders.get(headerId)) === null || _skeHeaders$get === void 0 ? void 0 : _skeHeaders$get.get(pageWidth);
|
|
16655
16490
|
if (skeHeader == null) return;
|
|
16656
16491
|
else skePage = skeHeader;
|
|
16657
|
-
} else if (pageType ===
|
|
16492
|
+
} else if (pageType === 2) {
|
|
16658
16493
|
var _skeFooters$get;
|
|
16659
16494
|
const skeFooter = (_skeFooters$get = skeFooters.get(footerId)) === null || _skeFooters$get === void 0 ? void 0 : _skeFooters$get.get(pageWidth);
|
|
16660
16495
|
if (skeFooter == null) return;
|
|
@@ -16664,12 +16499,12 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
|
|
|
16664
16499
|
if (skePage == null) return;
|
|
16665
16500
|
const glyphGroup = skePage.sections[section].columns[column].lines[line].divides[divide].glyphGroup;
|
|
16666
16501
|
glyph = Math.min(glyph, glyphGroup.length - 1);
|
|
16667
|
-
if (glyphGroup[glyph].glyphType ===
|
|
16502
|
+
if (glyphGroup[glyph].glyphType === 2) glyph += 1;
|
|
16668
16503
|
return glyphGroup[glyph];
|
|
16669
16504
|
}
|
|
16670
16505
|
findEditAreaByCoord(coord, pageLayoutType, pageMarginLeft, pageMarginTop) {
|
|
16671
16506
|
const { x, y } = coord;
|
|
16672
|
-
let editArea =
|
|
16507
|
+
let editArea = "BODY";
|
|
16673
16508
|
let pageNumber = -1;
|
|
16674
16509
|
let pageSkeleton = null;
|
|
16675
16510
|
const skeletonData = this.getSkeletonData();
|
|
@@ -16684,19 +16519,19 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
|
|
|
16684
16519
|
const page = pages[i];
|
|
16685
16520
|
const { marginTop, marginBottom, pageWidth, pageHeight } = page;
|
|
16686
16521
|
if (x > this._findLiquid.x && x < this._findLiquid.x + pageWidth && y > this._findLiquid.y && y < this._findLiquid.y + marginTop) {
|
|
16687
|
-
editArea =
|
|
16522
|
+
editArea = "HEADER";
|
|
16688
16523
|
pageSkeleton = page;
|
|
16689
16524
|
pageNumber = i;
|
|
16690
16525
|
break;
|
|
16691
16526
|
}
|
|
16692
16527
|
if (x > this._findLiquid.x && x < this._findLiquid.x + pageWidth && y > this._findLiquid.y + marginTop && y < this._findLiquid.y + pageHeight - marginBottom) {
|
|
16693
|
-
editArea =
|
|
16528
|
+
editArea = "BODY";
|
|
16694
16529
|
pageSkeleton = page;
|
|
16695
16530
|
pageNumber = i;
|
|
16696
16531
|
break;
|
|
16697
16532
|
}
|
|
16698
16533
|
if (x > this._findLiquid.x && x < this._findLiquid.x + pageWidth && y > this._findLiquid.y + pageHeight - marginBottom && y < this._findLiquid.y + pageHeight) {
|
|
16699
|
-
editArea =
|
|
16534
|
+
editArea = "FOOTER";
|
|
16700
16535
|
pageSkeleton = page;
|
|
16701
16536
|
pageNumber = i;
|
|
16702
16537
|
break;
|
|
@@ -16725,16 +16560,16 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
|
|
|
16725
16560
|
const page = pages[pi];
|
|
16726
16561
|
const { headerId, footerId, pageWidth } = page;
|
|
16727
16562
|
let exactMatch = null;
|
|
16728
|
-
if (editArea ===
|
|
16563
|
+
if (editArea === "HEADER" || editArea === "FOOTER") {
|
|
16729
16564
|
var _skeHeaders$get2, _skeFooters$get2;
|
|
16730
16565
|
const headerSke = (_skeHeaders$get2 = skeHeaders.get(headerId)) === null || _skeHeaders$get2 === void 0 ? void 0 : _skeHeaders$get2.get(pageWidth);
|
|
16731
|
-
if (headerSke) exactMatch = this._collectNearestNode(headerSke,
|
|
16566
|
+
if (headerSke) exactMatch = this._collectNearestNode(headerSke, 1, page, headerId, pi, cache, x, y, pageLength);
|
|
16732
16567
|
const footerSke = (_skeFooters$get2 = skeFooters.get(footerId)) === null || _skeFooters$get2 === void 0 ? void 0 : _skeFooters$get2.get(pageWidth);
|
|
16733
16568
|
if (footerSke) {
|
|
16734
16569
|
var _exactMatch;
|
|
16735
|
-
exactMatch = (_exactMatch = exactMatch) !== null && _exactMatch !== void 0 ? _exactMatch : this._collectNearestNode(footerSke,
|
|
16570
|
+
exactMatch = (_exactMatch = exactMatch) !== null && _exactMatch !== void 0 ? _exactMatch : this._collectNearestNode(footerSke, 2, page, footerId, pi, cache, x, y, pageLength);
|
|
16736
16571
|
}
|
|
16737
|
-
} else exactMatch = this._collectNearestNode(page,
|
|
16572
|
+
} else exactMatch = this._collectNearestNode(page, 0, page, "", pi, cache, x, y, pageLength);
|
|
16738
16573
|
if (exactMatch) return exactMatch;
|
|
16739
16574
|
this._translatePage(page, pageLayoutType, pageMarginLeft, pageMarginTop);
|
|
16740
16575
|
}
|
|
@@ -16747,13 +16582,13 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
|
|
|
16747
16582
|
if (segmentId !== "") {
|
|
16748
16583
|
var _skeHeaders$get3, _skeFooters$get3;
|
|
16749
16584
|
const headerSke = (_skeHeaders$get3 = skeHeaders.get(headerId)) === null || _skeHeaders$get3 === void 0 ? void 0 : _skeHeaders$get3.get(pageWidth);
|
|
16750
|
-
if (headerSke) exactMatch = this._collectNearestNode(headerSke,
|
|
16585
|
+
if (headerSke) exactMatch = this._collectNearestNode(headerSke, 1, page, headerId, pi, cache, x, y, pageLength);
|
|
16751
16586
|
const footerSke = (_skeFooters$get3 = skeFooters.get(footerId)) === null || _skeFooters$get3 === void 0 ? void 0 : _skeFooters$get3.get(pageWidth);
|
|
16752
16587
|
if (footerSke) {
|
|
16753
16588
|
var _exactMatch2;
|
|
16754
|
-
exactMatch = (_exactMatch2 = exactMatch) !== null && _exactMatch2 !== void 0 ? _exactMatch2 : this._collectNearestNode(footerSke,
|
|
16589
|
+
exactMatch = (_exactMatch2 = exactMatch) !== null && _exactMatch2 !== void 0 ? _exactMatch2 : this._collectNearestNode(footerSke, 2, page, footerId, pi, cache, x, y, pageLength);
|
|
16755
16590
|
}
|
|
16756
|
-
} else exactMatch = this._collectNearestNode(page,
|
|
16591
|
+
} else exactMatch = this._collectNearestNode(page, 0, page, "", pi, cache, x, y, pageLength);
|
|
16757
16592
|
if (exactMatch) return exactMatch;
|
|
16758
16593
|
this._translatePage(page, pageLayoutType, pageMarginLeft, pageMarginTop);
|
|
16759
16594
|
}
|
|
@@ -16767,8 +16602,8 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
|
|
|
16767
16602
|
}
|
|
16768
16603
|
const { headerId, pageWidth } = page;
|
|
16769
16604
|
const segmentSke = segmentId === headerId ? (_skeHeaders$get4 = skeHeaders.get(segmentId)) === null || _skeHeaders$get4 === void 0 ? void 0 : _skeHeaders$get4.get(pageWidth) : (_skeFooters$get4 = skeFooters.get(segmentId)) === null || _skeFooters$get4 === void 0 ? void 0 : _skeFooters$get4.get(pageWidth);
|
|
16770
|
-
if (segmentSke) exactMatch = this._collectNearestNode(segmentSke, segmentId === headerId ?
|
|
16771
|
-
} else exactMatch = this._collectNearestNode(page,
|
|
16605
|
+
if (segmentSke) exactMatch = this._collectNearestNode(segmentSke, segmentId === headerId ? 1 : 2, page, segmentId, segmentPage, cache, x, y, pageLength);
|
|
16606
|
+
} else exactMatch = this._collectNearestNode(page, 0, page, "", pi, cache, x, y, pageLength);
|
|
16772
16607
|
if (exactMatch) return exactMatch;
|
|
16773
16608
|
this._translatePage(page, pageLayoutType, pageMarginLeft, pageMarginTop);
|
|
16774
16609
|
}
|
|
@@ -16780,10 +16615,10 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
|
|
|
16780
16615
|
this._findLiquid.translateSave();
|
|
16781
16616
|
const pageLeft = this._findLiquid.x;
|
|
16782
16617
|
const pageRight = pageLeft + page.pageWidth;
|
|
16783
|
-
const pageTop = this._findLiquid.y + (pageType ===
|
|
16618
|
+
const pageTop = this._findLiquid.y + (pageType === 2 ? page.pageHeight - segmentPage.pageHeight : 0);
|
|
16784
16619
|
const pageBottom = pageTop + segmentPage.pageHeight;
|
|
16785
16620
|
let pointInPage = x >= pageLeft && x <= pageRight && y >= pageTop && y <= pageBottom;
|
|
16786
|
-
if (nestLevel === 0 && pageType ===
|
|
16621
|
+
if (nestLevel === 0 && pageType === 0) {
|
|
16787
16622
|
const isFirstPage = pi === 0;
|
|
16788
16623
|
const isLastPage = pi === pageLength - 1;
|
|
16789
16624
|
const halfMarginTop = page.originMarginTop / 2;
|
|
@@ -16793,13 +16628,13 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
|
|
|
16793
16628
|
else pointInPage = y >= pageTop - halfMarginTop && y <= pageBottom + halfMarginTop;
|
|
16794
16629
|
}
|
|
16795
16630
|
switch (pageType) {
|
|
16796
|
-
case
|
|
16631
|
+
case 1:
|
|
16797
16632
|
this._findLiquid.translatePagePadding({
|
|
16798
16633
|
...segmentPage,
|
|
16799
16634
|
marginLeft: page.marginLeft
|
|
16800
16635
|
});
|
|
16801
16636
|
break;
|
|
16802
|
-
case
|
|
16637
|
+
case 2: {
|
|
16803
16638
|
const footerTop = page.pageHeight - segmentPage.height - segmentPage.marginBottom;
|
|
16804
16639
|
this._findLiquid.translate(page.marginLeft, footerTop);
|
|
16805
16640
|
break;
|
|
@@ -16821,7 +16656,7 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
|
|
|
16821
16656
|
for (let i = 0; i < lines.length; i++) {
|
|
16822
16657
|
const line = lines[i];
|
|
16823
16658
|
const { divides, type, lineHeight = 0 } = line;
|
|
16824
|
-
if (type ===
|
|
16659
|
+
if (type === 1) continue;
|
|
16825
16660
|
else {
|
|
16826
16661
|
this._findLiquid.translateSave();
|
|
16827
16662
|
this._findLiquid.translateLine(line);
|
|
@@ -16845,7 +16680,7 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
|
|
|
16845
16680
|
if (y >= startY_fin && y <= endY_fin) {
|
|
16846
16681
|
if (x >= startX_fin && x <= endX_fin) return {
|
|
16847
16682
|
node: glyph,
|
|
16848
|
-
segmentPage: pageType ===
|
|
16683
|
+
segmentPage: pageType === 0 ? -1 : pi,
|
|
16849
16684
|
segmentId,
|
|
16850
16685
|
ratioX: x / (startX_fin + endX_fin),
|
|
16851
16686
|
ratioY: y / (startY_fin + endY_fin)
|
|
@@ -16856,7 +16691,7 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
|
|
|
16856
16691
|
}
|
|
16857
16692
|
cache.nearestNodeList.push({
|
|
16858
16693
|
node: glyph,
|
|
16859
|
-
segmentPage: pageType ===
|
|
16694
|
+
segmentPage: pageType === 0 ? -1 : pi,
|
|
16860
16695
|
segmentId,
|
|
16861
16696
|
ratioX: x / (startX_fin + endX_fin),
|
|
16862
16697
|
ratioY: y / (startY_fin + endY_fin)
|
|
@@ -16877,7 +16712,7 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
|
|
|
16877
16712
|
if (distanceY === nearestNodeDistanceY) {
|
|
16878
16713
|
cache.nearestNodeList.push({
|
|
16879
16714
|
node: glyph,
|
|
16880
|
-
segmentPage: pageType ===
|
|
16715
|
+
segmentPage: pageType === 0 ? -1 : pi,
|
|
16881
16716
|
segmentId,
|
|
16882
16717
|
ratioX: x / (startX_fin + endX_fin),
|
|
16883
16718
|
ratioY: y / (startY_fin + endY_fin)
|
|
@@ -16916,7 +16751,7 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
|
|
|
16916
16751
|
const { left: cellLeft } = cell;
|
|
16917
16752
|
(_this$_findLiquid5 = this._findLiquid) === null || _this$_findLiquid5 === void 0 || _this$_findLiquid5.translateSave();
|
|
16918
16753
|
(_this$_findLiquid6 = this._findLiquid) === null || _this$_findLiquid6 === void 0 || _this$_findLiquid6.translate(cellLeft, 0);
|
|
16919
|
-
exactMatch = (_exactMatch3 = exactMatch) !== null && _exactMatch3 !== void 0 ? _exactMatch3 : this._collectNearestNode(cell,
|
|
16754
|
+
exactMatch = (_exactMatch3 = exactMatch) !== null && _exactMatch3 !== void 0 ? _exactMatch3 : this._collectNearestNode(cell, 3, cell, segmentId, pi, cache, x, y, pageLength, nestLevel + 1);
|
|
16920
16755
|
(_this$_findLiquid7 = this._findLiquid) === null || _this$_findLiquid7 === void 0 || _this$_findLiquid7.translateRestore();
|
|
16921
16756
|
}
|
|
16922
16757
|
(_this$_findLiquid8 = this._findLiquid) === null || _this$_findLiquid8 === void 0 || _this$_findLiquid8.translateRestore();
|
|
@@ -16958,10 +16793,10 @@ var DocumentSkeleton = class DocumentSkeleton extends Skeleton {
|
|
|
16958
16793
|
const { x: startX, y: startY } = this._findLiquid;
|
|
16959
16794
|
let endX = -1;
|
|
16960
16795
|
let endY = -1;
|
|
16961
|
-
if (pageLayoutType ===
|
|
16796
|
+
if (pageLayoutType === 0) {
|
|
16962
16797
|
endX = pageWidth;
|
|
16963
16798
|
endY = startY + pageHeight;
|
|
16964
|
-
} else if (pageLayoutType ===
|
|
16799
|
+
} else if (pageLayoutType === 1) {
|
|
16965
16800
|
endX = startX + pageWidth;
|
|
16966
16801
|
endY = pageHeight;
|
|
16967
16802
|
}
|
|
@@ -17251,7 +17086,7 @@ function getFontFormat(format) {
|
|
|
17251
17086
|
}
|
|
17252
17087
|
|
|
17253
17088
|
//#endregion
|
|
17254
|
-
//#region \0@oxc-project+runtime@0.
|
|
17089
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/decorateParam.js
|
|
17255
17090
|
function __decorateParam(paramIndex, decorator) {
|
|
17256
17091
|
return function(target, key) {
|
|
17257
17092
|
decorator(target, key, paramIndex);
|
|
@@ -17259,7 +17094,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
17259
17094
|
}
|
|
17260
17095
|
|
|
17261
17096
|
//#endregion
|
|
17262
|
-
//#region \0@oxc-project+runtime@0.
|
|
17097
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/decorate.js
|
|
17263
17098
|
function __decorate(decorators, target, key, desc) {
|
|
17264
17099
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
17265
17100
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -17595,7 +17430,7 @@ let SpreadsheetSkeleton = class SpreadsheetSkeleton extends SheetSkeleton {
|
|
|
17595
17430
|
const paddingTop = (_style$pd$t = (_style$pd3 = style.pd) === null || _style$pd3 === void 0 ? void 0 : _style$pd3.t) !== null && _style$pd$t !== void 0 ? _style$pd$t : DEFAULT_PADDING_DATA.t;
|
|
17596
17431
|
const paddingBottom = (_style$pd$b = (_style$pd4 = style.pd) === null || _style$pd4 === void 0 ? void 0 : _style$pd4.b) !== null && _style$pd$b !== void 0 ? _style$pd$b : DEFAULT_PADDING_DATA.b;
|
|
17597
17432
|
if ((style === null || style === void 0 ? void 0 : style.tb) === WrapStrategy.WRAP) {
|
|
17598
|
-
const skeleton = new DocSimpleSkeleton(
|
|
17433
|
+
const skeleton = new DocSimpleSkeleton(getDisplayValueFromCell(cell), getFontStyleString(style).fontCache, (style === null || style === void 0 ? void 0 : style.tb) === WrapStrategy.WRAP, colWidth - paddingLeft - paddingRight, Infinity);
|
|
17599
17434
|
skeleton.calculate();
|
|
17600
17435
|
return skeleton.getTotalHeight() + paddingTop + paddingBottom;
|
|
17601
17436
|
} else {
|
|
@@ -17641,14 +17476,14 @@ let SpreadsheetSkeleton = class SpreadsheetSkeleton extends SheetSkeleton {
|
|
|
17641
17476
|
_calculateColWidth(colIndex) {
|
|
17642
17477
|
const worksheet = this.worksheet;
|
|
17643
17478
|
let colWidth = 0;
|
|
17644
|
-
const visibleRangeViewMain = this.visibleRangeByViewportKey(
|
|
17479
|
+
const visibleRangeViewMain = this.visibleRangeByViewportKey("viewMain");
|
|
17645
17480
|
if (!visibleRangeViewMain) return colWidth;
|
|
17646
17481
|
const { startRow: startRowOfViewMain, endRow: endRowOfViewMain } = visibleRangeViewMain;
|
|
17647
17482
|
const rowCount = this.worksheet.getRowCount();
|
|
17648
17483
|
const otherRowIndex = /* @__PURE__ */ new Set();
|
|
17649
17484
|
otherRowIndex.add(0);
|
|
17650
17485
|
otherRowIndex.add(rowCount - 1);
|
|
17651
|
-
const visibleRangeViewMainTop = this.visibleRangeByViewportKey(
|
|
17486
|
+
const visibleRangeViewMainTop = this.visibleRangeByViewportKey("viewMainTop");
|
|
17652
17487
|
if (visibleRangeViewMainTop) {
|
|
17653
17488
|
const { startRow: startRowOfViewMainTop, endRow: endRowOfViewMainTop } = visibleRangeViewMainTop;
|
|
17654
17489
|
for (let i = startRowOfViewMainTop; i <= endRowOfViewMainTop; i++) otherRowIndex.add(i);
|
|
@@ -18077,22 +17912,22 @@ let SpreadsheetSkeleton = class SpreadsheetSkeleton extends SheetSkeleton {
|
|
|
18077
17912
|
if (style && style.bd) {
|
|
18078
17913
|
const mergeRange = options === null || options === void 0 ? void 0 : options.mergeRange;
|
|
18079
17914
|
if (mergeRange) {
|
|
18080
|
-
this._setMergeBorderProps(
|
|
18081
|
-
this._setMergeBorderProps(
|
|
18082
|
-
this._setMergeBorderProps(
|
|
18083
|
-
this._setMergeBorderProps(
|
|
17915
|
+
this._setMergeBorderProps("t", this._stylesCache, mergeRange);
|
|
17916
|
+
this._setMergeBorderProps("b", this._stylesCache, mergeRange);
|
|
17917
|
+
this._setMergeBorderProps("l", this._stylesCache, mergeRange);
|
|
17918
|
+
this._setMergeBorderProps("r", this._stylesCache, mergeRange);
|
|
18084
17919
|
} else if (!this.intersectMergeRange(row, col)) {
|
|
18085
|
-
this._setBorderProps(row, col,
|
|
18086
|
-
this._setBorderProps(row, col,
|
|
18087
|
-
this._setBorderProps(row, col,
|
|
18088
|
-
this._setBorderProps(row, col,
|
|
17920
|
+
this._setBorderProps(row, col, "t", style, this._stylesCache);
|
|
17921
|
+
this._setBorderProps(row, col, "b", style, this._stylesCache);
|
|
17922
|
+
this._setBorderProps(row, col, "l", style, this._stylesCache);
|
|
17923
|
+
this._setBorderProps(row, col, "r", style, this._stylesCache);
|
|
18089
17924
|
}
|
|
18090
|
-
this._setBorderProps(row, col,
|
|
18091
|
-
this._setBorderProps(row, col,
|
|
18092
|
-
this._setBorderProps(row, col,
|
|
18093
|
-
this._setBorderProps(row, col,
|
|
18094
|
-
this._setBorderProps(row, col,
|
|
18095
|
-
this._setBorderProps(row, col,
|
|
17925
|
+
this._setBorderProps(row, col, "tl_br", style, this._stylesCache);
|
|
17926
|
+
this._setBorderProps(row, col, "tl_bc", style, this._stylesCache);
|
|
17927
|
+
this._setBorderProps(row, col, "tl_mr", style, this._stylesCache);
|
|
17928
|
+
this._setBorderProps(row, col, "bl_tr", style, this._stylesCache);
|
|
17929
|
+
this._setBorderProps(row, col, "ml_tr", style, this._stylesCache);
|
|
17930
|
+
this._setBorderProps(row, col, "bc_tr", style, this._stylesCache);
|
|
18096
17931
|
}
|
|
18097
17932
|
}
|
|
18098
17933
|
_setBgStylesCache(row, col, style, options) {
|
|
@@ -18213,29 +18048,29 @@ let SpreadsheetSkeleton = class SpreadsheetSkeleton extends SheetSkeleton {
|
|
|
18213
18048
|
let forEnd = mergeRange.endRow;
|
|
18214
18049
|
let row = mergeRange.startRow;
|
|
18215
18050
|
let column = mergeRange.startColumn;
|
|
18216
|
-
if (type ===
|
|
18051
|
+
if (type === "t") {
|
|
18217
18052
|
row = mergeRange.startRow;
|
|
18218
18053
|
forStart = mergeRange.startColumn;
|
|
18219
18054
|
forEnd = mergeRange.endColumn;
|
|
18220
|
-
} else if (type ===
|
|
18055
|
+
} else if (type === "b") {
|
|
18221
18056
|
row = mergeRange.endRow;
|
|
18222
18057
|
forStart = mergeRange.startColumn;
|
|
18223
18058
|
forEnd = mergeRange.endColumn;
|
|
18224
|
-
} else if (type ===
|
|
18059
|
+
} else if (type === "l") {
|
|
18225
18060
|
column = mergeRange.startColumn;
|
|
18226
18061
|
forStart = mergeRange.startRow;
|
|
18227
18062
|
forEnd = mergeRange.endRow;
|
|
18228
|
-
} else if (type ===
|
|
18063
|
+
} else if (type === "r") {
|
|
18229
18064
|
column = mergeRange.endColumn;
|
|
18230
18065
|
forStart = mergeRange.startRow;
|
|
18231
18066
|
forEnd = mergeRange.endRow;
|
|
18232
18067
|
}
|
|
18233
18068
|
for (let i = forStart; i <= forEnd; i++) {
|
|
18234
18069
|
var _cell$themeStyle, _style$bd$type, _style$bd;
|
|
18235
|
-
if (type ===
|
|
18236
|
-
else if (type ===
|
|
18237
|
-
else if (type ===
|
|
18238
|
-
else if (type ===
|
|
18070
|
+
if (type === "t") column = i;
|
|
18071
|
+
else if (type === "b") column = i;
|
|
18072
|
+
else if (type === "l") row = i;
|
|
18073
|
+
else if (type === "r") row = i;
|
|
18239
18074
|
const cell = this.worksheet.getCell(row, column);
|
|
18240
18075
|
if (!cell) break;
|
|
18241
18076
|
const themeStyleBackground = (_cell$themeStyle = cell.themeStyle) === null || _cell$themeStyle === void 0 ? void 0 : _cell$themeStyle.bd;
|
|
@@ -18275,12 +18110,12 @@ let SpreadsheetSkeleton = class SpreadsheetSkeleton extends SheetSkeleton {
|
|
|
18275
18110
|
* When the top border of a cell and the bottom border of the cell above it (r-1) overlap,
|
|
18276
18111
|
* if the top border of cell r is white, then the rendering is ignored.
|
|
18277
18112
|
*/
|
|
18278
|
-
if (type ===
|
|
18113
|
+
if (type === "t") {
|
|
18279
18114
|
var _borderCache$getValue;
|
|
18280
|
-
if (((_borderCache$getValue = borderCache.getValue(r - 1, c)) === null || _borderCache$getValue === void 0 ? void 0 : _borderCache$getValue[
|
|
18281
|
-
} else if (type ===
|
|
18115
|
+
if (((_borderCache$getValue = borderCache.getValue(r - 1, c)) === null || _borderCache$getValue === void 0 ? void 0 : _borderCache$getValue["b"]) && isWhiteColor(rgb)) return;
|
|
18116
|
+
} else if (type === "l") {
|
|
18282
18117
|
var _borderCache$getValue2;
|
|
18283
|
-
if (((_borderCache$getValue2 = borderCache.getValue(r, c - 1)) === null || _borderCache$getValue2 === void 0 ? void 0 : _borderCache$getValue2[
|
|
18118
|
+
if (((_borderCache$getValue2 = borderCache.getValue(r, c - 1)) === null || _borderCache$getValue2 === void 0 ? void 0 : _borderCache$getValue2["r"]) && isWhiteColor(rgb)) return;
|
|
18284
18119
|
}
|
|
18285
18120
|
borderCache.getValue(r, c)[type] = {
|
|
18286
18121
|
type,
|
|
@@ -18556,40 +18391,24 @@ var Font = class extends SheetExtension {
|
|
|
18556
18391
|
return false;
|
|
18557
18392
|
}
|
|
18558
18393
|
_renderImages(ctx, fontsConfig, startX, startY, endX, endY) {
|
|
18559
|
-
var _getSkeletonData;
|
|
18394
|
+
var _fontsConfig$style, _padding$l, _padding$r, _padding$t, _padding$b, _getSkeletonData;
|
|
18560
18395
|
const { documentSkeleton, verticalAlign, horizontalAlign } = fontsConfig;
|
|
18561
|
-
const fontHeight = documentSkeleton.getSkeletonData().pages[0].height;
|
|
18562
|
-
const fontWidth = documentSkeleton.getSkeletonData().pages[0].width;
|
|
18563
18396
|
const PADDING = 2;
|
|
18564
|
-
|
|
18565
|
-
|
|
18566
|
-
|
|
18567
|
-
|
|
18568
|
-
|
|
18569
|
-
|
|
18570
|
-
|
|
18571
|
-
|
|
18572
|
-
|
|
18573
|
-
default:
|
|
18574
|
-
fontY = endY - fontHeight - PADDING;
|
|
18575
|
-
break;
|
|
18576
|
-
}
|
|
18577
|
-
switch (horizontalAlign) {
|
|
18578
|
-
case HorizontalAlign.RIGHT:
|
|
18579
|
-
fontX = endX - fontWidth - PADDING;
|
|
18580
|
-
break;
|
|
18581
|
-
case HorizontalAlign.CENTER:
|
|
18582
|
-
fontX = (startX + endX) / 2 - fontWidth / 2;
|
|
18583
|
-
break;
|
|
18584
|
-
default:
|
|
18585
|
-
fontX = startX + PADDING;
|
|
18586
|
-
break;
|
|
18587
|
-
}
|
|
18397
|
+
const padding = (_fontsConfig$style = fontsConfig.style) === null || _fontsConfig$style === void 0 ? void 0 : _fontsConfig$style.pd;
|
|
18398
|
+
const paddingLeft = (_padding$l = padding === null || padding === void 0 ? void 0 : padding.l) !== null && _padding$l !== void 0 ? _padding$l : PADDING;
|
|
18399
|
+
const paddingRight = (_padding$r = padding === null || padding === void 0 ? void 0 : padding.r) !== null && _padding$r !== void 0 ? _padding$r : PADDING;
|
|
18400
|
+
const paddingTop = (_padding$t = padding === null || padding === void 0 ? void 0 : padding.t) !== null && _padding$t !== void 0 ? _padding$t : PADDING;
|
|
18401
|
+
const paddingBottom = (_padding$b = padding === null || padding === void 0 ? void 0 : padding.b) !== null && _padding$b !== void 0 ? _padding$b : PADDING;
|
|
18402
|
+
const contentStartX = startX + paddingLeft;
|
|
18403
|
+
const contentEndX = endX - paddingRight;
|
|
18404
|
+
const contentStartY = startY + paddingTop;
|
|
18405
|
+
const contentEndY = endY - paddingBottom;
|
|
18588
18406
|
const drawingDatas = documentSkeleton.getViewModel().getDataModel().getDrawings();
|
|
18589
18407
|
const drawings = (_getSkeletonData = documentSkeleton.getSkeletonData()) === null || _getSkeletonData === void 0 ? void 0 : _getSkeletonData.pages[0].skeDrawings;
|
|
18590
18408
|
drawings === null || drawings === void 0 || drawings.forEach((drawing) => {
|
|
18591
18409
|
const drawingData = drawingDatas === null || drawingDatas === void 0 ? void 0 : drawingDatas[drawing.drawingId];
|
|
18592
18410
|
if (drawingData) {
|
|
18411
|
+
var _drawingData$docTrans, _drawingData$docTrans2, _drawingData$docTrans3, _drawingData$docTrans4, _drawingData$docTrans5, _drawingData$docTrans6;
|
|
18593
18412
|
const image = fontsConfig.imageCacheMap.getImage(drawingData.imageSourceType, drawingData.source, () => {
|
|
18594
18413
|
var _this$parent;
|
|
18595
18414
|
(_this$parent = this.parent) === null || _this$parent === void 0 || _this$parent.makeDirty();
|
|
@@ -18597,11 +18416,33 @@ var Font = class extends SheetExtension {
|
|
|
18597
18416
|
var _this$parent2;
|
|
18598
18417
|
(_this$parent2 = this.parent) === null || _this$parent2 === void 0 || _this$parent2.makeDirty();
|
|
18599
18418
|
});
|
|
18600
|
-
const
|
|
18601
|
-
const
|
|
18602
|
-
const
|
|
18603
|
-
|
|
18604
|
-
|
|
18419
|
+
const width = (_drawingData$docTrans = (_drawingData$docTrans2 = drawingData.docTransform) === null || _drawingData$docTrans2 === void 0 ? void 0 : _drawingData$docTrans2.size.width) !== null && _drawingData$docTrans !== void 0 ? _drawingData$docTrans : drawing.width;
|
|
18420
|
+
const height = (_drawingData$docTrans3 = (_drawingData$docTrans4 = drawingData.docTransform) === null || _drawingData$docTrans4 === void 0 ? void 0 : _drawingData$docTrans4.size.height) !== null && _drawingData$docTrans3 !== void 0 ? _drawingData$docTrans3 : drawing.height;
|
|
18421
|
+
const angle = (_drawingData$docTrans5 = (_drawingData$docTrans6 = drawingData.docTransform) === null || _drawingData$docTrans6 === void 0 ? void 0 : _drawingData$docTrans6.angle) !== null && _drawingData$docTrans5 !== void 0 ? _drawingData$docTrans5 : drawing.angle;
|
|
18422
|
+
let x = startX;
|
|
18423
|
+
let y = startY;
|
|
18424
|
+
switch (verticalAlign) {
|
|
18425
|
+
case VerticalAlign.TOP:
|
|
18426
|
+
y = contentStartY;
|
|
18427
|
+
break;
|
|
18428
|
+
case VerticalAlign.MIDDLE:
|
|
18429
|
+
y = (contentStartY + contentEndY) / 2 - height / 2;
|
|
18430
|
+
break;
|
|
18431
|
+
default:
|
|
18432
|
+
y = contentEndY - height;
|
|
18433
|
+
break;
|
|
18434
|
+
}
|
|
18435
|
+
switch (horizontalAlign) {
|
|
18436
|
+
case HorizontalAlign.RIGHT:
|
|
18437
|
+
x = contentEndX - width;
|
|
18438
|
+
break;
|
|
18439
|
+
case HorizontalAlign.CENTER:
|
|
18440
|
+
x = (contentStartX + contentEndX) / 2 - width / 2;
|
|
18441
|
+
break;
|
|
18442
|
+
default:
|
|
18443
|
+
x = contentStartX;
|
|
18444
|
+
break;
|
|
18445
|
+
}
|
|
18605
18446
|
const { rotatedHeight, rotatedWidth } = rotatedBoundingBox(width, height, angle);
|
|
18606
18447
|
if (image && image.complete) {
|
|
18607
18448
|
const angleRadians = angle * Math.PI / 180;
|
|
@@ -18669,17 +18510,17 @@ var Font = class extends SheetExtension {
|
|
|
18669
18510
|
renderFontContext.endY = endY;
|
|
18670
18511
|
}
|
|
18671
18512
|
_renderText(ctx, row, col, renderFontCtx, overflowCache) {
|
|
18672
|
-
var _fontCache$style$pd, _fontCache$style, _padding$
|
|
18513
|
+
var _fontCache$style$pd, _fontCache$style, _padding$l2, _padding$r2, _padding$t2, _padding$b2, _fontCache$style2, _fontCache$style3, _fontCache$style4, _fontCache$style5;
|
|
18673
18514
|
const { fontCache } = renderFontCtx;
|
|
18674
18515
|
if (!fontCache) return;
|
|
18675
18516
|
const padding = (_fontCache$style$pd = (_fontCache$style = fontCache.style) === null || _fontCache$style === void 0 ? void 0 : _fontCache$style.pd) !== null && _fontCache$style$pd !== void 0 ? _fontCache$style$pd : DEFAULT_PADDING_DATA;
|
|
18676
|
-
const paddingLeft = (_padding$
|
|
18677
|
-
const paddingRight = (_padding$
|
|
18678
|
-
const paddingTop = (_padding$
|
|
18679
|
-
const paddingBottom = (_padding$
|
|
18517
|
+
const paddingLeft = (_padding$l2 = padding.l) !== null && _padding$l2 !== void 0 ? _padding$l2 : DEFAULT_PADDING_DATA.l;
|
|
18518
|
+
const paddingRight = (_padding$r2 = padding.r) !== null && _padding$r2 !== void 0 ? _padding$r2 : DEFAULT_PADDING_DATA.r;
|
|
18519
|
+
const paddingTop = (_padding$t2 = padding.t) !== null && _padding$t2 !== void 0 ? _padding$t2 : DEFAULT_PADDING_DATA.t;
|
|
18520
|
+
const paddingBottom = (_padding$b2 = padding.b) !== null && _padding$b2 !== void 0 ? _padding$b2 : DEFAULT_PADDING_DATA.b;
|
|
18680
18521
|
const { vertexAngle = 0, wrapStrategy, cellData } = fontCache;
|
|
18681
18522
|
if ((cellData === null || cellData === void 0 ? void 0 : cellData.v) === void 0 || (cellData === null || cellData === void 0 ? void 0 : cellData.v) === null) return;
|
|
18682
|
-
const text =
|
|
18523
|
+
const text = getDisplayValueFromCell(cellData);
|
|
18683
18524
|
const { startX, startY, endX, endY } = renderFontCtx;
|
|
18684
18525
|
const cellWidth = endX - startX - paddingLeft - paddingRight;
|
|
18685
18526
|
const cellHeight = endY - startY - paddingTop - paddingBottom;
|
|
@@ -19127,7 +18968,7 @@ var DocComponent = class extends RenderComponent {
|
|
|
19127
18968
|
this._skeleton = _skeleton;
|
|
19128
18969
|
_defineProperty(this, "pageMarginLeft", 0);
|
|
19129
18970
|
_defineProperty(this, "pageMarginTop", 0);
|
|
19130
|
-
_defineProperty(this, "pageLayoutType",
|
|
18971
|
+
_defineProperty(this, "pageLayoutType", 0);
|
|
19131
18972
|
this._setConfig(config);
|
|
19132
18973
|
}
|
|
19133
18974
|
getSkeleton() {
|
|
@@ -19142,7 +18983,7 @@ var DocComponent = class extends RenderComponent {
|
|
|
19142
18983
|
if ((config === null || config === void 0 ? void 0 : config.pageMarginTop) != null) this.pageMarginTop = config === null || config === void 0 ? void 0 : config.pageMarginTop;
|
|
19143
18984
|
else this.pageMarginTop = 14;
|
|
19144
18985
|
if ((config === null || config === void 0 ? void 0 : config.pageLayoutType) != null) this.pageLayoutType = config === null || config === void 0 ? void 0 : config.pageLayoutType;
|
|
19145
|
-
else this.pageLayoutType =
|
|
18986
|
+
else this.pageLayoutType = 0;
|
|
19146
18987
|
}
|
|
19147
18988
|
render(mainCtx, bounds) {
|
|
19148
18989
|
if (!this.visible) {
|
|
@@ -19162,7 +19003,7 @@ var DocComponent = class extends RenderComponent {
|
|
|
19162
19003
|
scaleY: 1
|
|
19163
19004
|
};
|
|
19164
19005
|
let { scaleX = 1, scaleY = 1 } = this.parent;
|
|
19165
|
-
if (this.parent.classType ===
|
|
19006
|
+
if (this.parent.classType === "Scene") {
|
|
19166
19007
|
scaleX = this.parent.ancestorScaleX || 1;
|
|
19167
19008
|
scaleY = this.parent.ancestorScaleY || 1;
|
|
19168
19009
|
}
|
|
@@ -19186,15 +19027,10 @@ var DocComponent = class extends RenderComponent {
|
|
|
19186
19027
|
|
|
19187
19028
|
//#endregion
|
|
19188
19029
|
//#region src/components/docs/doc-extension.ts
|
|
19189
|
-
let DOCS_EXTENSION_TYPE = /* @__PURE__ */ function(DOCS_EXTENSION_TYPE) {
|
|
19190
|
-
DOCS_EXTENSION_TYPE[DOCS_EXTENSION_TYPE["SPAN"] = 0] = "SPAN";
|
|
19191
|
-
DOCS_EXTENSION_TYPE[DOCS_EXTENSION_TYPE["LINE"] = 1] = "LINE";
|
|
19192
|
-
return DOCS_EXTENSION_TYPE;
|
|
19193
|
-
}({});
|
|
19194
19030
|
var docExtension = class extends ComponentExtension {
|
|
19195
19031
|
constructor(..._args) {
|
|
19196
19032
|
super(..._args);
|
|
19197
|
-
_defineProperty(this, "type",
|
|
19033
|
+
_defineProperty(this, "type", 0);
|
|
19198
19034
|
_defineProperty(this, "translateX", 0);
|
|
19199
19035
|
_defineProperty(this, "translateY", 0);
|
|
19200
19036
|
}
|
|
@@ -19289,10 +19125,10 @@ var Border$1 = class extends docExtension {
|
|
|
19289
19125
|
_createBorderCache(borderData) {
|
|
19290
19126
|
const { t, b, l, r } = borderData;
|
|
19291
19127
|
const borderCache = /* @__PURE__ */ new Map();
|
|
19292
|
-
t && borderCache.set(
|
|
19293
|
-
b && borderCache.set(
|
|
19294
|
-
l && borderCache.set(
|
|
19295
|
-
r && borderCache.set(
|
|
19128
|
+
t && borderCache.set("t", t);
|
|
19129
|
+
b && borderCache.set("b", b);
|
|
19130
|
+
l && borderCache.set("l", l);
|
|
19131
|
+
r && borderCache.set("r", r);
|
|
19296
19132
|
return borderCache;
|
|
19297
19133
|
}
|
|
19298
19134
|
};
|
|
@@ -19344,12 +19180,12 @@ var Circle = class Circle extends Shape {
|
|
|
19344
19180
|
constructor(key, props) {
|
|
19345
19181
|
super(key, props);
|
|
19346
19182
|
_defineProperty(this, "_radius", void 0);
|
|
19347
|
-
_defineProperty(this, "objectType",
|
|
19183
|
+
_defineProperty(this, "objectType", 5);
|
|
19348
19184
|
this._radius = (props === null || props === void 0 ? void 0 : props.radius) || 10;
|
|
19349
19185
|
this._setFixBoundingBox();
|
|
19350
19186
|
this.onTransformChange$.subscribeEvent((changeState) => {
|
|
19351
19187
|
const { type, value, preValue } = changeState;
|
|
19352
|
-
if (type ===
|
|
19188
|
+
if (type === 1 || type === 5) {
|
|
19353
19189
|
const value = Math.min(this.width, this.height);
|
|
19354
19190
|
this._radius = value / 2;
|
|
19355
19191
|
this.width = value;
|
|
@@ -19418,7 +19254,7 @@ const RECT_OBJECT_ARRAY = ["radius"];
|
|
|
19418
19254
|
var Rect = class Rect extends Shape {
|
|
19419
19255
|
constructor(key, props) {
|
|
19420
19256
|
super(key, props);
|
|
19421
|
-
_defineProperty(this, "objectType",
|
|
19257
|
+
_defineProperty(this, "objectType", 4);
|
|
19422
19258
|
_defineProperty(this, "_radius", 0);
|
|
19423
19259
|
_defineProperty(this, "_opacity", 1);
|
|
19424
19260
|
_defineProperty(this, "_visualHeight", void 0);
|
|
@@ -19606,7 +19442,7 @@ var Image$1 = class extends Shape {
|
|
|
19606
19442
|
_defineProperty(this, "_renderByCropper", false);
|
|
19607
19443
|
_defineProperty(this, "_transformCalculateSrcRect", true);
|
|
19608
19444
|
_defineProperty(this, "_clipService", null);
|
|
19609
|
-
_defineProperty(this, "objectType",
|
|
19445
|
+
_defineProperty(this, "objectType", 3);
|
|
19610
19446
|
_defineProperty(this, "isDrawingObject", true);
|
|
19611
19447
|
this._props = { ...config };
|
|
19612
19448
|
if (config.image) {
|
|
@@ -19654,7 +19490,7 @@ var Image$1 = class extends Shape {
|
|
|
19654
19490
|
return this._clipService;
|
|
19655
19491
|
}
|
|
19656
19492
|
get classType() {
|
|
19657
|
-
return
|
|
19493
|
+
return "Image";
|
|
19658
19494
|
}
|
|
19659
19495
|
transformByStateCloseCropper(option) {
|
|
19660
19496
|
this._transformCalculateSrcRect = false;
|
|
@@ -19872,7 +19708,7 @@ var Image$1 = class extends Shape {
|
|
|
19872
19708
|
centerY
|
|
19873
19709
|
]);
|
|
19874
19710
|
const parent = this.getParent();
|
|
19875
|
-
const oCoord = (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) ===
|
|
19711
|
+
const oCoord = (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) === "Group" ? parent.ancestorTransform.multiply(renderTransform) : renderTransform).invert().applyPoint(coord);
|
|
19876
19712
|
const halfWidth = realWidth / 2;
|
|
19877
19713
|
const halfHeight = realHeight / 2;
|
|
19878
19714
|
if (oCoord.x >= -halfWidth - this.strokeWidth / 2 && oCoord.x <= halfWidth + this.strokeWidth / 2 && oCoord.y >= -halfHeight - this.strokeWidth / 2 && oCoord.y <= halfHeight + this.strokeWidth / 2) return true;
|
|
@@ -19901,7 +19737,7 @@ var Path = class Path extends Shape {
|
|
|
19901
19737
|
this._setFixBoundingBox();
|
|
19902
19738
|
this.onTransformChange$.subscribeEvent((changeState) => {
|
|
19903
19739
|
const { type, preValue } = changeState;
|
|
19904
|
-
if (type ===
|
|
19740
|
+
if (type === 1 || type === 5) {
|
|
19905
19741
|
this._reCalculateCache = true;
|
|
19906
19742
|
const { left, top, width, height } = this._getSelfRect();
|
|
19907
19743
|
const { width: preWidth, height: preHeight } = preValue;
|
|
@@ -20569,7 +20405,7 @@ var RegularPolygon = class RegularPolygon extends Shape {
|
|
|
20569
20405
|
this._setFixBoundingBox();
|
|
20570
20406
|
this.onTransformChange$.subscribeEvent((changeState) => {
|
|
20571
20407
|
const { type, value, preValue } = changeState;
|
|
20572
|
-
if (type ===
|
|
20408
|
+
if (type === 1 || type === 5) this.resizePolygon(preValue);
|
|
20573
20409
|
});
|
|
20574
20410
|
}
|
|
20575
20411
|
get pointsGroup() {
|
|
@@ -20736,7 +20572,7 @@ var RichText = class extends BaseObject {
|
|
|
20736
20572
|
_defineProperty(this, "_bg", void 0);
|
|
20737
20573
|
_defineProperty(this, "_bd", void 0);
|
|
20738
20574
|
_defineProperty(this, "_cl", void 0);
|
|
20739
|
-
_defineProperty(this, "objectType",
|
|
20575
|
+
_defineProperty(this, "objectType", 1);
|
|
20740
20576
|
if (props === null || props === void 0 ? void 0 : props.richText) this._documentData = props.richText;
|
|
20741
20577
|
else if (props) {
|
|
20742
20578
|
this._fs = props.fs;
|
|
@@ -20761,7 +20597,7 @@ var RichText = class extends BaseObject {
|
|
|
20761
20597
|
this._initialProps(props);
|
|
20762
20598
|
this.onTransformChange$.subscribeEvent((changeState) => {
|
|
20763
20599
|
const { type } = changeState;
|
|
20764
|
-
if (type ===
|
|
20600
|
+
if (type === 1 || type === 5) {
|
|
20765
20601
|
docModel.updateDocumentDataPageSize(this.width);
|
|
20766
20602
|
this._documentSkeleton.makeDirty(true);
|
|
20767
20603
|
this._documentSkeleton.calculate();
|
|
@@ -21454,7 +21290,7 @@ var FontAndBaseLine = class extends docExtension {
|
|
|
21454
21290
|
ctx.restore();
|
|
21455
21291
|
} else {
|
|
21456
21292
|
const CHECKED_GLYPH = "☑";
|
|
21457
|
-
if ((content === "☐" || content === CHECKED_GLYPH) && glyph.glyphType ===
|
|
21293
|
+
if ((content === "☐" || content === CHECKED_GLYPH) && glyph.glyphType === 2) {
|
|
21458
21294
|
var _glyph$ts$fs, _glyph$ts;
|
|
21459
21295
|
const size = Math.ceil(((_glyph$ts$fs = (_glyph$ts = glyph.ts) === null || _glyph$ts === void 0 ? void 0 : _glyph$ts.fs) !== null && _glyph$ts$fs !== void 0 ? _glyph$ts$fs : 12) * 1.2);
|
|
21460
21296
|
ctx.save();
|
|
@@ -21713,7 +21549,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
21713
21549
|
const extensions = this.getExtensionsByOrder();
|
|
21714
21550
|
for (const extension of extensions) extension.clearCache();
|
|
21715
21551
|
const backgroundExtension = extensions.find((e) => e.uKey === "DefaultDocsBackgroundExtension");
|
|
21716
|
-
const glyphExtensionsExcludeBackground = extensions.filter((e) => e.type ===
|
|
21552
|
+
const glyphExtensionsExcludeBackground = extensions.filter((e) => e.type === 0 && e.uKey !== "DefaultDocsBackgroundExtension");
|
|
21717
21553
|
let pageTop = 0;
|
|
21718
21554
|
let pageLeft = 0;
|
|
21719
21555
|
for (let i = 0, len = pages.length; i < len; i++) {
|
|
@@ -21771,8 +21607,8 @@ var Documents = class Documents extends DocComponent {
|
|
|
21771
21607
|
const maxLineAsc = asc;
|
|
21772
21608
|
const maxLineAscSin = maxLineAsc * Math.sin(centerAngle);
|
|
21773
21609
|
const maxLineAscCos = maxLineAsc * Math.cos(centerAngle);
|
|
21774
|
-
if (type ===
|
|
21775
|
-
for (const extension of extensions) if (extension.type ===
|
|
21610
|
+
if (type === 1) {
|
|
21611
|
+
for (const extension of extensions) if (extension.type === 1) {
|
|
21776
21612
|
extension.extensionOffset = {
|
|
21777
21613
|
alignOffset,
|
|
21778
21614
|
renderConfig
|
|
@@ -21882,7 +21718,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
21882
21718
|
ctx.save();
|
|
21883
21719
|
ctx.setLineWidthByPrecision(1);
|
|
21884
21720
|
ctx.strokeStyle = (_line$borderBottom$co = (_line$borderBottom2 = line.borderBottom) === null || _line$borderBottom2 === void 0 ? void 0 : _line$borderBottom2.color.rgb) !== null && _line$borderBottom$co !== void 0 ? _line$borderBottom$co : "#CDD0D8";
|
|
21885
|
-
drawLineByBorderType(ctx,
|
|
21721
|
+
drawLineByBorderType(ctx, "b", 0, {
|
|
21886
21722
|
startX: x,
|
|
21887
21723
|
startY: y,
|
|
21888
21724
|
endX: x + pageWidth - marginLeft - marginRight,
|
|
@@ -21918,8 +21754,8 @@ var Documents = class Documents extends DocComponent {
|
|
|
21918
21754
|
const maxLineAsc = asc;
|
|
21919
21755
|
const maxLineAscSin = maxLineAsc * Math.sin(centerAngle);
|
|
21920
21756
|
const maxLineAscCos = maxLineAsc * Math.cos(centerAngle);
|
|
21921
|
-
if (type ===
|
|
21922
|
-
for (const extension of extensions) if (extension.type ===
|
|
21757
|
+
if (type === 1) {
|
|
21758
|
+
for (const extension of extensions) if (extension.type === 1) {
|
|
21923
21759
|
extension.extensionOffset = {
|
|
21924
21760
|
alignOffset,
|
|
21925
21761
|
renderConfig
|
|
@@ -21999,7 +21835,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
21999
21835
|
ctx.setLineWidthByPrecision(1);
|
|
22000
21836
|
ctx.save();
|
|
22001
21837
|
ctx.strokeStyle = (_borderLeft$color$rgb = borderLeft.color.rgb) !== null && _borderLeft$color$rgb !== void 0 ? _borderLeft$color$rgb : DEFAULT_BORDER_COLOR.color.rgb;
|
|
22002
|
-
drawLineByBorderType(ctx,
|
|
21838
|
+
drawLineByBorderType(ctx, "l", 0, {
|
|
22003
21839
|
startX: x,
|
|
22004
21840
|
startY: y,
|
|
22005
21841
|
endX: x + pageWidth,
|
|
@@ -22008,7 +21844,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
22008
21844
|
ctx.restore();
|
|
22009
21845
|
ctx.save();
|
|
22010
21846
|
ctx.strokeStyle = (_borderTop$color$rgb = borderTop.color.rgb) !== null && _borderTop$color$rgb !== void 0 ? _borderTop$color$rgb : DEFAULT_BORDER_COLOR.color.rgb;
|
|
22011
|
-
drawLineByBorderType(ctx,
|
|
21847
|
+
drawLineByBorderType(ctx, "t", 0, {
|
|
22012
21848
|
startX: x,
|
|
22013
21849
|
startY: y,
|
|
22014
21850
|
endX: x + pageWidth,
|
|
@@ -22017,7 +21853,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
22017
21853
|
ctx.restore();
|
|
22018
21854
|
ctx.save();
|
|
22019
21855
|
ctx.strokeStyle = (_borderRight$color$rg = borderRight.color.rgb) !== null && _borderRight$color$rg !== void 0 ? _borderRight$color$rg : DEFAULT_BORDER_COLOR.color.rgb;
|
|
22020
|
-
drawLineByBorderType(ctx,
|
|
21856
|
+
drawLineByBorderType(ctx, "r", 0, {
|
|
22021
21857
|
startX: x,
|
|
22022
21858
|
startY: y,
|
|
22023
21859
|
endX: x + pageWidth,
|
|
@@ -22026,7 +21862,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
22026
21862
|
ctx.restore();
|
|
22027
21863
|
ctx.save();
|
|
22028
21864
|
ctx.strokeStyle = (_borderBottom$color$r = borderBottom.color.rgb) !== null && _borderBottom$color$r !== void 0 ? _borderBottom$color$r : DEFAULT_BORDER_COLOR.color.rgb;
|
|
22029
|
-
drawLineByBorderType(ctx,
|
|
21865
|
+
drawLineByBorderType(ctx, "b", 0, {
|
|
22030
21866
|
startX: x,
|
|
22031
21867
|
startY: y,
|
|
22032
21868
|
endX: x + pageWidth,
|
|
@@ -22055,8 +21891,8 @@ var Documents = class Documents extends DocComponent {
|
|
|
22055
21891
|
const maxLineAsc = asc;
|
|
22056
21892
|
const maxLineAscSin = maxLineAsc * Math.sin(centerAngle);
|
|
22057
21893
|
const maxLineAscCos = maxLineAsc * Math.cos(centerAngle);
|
|
22058
|
-
if (type ===
|
|
22059
|
-
for (const extension of extensions) if (extension.type ===
|
|
21894
|
+
if (type === 1) {
|
|
21895
|
+
for (const extension of extensions) if (extension.type === 1) {
|
|
22060
21896
|
extension.extensionOffset = {
|
|
22061
21897
|
alignOffset,
|
|
22062
21898
|
renderConfig
|
|
@@ -22479,14 +22315,14 @@ var Spreadsheet = class extends SheetComponent {
|
|
|
22479
22315
|
_getAncestorSize() {
|
|
22480
22316
|
const parent = this._getAncestorParent();
|
|
22481
22317
|
if (!parent) return;
|
|
22482
|
-
if (parent.classType ===
|
|
22318
|
+
if (parent.classType === "Engine") {
|
|
22483
22319
|
const mainCanvas = parent.getCanvas();
|
|
22484
22320
|
return {
|
|
22485
22321
|
width: mainCanvas.getWidth(),
|
|
22486
22322
|
height: mainCanvas.getHeight()
|
|
22487
22323
|
};
|
|
22488
22324
|
}
|
|
22489
|
-
if (parent.classType ===
|
|
22325
|
+
if (parent.classType === "SceneViewer") return {
|
|
22490
22326
|
width: parent.width,
|
|
22491
22327
|
height: parent.height
|
|
22492
22328
|
};
|
|
@@ -22494,7 +22330,7 @@ var Spreadsheet = class extends SheetComponent {
|
|
|
22494
22330
|
_getAncestorParent() {
|
|
22495
22331
|
let parent = this.parent;
|
|
22496
22332
|
while (parent) {
|
|
22497
|
-
if (parent.classType ===
|
|
22333
|
+
if (parent.classType === "Engine" || parent.classType === "SceneViewer") return parent;
|
|
22498
22334
|
parent = (parent === null || parent === void 0 ? void 0 : parent.getParent) && (parent === null || parent === void 0 ? void 0 : parent.getParent());
|
|
22499
22335
|
}
|
|
22500
22336
|
}
|
|
@@ -22751,9 +22587,9 @@ let IWatermarkTypeEnum = /* @__PURE__ */ function(IWatermarkTypeEnum) {
|
|
|
22751
22587
|
function renderWatermark(ctx, config, image, userInfo) {
|
|
22752
22588
|
const type = config.type;
|
|
22753
22589
|
const watermarkConfig = config.config;
|
|
22754
|
-
if (type ===
|
|
22755
|
-
else if (type ===
|
|
22756
|
-
else if (type ===
|
|
22590
|
+
if (type === "userInfo" && watermarkConfig.userInfo) renderUserInfoWatermark(ctx, watermarkConfig.userInfo, userInfo);
|
|
22591
|
+
else if (type === "image" && watermarkConfig.image) renderImageWatermark(ctx, watermarkConfig.image, image);
|
|
22592
|
+
else if (type === "text" && watermarkConfig.text) renderTextWatermark(ctx, watermarkConfig.text);
|
|
22757
22593
|
}
|
|
22758
22594
|
function renderUserInfoWatermark(ctx, config, userInfo) {
|
|
22759
22595
|
const { x, y, repeat, spacingX, spacingY, rotate, opacity, name, fontSize, color, bold, italic, direction } = config;
|
|
@@ -22909,7 +22745,7 @@ var Layer = class extends Disposable {
|
|
|
22909
22745
|
* @returns {Layer} this
|
|
22910
22746
|
*/
|
|
22911
22747
|
addObject(o) {
|
|
22912
|
-
if (o.classType ===
|
|
22748
|
+
if (o.classType === "Group") {
|
|
22913
22749
|
const objects = o.getObjects();
|
|
22914
22750
|
for (const object of objects) {
|
|
22915
22751
|
if (this.scene.getObject(object.oKey)) continue;
|
|
@@ -22971,7 +22807,7 @@ var Layer = class extends Disposable {
|
|
|
22971
22807
|
* parent is SceneViewer, make it dirty
|
|
22972
22808
|
*/
|
|
22973
22809
|
const parent = this.scene.getParent();
|
|
22974
|
-
if (parent.classType ===
|
|
22810
|
+
if (parent.classType === "SceneViewer") parent.makeDirty(true);
|
|
22975
22811
|
return this;
|
|
22976
22812
|
}
|
|
22977
22813
|
makeDirtyWithDebounce(state = true) {
|
|
@@ -23078,7 +22914,7 @@ var WatermarkLayer = class extends Layer {
|
|
|
23078
22914
|
updateConfig(config, user) {
|
|
23079
22915
|
var _this$_config;
|
|
23080
22916
|
this._config = config;
|
|
23081
|
-
if (((_this$_config = this._config) === null || _this$_config === void 0 ? void 0 : _this$_config.type) ===
|
|
22917
|
+
if (((_this$_config = this._config) === null || _this$_config === void 0 ? void 0 : _this$_config.type) === "image" && this._config.config.image) {
|
|
23082
22918
|
this._image = new Image();
|
|
23083
22919
|
this._image.src = this._config.config.image.url;
|
|
23084
22920
|
}
|
|
@@ -23116,7 +22952,7 @@ var SceneViewer = class extends BaseObject {
|
|
|
23116
22952
|
this._initialProps(props);
|
|
23117
22953
|
}
|
|
23118
22954
|
get classType() {
|
|
23119
|
-
return
|
|
22955
|
+
return "SceneViewer";
|
|
23120
22956
|
}
|
|
23121
22957
|
render(mainCtx, bounds) {
|
|
23122
22958
|
var _this$_activeSubScene;
|
|
@@ -23243,7 +23079,7 @@ var Slide = class extends SceneViewer {
|
|
|
23243
23079
|
addNavigation() {
|
|
23244
23080
|
const scene = this.getActiveSubScene();
|
|
23245
23081
|
if (scene == null || this._navigationEnabled === false) return;
|
|
23246
|
-
const leftArrow = new Path(
|
|
23082
|
+
const leftArrow = new Path("__slideNavigationLeft__", {
|
|
23247
23083
|
data: arrowPath,
|
|
23248
23084
|
width: 60,
|
|
23249
23085
|
height: 60,
|
|
@@ -23252,7 +23088,7 @@ var Slide = class extends SceneViewer {
|
|
|
23252
23088
|
fill: this._getArrowColor(),
|
|
23253
23089
|
flipX: true
|
|
23254
23090
|
});
|
|
23255
|
-
const rightArrow = new Path(
|
|
23091
|
+
const rightArrow = new Path("__slideNavigationRight__", {
|
|
23256
23092
|
data: arrowPath,
|
|
23257
23093
|
width: 60,
|
|
23258
23094
|
height: 60,
|
|
@@ -23261,11 +23097,11 @@ var Slide = class extends SceneViewer {
|
|
|
23261
23097
|
fill: this._getArrowColor()
|
|
23262
23098
|
});
|
|
23263
23099
|
const hoverIn = (o, evt) => {
|
|
23264
|
-
o.setCursor(
|
|
23100
|
+
o.setCursor("pointer");
|
|
23265
23101
|
o.setProps({ fill: this._getArrowColor(true) });
|
|
23266
23102
|
};
|
|
23267
23103
|
const hoverOut = (o, evt) => {
|
|
23268
|
-
o.setCursor(
|
|
23104
|
+
o.setCursor("default");
|
|
23269
23105
|
o.setProps({ fill: this._getArrowColor() });
|
|
23270
23106
|
};
|
|
23271
23107
|
attachObjectHover(leftArrow, hoverIn, hoverOut);
|
|
@@ -23277,8 +23113,8 @@ var Slide = class extends SceneViewer {
|
|
|
23277
23113
|
var _scene$getObject, _scene$getObject2;
|
|
23278
23114
|
const scene = this.getActiveSubScene();
|
|
23279
23115
|
if (scene == null || this._navigationEnabled === false) return;
|
|
23280
|
-
(_scene$getObject = scene.getObject(
|
|
23281
|
-
(_scene$getObject2 = scene.getObject(
|
|
23116
|
+
(_scene$getObject = scene.getObject("__slideNavigationLeft__")) === null || _scene$getObject === void 0 || _scene$getObject.dispose();
|
|
23117
|
+
(_scene$getObject2 = scene.getObject("__slideNavigationRight__")) === null || _scene$getObject2 === void 0 || _scene$getObject2.dispose();
|
|
23282
23118
|
}
|
|
23283
23119
|
enableNav() {
|
|
23284
23120
|
this._navigationEnabled = true;
|
|
@@ -23290,15 +23126,15 @@ var Slide = class extends SceneViewer {
|
|
|
23290
23126
|
var _scene$getObject3, _scene$getObject4;
|
|
23291
23127
|
const scene = this.getActiveSubScene();
|
|
23292
23128
|
if (scene == null || this._navigationEnabled === false) return;
|
|
23293
|
-
(_scene$getObject3 = scene.getObject(
|
|
23294
|
-
(_scene$getObject4 = scene.getObject(
|
|
23129
|
+
(_scene$getObject3 = scene.getObject("__slideNavigationLeft__")) === null || _scene$getObject3 === void 0 || _scene$getObject3.hide();
|
|
23130
|
+
(_scene$getObject4 = scene.getObject("__slideNavigationRight__")) === null || _scene$getObject4 === void 0 || _scene$getObject4.hide();
|
|
23295
23131
|
}
|
|
23296
23132
|
showNav() {
|
|
23297
23133
|
var _scene$getObject5, _scene$getObject6;
|
|
23298
23134
|
const scene = this.getActiveSubScene();
|
|
23299
23135
|
if (scene == null || this._navigationEnabled === false) return;
|
|
23300
|
-
(_scene$getObject5 = scene.getObject(
|
|
23301
|
-
(_scene$getObject6 = scene.getObject(
|
|
23136
|
+
(_scene$getObject5 = scene.getObject("__slideNavigationLeft__")) === null || _scene$getObject5 === void 0 || _scene$getObject5.show();
|
|
23137
|
+
(_scene$getObject6 = scene.getObject("__slideNavigationRight__")) === null || _scene$getObject6 === void 0 || _scene$getObject6.show();
|
|
23302
23138
|
}
|
|
23303
23139
|
renderToThumb(mainCtx, pageId, scaleX = 1, scaleY = 1) {
|
|
23304
23140
|
const scene = this.getSubScene(pageId);
|
|
@@ -23512,7 +23348,7 @@ var Group = class extends BaseObject {
|
|
|
23512
23348
|
this.addObjects(...objects);
|
|
23513
23349
|
}
|
|
23514
23350
|
get classType() {
|
|
23515
|
-
return
|
|
23351
|
+
return "Group";
|
|
23516
23352
|
}
|
|
23517
23353
|
set cursor(val) {
|
|
23518
23354
|
this.setCursor(val);
|
|
@@ -23632,7 +23468,7 @@ var Group = class extends BaseObject {
|
|
|
23632
23468
|
}
|
|
23633
23469
|
_transformObject(object, groupWidth, groupHeight) {
|
|
23634
23470
|
const transform = transformObjectOutOfGroup(object.getState(), this.getState(), groupWidth, groupHeight);
|
|
23635
|
-
if (object.classType ===
|
|
23471
|
+
if (object.classType === "Group") object.transformByState({
|
|
23636
23472
|
left: transform.left,
|
|
23637
23473
|
top: transform.top
|
|
23638
23474
|
});
|
|
@@ -23716,7 +23552,7 @@ var DrawingGroupObject = class extends Group {
|
|
|
23716
23552
|
centerY
|
|
23717
23553
|
]);
|
|
23718
23554
|
const parent = this.getParent();
|
|
23719
|
-
if (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) ===
|
|
23555
|
+
if (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) === "Group") return parent.ancestorTransform.multiply(renderTransform);
|
|
23720
23556
|
return renderTransform;
|
|
23721
23557
|
}
|
|
23722
23558
|
render(ctx, bounds) {
|
|
@@ -23747,7 +23583,7 @@ var DrawingGroupObject = class extends Group {
|
|
|
23747
23583
|
centerY
|
|
23748
23584
|
]);
|
|
23749
23585
|
const parent = this.getParent();
|
|
23750
|
-
const oCoord = (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) ===
|
|
23586
|
+
const oCoord = (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) === "Group" ? parent.ancestorTransform.multiply(renderTransform) : renderTransform).invert().applyPoint(coord);
|
|
23751
23587
|
const halfWidth = realWidth / 2;
|
|
23752
23588
|
const halfHeight = realHeight / 2;
|
|
23753
23589
|
if (oCoord.x < -halfWidth || oCoord.x > halfWidth || oCoord.y < -halfHeight || oCoord.y > halfHeight) return false;
|
|
@@ -23991,7 +23827,7 @@ let Engine = class Engine extends Disposable {
|
|
|
23991
23827
|
return this.getCanvas().getHeight();
|
|
23992
23828
|
}
|
|
23993
23829
|
get classType() {
|
|
23994
|
-
return
|
|
23830
|
+
return "Engine";
|
|
23995
23831
|
}
|
|
23996
23832
|
get activeScene() {
|
|
23997
23833
|
return this._activeScene;
|
|
@@ -24061,7 +23897,7 @@ let Engine = class Engine extends Disposable {
|
|
|
24061
23897
|
const options = Object.assign({}, {
|
|
24062
23898
|
elementHeight: 1,
|
|
24063
23899
|
elementWidth: 1,
|
|
24064
|
-
renderMode:
|
|
23900
|
+
renderMode: 0,
|
|
24065
23901
|
dpr: 1
|
|
24066
23902
|
}, _options);
|
|
24067
23903
|
this._canvas = new Canvas({
|
|
@@ -24075,7 +23911,7 @@ let Engine = class Engine extends Disposable {
|
|
|
24075
23911
|
this._handleKeyboardAction();
|
|
24076
23912
|
this._handlePointerAction();
|
|
24077
23913
|
this._handleDragAction();
|
|
24078
|
-
if (options.renderMode !==
|
|
23914
|
+
if (options.renderMode !== 1) this._matchMediaHandler();
|
|
24079
23915
|
}
|
|
24080
23916
|
getScenes() {
|
|
24081
23917
|
return this._scenes;
|
|
@@ -24208,7 +24044,7 @@ let Engine = class Engine extends Disposable {
|
|
|
24208
24044
|
const preHeight = this.height;
|
|
24209
24045
|
this.getCanvas().setSize(width, height);
|
|
24210
24046
|
this.onTransformChange$.emitEvent({
|
|
24211
|
-
type:
|
|
24047
|
+
type: 1,
|
|
24212
24048
|
value: {
|
|
24213
24049
|
width,
|
|
24214
24050
|
height
|
|
@@ -24354,13 +24190,13 @@ let Engine = class Engine extends Disposable {
|
|
|
24354
24190
|
_handleKeyboardAction() {
|
|
24355
24191
|
const keyboardDownEvent = (evt) => {
|
|
24356
24192
|
const deviceEvent = evt;
|
|
24357
|
-
deviceEvent.deviceType =
|
|
24193
|
+
deviceEvent.deviceType = 1;
|
|
24358
24194
|
deviceEvent.inputIndex = evt.keyCode;
|
|
24359
24195
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24360
24196
|
};
|
|
24361
24197
|
const keyboardUpEvent = (evt) => {
|
|
24362
24198
|
const deviceEvent = evt;
|
|
24363
|
-
deviceEvent.deviceType =
|
|
24199
|
+
deviceEvent.deviceType = 1;
|
|
24364
24200
|
deviceEvent.inputIndex = evt.keyCode;
|
|
24365
24201
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24366
24202
|
};
|
|
@@ -24385,13 +24221,13 @@ let Engine = class Engine extends Disposable {
|
|
|
24385
24221
|
this._pointerMoveEvent = (e) => {
|
|
24386
24222
|
const evt = e;
|
|
24387
24223
|
const deviceType = this._getPointerType(evt);
|
|
24388
|
-
this._pointerPosRecord[
|
|
24389
|
-
this._pointerPosRecord[
|
|
24390
|
-
this._pointerPosRecord[
|
|
24391
|
-
this._pointerPosRecord[
|
|
24224
|
+
this._pointerPosRecord[0] = evt.clientX;
|
|
24225
|
+
this._pointerPosRecord[1] = evt.clientY;
|
|
24226
|
+
this._pointerPosRecord[10] = evt.movementX;
|
|
24227
|
+
this._pointerPosRecord[11] = evt.movementY;
|
|
24392
24228
|
const deviceEvent = evt;
|
|
24393
24229
|
deviceEvent.deviceType = deviceType;
|
|
24394
|
-
deviceEvent.inputIndex =
|
|
24230
|
+
deviceEvent.inputIndex = 0;
|
|
24395
24231
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24396
24232
|
if (!this._usingSafari) {
|
|
24397
24233
|
deviceEvent.inputIndex = evt.button + 2;
|
|
@@ -24401,23 +24237,23 @@ let Engine = class Engine extends Disposable {
|
|
|
24401
24237
|
this._pointerDownEvent = (nativeEvent) => {
|
|
24402
24238
|
const evt = nativeEvent;
|
|
24403
24239
|
const deviceType = this._getPointerType(evt);
|
|
24404
|
-
const previousHorizontal = this._pointerPosRecord[
|
|
24405
|
-
const previousVertical = this._pointerPosRecord[
|
|
24406
|
-
if (deviceType ===
|
|
24240
|
+
const previousHorizontal = this._pointerPosRecord[0];
|
|
24241
|
+
const previousVertical = this._pointerPosRecord[1];
|
|
24242
|
+
if (deviceType === 2) {
|
|
24407
24243
|
if (this._mouseId === -1) if (evt.pointerId === void 0) this._mouseId = this._isUsingFirefox ? 0 : 1;
|
|
24408
24244
|
else this._mouseId = evt.pointerId;
|
|
24409
24245
|
if (!document.pointerLockElement) this._remainCapture = this._mouseId;
|
|
24410
24246
|
} else if (evt.pointerId && !document.pointerLockElement) this._remainCapture = evt.pointerId;
|
|
24411
|
-
this._pointerPosRecord[
|
|
24412
|
-
this._pointerPosRecord[
|
|
24247
|
+
this._pointerPosRecord[0] = evt.clientX;
|
|
24248
|
+
this._pointerPosRecord[1] = evt.clientY;
|
|
24413
24249
|
const deviceEvent = evt;
|
|
24414
24250
|
deviceEvent.deviceType = deviceType;
|
|
24415
24251
|
if (previousHorizontal !== evt.clientX) {
|
|
24416
|
-
deviceEvent.inputIndex =
|
|
24252
|
+
deviceEvent.inputIndex = 0;
|
|
24417
24253
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24418
24254
|
}
|
|
24419
24255
|
if (previousVertical !== evt.clientY) {
|
|
24420
|
-
deviceEvent.inputIndex =
|
|
24256
|
+
deviceEvent.inputIndex = 1;
|
|
24421
24257
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24422
24258
|
}
|
|
24423
24259
|
deviceEvent.inputIndex = evt.button + 2;
|
|
@@ -24426,23 +24262,23 @@ let Engine = class Engine extends Disposable {
|
|
|
24426
24262
|
this._pointerUpEvent = (_evt) => {
|
|
24427
24263
|
const evt = _evt;
|
|
24428
24264
|
const deviceType = this._getPointerType(evt);
|
|
24429
|
-
const previousHorizontal = this._pointerPosRecord[
|
|
24430
|
-
const previousVertical = this._pointerPosRecord[
|
|
24431
|
-
this._pointerPosRecord[
|
|
24432
|
-
this._pointerPosRecord[
|
|
24265
|
+
const previousHorizontal = this._pointerPosRecord[0];
|
|
24266
|
+
const previousVertical = this._pointerPosRecord[1];
|
|
24267
|
+
this._pointerPosRecord[0] = evt.clientX;
|
|
24268
|
+
this._pointerPosRecord[1] = evt.clientY;
|
|
24433
24269
|
const deviceEvent = evt;
|
|
24434
24270
|
deviceEvent.deviceType = deviceType;
|
|
24435
24271
|
if (previousHorizontal !== evt.clientX) {
|
|
24436
|
-
deviceEvent.inputIndex =
|
|
24272
|
+
deviceEvent.inputIndex = 0;
|
|
24437
24273
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24438
24274
|
}
|
|
24439
24275
|
if (previousVertical !== evt.clientY) {
|
|
24440
|
-
deviceEvent.inputIndex =
|
|
24276
|
+
deviceEvent.inputIndex = 1;
|
|
24441
24277
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24442
24278
|
}
|
|
24443
24279
|
deviceEvent.inputIndex = evt.button + 2;
|
|
24444
24280
|
const canvasEle = this.getCanvasElement();
|
|
24445
|
-
if (deviceType ===
|
|
24281
|
+
if (deviceType === 2 && this._mouseId >= 0 && canvasEle.hasPointerCapture(this._mouseId)) {
|
|
24446
24282
|
this._remainCapture = this._mouseId;
|
|
24447
24283
|
canvasEle.releasePointerCapture(this._mouseId);
|
|
24448
24284
|
} else if (deviceEvent.pointerId && canvasEle.hasPointerCapture(deviceEvent.pointerId)) {
|
|
@@ -24450,7 +24286,7 @@ let Engine = class Engine extends Disposable {
|
|
|
24450
24286
|
canvasEle.releasePointerCapture(deviceEvent.pointerId);
|
|
24451
24287
|
}
|
|
24452
24288
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24453
|
-
if (deviceType !==
|
|
24289
|
+
if (deviceType !== 2) this._pointerPosRecord = {};
|
|
24454
24290
|
};
|
|
24455
24291
|
this._pointerEnterEvent = (evt) => {
|
|
24456
24292
|
const deviceType = this._getPointerType(evt);
|
|
@@ -24481,15 +24317,15 @@ let Engine = class Engine extends Disposable {
|
|
|
24481
24317
|
this._pointerPosRecord = {};
|
|
24482
24318
|
};
|
|
24483
24319
|
this._pointerWheelEvent = (evt) => {
|
|
24484
|
-
const deviceType =
|
|
24485
|
-
this._pointerPosRecord[
|
|
24486
|
-
this._pointerPosRecord[
|
|
24487
|
-
this._pointerPosRecord[
|
|
24320
|
+
const deviceType = 2;
|
|
24321
|
+
this._pointerPosRecord[7] = evt.deltaX || 0;
|
|
24322
|
+
this._pointerPosRecord[8] = evt.deltaY || evt.wheelDelta || 0;
|
|
24323
|
+
this._pointerPosRecord[9] = evt.deltaZ || 0;
|
|
24488
24324
|
const deviceEvent = evt;
|
|
24489
24325
|
deviceEvent.deviceType = deviceType;
|
|
24490
|
-
if (this._pointerPosRecord[
|
|
24491
|
-
if (this._pointerPosRecord[
|
|
24492
|
-
if (this._pointerPosRecord[
|
|
24326
|
+
if (this._pointerPosRecord[7] !== 0) deviceEvent.currentState = this._pointerPosRecord[7];
|
|
24327
|
+
if (this._pointerPosRecord[8] !== 0) deviceEvent.currentState = this._pointerPosRecord[8];
|
|
24328
|
+
if (this._pointerPosRecord[9] !== 0) deviceEvent.currentState = this._pointerPosRecord[9];
|
|
24493
24329
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24494
24330
|
};
|
|
24495
24331
|
const canvasEle = this.getCanvasElement();
|
|
@@ -24523,32 +24359,32 @@ let Engine = class Engine extends Disposable {
|
|
|
24523
24359
|
this._dragOverEvent = (evt) => {
|
|
24524
24360
|
evt.preventDefault();
|
|
24525
24361
|
const deviceType = this._getPointerType(evt);
|
|
24526
|
-
const previousHorizontal = this._pointerPosRecord[
|
|
24527
|
-
const previousVertical = this._pointerPosRecord[
|
|
24528
|
-
this._pointerPosRecord[
|
|
24529
|
-
this._pointerPosRecord[
|
|
24530
|
-
this._pointerPosRecord[
|
|
24531
|
-
this._pointerPosRecord[
|
|
24362
|
+
const previousHorizontal = this._pointerPosRecord[0];
|
|
24363
|
+
const previousVertical = this._pointerPosRecord[1];
|
|
24364
|
+
this._pointerPosRecord[0] = evt.clientX;
|
|
24365
|
+
this._pointerPosRecord[1] = evt.clientY;
|
|
24366
|
+
this._pointerPosRecord[10] = evt.movementX;
|
|
24367
|
+
this._pointerPosRecord[11] = evt.movementY;
|
|
24532
24368
|
const deviceEvent = evt;
|
|
24533
24369
|
deviceEvent.deviceType = deviceType;
|
|
24534
24370
|
if (previousHorizontal !== evt.clientX) {
|
|
24535
|
-
deviceEvent.inputIndex =
|
|
24536
|
-
deviceEvent.currentState = this._pointerPosRecord[
|
|
24371
|
+
deviceEvent.inputIndex = 0;
|
|
24372
|
+
deviceEvent.currentState = this._pointerPosRecord[0];
|
|
24537
24373
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24538
24374
|
}
|
|
24539
24375
|
if (previousVertical !== evt.clientY) {
|
|
24540
|
-
deviceEvent.inputIndex =
|
|
24541
|
-
deviceEvent.currentState = this._pointerPosRecord[
|
|
24376
|
+
deviceEvent.inputIndex = 1;
|
|
24377
|
+
deviceEvent.currentState = this._pointerPosRecord[1];
|
|
24542
24378
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24543
24379
|
}
|
|
24544
|
-
if (this._pointerPosRecord[
|
|
24545
|
-
deviceEvent.inputIndex =
|
|
24546
|
-
deviceEvent.currentState = this._pointerPosRecord[
|
|
24380
|
+
if (this._pointerPosRecord[10] !== 0) {
|
|
24381
|
+
deviceEvent.inputIndex = 10;
|
|
24382
|
+
deviceEvent.currentState = this._pointerPosRecord[10];
|
|
24547
24383
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24548
24384
|
}
|
|
24549
|
-
if (this._pointerPosRecord[
|
|
24550
|
-
deviceEvent.inputIndex =
|
|
24551
|
-
deviceEvent.currentState = this._pointerPosRecord[
|
|
24385
|
+
if (this._pointerPosRecord[11] !== 0) {
|
|
24386
|
+
deviceEvent.inputIndex = 11;
|
|
24387
|
+
deviceEvent.currentState = this._pointerPosRecord[11];
|
|
24552
24388
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24553
24389
|
}
|
|
24554
24390
|
if (!this._usingSafari) {
|
|
@@ -24587,8 +24423,8 @@ let Engine = class Engine extends Disposable {
|
|
|
24587
24423
|
return passiveSupported;
|
|
24588
24424
|
}
|
|
24589
24425
|
_getPointerType(evt) {
|
|
24590
|
-
let deviceType =
|
|
24591
|
-
if (evt.pointerType === "touch" || evt.pointerType === "pen" || evt.touches) deviceType =
|
|
24426
|
+
let deviceType = 2;
|
|
24427
|
+
if (evt.pointerType === "touch" || evt.pointerType === "pen" || evt.touches) deviceType = 3;
|
|
24592
24428
|
return deviceType;
|
|
24593
24429
|
}
|
|
24594
24430
|
_matchMediaHandler() {
|
|
@@ -24609,7 +24445,7 @@ Engine = __decorate([__decorateParam(2, ICanvasColorService)], Engine);
|
|
|
24609
24445
|
//#endregion
|
|
24610
24446
|
//#region package.json
|
|
24611
24447
|
var name = "@univerjs/engine-render";
|
|
24612
|
-
var version = "0.
|
|
24448
|
+
var version = "0.22.0-insiders.20260513-09bbeca";
|
|
24613
24449
|
|
|
24614
24450
|
//#endregion
|
|
24615
24451
|
//#region src/config/config.ts
|
|
@@ -24804,7 +24640,7 @@ var InputManager = class InputManager extends Disposable {
|
|
|
24804
24640
|
if (!engine) return;
|
|
24805
24641
|
this._onInput$ = engine.onInputChanged$.subscribeEvent((eventData) => {
|
|
24806
24642
|
const evt = eventData;
|
|
24807
|
-
if (eventData.deviceType ===
|
|
24643
|
+
if (eventData.deviceType === 1) switch (eventData.type) {
|
|
24808
24644
|
case "keydown":
|
|
24809
24645
|
this._onKeyDown(evt);
|
|
24810
24646
|
break;
|
|
@@ -24812,7 +24648,7 @@ var InputManager = class InputManager extends Disposable {
|
|
|
24812
24648
|
this._onKeyUp(evt);
|
|
24813
24649
|
break;
|
|
24814
24650
|
}
|
|
24815
|
-
if (eventData.deviceType ===
|
|
24651
|
+
if (eventData.deviceType === 2 || eventData.deviceType === 3) switch (eventData.type) {
|
|
24816
24652
|
case "wheel":
|
|
24817
24653
|
case "DOMMouseScroll":
|
|
24818
24654
|
case "mousewheel":
|
|
@@ -24834,10 +24670,10 @@ var InputManager = class InputManager extends Disposable {
|
|
|
24834
24670
|
if (enableMove) this._onPointerMove(evt);
|
|
24835
24671
|
break;
|
|
24836
24672
|
case "pointerup":
|
|
24837
|
-
if (enableUp && eventData.inputIndex >=
|
|
24673
|
+
if (enableUp && eventData.inputIndex >= 2 && eventData.inputIndex <= 4) this._onPointerUp(evt);
|
|
24838
24674
|
break;
|
|
24839
24675
|
case "pointerdown":
|
|
24840
|
-
if (enableDown && eventData.inputIndex >=
|
|
24676
|
+
if (enableDown && eventData.inputIndex >= 2 && eventData.inputIndex <= 4) this._onPointerDown(evt);
|
|
24841
24677
|
break;
|
|
24842
24678
|
}
|
|
24843
24679
|
if (eventData.dataTransfer) switch (eventData.type) {
|
|
@@ -24845,7 +24681,7 @@ var InputManager = class InputManager extends Disposable {
|
|
|
24845
24681
|
if (enableEnter) this._onDragEnter(evt);
|
|
24846
24682
|
break;
|
|
24847
24683
|
case "dragover": {
|
|
24848
|
-
const validIndex = eventData.inputIndex ===
|
|
24684
|
+
const validIndex = eventData.inputIndex === 0 || eventData.inputIndex === 1 || eventData.inputIndex === 10 || eventData.inputIndex === 11;
|
|
24849
24685
|
if (enableMove && validIndex) this._onDragOver(evt);
|
|
24850
24686
|
break;
|
|
24851
24687
|
}
|
|
@@ -24892,9 +24728,9 @@ var InputManager = class InputManager extends Disposable {
|
|
|
24892
24728
|
return !this._isObjectInSceneViewer(currentObject);
|
|
24893
24729
|
}
|
|
24894
24730
|
_isObjectInSceneViewer(obj) {
|
|
24895
|
-
if (obj && obj.classType ===
|
|
24731
|
+
if (obj && obj.classType === "BaseObject") {
|
|
24896
24732
|
const scene = obj.getScene();
|
|
24897
|
-
if (scene) return scene.getParent().classType ===
|
|
24733
|
+
if (scene) return scene.getParent().classType === "SceneViewer";
|
|
24898
24734
|
}
|
|
24899
24735
|
return false;
|
|
24900
24736
|
}
|
|
@@ -24961,7 +24797,7 @@ const THRESHOLD_TO_AUTO_MOVE = {
|
|
|
24961
24797
|
r: 60
|
|
24962
24798
|
};
|
|
24963
24799
|
var ScrollTimer = class ScrollTimer {
|
|
24964
|
-
constructor(_scene, _scrollTimerType =
|
|
24800
|
+
constructor(_scene, _scrollTimerType = 3, _thresholdAutoMove = THRESHOLD_TO_AUTO_MOVE) {
|
|
24965
24801
|
this._scene = _scene;
|
|
24966
24802
|
this._scrollTimerType = _scrollTimerType;
|
|
24967
24803
|
this._thresholdAutoMove = _thresholdAutoMove;
|
|
@@ -24975,7 +24811,7 @@ var ScrollTimer = class ScrollTimer {
|
|
|
24975
24811
|
_defineProperty(this, "_scrollY", 0);
|
|
24976
24812
|
_defineProperty(this, "_scrollFunction", void 0);
|
|
24977
24813
|
}
|
|
24978
|
-
static create(scene, scrollTimerType =
|
|
24814
|
+
static create(scene, scrollTimerType = 3, padding) {
|
|
24979
24815
|
return new ScrollTimer(scene, scrollTimerType, padding);
|
|
24980
24816
|
}
|
|
24981
24817
|
get offsetX() {
|
|
@@ -25014,7 +24850,7 @@ var ScrollTimer = class ScrollTimer {
|
|
|
25014
24850
|
let x = 0;
|
|
25015
24851
|
let y = 0;
|
|
25016
24852
|
let shouldScroll = false;
|
|
25017
|
-
if (this._scrollTimerType &
|
|
24853
|
+
if (this._scrollTimerType & 1) {
|
|
25018
24854
|
if (this._moveX < leftBounding + l) {
|
|
25019
24855
|
x = this._moveX - leftBounding - l;
|
|
25020
24856
|
shouldScroll = true;
|
|
@@ -25024,7 +24860,7 @@ var ScrollTimer = class ScrollTimer {
|
|
|
25024
24860
|
shouldScroll = true;
|
|
25025
24861
|
}
|
|
25026
24862
|
}
|
|
25027
|
-
if (this._scrollTimerType &
|
|
24863
|
+
if (this._scrollTimerType & 2) {
|
|
25028
24864
|
if (this._moveY < topBounding + t) {
|
|
25029
24865
|
y = this._moveY - topBounding - t;
|
|
25030
24866
|
shouldScroll = true;
|
|
@@ -25067,42 +24903,21 @@ var ScrollTimer = class ScrollTimer {
|
|
|
25067
24903
|
|
|
25068
24904
|
//#endregion
|
|
25069
24905
|
//#region src/scene.transformer.ts
|
|
25070
|
-
var TransformerManagerType = /* @__PURE__ */ function(TransformerManagerType) {
|
|
25071
|
-
TransformerManagerType["RESIZE_LT"] = "__SpreadsheetTransformerResizeLT__";
|
|
25072
|
-
TransformerManagerType["RESIZE_CT"] = "__SpreadsheetTransformerResizeCT__";
|
|
25073
|
-
TransformerManagerType["RESIZE_RT"] = "__SpreadsheetTransformerResizeRT__";
|
|
25074
|
-
TransformerManagerType["RESIZE_LM"] = "__SpreadsheetTransformerResizeLM__";
|
|
25075
|
-
TransformerManagerType["RESIZE_RM"] = "__SpreadsheetTransformerResizeRM__";
|
|
25076
|
-
TransformerManagerType["RESIZE_LB"] = "__SpreadsheetTransformerResizeLB__";
|
|
25077
|
-
TransformerManagerType["RESIZE_CB"] = "__SpreadsheetTransformerResizeCB__";
|
|
25078
|
-
TransformerManagerType["RESIZE_RB"] = "__SpreadsheetTransformerResizeRB__";
|
|
25079
|
-
TransformerManagerType["OUTLINE"] = "__SpreadsheetTransformerOutline__";
|
|
25080
|
-
TransformerManagerType["ROTATE_LINE"] = "__SpreadsheetTransformerRotateLine__";
|
|
25081
|
-
TransformerManagerType["ROTATE"] = "__SpreadsheetTransformerRotate__";
|
|
25082
|
-
TransformerManagerType["GROUP"] = "__SpreadsheetTransformer__";
|
|
25083
|
-
return TransformerManagerType;
|
|
25084
|
-
}(TransformerManagerType || {});
|
|
25085
24906
|
const TransformerManagerTypeArray = [
|
|
25086
|
-
|
|
25087
|
-
|
|
25088
|
-
|
|
25089
|
-
|
|
25090
|
-
|
|
25091
|
-
|
|
25092
|
-
|
|
25093
|
-
|
|
24907
|
+
"__SpreadsheetTransformerResizeLT__",
|
|
24908
|
+
"__SpreadsheetTransformerResizeCT__",
|
|
24909
|
+
"__SpreadsheetTransformerResizeRT__",
|
|
24910
|
+
"__SpreadsheetTransformerResizeLM__",
|
|
24911
|
+
"__SpreadsheetTransformerResizeRM__",
|
|
24912
|
+
"__SpreadsheetTransformerResizeLB__",
|
|
24913
|
+
"__SpreadsheetTransformerResizeCB__",
|
|
24914
|
+
"__SpreadsheetTransformerResizeRB__"
|
|
25094
24915
|
];
|
|
25095
|
-
var MoveObserverType = /* @__PURE__ */ function(MoveObserverType) {
|
|
25096
|
-
MoveObserverType[MoveObserverType["MOVE_START"] = 0] = "MOVE_START";
|
|
25097
|
-
MoveObserverType[MoveObserverType["MOVING"] = 1] = "MOVING";
|
|
25098
|
-
MoveObserverType[MoveObserverType["MOVE_END"] = 2] = "MOVE_END";
|
|
25099
|
-
return MoveObserverType;
|
|
25100
|
-
}(MoveObserverType || {});
|
|
25101
24916
|
const DEFAULT_TRANSFORMER_LAYER_INDEX = 2;
|
|
25102
24917
|
const MINI_WIDTH_LIMIT = 20;
|
|
25103
24918
|
const MINI_HEIGHT_LIMIT = 20;
|
|
25104
24919
|
const DEFAULT_CONTROL_PLUS_INDEX = 5e3;
|
|
25105
|
-
const SINGLE_ACTIVE_OBJECT_TYPE_MAP = new Set([
|
|
24920
|
+
const SINGLE_ACTIVE_OBJECT_TYPE_MAP = new Set([6]);
|
|
25106
24921
|
/**
|
|
25107
24922
|
* Transformer constructor. Transformer is a special type of group that allow you transform
|
|
25108
24923
|
* primitives and shapes. Transforming tool is not changing `width` and `height` properties of nodes
|
|
@@ -25195,7 +25010,7 @@ var Transformer = class extends Disposable {
|
|
|
25195
25010
|
changeNotification() {
|
|
25196
25011
|
this._changing$.next({
|
|
25197
25012
|
objects: this._selectedObjectMap,
|
|
25198
|
-
type:
|
|
25013
|
+
type: 0
|
|
25199
25014
|
});
|
|
25200
25015
|
return this;
|
|
25201
25016
|
}
|
|
@@ -25340,14 +25155,14 @@ var Transformer = class extends Disposable {
|
|
|
25340
25155
|
this._changeStart$.next({
|
|
25341
25156
|
target: applyObject,
|
|
25342
25157
|
objects: this._selectedObjectMap,
|
|
25343
|
-
type:
|
|
25158
|
+
type: 0
|
|
25344
25159
|
});
|
|
25345
25160
|
} else {
|
|
25346
25161
|
this._copperSelectedObject = applyObject;
|
|
25347
25162
|
this._changeStart$.next({
|
|
25348
25163
|
target: applyObject,
|
|
25349
25164
|
objects: new Map([[applyObject.oKey, applyObject]]),
|
|
25350
|
-
type:
|
|
25165
|
+
type: 0
|
|
25351
25166
|
});
|
|
25352
25167
|
}
|
|
25353
25168
|
this._moveBufferSkip = false;
|
|
@@ -25368,14 +25183,14 @@ var Transformer = class extends Disposable {
|
|
|
25368
25183
|
const { offsetX, offsetY } = event;
|
|
25369
25184
|
if (!isCropper) this._changeEnd$.next({
|
|
25370
25185
|
objects: this._selectedObjectMap,
|
|
25371
|
-
type:
|
|
25186
|
+
type: 2,
|
|
25372
25187
|
offsetX,
|
|
25373
25188
|
offsetY,
|
|
25374
25189
|
event
|
|
25375
25190
|
});
|
|
25376
25191
|
else this._changeEnd$.next({
|
|
25377
25192
|
objects: new Map([[applyObject.oKey, applyObject]]),
|
|
25378
|
-
type:
|
|
25193
|
+
type: 2,
|
|
25379
25194
|
offsetX,
|
|
25380
25195
|
offsetY,
|
|
25381
25196
|
event
|
|
@@ -25459,7 +25274,7 @@ var Transformer = class extends Disposable {
|
|
|
25459
25274
|
objects: this._selectedObjectMap,
|
|
25460
25275
|
moveX: moveLeft,
|
|
25461
25276
|
moveY: moveTop,
|
|
25462
|
-
type:
|
|
25277
|
+
type: 1,
|
|
25463
25278
|
offsetX: moveOffsetX,
|
|
25464
25279
|
offsetY: moveOffsetY
|
|
25465
25280
|
});
|
|
@@ -25473,7 +25288,7 @@ var Transformer = class extends Disposable {
|
|
|
25473
25288
|
objects: new Map([[cropper.oKey, cropper]]),
|
|
25474
25289
|
moveX: moveLeft,
|
|
25475
25290
|
moveY: moveTop,
|
|
25476
|
-
type:
|
|
25291
|
+
type: 1,
|
|
25477
25292
|
offsetX: moveOffsetX,
|
|
25478
25293
|
offsetY: moveOffsetY
|
|
25479
25294
|
});
|
|
@@ -25498,7 +25313,7 @@ var Transformer = class extends Disposable {
|
|
|
25498
25313
|
});
|
|
25499
25314
|
this._changing$.next({
|
|
25500
25315
|
objects: this._selectedObjectMap,
|
|
25501
|
-
type:
|
|
25316
|
+
type: 1,
|
|
25502
25317
|
offsetX: moveOffsetX,
|
|
25503
25318
|
offsetY: moveOffsetY
|
|
25504
25319
|
});
|
|
@@ -25506,12 +25321,12 @@ var Transformer = class extends Disposable {
|
|
|
25506
25321
|
this._moveFunc(applyObject, type, x, y, keepRatio, isCropper, isGroup);
|
|
25507
25322
|
this._changing$.next({
|
|
25508
25323
|
objects: new Map([[applyObject.oKey, applyObject]]),
|
|
25509
|
-
type:
|
|
25324
|
+
type: 1,
|
|
25510
25325
|
offsetX: moveOffsetX,
|
|
25511
25326
|
offsetY: moveOffsetY
|
|
25512
25327
|
});
|
|
25513
25328
|
}
|
|
25514
|
-
if (!(keepRatio && type !==
|
|
25329
|
+
if (!(keepRatio && type !== "__SpreadsheetTransformerResizeCT__" && type !== "__SpreadsheetTransformerResizeCB__" && type !== "__SpreadsheetTransformerResizeLM__" && type !== "__SpreadsheetTransformerResizeRM__" && !isGroup)) {
|
|
25515
25330
|
this._startOffsetX = x;
|
|
25516
25331
|
this._startOffsetY = y;
|
|
25517
25332
|
}
|
|
@@ -25521,17 +25336,17 @@ var Transformer = class extends Disposable {
|
|
|
25521
25336
|
const originState = this._startStateMap.get(moveObject.oKey) || {};
|
|
25522
25337
|
let state = {};
|
|
25523
25338
|
const { moveLeft, moveTop } = this._getMovePoint(x, y, moveObject);
|
|
25524
|
-
if (keepRatio && type !==
|
|
25525
|
-
case
|
|
25339
|
+
if (keepRatio && type !== "__SpreadsheetTransformerResizeCT__" && type !== "__SpreadsheetTransformerResizeCB__" && type !== "__SpreadsheetTransformerResizeLM__" && type !== "__SpreadsheetTransformerResizeRM__" && !isGroup) switch (type) {
|
|
25340
|
+
case "__SpreadsheetTransformerResizeLT__":
|
|
25526
25341
|
state = this._resizeLeftTop(moveObject, moveLeft, moveTop, originState);
|
|
25527
25342
|
break;
|
|
25528
|
-
case
|
|
25343
|
+
case "__SpreadsheetTransformerResizeRT__":
|
|
25529
25344
|
state = this._resizeRightTop(moveObject, moveLeft, moveTop, originState);
|
|
25530
25345
|
break;
|
|
25531
|
-
case
|
|
25346
|
+
case "__SpreadsheetTransformerResizeLB__":
|
|
25532
25347
|
state = this._resizeLeftBottom(moveObject, moveLeft, moveTop, originState);
|
|
25533
25348
|
break;
|
|
25534
|
-
case
|
|
25349
|
+
case "__SpreadsheetTransformerResizeRB__":
|
|
25535
25350
|
state = this._resizeRightBottom(moveObject, moveLeft, moveTop, originState);
|
|
25536
25351
|
break;
|
|
25537
25352
|
}
|
|
@@ -25583,37 +25398,37 @@ var Transformer = class extends Disposable {
|
|
|
25583
25398
|
height
|
|
25584
25399
|
};
|
|
25585
25400
|
switch (type) {
|
|
25586
|
-
case
|
|
25401
|
+
case "__SpreadsheetTransformerResizeLT__":
|
|
25587
25402
|
state.width = width - moveLeft < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : width - moveLeft;
|
|
25588
25403
|
state.height = height - moveTop < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : height - moveTop;
|
|
25589
25404
|
state.left = left + width - state.width;
|
|
25590
25405
|
state.top = top + height - state.height;
|
|
25591
25406
|
break;
|
|
25592
|
-
case
|
|
25407
|
+
case "__SpreadsheetTransformerResizeCT__":
|
|
25593
25408
|
state.height = height - moveTop < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : height - moveTop;
|
|
25594
25409
|
state.top = top + height - state.height;
|
|
25595
25410
|
break;
|
|
25596
|
-
case
|
|
25411
|
+
case "__SpreadsheetTransformerResizeRT__":
|
|
25597
25412
|
state.width = width + moveLeft < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : width + moveLeft;
|
|
25598
25413
|
state.height = height - moveTop < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : height - moveTop;
|
|
25599
25414
|
state.top = top + height - state.height;
|
|
25600
25415
|
break;
|
|
25601
|
-
case
|
|
25416
|
+
case "__SpreadsheetTransformerResizeLM__":
|
|
25602
25417
|
state.width = width - moveLeft < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : width - moveLeft;
|
|
25603
25418
|
state.left = left + width - state.width;
|
|
25604
25419
|
break;
|
|
25605
|
-
case
|
|
25420
|
+
case "__SpreadsheetTransformerResizeRM__":
|
|
25606
25421
|
state.width = moveLeft + width < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : moveLeft + width;
|
|
25607
25422
|
break;
|
|
25608
|
-
case
|
|
25423
|
+
case "__SpreadsheetTransformerResizeLB__":
|
|
25609
25424
|
state.width = width - moveLeft < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : width - moveLeft;
|
|
25610
25425
|
state.height = height + moveTop < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : height + moveTop;
|
|
25611
25426
|
state.left = state.width <= MINI_WIDTH_LIMIT ? left : left + moveLeft;
|
|
25612
25427
|
break;
|
|
25613
|
-
case
|
|
25428
|
+
case "__SpreadsheetTransformerResizeCB__":
|
|
25614
25429
|
state.height = moveTop + height < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : moveTop + height;
|
|
25615
25430
|
break;
|
|
25616
|
-
case
|
|
25431
|
+
case "__SpreadsheetTransformerResizeRB__":
|
|
25617
25432
|
state.width = moveLeft + width < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : moveLeft + width;
|
|
25618
25433
|
state.height = moveTop + height < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : moveTop + height;
|
|
25619
25434
|
break;
|
|
@@ -25718,7 +25533,7 @@ var Transformer = class extends Disposable {
|
|
|
25718
25533
|
moveTop: moveTopFix
|
|
25719
25534
|
};
|
|
25720
25535
|
}
|
|
25721
|
-
_attachEventToAnchor(anchor, type =
|
|
25536
|
+
_attachEventToAnchor(anchor, type = "__SpreadsheetTransformerResizeLT__", applyObject) {
|
|
25722
25537
|
this.disposeWithMe(toDisposable(anchor.onPointerDown$.subscribeEvent((evt, state) => {
|
|
25723
25538
|
const { offsetX: evtOffsetX, offsetY: evtOffsetY } = evt;
|
|
25724
25539
|
this._startOffsetX = evtOffsetX;
|
|
@@ -25739,7 +25554,7 @@ var Transformer = class extends Disposable {
|
|
|
25739
25554
|
this._clearControlMap();
|
|
25740
25555
|
this._changeStart$.next({
|
|
25741
25556
|
objects: this._selectedObjectMap,
|
|
25742
|
-
type:
|
|
25557
|
+
type: 0
|
|
25743
25558
|
});
|
|
25744
25559
|
this._selectedObjectMap.forEach((moveObject) => {
|
|
25745
25560
|
const { width, height, left, top } = moveObject.getState();
|
|
@@ -25753,7 +25568,7 @@ var Transformer = class extends Disposable {
|
|
|
25753
25568
|
} else {
|
|
25754
25569
|
this._changeStart$.next({
|
|
25755
25570
|
objects: new Map([[applyObject.oKey, applyObject]]),
|
|
25756
|
-
type:
|
|
25571
|
+
type: 0
|
|
25757
25572
|
});
|
|
25758
25573
|
const { width, height, left, top } = applyObject.getState();
|
|
25759
25574
|
this._startStateMap.set(applyObject.oKey, {
|
|
@@ -25785,7 +25600,7 @@ var Transformer = class extends Disposable {
|
|
|
25785
25600
|
this._recoverySizeBoundary(Array.from(this._selectedObjectMap.values()), ancestorLeft, ancestorTop, topSceneWidth, topSceneHeight);
|
|
25786
25601
|
this._changeEnd$.next({
|
|
25787
25602
|
objects: this._selectedObjectMap,
|
|
25788
|
-
type:
|
|
25603
|
+
type: 2,
|
|
25789
25604
|
offsetX,
|
|
25790
25605
|
offsetY,
|
|
25791
25606
|
event
|
|
@@ -25794,7 +25609,7 @@ var Transformer = class extends Disposable {
|
|
|
25794
25609
|
this._recoverySizeBoundary([applyObject], ancestorLeft, ancestorTop, topSceneWidth, topSceneHeight);
|
|
25795
25610
|
this._changeEnd$.next({
|
|
25796
25611
|
objects: new Map([[applyObject.oKey, applyObject]]),
|
|
25797
|
-
type:
|
|
25612
|
+
type: 2,
|
|
25798
25613
|
offsetX,
|
|
25799
25614
|
offsetY,
|
|
25800
25615
|
event
|
|
@@ -25832,14 +25647,14 @@ var Transformer = class extends Disposable {
|
|
|
25832
25647
|
const viewportActualXY = topScene.getScrollXYInfoByViewport(Vector2.create(evtOffsetX, evtOffsetY));
|
|
25833
25648
|
this._viewportScrollX = viewportActualXY.x;
|
|
25834
25649
|
this._viewportScrollY = viewportActualXY.y;
|
|
25835
|
-
const cursor = this._getRotateAnchorCursor(
|
|
25650
|
+
const cursor = this._getRotateAnchorCursor("__SpreadsheetTransformerRotateLine__");
|
|
25836
25651
|
const { ancestorLeft, ancestorTop, width, height, angle: agentOrigin } = applyObject;
|
|
25837
25652
|
const centerX = width / 2 + ancestorLeft;
|
|
25838
25653
|
const centerY = height / 2 + ancestorTop;
|
|
25839
25654
|
this._clearControlMap();
|
|
25840
25655
|
this._changeStart$.next({
|
|
25841
25656
|
objects: this._selectedObjectMap,
|
|
25842
|
-
type:
|
|
25657
|
+
type: 0
|
|
25843
25658
|
});
|
|
25844
25659
|
this._moveBufferSkip = false;
|
|
25845
25660
|
const topScenePointerMoveSub = topScene.onPointerMove$.subscribeEvent((moveEvt) => {
|
|
@@ -25856,7 +25671,7 @@ var Transformer = class extends Disposable {
|
|
|
25856
25671
|
const { offsetX, offsetY } = event;
|
|
25857
25672
|
this._changeEnd$.next({
|
|
25858
25673
|
objects: this._selectedObjectMap,
|
|
25859
|
-
type:
|
|
25674
|
+
type: 2,
|
|
25860
25675
|
offsetX,
|
|
25861
25676
|
offsetY,
|
|
25862
25677
|
event
|
|
@@ -25878,7 +25693,7 @@ var Transformer = class extends Disposable {
|
|
|
25878
25693
|
this._changing$.next({
|
|
25879
25694
|
objects: this._selectedObjectMap,
|
|
25880
25695
|
angle,
|
|
25881
|
-
type:
|
|
25696
|
+
type: 1,
|
|
25882
25697
|
offsetX: moveOffsetX,
|
|
25883
25698
|
offsetY: moveOffsetY
|
|
25884
25699
|
});
|
|
@@ -25892,35 +25707,35 @@ var Transformer = class extends Disposable {
|
|
|
25892
25707
|
};
|
|
25893
25708
|
}
|
|
25894
25709
|
_getRotateAnchorCursor(type) {
|
|
25895
|
-
let cursor =
|
|
25710
|
+
let cursor = "nw-resize";
|
|
25896
25711
|
switch (type) {
|
|
25897
|
-
case
|
|
25898
|
-
cursor =
|
|
25712
|
+
case "__SpreadsheetTransformerRotate__":
|
|
25713
|
+
cursor = "move";
|
|
25899
25714
|
break;
|
|
25900
|
-
case
|
|
25901
|
-
cursor =
|
|
25715
|
+
case "__SpreadsheetTransformerRotateLine__":
|
|
25716
|
+
cursor = "move";
|
|
25902
25717
|
break;
|
|
25903
|
-
case
|
|
25904
|
-
case
|
|
25905
|
-
cursor =
|
|
25718
|
+
case "__SpreadsheetTransformerResizeLT__": break;
|
|
25719
|
+
case "__SpreadsheetTransformerResizeCT__":
|
|
25720
|
+
cursor = "n-resize";
|
|
25906
25721
|
break;
|
|
25907
|
-
case
|
|
25908
|
-
cursor =
|
|
25722
|
+
case "__SpreadsheetTransformerResizeRT__":
|
|
25723
|
+
cursor = "ne-resize";
|
|
25909
25724
|
break;
|
|
25910
|
-
case
|
|
25911
|
-
cursor =
|
|
25725
|
+
case "__SpreadsheetTransformerResizeLM__":
|
|
25726
|
+
cursor = "w-resize";
|
|
25912
25727
|
break;
|
|
25913
|
-
case
|
|
25914
|
-
cursor =
|
|
25728
|
+
case "__SpreadsheetTransformerResizeRM__":
|
|
25729
|
+
cursor = "e-resize";
|
|
25915
25730
|
break;
|
|
25916
|
-
case
|
|
25917
|
-
cursor =
|
|
25731
|
+
case "__SpreadsheetTransformerResizeLB__":
|
|
25732
|
+
cursor = "sw-resize";
|
|
25918
25733
|
break;
|
|
25919
|
-
case
|
|
25920
|
-
cursor =
|
|
25734
|
+
case "__SpreadsheetTransformerResizeCB__":
|
|
25735
|
+
cursor = "s-resize";
|
|
25921
25736
|
break;
|
|
25922
|
-
case
|
|
25923
|
-
cursor =
|
|
25737
|
+
case "__SpreadsheetTransformerResizeRB__":
|
|
25738
|
+
cursor = "se-resize";
|
|
25924
25739
|
break;
|
|
25925
25740
|
}
|
|
25926
25741
|
return cursor;
|
|
@@ -25932,35 +25747,35 @@ var Transformer = class extends Disposable {
|
|
|
25932
25747
|
const longEdge = anchorSize;
|
|
25933
25748
|
const shortEdge = anchorSize / 4;
|
|
25934
25749
|
switch (type) {
|
|
25935
|
-
case
|
|
25750
|
+
case "__SpreadsheetTransformerResizeLT__":
|
|
25936
25751
|
left += -borderSpacing - borderStrokeWidth;
|
|
25937
25752
|
top += -borderSpacing - borderStrokeWidth;
|
|
25938
25753
|
break;
|
|
25939
|
-
case
|
|
25754
|
+
case "__SpreadsheetTransformerResizeCT__":
|
|
25940
25755
|
left += width / 2 - longEdge / 2;
|
|
25941
25756
|
top += -borderSpacing - borderStrokeWidth;
|
|
25942
25757
|
break;
|
|
25943
|
-
case
|
|
25758
|
+
case "__SpreadsheetTransformerResizeRT__":
|
|
25944
25759
|
left += width + borderSpacing - borderStrokeWidth - longEdge;
|
|
25945
25760
|
top += -borderSpacing - borderStrokeWidth;
|
|
25946
25761
|
break;
|
|
25947
|
-
case
|
|
25762
|
+
case "__SpreadsheetTransformerResizeLM__":
|
|
25948
25763
|
left += borderSpacing - borderStrokeWidth;
|
|
25949
25764
|
top += height / 2 - longEdge / 2;
|
|
25950
25765
|
break;
|
|
25951
|
-
case
|
|
25766
|
+
case "__SpreadsheetTransformerResizeRM__":
|
|
25952
25767
|
left += width + borderSpacing - borderStrokeWidth - shortEdge;
|
|
25953
25768
|
top += height / 2 - longEdge / 2;
|
|
25954
25769
|
break;
|
|
25955
|
-
case
|
|
25770
|
+
case "__SpreadsheetTransformerResizeLB__":
|
|
25956
25771
|
left += -this.borderSpacing - borderStrokeWidth;
|
|
25957
25772
|
top += height + borderSpacing - borderStrokeWidth - longEdge;
|
|
25958
25773
|
break;
|
|
25959
|
-
case
|
|
25774
|
+
case "__SpreadsheetTransformerResizeCB__":
|
|
25960
25775
|
left += width / 2 - longEdge / 2;
|
|
25961
25776
|
top += height + borderSpacing - borderStrokeWidth - shortEdge;
|
|
25962
25777
|
break;
|
|
25963
|
-
case
|
|
25778
|
+
case "__SpreadsheetTransformerResizeRB__":
|
|
25964
25779
|
left += width + borderSpacing - borderStrokeWidth - longEdge;
|
|
25965
25780
|
top += height + borderSpacing - borderStrokeWidth - longEdge;
|
|
25966
25781
|
break;
|
|
@@ -25975,43 +25790,43 @@ var Transformer = class extends Disposable {
|
|
|
25975
25790
|
let left = -anchorSize / 2;
|
|
25976
25791
|
let top = -anchorSize / 2;
|
|
25977
25792
|
switch (type) {
|
|
25978
|
-
case
|
|
25793
|
+
case "__SpreadsheetTransformerRotate__":
|
|
25979
25794
|
left = width / 2 - rotateSize / 2;
|
|
25980
25795
|
top = -rotateAnchorOffset - borderSpacing - borderStrokeWidth * 2 - rotateSize;
|
|
25981
25796
|
break;
|
|
25982
|
-
case
|
|
25797
|
+
case "__SpreadsheetTransformerRotateLine__":
|
|
25983
25798
|
left = width / 2;
|
|
25984
25799
|
top = -rotateAnchorOffset - borderSpacing - borderStrokeWidth;
|
|
25985
25800
|
break;
|
|
25986
|
-
case
|
|
25801
|
+
case "__SpreadsheetTransformerResizeLT__":
|
|
25987
25802
|
left += -borderSpacing - borderStrokeWidth;
|
|
25988
25803
|
top += -borderSpacing - borderStrokeWidth;
|
|
25989
25804
|
break;
|
|
25990
|
-
case
|
|
25805
|
+
case "__SpreadsheetTransformerResizeCT__":
|
|
25991
25806
|
left += width / 2;
|
|
25992
25807
|
top += -borderSpacing - borderStrokeWidth;
|
|
25993
25808
|
break;
|
|
25994
|
-
case
|
|
25809
|
+
case "__SpreadsheetTransformerResizeRT__":
|
|
25995
25810
|
left += width + borderSpacing - borderStrokeWidth;
|
|
25996
25811
|
top += -borderSpacing - borderStrokeWidth;
|
|
25997
25812
|
break;
|
|
25998
|
-
case
|
|
25813
|
+
case "__SpreadsheetTransformerResizeLM__":
|
|
25999
25814
|
left += borderSpacing - borderStrokeWidth;
|
|
26000
25815
|
top += height / 2;
|
|
26001
25816
|
break;
|
|
26002
|
-
case
|
|
25817
|
+
case "__SpreadsheetTransformerResizeRM__":
|
|
26003
25818
|
left += width + borderSpacing - borderStrokeWidth;
|
|
26004
25819
|
top += height / 2;
|
|
26005
25820
|
break;
|
|
26006
|
-
case
|
|
25821
|
+
case "__SpreadsheetTransformerResizeLB__":
|
|
26007
25822
|
left += -this.borderSpacing - borderStrokeWidth;
|
|
26008
25823
|
top += height + borderSpacing - borderStrokeWidth;
|
|
26009
25824
|
break;
|
|
26010
|
-
case
|
|
25825
|
+
case "__SpreadsheetTransformerResizeCB__":
|
|
26011
25826
|
left += width / 2;
|
|
26012
25827
|
top += height + borderSpacing - borderStrokeWidth;
|
|
26013
25828
|
break;
|
|
26014
|
-
case
|
|
25829
|
+
case "__SpreadsheetTransformerResizeRB__":
|
|
26015
25830
|
left += width + borderSpacing - borderStrokeWidth;
|
|
26016
25831
|
top += height + borderSpacing - borderStrokeWidth;
|
|
26017
25832
|
break;
|
|
@@ -26037,7 +25852,7 @@ var Transformer = class extends Disposable {
|
|
|
26037
25852
|
left,
|
|
26038
25853
|
top
|
|
26039
25854
|
});
|
|
26040
|
-
this._attachHover(anchor, cursor,
|
|
25855
|
+
this._attachHover(anchor, cursor, "default");
|
|
26041
25856
|
return anchor;
|
|
26042
25857
|
}
|
|
26043
25858
|
_createCopperResizeAnchor(type, applyObject, zIndex) {
|
|
@@ -26059,36 +25874,36 @@ var Transformer = class extends Disposable {
|
|
|
26059
25874
|
};
|
|
26060
25875
|
const longEdge = anchorSize;
|
|
26061
25876
|
const shortEdge = anchorSize / 4;
|
|
26062
|
-
if (cursor ===
|
|
25877
|
+
if (cursor === "e-resize") {
|
|
26063
25878
|
config.width = shortEdge;
|
|
26064
25879
|
config.height = longEdge;
|
|
26065
25880
|
anchor = new Rect(oKey, config);
|
|
26066
|
-
} else if (cursor ===
|
|
25881
|
+
} else if (cursor === "w-resize") {
|
|
26067
25882
|
config.width = shortEdge;
|
|
26068
25883
|
config.height = longEdge;
|
|
26069
25884
|
anchor = new Rect(oKey, config);
|
|
26070
|
-
} else if (cursor ===
|
|
25885
|
+
} else if (cursor === "n-resize") {
|
|
26071
25886
|
config.width = longEdge;
|
|
26072
25887
|
config.height = shortEdge;
|
|
26073
25888
|
anchor = new Rect(oKey, config);
|
|
26074
|
-
} else if (cursor ===
|
|
25889
|
+
} else if (cursor === "s-resize") {
|
|
26075
25890
|
config.width = longEdge;
|
|
26076
25891
|
config.height = shortEdge;
|
|
26077
25892
|
anchor = new Rect(oKey, config);
|
|
26078
|
-
} else if (cursor ===
|
|
25893
|
+
} else if (cursor === "ne-resize") {
|
|
26079
25894
|
config.pointsGroup = this._getNorthEastPoints(longEdge, shortEdge);
|
|
26080
25895
|
anchor = new RegularPolygon(oKey, config);
|
|
26081
|
-
} else if (cursor ===
|
|
25896
|
+
} else if (cursor === "nw-resize") {
|
|
26082
25897
|
config.pointsGroup = this._getNorthWestPoints(longEdge, shortEdge);
|
|
26083
25898
|
anchor = new RegularPolygon(oKey, config);
|
|
26084
|
-
} else if (cursor ===
|
|
25899
|
+
} else if (cursor === "se-resize") {
|
|
26085
25900
|
config.pointsGroup = this._getSouthEastPoints(longEdge, shortEdge);
|
|
26086
25901
|
anchor = new RegularPolygon(oKey, config);
|
|
26087
|
-
} else if (cursor ===
|
|
25902
|
+
} else if (cursor === "sw-resize") {
|
|
26088
25903
|
config.pointsGroup = this._getSouthWestPoints(longEdge, shortEdge);
|
|
26089
25904
|
anchor = new RegularPolygon(oKey, config);
|
|
26090
25905
|
}
|
|
26091
|
-
this._attachHover(anchor, cursor,
|
|
25906
|
+
this._attachHover(anchor, cursor, "default");
|
|
26092
25907
|
return anchor;
|
|
26093
25908
|
}
|
|
26094
25909
|
_getNorthEastPoints(longEdge, shortEdge) {
|
|
@@ -26215,17 +26030,17 @@ var Transformer = class extends Disposable {
|
|
|
26215
26030
|
]];
|
|
26216
26031
|
}
|
|
26217
26032
|
_checkTransformerType(oKey) {
|
|
26218
|
-
if (oKey.indexOf(
|
|
26219
|
-
if (oKey.indexOf(
|
|
26220
|
-
if (oKey.indexOf(
|
|
26221
|
-
if (oKey.indexOf(
|
|
26222
|
-
if (oKey.indexOf(
|
|
26223
|
-
if (oKey.indexOf(
|
|
26224
|
-
if (oKey.indexOf(
|
|
26225
|
-
if (oKey.indexOf(
|
|
26226
|
-
if (oKey.indexOf(
|
|
26227
|
-
if (oKey.indexOf(
|
|
26228
|
-
if (oKey.indexOf(
|
|
26033
|
+
if (oKey.indexOf("__SpreadsheetTransformerOutline__") > -1) return "__SpreadsheetTransformerOutline__";
|
|
26034
|
+
if (oKey.indexOf("__SpreadsheetTransformerRotate__") > -1) return "__SpreadsheetTransformerRotate__";
|
|
26035
|
+
if (oKey.indexOf("__SpreadsheetTransformerRotateLine__") > -1) return "__SpreadsheetTransformerRotateLine__";
|
|
26036
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeLT__") > -1) return "__SpreadsheetTransformerResizeLT__";
|
|
26037
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeCT__") > -1) return "__SpreadsheetTransformerResizeCT__";
|
|
26038
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeRT__") > -1) return "__SpreadsheetTransformerResizeRT__";
|
|
26039
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeLM__") > -1) return "__SpreadsheetTransformerResizeLM__";
|
|
26040
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeRM__") > -1) return "__SpreadsheetTransformerResizeRM__";
|
|
26041
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeLB__") > -1) return "__SpreadsheetTransformerResizeLB__";
|
|
26042
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeCB__") > -1) return "__SpreadsheetTransformerResizeCB__";
|
|
26043
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeRB__") > -1) return "__SpreadsheetTransformerResizeRB__";
|
|
26229
26044
|
}
|
|
26230
26045
|
_updateControlIterator(func) {
|
|
26231
26046
|
this._transformerControlMap.forEach((control, oKey) => {
|
|
@@ -26290,7 +26105,7 @@ var Transformer = class extends Disposable {
|
|
|
26290
26105
|
const layerIndex = applyObject.getLayerIndex() || DEFAULT_TRANSFORMER_LAYER_INDEX;
|
|
26291
26106
|
const groupElements = [];
|
|
26292
26107
|
if (borderEnabled && !isCropper) {
|
|
26293
|
-
const outline = new Rect(
|
|
26108
|
+
const outline = new Rect(`__SpreadsheetTransformerOutline___${zIndex}`, {
|
|
26294
26109
|
zIndex: zIndex - 1,
|
|
26295
26110
|
evented: false,
|
|
26296
26111
|
strokeWidth: borderStrokeWidth,
|
|
@@ -26300,9 +26115,9 @@ var Transformer = class extends Disposable {
|
|
|
26300
26115
|
groupElements.push(outline);
|
|
26301
26116
|
}
|
|
26302
26117
|
if (resizeEnabled && !isCropper) {
|
|
26303
|
-
const { left: lineLeft, top: lineTop } = this._getRotateAnchorPosition(
|
|
26118
|
+
const { left: lineLeft, top: lineTop } = this._getRotateAnchorPosition("__SpreadsheetTransformerRotateLine__", height, width, applyObject);
|
|
26304
26119
|
if (rotateEnabled) {
|
|
26305
|
-
const rotateLine = new Rect(
|
|
26120
|
+
const rotateLine = new Rect(`__SpreadsheetTransformerRotateLine___${zIndex}`, {
|
|
26306
26121
|
zIndex: zIndex - 1,
|
|
26307
26122
|
evented: false,
|
|
26308
26123
|
left: lineLeft,
|
|
@@ -26312,9 +26127,9 @@ var Transformer = class extends Disposable {
|
|
|
26312
26127
|
strokeWidth: borderStrokeWidth,
|
|
26313
26128
|
stroke: borderStroke
|
|
26314
26129
|
});
|
|
26315
|
-
const { left: rotateLeft, top: rotateTop } = this._getRotateAnchorPosition(
|
|
26316
|
-
const cursor = this._getRotateAnchorCursor(
|
|
26317
|
-
const rotate = new Rect(
|
|
26130
|
+
const { left: rotateLeft, top: rotateTop } = this._getRotateAnchorPosition("__SpreadsheetTransformerRotate__", height, width, applyObject);
|
|
26131
|
+
const cursor = this._getRotateAnchorCursor("__SpreadsheetTransformerRotate__");
|
|
26132
|
+
const rotate = new Rect(`__SpreadsheetTransformerRotate___${zIndex}`, {
|
|
26318
26133
|
zIndex: zIndex - 1,
|
|
26319
26134
|
left: rotateLeft,
|
|
26320
26135
|
top: rotateTop,
|
|
@@ -26325,7 +26140,7 @@ var Transformer = class extends Disposable {
|
|
|
26325
26140
|
stroke: borderStroke
|
|
26326
26141
|
});
|
|
26327
26142
|
this._attachEventToRotate(rotate, applyObject);
|
|
26328
|
-
this._attachHover(rotate, cursor,
|
|
26143
|
+
this._attachHover(rotate, cursor, "default");
|
|
26329
26144
|
groupElements.push(rotateLine, rotate);
|
|
26330
26145
|
}
|
|
26331
26146
|
}
|
|
@@ -26338,7 +26153,7 @@ var Transformer = class extends Disposable {
|
|
|
26338
26153
|
this._attachEventToAnchor(anchor, type, applyObject);
|
|
26339
26154
|
groupElements.push(anchor);
|
|
26340
26155
|
}
|
|
26341
|
-
const transformerControl = new Group(
|
|
26156
|
+
const transformerControl = new Group(`__SpreadsheetTransformer___${oKey}`, ...groupElements);
|
|
26342
26157
|
transformerControl.zIndex = zIndex;
|
|
26343
26158
|
transformerControl.evented = false;
|
|
26344
26159
|
transformerControl.openSelfSizeMode();
|
|
@@ -26366,7 +26181,7 @@ var Transformer = class extends Disposable {
|
|
|
26366
26181
|
this._changeStart$.next({
|
|
26367
26182
|
target: applyObject,
|
|
26368
26183
|
objects: this._selectedObjectMap,
|
|
26369
|
-
type:
|
|
26184
|
+
type: 0
|
|
26370
26185
|
});
|
|
26371
26186
|
}
|
|
26372
26187
|
_updateActiveObjectList(applyObject, evt) {
|
|
@@ -26416,8 +26231,8 @@ var Scene = class extends Disposable {
|
|
|
26416
26231
|
_defineProperty(this, "_evented", true);
|
|
26417
26232
|
_defineProperty(this, "_layers", []);
|
|
26418
26233
|
_defineProperty(this, "_viewports", []);
|
|
26419
|
-
_defineProperty(this, "_cursor",
|
|
26420
|
-
_defineProperty(this, "_defaultCursor",
|
|
26234
|
+
_defineProperty(this, "_cursor", "default");
|
|
26235
|
+
_defineProperty(this, "_defaultCursor", "default");
|
|
26421
26236
|
_defineProperty(this, "_addObject$", new BehaviorSubject(this));
|
|
26422
26237
|
_defineProperty(this, "addObject$", this._addObject$.asObservable());
|
|
26423
26238
|
_defineProperty(this, "onTransformChange$", new EventSubject());
|
|
@@ -26463,18 +26278,18 @@ var Scene = class extends Disposable {
|
|
|
26463
26278
|
_defineProperty(this, "_capturedObject", null);
|
|
26464
26279
|
this._sceneKey = sceneKey;
|
|
26465
26280
|
if (state) this.transformByState(state);
|
|
26466
|
-
if (this._parent.classType ===
|
|
26281
|
+
if (this._parent.classType === "Engine") {
|
|
26467
26282
|
const parent = this._parent;
|
|
26468
26283
|
parent.addScene(this);
|
|
26469
26284
|
if (!parent.hasActiveScene()) parent.setActiveScene(sceneKey);
|
|
26470
26285
|
this._inputManager = new InputManager(this);
|
|
26471
|
-
} else if (this._parent.classType ===
|
|
26286
|
+
} else if (this._parent.classType === "SceneViewer") this._parent.addSubScene(this);
|
|
26472
26287
|
this.disposeWithMe(toDisposable((_this$_parent = this._parent) === null || _this$_parent === void 0 ? void 0 : _this$_parent.onTransformChange$.subscribeEvent((_change) => {
|
|
26473
26288
|
this._transformHandler();
|
|
26474
26289
|
})));
|
|
26475
26290
|
}
|
|
26476
26291
|
get classType() {
|
|
26477
|
-
return
|
|
26292
|
+
return "Scene";
|
|
26478
26293
|
}
|
|
26479
26294
|
get transform() {
|
|
26480
26295
|
return this._transform;
|
|
@@ -26518,7 +26333,7 @@ var Scene = class extends Disposable {
|
|
|
26518
26333
|
get ancestorScaleX() {
|
|
26519
26334
|
const p = this.getParent();
|
|
26520
26335
|
let pScale = 1;
|
|
26521
|
-
if (p.classType ===
|
|
26336
|
+
if (p.classType === "SceneViewer") pScale = p.ancestorScaleX;
|
|
26522
26337
|
return this.scaleX * pScale;
|
|
26523
26338
|
}
|
|
26524
26339
|
/**
|
|
@@ -26527,7 +26342,7 @@ var Scene = class extends Disposable {
|
|
|
26527
26342
|
get ancestorScaleY() {
|
|
26528
26343
|
const p = this.getParent();
|
|
26529
26344
|
let pScale = 1;
|
|
26530
|
-
if (p.classType ===
|
|
26345
|
+
if (p.classType === "SceneViewer") pScale = p.ancestorScaleY;
|
|
26531
26346
|
return this.scaleY * pScale;
|
|
26532
26347
|
}
|
|
26533
26348
|
getAncestorScale() {
|
|
@@ -26539,13 +26354,13 @@ var Scene = class extends Disposable {
|
|
|
26539
26354
|
get ancestorLeft() {
|
|
26540
26355
|
const p = this.getParent();
|
|
26541
26356
|
let pOffsetX = 0;
|
|
26542
|
-
if (p.classType ===
|
|
26357
|
+
if (p.classType === "SceneViewer") pOffsetX = p.ancestorLeft;
|
|
26543
26358
|
return pOffsetX;
|
|
26544
26359
|
}
|
|
26545
26360
|
get ancestorTop() {
|
|
26546
26361
|
const p = this.getParent();
|
|
26547
26362
|
let pOffsetY = 0;
|
|
26548
|
-
if (p.classType ===
|
|
26363
|
+
if (p.classType === "SceneViewer") pOffsetY = p.ancestorTop;
|
|
26549
26364
|
return pOffsetY;
|
|
26550
26365
|
}
|
|
26551
26366
|
set cursor(val) {
|
|
@@ -26553,7 +26368,7 @@ var Scene = class extends Disposable {
|
|
|
26553
26368
|
}
|
|
26554
26369
|
attachControl(options) {
|
|
26555
26370
|
var _this$_inputManager;
|
|
26556
|
-
if (!(this._parent.classType ===
|
|
26371
|
+
if (!(this._parent.classType === "Engine")) return;
|
|
26557
26372
|
(_this$_inputManager = this._inputManager) === null || _this$_inputManager === void 0 || _this$_inputManager.attachControl(options);
|
|
26558
26373
|
return this;
|
|
26559
26374
|
}
|
|
@@ -26566,7 +26381,7 @@ var Scene = class extends Disposable {
|
|
|
26566
26381
|
this._layers.forEach((layer) => {
|
|
26567
26382
|
layer.makeDirty(state);
|
|
26568
26383
|
});
|
|
26569
|
-
if (this._parent.classType ===
|
|
26384
|
+
if (this._parent.classType === "SceneViewer") {
|
|
26570
26385
|
var _this$_parent2;
|
|
26571
26386
|
(_this$_parent2 = this._parent) === null || _this$_parent2 === void 0 || _this$_parent2.makeDirty(state);
|
|
26572
26387
|
}
|
|
@@ -26620,7 +26435,7 @@ var Scene = class extends Disposable {
|
|
|
26620
26435
|
if (height !== void 0) this.height = height;
|
|
26621
26436
|
this._transformHandler();
|
|
26622
26437
|
this.onTransformChange$.emitEvent({
|
|
26623
|
-
type:
|
|
26438
|
+
type: 1,
|
|
26624
26439
|
value: {
|
|
26625
26440
|
width: this.width,
|
|
26626
26441
|
height: this.height
|
|
@@ -26653,7 +26468,7 @@ var Scene = class extends Disposable {
|
|
|
26653
26468
|
this.setScaleValueOnly(scaleX || 1, scaleY || 1);
|
|
26654
26469
|
this._transformHandler();
|
|
26655
26470
|
this.onTransformChange$.emitEvent({
|
|
26656
|
-
type:
|
|
26471
|
+
type: 2,
|
|
26657
26472
|
value: {
|
|
26658
26473
|
scaleX: this.scaleX,
|
|
26659
26474
|
scaleY: this.scaleY
|
|
@@ -26677,7 +26492,7 @@ var Scene = class extends Disposable {
|
|
|
26677
26492
|
this.scaleY = precisionTo(this.scaleY, 1);
|
|
26678
26493
|
this._transformHandler();
|
|
26679
26494
|
this.onTransformChange$.emitEvent({
|
|
26680
|
-
type:
|
|
26495
|
+
type: 2,
|
|
26681
26496
|
value: {
|
|
26682
26497
|
scaleX: this.scaleX,
|
|
26683
26498
|
scaleY: this.scaleY
|
|
@@ -26705,7 +26520,7 @@ var Scene = class extends Disposable {
|
|
|
26705
26520
|
});
|
|
26706
26521
|
this._transformHandler();
|
|
26707
26522
|
this.onTransformChange$.emitEvent({
|
|
26708
|
-
type:
|
|
26523
|
+
type: 5,
|
|
26709
26524
|
value: state,
|
|
26710
26525
|
preValue: preKeys
|
|
26711
26526
|
});
|
|
@@ -26714,10 +26529,10 @@ var Scene = class extends Disposable {
|
|
|
26714
26529
|
return this._parent;
|
|
26715
26530
|
}
|
|
26716
26531
|
getEngine() {
|
|
26717
|
-
if (this._parent.classType ===
|
|
26532
|
+
if (this._parent.classType === "Engine") return this._parent;
|
|
26718
26533
|
let parent = this._parent;
|
|
26719
26534
|
while (parent) {
|
|
26720
|
-
if (parent.classType ===
|
|
26535
|
+
if (parent.classType === "Engine") return parent;
|
|
26721
26536
|
parent = parent === null || parent === void 0 ? void 0 : parent.getParent();
|
|
26722
26537
|
}
|
|
26723
26538
|
return null;
|
|
@@ -27004,18 +26819,18 @@ var Scene = class extends Disposable {
|
|
|
27004
26819
|
let parent = this.getParent();
|
|
27005
26820
|
const parentList = [];
|
|
27006
26821
|
while (parent) {
|
|
27007
|
-
if (parent.classType ===
|
|
26822
|
+
if (parent.classType === "Scene" || parent.classType === "SceneViewer") parentList.push(parent);
|
|
27008
26823
|
parent = (parent === null || parent === void 0 ? void 0 : parent.getParent) && (parent === null || parent === void 0 ? void 0 : parent.getParent());
|
|
27009
26824
|
}
|
|
27010
26825
|
parentList.reverse();
|
|
27011
|
-
for (const parent of parentList) if (parent.classType ===
|
|
26826
|
+
for (const parent of parentList) if (parent.classType === "Scene") {
|
|
27012
26827
|
const viewPort = parent.getActiveViewportByCoord(coord);
|
|
27013
26828
|
if (viewPort) {
|
|
27014
26829
|
const actualX = viewPort.viewportScrollX || 0;
|
|
27015
26830
|
const actualY = viewPort.viewportScrollY || 0;
|
|
27016
26831
|
coord = coord.addByPoint(actualX, actualY);
|
|
27017
26832
|
}
|
|
27018
|
-
} else if (parent.classType ===
|
|
26833
|
+
} else if (parent.classType === "SceneViewer") coord = parent.transform.clone().invert().applyPoint(coord);
|
|
27019
26834
|
return coord;
|
|
27020
26835
|
}
|
|
27021
26836
|
clearLayer() {
|
|
@@ -27093,16 +26908,16 @@ var Scene = class extends Disposable {
|
|
|
27093
26908
|
for (let i = 0; i < objectLength; i++) {
|
|
27094
26909
|
var _testObject$parent;
|
|
27095
26910
|
const testObject = objectOrder[i];
|
|
27096
|
-
if (!testObject.visible || !testObject.evented || testObject.isInGroup && ((_testObject$parent = testObject.parent) === null || _testObject$parent === void 0 ? void 0 : _testObject$parent.classType) ===
|
|
26911
|
+
if (!testObject.visible || !testObject.evented || testObject.isInGroup && ((_testObject$parent = testObject.parent) === null || _testObject$parent === void 0 ? void 0 : _testObject$parent.classType) === "Group" && testObject.isDrawingObject) continue;
|
|
27097
26912
|
const svCoord = vecFromSheetContent;
|
|
27098
26913
|
if (testObject.isHit(svCoord)) {
|
|
27099
|
-
if (testObject.classType ===
|
|
26914
|
+
if (testObject.classType === "SceneViewer") {
|
|
27100
26915
|
const pickedObject = testObject.pick(svCoord);
|
|
27101
26916
|
if (pickedObject) isPickedObject = pickedObject;
|
|
27102
26917
|
else isPickedObject = testObject.getActiveSubScene();
|
|
27103
26918
|
} else isPickedObject = testObject;
|
|
27104
26919
|
break;
|
|
27105
|
-
} else if (testObject.classType ===
|
|
26920
|
+
} else if (testObject.classType === "SceneViewer" && testObject.allowSelectedClipElement()) {
|
|
27106
26921
|
const pickedObject = testObject.pick(svCoord);
|
|
27107
26922
|
if (pickedObject) {
|
|
27108
26923
|
isPickedObject = pickedObject;
|
|
@@ -27110,12 +26925,12 @@ var Scene = class extends Disposable {
|
|
|
27110
26925
|
}
|
|
27111
26926
|
}
|
|
27112
26927
|
}
|
|
27113
|
-
if (!isPickedObject && this._parent.classType ===
|
|
26928
|
+
if (!isPickedObject && this._parent.classType === "Engine") return this;
|
|
27114
26929
|
return isPickedObject;
|
|
27115
26930
|
}
|
|
27116
26931
|
triggerPointerUp(evt) {
|
|
27117
26932
|
var _this$onPointerUp$$em;
|
|
27118
|
-
if (!((_this$onPointerUp$$em = this.onPointerUp$.emitEvent(evt)) === null || _this$onPointerUp$$em === void 0 ? void 0 : _this$onPointerUp$$em.stopPropagation) && this._parent.classType ===
|
|
26933
|
+
if (!((_this$onPointerUp$$em = this.onPointerUp$.emitEvent(evt)) === null || _this$onPointerUp$$em === void 0 ? void 0 : _this$onPointerUp$$em.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27119
26934
|
var _this$_parent3;
|
|
27120
26935
|
(_this$_parent3 = this._parent) === null || _this$_parent3 === void 0 || _this$_parent3.triggerPointerUp(evt);
|
|
27121
26936
|
return false;
|
|
@@ -27124,7 +26939,7 @@ var Scene = class extends Disposable {
|
|
|
27124
26939
|
}
|
|
27125
26940
|
triggerMouseWheel(evt) {
|
|
27126
26941
|
var _this$onMouseWheel$$e;
|
|
27127
|
-
if (!((_this$onMouseWheel$$e = this.onMouseWheel$.emitEvent(evt)) === null || _this$onMouseWheel$$e === void 0 ? void 0 : _this$onMouseWheel$$e.stopPropagation) && this._parent.classType ===
|
|
26942
|
+
if (!((_this$onMouseWheel$$e = this.onMouseWheel$.emitEvent(evt)) === null || _this$onMouseWheel$$e === void 0 ? void 0 : _this$onMouseWheel$$e.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27128
26943
|
var _this$_parent4;
|
|
27129
26944
|
(_this$_parent4 = this._parent) === null || _this$_parent4 === void 0 || _this$_parent4.triggerMouseWheel(evt);
|
|
27130
26945
|
return false;
|
|
@@ -27133,7 +26948,7 @@ var Scene = class extends Disposable {
|
|
|
27133
26948
|
}
|
|
27134
26949
|
triggerSingleClick(evt) {
|
|
27135
26950
|
var _this$onSingleClick$$;
|
|
27136
|
-
if (!((_this$onSingleClick$$ = this.onSingleClick$.emitEvent(evt)) === null || _this$onSingleClick$$ === void 0 ? void 0 : _this$onSingleClick$$.stopPropagation) && this._parent.classType ===
|
|
26951
|
+
if (!((_this$onSingleClick$$ = this.onSingleClick$.emitEvent(evt)) === null || _this$onSingleClick$$ === void 0 ? void 0 : _this$onSingleClick$$.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27137
26952
|
var _this$_parent5;
|
|
27138
26953
|
(_this$_parent5 = this._parent) === null || _this$_parent5 === void 0 || _this$_parent5.triggerSingleClick(evt);
|
|
27139
26954
|
return false;
|
|
@@ -27142,7 +26957,7 @@ var Scene = class extends Disposable {
|
|
|
27142
26957
|
}
|
|
27143
26958
|
triggerClick(evt) {
|
|
27144
26959
|
var _this$onClick$$emitEv;
|
|
27145
|
-
if (!((_this$onClick$$emitEv = this.onClick$.emitEvent(evt)) === null || _this$onClick$$emitEv === void 0 ? void 0 : _this$onClick$$emitEv.stopPropagation) && this._parent.classType ===
|
|
26960
|
+
if (!((_this$onClick$$emitEv = this.onClick$.emitEvent(evt)) === null || _this$onClick$$emitEv === void 0 ? void 0 : _this$onClick$$emitEv.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27146
26961
|
var _this$_parent6;
|
|
27147
26962
|
(_this$_parent6 = this._parent) === null || _this$_parent6 === void 0 || _this$_parent6.triggerClick(evt);
|
|
27148
26963
|
return false;
|
|
@@ -27151,7 +26966,7 @@ var Scene = class extends Disposable {
|
|
|
27151
26966
|
}
|
|
27152
26967
|
triggerDblclick(evt) {
|
|
27153
26968
|
var _this$onDblclick$$emi;
|
|
27154
|
-
if (!((_this$onDblclick$$emi = this.onDblclick$.emitEvent(evt)) === null || _this$onDblclick$$emi === void 0 ? void 0 : _this$onDblclick$$emi.stopPropagation) && this._parent.classType ===
|
|
26969
|
+
if (!((_this$onDblclick$$emi = this.onDblclick$.emitEvent(evt)) === null || _this$onDblclick$$emi === void 0 ? void 0 : _this$onDblclick$$emi.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27155
26970
|
var _this$_parent7;
|
|
27156
26971
|
(_this$_parent7 = this._parent) === null || _this$_parent7 === void 0 || _this$_parent7.triggerDblclick(evt);
|
|
27157
26972
|
return false;
|
|
@@ -27160,7 +26975,7 @@ var Scene = class extends Disposable {
|
|
|
27160
26975
|
}
|
|
27161
26976
|
triggerTripleClick(evt) {
|
|
27162
26977
|
var _this$onTripleClick$$;
|
|
27163
|
-
if (!((_this$onTripleClick$$ = this.onTripleClick$.emitEvent(evt)) === null || _this$onTripleClick$$ === void 0 ? void 0 : _this$onTripleClick$$.stopPropagation) && this._parent.classType ===
|
|
26978
|
+
if (!((_this$onTripleClick$$ = this.onTripleClick$.emitEvent(evt)) === null || _this$onTripleClick$$ === void 0 ? void 0 : _this$onTripleClick$$.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27164
26979
|
var _this$_parent8;
|
|
27165
26980
|
(_this$_parent8 = this._parent) === null || _this$_parent8 === void 0 || _this$_parent8.triggerTripleClick(evt);
|
|
27166
26981
|
return false;
|
|
@@ -27169,7 +26984,7 @@ var Scene = class extends Disposable {
|
|
|
27169
26984
|
}
|
|
27170
26985
|
triggerPointerMove(evt) {
|
|
27171
26986
|
var _this$onPointerMove$$;
|
|
27172
|
-
if (!((_this$onPointerMove$$ = this.onPointerMove$.emitEvent(evt)) === null || _this$onPointerMove$$ === void 0 ? void 0 : _this$onPointerMove$$.stopPropagation) && this._parent.classType ===
|
|
26987
|
+
if (!((_this$onPointerMove$$ = this.onPointerMove$.emitEvent(evt)) === null || _this$onPointerMove$$ === void 0 ? void 0 : _this$onPointerMove$$.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27173
26988
|
var _this$_parent9;
|
|
27174
26989
|
(_this$_parent9 = this._parent) === null || _this$_parent9 === void 0 || _this$_parent9.triggerPointerMove(evt);
|
|
27175
26990
|
return false;
|
|
@@ -27178,7 +26993,7 @@ var Scene = class extends Disposable {
|
|
|
27178
26993
|
}
|
|
27179
26994
|
triggerPointerDown(evt) {
|
|
27180
26995
|
var _this$onPointerDown$$;
|
|
27181
|
-
if (!((_this$onPointerDown$$ = this.onPointerDown$.emitEvent(evt)) === null || _this$onPointerDown$$ === void 0 ? void 0 : _this$onPointerDown$$.stopPropagation) && this._parent.classType ===
|
|
26996
|
+
if (!((_this$onPointerDown$$ = this.onPointerDown$.emitEvent(evt)) === null || _this$onPointerDown$$ === void 0 ? void 0 : _this$onPointerDown$$.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27182
26997
|
var _this$_parent10;
|
|
27183
26998
|
(_this$_parent10 = this._parent) === null || _this$_parent10 === void 0 || _this$_parent10.triggerPointerDown(evt);
|
|
27184
26999
|
return false;
|
|
@@ -27186,7 +27001,7 @@ var Scene = class extends Disposable {
|
|
|
27186
27001
|
return true;
|
|
27187
27002
|
}
|
|
27188
27003
|
triggerPointerOut(evt) {
|
|
27189
|
-
if (this._parent.classType ===
|
|
27004
|
+
if (this._parent.classType === "SceneViewer") {
|
|
27190
27005
|
var _this$_parent11;
|
|
27191
27006
|
(_this$_parent11 = this._parent) === null || _this$_parent11 === void 0 || _this$_parent11.triggerPointerOut(evt);
|
|
27192
27007
|
return false;
|
|
@@ -27195,7 +27010,7 @@ var Scene = class extends Disposable {
|
|
|
27195
27010
|
}
|
|
27196
27011
|
triggerPointerLeave(evt) {
|
|
27197
27012
|
var _this$onPointerLeave$;
|
|
27198
|
-
if (!((_this$onPointerLeave$ = this.onPointerLeave$.emitEvent(evt)) === null || _this$onPointerLeave$ === void 0 ? void 0 : _this$onPointerLeave$.stopPropagation) && this._parent.classType ===
|
|
27013
|
+
if (!((_this$onPointerLeave$ = this.onPointerLeave$.emitEvent(evt)) === null || _this$onPointerLeave$ === void 0 ? void 0 : _this$onPointerLeave$.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27199
27014
|
var _this$_parent12;
|
|
27200
27015
|
(_this$_parent12 = this._parent) === null || _this$_parent12 === void 0 || _this$_parent12.triggerPointerLeave(evt);
|
|
27201
27016
|
return false;
|
|
@@ -27203,7 +27018,7 @@ var Scene = class extends Disposable {
|
|
|
27203
27018
|
return true;
|
|
27204
27019
|
}
|
|
27205
27020
|
triggerPointerOver(evt) {
|
|
27206
|
-
if (this._parent.classType ===
|
|
27021
|
+
if (this._parent.classType === "SceneViewer") {
|
|
27207
27022
|
var _this$_parent13;
|
|
27208
27023
|
(_this$_parent13 = this._parent) === null || _this$_parent13 === void 0 || _this$_parent13.triggerPointerOver(evt);
|
|
27209
27024
|
return false;
|
|
@@ -27211,7 +27026,7 @@ var Scene = class extends Disposable {
|
|
|
27211
27026
|
return true;
|
|
27212
27027
|
}
|
|
27213
27028
|
triggerPointerCancel(evt) {
|
|
27214
|
-
if (this._parent.classType ===
|
|
27029
|
+
if (this._parent.classType === "SceneViewer") {
|
|
27215
27030
|
var _this$_parent14;
|
|
27216
27031
|
(_this$_parent14 = this._parent) === null || _this$_parent14 === void 0 || _this$_parent14.triggerPointerCancel(evt);
|
|
27217
27032
|
return false;
|
|
@@ -27220,7 +27035,7 @@ var Scene = class extends Disposable {
|
|
|
27220
27035
|
}
|
|
27221
27036
|
triggerPointerEnter(evt) {
|
|
27222
27037
|
var _this$onPointerEnter$;
|
|
27223
|
-
if (!((_this$onPointerEnter$ = this.onPointerEnter$.emitEvent(evt)) === null || _this$onPointerEnter$ === void 0 ? void 0 : _this$onPointerEnter$.stopPropagation) && this._parent.classType ===
|
|
27038
|
+
if (!((_this$onPointerEnter$ = this.onPointerEnter$.emitEvent(evt)) === null || _this$onPointerEnter$ === void 0 ? void 0 : _this$onPointerEnter$.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27224
27039
|
var _this$_parent15;
|
|
27225
27040
|
(_this$_parent15 = this._parent) === null || _this$_parent15 === void 0 || _this$_parent15.triggerPointerEnter(evt);
|
|
27226
27041
|
return false;
|
|
@@ -27229,7 +27044,7 @@ var Scene = class extends Disposable {
|
|
|
27229
27044
|
}
|
|
27230
27045
|
triggerDragLeave(evt) {
|
|
27231
27046
|
var _this$onDragLeave$$em;
|
|
27232
|
-
if (!((_this$onDragLeave$$em = this.onDragLeave$.emitEvent(evt)) === null || _this$onDragLeave$$em === void 0 ? void 0 : _this$onDragLeave$$em.stopPropagation) && this._parent.classType ===
|
|
27047
|
+
if (!((_this$onDragLeave$$em = this.onDragLeave$.emitEvent(evt)) === null || _this$onDragLeave$$em === void 0 ? void 0 : _this$onDragLeave$$em.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27233
27048
|
var _this$_parent16;
|
|
27234
27049
|
(_this$_parent16 = this._parent) === null || _this$_parent16 === void 0 || _this$_parent16.triggerDragLeave(evt);
|
|
27235
27050
|
return false;
|
|
@@ -27238,7 +27053,7 @@ var Scene = class extends Disposable {
|
|
|
27238
27053
|
}
|
|
27239
27054
|
triggerDragOver(evt) {
|
|
27240
27055
|
var _this$onDragOver$$emi;
|
|
27241
|
-
if (!((_this$onDragOver$$emi = this.onDragOver$.emitEvent(evt)) === null || _this$onDragOver$$emi === void 0 ? void 0 : _this$onDragOver$$emi.stopPropagation) && this._parent.classType ===
|
|
27056
|
+
if (!((_this$onDragOver$$emi = this.onDragOver$.emitEvent(evt)) === null || _this$onDragOver$$emi === void 0 ? void 0 : _this$onDragOver$$emi.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27242
27057
|
var _this$_parent17;
|
|
27243
27058
|
(_this$_parent17 = this._parent) === null || _this$_parent17 === void 0 || _this$_parent17.triggerDragOver(evt);
|
|
27244
27059
|
return false;
|
|
@@ -27247,7 +27062,7 @@ var Scene = class extends Disposable {
|
|
|
27247
27062
|
}
|
|
27248
27063
|
triggerDragEnter(evt) {
|
|
27249
27064
|
var _this$onDragEnter$$em;
|
|
27250
|
-
if (!((_this$onDragEnter$$em = this.onDragEnter$.emitEvent(evt)) === null || _this$onDragEnter$$em === void 0 ? void 0 : _this$onDragEnter$$em.stopPropagation) && this._parent.classType ===
|
|
27065
|
+
if (!((_this$onDragEnter$$em = this.onDragEnter$.emitEvent(evt)) === null || _this$onDragEnter$$em === void 0 ? void 0 : _this$onDragEnter$$em.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27251
27066
|
var _this$_parent18;
|
|
27252
27067
|
(_this$_parent18 = this._parent) === null || _this$_parent18 === void 0 || _this$_parent18.triggerDragEnter(evt);
|
|
27253
27068
|
return false;
|
|
@@ -27256,7 +27071,7 @@ var Scene = class extends Disposable {
|
|
|
27256
27071
|
}
|
|
27257
27072
|
triggerDrop(evt) {
|
|
27258
27073
|
var _this$onDrop$$emitEve;
|
|
27259
|
-
if (!((_this$onDrop$$emitEve = this.onDrop$.emitEvent(evt)) === null || _this$onDrop$$emitEve === void 0 ? void 0 : _this$onDrop$$emitEve.stopPropagation) && this._parent.classType ===
|
|
27074
|
+
if (!((_this$onDrop$$emitEve = this.onDrop$.emitEvent(evt)) === null || _this$onDrop$$emitEve === void 0 ? void 0 : _this$onDrop$$emitEve.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27260
27075
|
var _this$_parent19;
|
|
27261
27076
|
(_this$_parent19 = this._parent) === null || _this$_parent19 === void 0 || _this$_parent19.triggerDrop(evt);
|
|
27262
27077
|
return false;
|
|
@@ -27269,10 +27084,11 @@ var Scene = class extends Disposable {
|
|
|
27269
27084
|
*
|
|
27270
27085
|
*/
|
|
27271
27086
|
_transformHandler() {
|
|
27272
|
-
|
|
27087
|
+
const composeResult = Transform.create().composeMatrix({
|
|
27273
27088
|
scaleX: this.scaleX,
|
|
27274
27089
|
scaleY: this.scaleY
|
|
27275
27090
|
});
|
|
27091
|
+
this.transform = composeResult;
|
|
27276
27092
|
this.getViewports().forEach((vp) => {
|
|
27277
27093
|
vp.resetCanvasSizeAndUpdateScroll();
|
|
27278
27094
|
});
|
|
@@ -28367,7 +28183,7 @@ var Viewport = class {
|
|
|
28367
28183
|
});
|
|
28368
28184
|
if (isLimitedStore && !isLimitedStore.isLimitedX && !isLimitedStore.isLimitedY) {
|
|
28369
28185
|
evt.preventDefault();
|
|
28370
|
-
if (this._scene.getParent().classType ===
|
|
28186
|
+
if (this._scene.getParent().classType === "SceneViewer") state.stopPropagation();
|
|
28371
28187
|
}
|
|
28372
28188
|
if (this._isWheelPreventDefaultX && this._isWheelPreventDefaultY) evt.preventDefault();
|
|
28373
28189
|
this._scene.makeDirty(true);
|
|
@@ -28725,8 +28541,8 @@ var Viewport = class {
|
|
|
28725
28541
|
_drawScrollbar(ctx) {
|
|
28726
28542
|
if (!this._scrollBar) return;
|
|
28727
28543
|
const parent = this._scene.getParent();
|
|
28728
|
-
if (parent.classType ===
|
|
28729
|
-
else if (parent.classType ===
|
|
28544
|
+
if (parent.classType === "SceneViewer") this._scrollBar.render(ctx);
|
|
28545
|
+
else if (parent.classType === "Engine") this._scrollBar.render(ctx);
|
|
28730
28546
|
}
|
|
28731
28547
|
setViewportSize(props) {
|
|
28732
28548
|
if (Tools.isDefine(props === null || props === void 0 ? void 0 : props.top)) this.top = props.top;
|