@univerjs/engine-render 0.21.0 → 0.21.1-insiders.20260509-bf98cad
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 +721 -906
- package/lib/es/index.js +721 -906
- package/lib/types/components/sheets/sheet.render-skeleton.d.ts +1 -0
- package/lib/types/render-manager/render-manager.service.d.ts +4 -4
- package/lib/types/render-manager/render-unit.d.ts +4 -2
- 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);
|
|
@@ -17312,6 +17147,8 @@ let SpreadsheetSkeleton = class SpreadsheetSkeleton extends SheetSkeleton {
|
|
|
17312
17147
|
this._resetCache();
|
|
17313
17148
|
this.makeDirty(true);
|
|
17314
17149
|
}));
|
|
17150
|
+
}
|
|
17151
|
+
registerGetCellHeight() {
|
|
17315
17152
|
this.disposeWithMe(this.worksheet.__registerGetCellHeight((row, col) => {
|
|
17316
17153
|
var _this$calculateAutoHe;
|
|
17317
17154
|
return (_this$calculateAutoHe = this.calculateAutoHeightForCell(row, col)) !== null && _this$calculateAutoHe !== void 0 ? _this$calculateAutoHe : 0;
|
|
@@ -17593,7 +17430,7 @@ let SpreadsheetSkeleton = class SpreadsheetSkeleton extends SheetSkeleton {
|
|
|
17593
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;
|
|
17594
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;
|
|
17595
17432
|
if ((style === null || style === void 0 ? void 0 : style.tb) === WrapStrategy.WRAP) {
|
|
17596
|
-
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);
|
|
17597
17434
|
skeleton.calculate();
|
|
17598
17435
|
return skeleton.getTotalHeight() + paddingTop + paddingBottom;
|
|
17599
17436
|
} else {
|
|
@@ -17639,14 +17476,14 @@ let SpreadsheetSkeleton = class SpreadsheetSkeleton extends SheetSkeleton {
|
|
|
17639
17476
|
_calculateColWidth(colIndex) {
|
|
17640
17477
|
const worksheet = this.worksheet;
|
|
17641
17478
|
let colWidth = 0;
|
|
17642
|
-
const visibleRangeViewMain = this.visibleRangeByViewportKey(
|
|
17479
|
+
const visibleRangeViewMain = this.visibleRangeByViewportKey("viewMain");
|
|
17643
17480
|
if (!visibleRangeViewMain) return colWidth;
|
|
17644
17481
|
const { startRow: startRowOfViewMain, endRow: endRowOfViewMain } = visibleRangeViewMain;
|
|
17645
17482
|
const rowCount = this.worksheet.getRowCount();
|
|
17646
17483
|
const otherRowIndex = /* @__PURE__ */ new Set();
|
|
17647
17484
|
otherRowIndex.add(0);
|
|
17648
17485
|
otherRowIndex.add(rowCount - 1);
|
|
17649
|
-
const visibleRangeViewMainTop = this.visibleRangeByViewportKey(
|
|
17486
|
+
const visibleRangeViewMainTop = this.visibleRangeByViewportKey("viewMainTop");
|
|
17650
17487
|
if (visibleRangeViewMainTop) {
|
|
17651
17488
|
const { startRow: startRowOfViewMainTop, endRow: endRowOfViewMainTop } = visibleRangeViewMainTop;
|
|
17652
17489
|
for (let i = startRowOfViewMainTop; i <= endRowOfViewMainTop; i++) otherRowIndex.add(i);
|
|
@@ -18075,22 +17912,22 @@ let SpreadsheetSkeleton = class SpreadsheetSkeleton extends SheetSkeleton {
|
|
|
18075
17912
|
if (style && style.bd) {
|
|
18076
17913
|
const mergeRange = options === null || options === void 0 ? void 0 : options.mergeRange;
|
|
18077
17914
|
if (mergeRange) {
|
|
18078
|
-
this._setMergeBorderProps(
|
|
18079
|
-
this._setMergeBorderProps(
|
|
18080
|
-
this._setMergeBorderProps(
|
|
18081
|
-
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);
|
|
18082
17919
|
} else if (!this.intersectMergeRange(row, col)) {
|
|
18083
|
-
this._setBorderProps(row, col,
|
|
18084
|
-
this._setBorderProps(row, col,
|
|
18085
|
-
this._setBorderProps(row, col,
|
|
18086
|
-
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);
|
|
18087
17924
|
}
|
|
18088
|
-
this._setBorderProps(row, col,
|
|
18089
|
-
this._setBorderProps(row, col,
|
|
18090
|
-
this._setBorderProps(row, col,
|
|
18091
|
-
this._setBorderProps(row, col,
|
|
18092
|
-
this._setBorderProps(row, col,
|
|
18093
|
-
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);
|
|
18094
17931
|
}
|
|
18095
17932
|
}
|
|
18096
17933
|
_setBgStylesCache(row, col, style, options) {
|
|
@@ -18211,29 +18048,29 @@ let SpreadsheetSkeleton = class SpreadsheetSkeleton extends SheetSkeleton {
|
|
|
18211
18048
|
let forEnd = mergeRange.endRow;
|
|
18212
18049
|
let row = mergeRange.startRow;
|
|
18213
18050
|
let column = mergeRange.startColumn;
|
|
18214
|
-
if (type ===
|
|
18051
|
+
if (type === "t") {
|
|
18215
18052
|
row = mergeRange.startRow;
|
|
18216
18053
|
forStart = mergeRange.startColumn;
|
|
18217
18054
|
forEnd = mergeRange.endColumn;
|
|
18218
|
-
} else if (type ===
|
|
18055
|
+
} else if (type === "b") {
|
|
18219
18056
|
row = mergeRange.endRow;
|
|
18220
18057
|
forStart = mergeRange.startColumn;
|
|
18221
18058
|
forEnd = mergeRange.endColumn;
|
|
18222
|
-
} else if (type ===
|
|
18059
|
+
} else if (type === "l") {
|
|
18223
18060
|
column = mergeRange.startColumn;
|
|
18224
18061
|
forStart = mergeRange.startRow;
|
|
18225
18062
|
forEnd = mergeRange.endRow;
|
|
18226
|
-
} else if (type ===
|
|
18063
|
+
} else if (type === "r") {
|
|
18227
18064
|
column = mergeRange.endColumn;
|
|
18228
18065
|
forStart = mergeRange.startRow;
|
|
18229
18066
|
forEnd = mergeRange.endRow;
|
|
18230
18067
|
}
|
|
18231
18068
|
for (let i = forStart; i <= forEnd; i++) {
|
|
18232
18069
|
var _cell$themeStyle, _style$bd$type, _style$bd;
|
|
18233
|
-
if (type ===
|
|
18234
|
-
else if (type ===
|
|
18235
|
-
else if (type ===
|
|
18236
|
-
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;
|
|
18237
18074
|
const cell = this.worksheet.getCell(row, column);
|
|
18238
18075
|
if (!cell) break;
|
|
18239
18076
|
const themeStyleBackground = (_cell$themeStyle = cell.themeStyle) === null || _cell$themeStyle === void 0 ? void 0 : _cell$themeStyle.bd;
|
|
@@ -18273,12 +18110,12 @@ let SpreadsheetSkeleton = class SpreadsheetSkeleton extends SheetSkeleton {
|
|
|
18273
18110
|
* When the top border of a cell and the bottom border of the cell above it (r-1) overlap,
|
|
18274
18111
|
* if the top border of cell r is white, then the rendering is ignored.
|
|
18275
18112
|
*/
|
|
18276
|
-
if (type ===
|
|
18113
|
+
if (type === "t") {
|
|
18277
18114
|
var _borderCache$getValue;
|
|
18278
|
-
if (((_borderCache$getValue = borderCache.getValue(r - 1, c)) === null || _borderCache$getValue === void 0 ? void 0 : _borderCache$getValue[
|
|
18279
|
-
} 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") {
|
|
18280
18117
|
var _borderCache$getValue2;
|
|
18281
|
-
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;
|
|
18282
18119
|
}
|
|
18283
18120
|
borderCache.getValue(r, c)[type] = {
|
|
18284
18121
|
type,
|
|
@@ -18677,7 +18514,7 @@ var Font = class extends SheetExtension {
|
|
|
18677
18514
|
const paddingBottom = (_padding$b = padding.b) !== null && _padding$b !== void 0 ? _padding$b : DEFAULT_PADDING_DATA.b;
|
|
18678
18515
|
const { vertexAngle = 0, wrapStrategy, cellData } = fontCache;
|
|
18679
18516
|
if ((cellData === null || cellData === void 0 ? void 0 : cellData.v) === void 0 || (cellData === null || cellData === void 0 ? void 0 : cellData.v) === null) return;
|
|
18680
|
-
const text =
|
|
18517
|
+
const text = getDisplayValueFromCell(cellData);
|
|
18681
18518
|
const { startX, startY, endX, endY } = renderFontCtx;
|
|
18682
18519
|
const cellWidth = endX - startX - paddingLeft - paddingRight;
|
|
18683
18520
|
const cellHeight = endY - startY - paddingTop - paddingBottom;
|
|
@@ -19125,7 +18962,7 @@ var DocComponent = class extends RenderComponent {
|
|
|
19125
18962
|
this._skeleton = _skeleton;
|
|
19126
18963
|
_defineProperty(this, "pageMarginLeft", 0);
|
|
19127
18964
|
_defineProperty(this, "pageMarginTop", 0);
|
|
19128
|
-
_defineProperty(this, "pageLayoutType",
|
|
18965
|
+
_defineProperty(this, "pageLayoutType", 0);
|
|
19129
18966
|
this._setConfig(config);
|
|
19130
18967
|
}
|
|
19131
18968
|
getSkeleton() {
|
|
@@ -19140,7 +18977,7 @@ var DocComponent = class extends RenderComponent {
|
|
|
19140
18977
|
if ((config === null || config === void 0 ? void 0 : config.pageMarginTop) != null) this.pageMarginTop = config === null || config === void 0 ? void 0 : config.pageMarginTop;
|
|
19141
18978
|
else this.pageMarginTop = 14;
|
|
19142
18979
|
if ((config === null || config === void 0 ? void 0 : config.pageLayoutType) != null) this.pageLayoutType = config === null || config === void 0 ? void 0 : config.pageLayoutType;
|
|
19143
|
-
else this.pageLayoutType =
|
|
18980
|
+
else this.pageLayoutType = 0;
|
|
19144
18981
|
}
|
|
19145
18982
|
render(mainCtx, bounds) {
|
|
19146
18983
|
if (!this.visible) {
|
|
@@ -19160,7 +18997,7 @@ var DocComponent = class extends RenderComponent {
|
|
|
19160
18997
|
scaleY: 1
|
|
19161
18998
|
};
|
|
19162
18999
|
let { scaleX = 1, scaleY = 1 } = this.parent;
|
|
19163
|
-
if (this.parent.classType ===
|
|
19000
|
+
if (this.parent.classType === "Scene") {
|
|
19164
19001
|
scaleX = this.parent.ancestorScaleX || 1;
|
|
19165
19002
|
scaleY = this.parent.ancestorScaleY || 1;
|
|
19166
19003
|
}
|
|
@@ -19184,15 +19021,10 @@ var DocComponent = class extends RenderComponent {
|
|
|
19184
19021
|
|
|
19185
19022
|
//#endregion
|
|
19186
19023
|
//#region src/components/docs/doc-extension.ts
|
|
19187
|
-
let DOCS_EXTENSION_TYPE = /* @__PURE__ */ function(DOCS_EXTENSION_TYPE) {
|
|
19188
|
-
DOCS_EXTENSION_TYPE[DOCS_EXTENSION_TYPE["SPAN"] = 0] = "SPAN";
|
|
19189
|
-
DOCS_EXTENSION_TYPE[DOCS_EXTENSION_TYPE["LINE"] = 1] = "LINE";
|
|
19190
|
-
return DOCS_EXTENSION_TYPE;
|
|
19191
|
-
}({});
|
|
19192
19024
|
var docExtension = class extends ComponentExtension {
|
|
19193
19025
|
constructor(..._args) {
|
|
19194
19026
|
super(..._args);
|
|
19195
|
-
_defineProperty(this, "type",
|
|
19027
|
+
_defineProperty(this, "type", 0);
|
|
19196
19028
|
_defineProperty(this, "translateX", 0);
|
|
19197
19029
|
_defineProperty(this, "translateY", 0);
|
|
19198
19030
|
}
|
|
@@ -19287,10 +19119,10 @@ var Border$1 = class extends docExtension {
|
|
|
19287
19119
|
_createBorderCache(borderData) {
|
|
19288
19120
|
const { t, b, l, r } = borderData;
|
|
19289
19121
|
const borderCache = /* @__PURE__ */ new Map();
|
|
19290
|
-
t && borderCache.set(
|
|
19291
|
-
b && borderCache.set(
|
|
19292
|
-
l && borderCache.set(
|
|
19293
|
-
r && borderCache.set(
|
|
19122
|
+
t && borderCache.set("t", t);
|
|
19123
|
+
b && borderCache.set("b", b);
|
|
19124
|
+
l && borderCache.set("l", l);
|
|
19125
|
+
r && borderCache.set("r", r);
|
|
19294
19126
|
return borderCache;
|
|
19295
19127
|
}
|
|
19296
19128
|
};
|
|
@@ -19342,12 +19174,12 @@ var Circle = class Circle extends Shape {
|
|
|
19342
19174
|
constructor(key, props) {
|
|
19343
19175
|
super(key, props);
|
|
19344
19176
|
_defineProperty(this, "_radius", void 0);
|
|
19345
|
-
_defineProperty(this, "objectType",
|
|
19177
|
+
_defineProperty(this, "objectType", 5);
|
|
19346
19178
|
this._radius = (props === null || props === void 0 ? void 0 : props.radius) || 10;
|
|
19347
19179
|
this._setFixBoundingBox();
|
|
19348
19180
|
this.onTransformChange$.subscribeEvent((changeState) => {
|
|
19349
19181
|
const { type, value, preValue } = changeState;
|
|
19350
|
-
if (type ===
|
|
19182
|
+
if (type === 1 || type === 5) {
|
|
19351
19183
|
const value = Math.min(this.width, this.height);
|
|
19352
19184
|
this._radius = value / 2;
|
|
19353
19185
|
this.width = value;
|
|
@@ -19416,7 +19248,7 @@ const RECT_OBJECT_ARRAY = ["radius"];
|
|
|
19416
19248
|
var Rect = class Rect extends Shape {
|
|
19417
19249
|
constructor(key, props) {
|
|
19418
19250
|
super(key, props);
|
|
19419
|
-
_defineProperty(this, "objectType",
|
|
19251
|
+
_defineProperty(this, "objectType", 4);
|
|
19420
19252
|
_defineProperty(this, "_radius", 0);
|
|
19421
19253
|
_defineProperty(this, "_opacity", 1);
|
|
19422
19254
|
_defineProperty(this, "_visualHeight", void 0);
|
|
@@ -19604,7 +19436,7 @@ var Image$1 = class extends Shape {
|
|
|
19604
19436
|
_defineProperty(this, "_renderByCropper", false);
|
|
19605
19437
|
_defineProperty(this, "_transformCalculateSrcRect", true);
|
|
19606
19438
|
_defineProperty(this, "_clipService", null);
|
|
19607
|
-
_defineProperty(this, "objectType",
|
|
19439
|
+
_defineProperty(this, "objectType", 3);
|
|
19608
19440
|
_defineProperty(this, "isDrawingObject", true);
|
|
19609
19441
|
this._props = { ...config };
|
|
19610
19442
|
if (config.image) {
|
|
@@ -19652,7 +19484,7 @@ var Image$1 = class extends Shape {
|
|
|
19652
19484
|
return this._clipService;
|
|
19653
19485
|
}
|
|
19654
19486
|
get classType() {
|
|
19655
|
-
return
|
|
19487
|
+
return "Image";
|
|
19656
19488
|
}
|
|
19657
19489
|
transformByStateCloseCropper(option) {
|
|
19658
19490
|
this._transformCalculateSrcRect = false;
|
|
@@ -19870,7 +19702,7 @@ var Image$1 = class extends Shape {
|
|
|
19870
19702
|
centerY
|
|
19871
19703
|
]);
|
|
19872
19704
|
const parent = this.getParent();
|
|
19873
|
-
const oCoord = (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) ===
|
|
19705
|
+
const oCoord = (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) === "Group" ? parent.ancestorTransform.multiply(renderTransform) : renderTransform).invert().applyPoint(coord);
|
|
19874
19706
|
const halfWidth = realWidth / 2;
|
|
19875
19707
|
const halfHeight = realHeight / 2;
|
|
19876
19708
|
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;
|
|
@@ -19899,7 +19731,7 @@ var Path = class Path extends Shape {
|
|
|
19899
19731
|
this._setFixBoundingBox();
|
|
19900
19732
|
this.onTransformChange$.subscribeEvent((changeState) => {
|
|
19901
19733
|
const { type, preValue } = changeState;
|
|
19902
|
-
if (type ===
|
|
19734
|
+
if (type === 1 || type === 5) {
|
|
19903
19735
|
this._reCalculateCache = true;
|
|
19904
19736
|
const { left, top, width, height } = this._getSelfRect();
|
|
19905
19737
|
const { width: preWidth, height: preHeight } = preValue;
|
|
@@ -20567,7 +20399,7 @@ var RegularPolygon = class RegularPolygon extends Shape {
|
|
|
20567
20399
|
this._setFixBoundingBox();
|
|
20568
20400
|
this.onTransformChange$.subscribeEvent((changeState) => {
|
|
20569
20401
|
const { type, value, preValue } = changeState;
|
|
20570
|
-
if (type ===
|
|
20402
|
+
if (type === 1 || type === 5) this.resizePolygon(preValue);
|
|
20571
20403
|
});
|
|
20572
20404
|
}
|
|
20573
20405
|
get pointsGroup() {
|
|
@@ -20734,7 +20566,7 @@ var RichText = class extends BaseObject {
|
|
|
20734
20566
|
_defineProperty(this, "_bg", void 0);
|
|
20735
20567
|
_defineProperty(this, "_bd", void 0);
|
|
20736
20568
|
_defineProperty(this, "_cl", void 0);
|
|
20737
|
-
_defineProperty(this, "objectType",
|
|
20569
|
+
_defineProperty(this, "objectType", 1);
|
|
20738
20570
|
if (props === null || props === void 0 ? void 0 : props.richText) this._documentData = props.richText;
|
|
20739
20571
|
else if (props) {
|
|
20740
20572
|
this._fs = props.fs;
|
|
@@ -20759,7 +20591,7 @@ var RichText = class extends BaseObject {
|
|
|
20759
20591
|
this._initialProps(props);
|
|
20760
20592
|
this.onTransformChange$.subscribeEvent((changeState) => {
|
|
20761
20593
|
const { type } = changeState;
|
|
20762
|
-
if (type ===
|
|
20594
|
+
if (type === 1 || type === 5) {
|
|
20763
20595
|
docModel.updateDocumentDataPageSize(this.width);
|
|
20764
20596
|
this._documentSkeleton.makeDirty(true);
|
|
20765
20597
|
this._documentSkeleton.calculate();
|
|
@@ -21452,7 +21284,7 @@ var FontAndBaseLine = class extends docExtension {
|
|
|
21452
21284
|
ctx.restore();
|
|
21453
21285
|
} else {
|
|
21454
21286
|
const CHECKED_GLYPH = "☑";
|
|
21455
|
-
if ((content === "☐" || content === CHECKED_GLYPH) && glyph.glyphType ===
|
|
21287
|
+
if ((content === "☐" || content === CHECKED_GLYPH) && glyph.glyphType === 2) {
|
|
21456
21288
|
var _glyph$ts$fs, _glyph$ts;
|
|
21457
21289
|
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);
|
|
21458
21290
|
ctx.save();
|
|
@@ -21711,7 +21543,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
21711
21543
|
const extensions = this.getExtensionsByOrder();
|
|
21712
21544
|
for (const extension of extensions) extension.clearCache();
|
|
21713
21545
|
const backgroundExtension = extensions.find((e) => e.uKey === "DefaultDocsBackgroundExtension");
|
|
21714
|
-
const glyphExtensionsExcludeBackground = extensions.filter((e) => e.type ===
|
|
21546
|
+
const glyphExtensionsExcludeBackground = extensions.filter((e) => e.type === 0 && e.uKey !== "DefaultDocsBackgroundExtension");
|
|
21715
21547
|
let pageTop = 0;
|
|
21716
21548
|
let pageLeft = 0;
|
|
21717
21549
|
for (let i = 0, len = pages.length; i < len; i++) {
|
|
@@ -21769,8 +21601,8 @@ var Documents = class Documents extends DocComponent {
|
|
|
21769
21601
|
const maxLineAsc = asc;
|
|
21770
21602
|
const maxLineAscSin = maxLineAsc * Math.sin(centerAngle);
|
|
21771
21603
|
const maxLineAscCos = maxLineAsc * Math.cos(centerAngle);
|
|
21772
|
-
if (type ===
|
|
21773
|
-
for (const extension of extensions) if (extension.type ===
|
|
21604
|
+
if (type === 1) {
|
|
21605
|
+
for (const extension of extensions) if (extension.type === 1) {
|
|
21774
21606
|
extension.extensionOffset = {
|
|
21775
21607
|
alignOffset,
|
|
21776
21608
|
renderConfig
|
|
@@ -21880,7 +21712,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
21880
21712
|
ctx.save();
|
|
21881
21713
|
ctx.setLineWidthByPrecision(1);
|
|
21882
21714
|
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";
|
|
21883
|
-
drawLineByBorderType(ctx,
|
|
21715
|
+
drawLineByBorderType(ctx, "b", 0, {
|
|
21884
21716
|
startX: x,
|
|
21885
21717
|
startY: y,
|
|
21886
21718
|
endX: x + pageWidth - marginLeft - marginRight,
|
|
@@ -21916,8 +21748,8 @@ var Documents = class Documents extends DocComponent {
|
|
|
21916
21748
|
const maxLineAsc = asc;
|
|
21917
21749
|
const maxLineAscSin = maxLineAsc * Math.sin(centerAngle);
|
|
21918
21750
|
const maxLineAscCos = maxLineAsc * Math.cos(centerAngle);
|
|
21919
|
-
if (type ===
|
|
21920
|
-
for (const extension of extensions) if (extension.type ===
|
|
21751
|
+
if (type === 1) {
|
|
21752
|
+
for (const extension of extensions) if (extension.type === 1) {
|
|
21921
21753
|
extension.extensionOffset = {
|
|
21922
21754
|
alignOffset,
|
|
21923
21755
|
renderConfig
|
|
@@ -21997,7 +21829,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
21997
21829
|
ctx.setLineWidthByPrecision(1);
|
|
21998
21830
|
ctx.save();
|
|
21999
21831
|
ctx.strokeStyle = (_borderLeft$color$rgb = borderLeft.color.rgb) !== null && _borderLeft$color$rgb !== void 0 ? _borderLeft$color$rgb : DEFAULT_BORDER_COLOR.color.rgb;
|
|
22000
|
-
drawLineByBorderType(ctx,
|
|
21832
|
+
drawLineByBorderType(ctx, "l", 0, {
|
|
22001
21833
|
startX: x,
|
|
22002
21834
|
startY: y,
|
|
22003
21835
|
endX: x + pageWidth,
|
|
@@ -22006,7 +21838,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
22006
21838
|
ctx.restore();
|
|
22007
21839
|
ctx.save();
|
|
22008
21840
|
ctx.strokeStyle = (_borderTop$color$rgb = borderTop.color.rgb) !== null && _borderTop$color$rgb !== void 0 ? _borderTop$color$rgb : DEFAULT_BORDER_COLOR.color.rgb;
|
|
22009
|
-
drawLineByBorderType(ctx,
|
|
21841
|
+
drawLineByBorderType(ctx, "t", 0, {
|
|
22010
21842
|
startX: x,
|
|
22011
21843
|
startY: y,
|
|
22012
21844
|
endX: x + pageWidth,
|
|
@@ -22015,7 +21847,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
22015
21847
|
ctx.restore();
|
|
22016
21848
|
ctx.save();
|
|
22017
21849
|
ctx.strokeStyle = (_borderRight$color$rg = borderRight.color.rgb) !== null && _borderRight$color$rg !== void 0 ? _borderRight$color$rg : DEFAULT_BORDER_COLOR.color.rgb;
|
|
22018
|
-
drawLineByBorderType(ctx,
|
|
21850
|
+
drawLineByBorderType(ctx, "r", 0, {
|
|
22019
21851
|
startX: x,
|
|
22020
21852
|
startY: y,
|
|
22021
21853
|
endX: x + pageWidth,
|
|
@@ -22024,7 +21856,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
22024
21856
|
ctx.restore();
|
|
22025
21857
|
ctx.save();
|
|
22026
21858
|
ctx.strokeStyle = (_borderBottom$color$r = borderBottom.color.rgb) !== null && _borderBottom$color$r !== void 0 ? _borderBottom$color$r : DEFAULT_BORDER_COLOR.color.rgb;
|
|
22027
|
-
drawLineByBorderType(ctx,
|
|
21859
|
+
drawLineByBorderType(ctx, "b", 0, {
|
|
22028
21860
|
startX: x,
|
|
22029
21861
|
startY: y,
|
|
22030
21862
|
endX: x + pageWidth,
|
|
@@ -22053,8 +21885,8 @@ var Documents = class Documents extends DocComponent {
|
|
|
22053
21885
|
const maxLineAsc = asc;
|
|
22054
21886
|
const maxLineAscSin = maxLineAsc * Math.sin(centerAngle);
|
|
22055
21887
|
const maxLineAscCos = maxLineAsc * Math.cos(centerAngle);
|
|
22056
|
-
if (type ===
|
|
22057
|
-
for (const extension of extensions) if (extension.type ===
|
|
21888
|
+
if (type === 1) {
|
|
21889
|
+
for (const extension of extensions) if (extension.type === 1) {
|
|
22058
21890
|
extension.extensionOffset = {
|
|
22059
21891
|
alignOffset,
|
|
22060
21892
|
renderConfig
|
|
@@ -22477,14 +22309,14 @@ var Spreadsheet = class extends SheetComponent {
|
|
|
22477
22309
|
_getAncestorSize() {
|
|
22478
22310
|
const parent = this._getAncestorParent();
|
|
22479
22311
|
if (!parent) return;
|
|
22480
|
-
if (parent.classType ===
|
|
22312
|
+
if (parent.classType === "Engine") {
|
|
22481
22313
|
const mainCanvas = parent.getCanvas();
|
|
22482
22314
|
return {
|
|
22483
22315
|
width: mainCanvas.getWidth(),
|
|
22484
22316
|
height: mainCanvas.getHeight()
|
|
22485
22317
|
};
|
|
22486
22318
|
}
|
|
22487
|
-
if (parent.classType ===
|
|
22319
|
+
if (parent.classType === "SceneViewer") return {
|
|
22488
22320
|
width: parent.width,
|
|
22489
22321
|
height: parent.height
|
|
22490
22322
|
};
|
|
@@ -22492,7 +22324,7 @@ var Spreadsheet = class extends SheetComponent {
|
|
|
22492
22324
|
_getAncestorParent() {
|
|
22493
22325
|
let parent = this.parent;
|
|
22494
22326
|
while (parent) {
|
|
22495
|
-
if (parent.classType ===
|
|
22327
|
+
if (parent.classType === "Engine" || parent.classType === "SceneViewer") return parent;
|
|
22496
22328
|
parent = (parent === null || parent === void 0 ? void 0 : parent.getParent) && (parent === null || parent === void 0 ? void 0 : parent.getParent());
|
|
22497
22329
|
}
|
|
22498
22330
|
}
|
|
@@ -22749,9 +22581,9 @@ let IWatermarkTypeEnum = /* @__PURE__ */ function(IWatermarkTypeEnum) {
|
|
|
22749
22581
|
function renderWatermark(ctx, config, image, userInfo) {
|
|
22750
22582
|
const type = config.type;
|
|
22751
22583
|
const watermarkConfig = config.config;
|
|
22752
|
-
if (type ===
|
|
22753
|
-
else if (type ===
|
|
22754
|
-
else if (type ===
|
|
22584
|
+
if (type === "userInfo" && watermarkConfig.userInfo) renderUserInfoWatermark(ctx, watermarkConfig.userInfo, userInfo);
|
|
22585
|
+
else if (type === "image" && watermarkConfig.image) renderImageWatermark(ctx, watermarkConfig.image, image);
|
|
22586
|
+
else if (type === "text" && watermarkConfig.text) renderTextWatermark(ctx, watermarkConfig.text);
|
|
22755
22587
|
}
|
|
22756
22588
|
function renderUserInfoWatermark(ctx, config, userInfo) {
|
|
22757
22589
|
const { x, y, repeat, spacingX, spacingY, rotate, opacity, name, fontSize, color, bold, italic, direction } = config;
|
|
@@ -22907,7 +22739,7 @@ var Layer = class extends Disposable {
|
|
|
22907
22739
|
* @returns {Layer} this
|
|
22908
22740
|
*/
|
|
22909
22741
|
addObject(o) {
|
|
22910
|
-
if (o.classType ===
|
|
22742
|
+
if (o.classType === "Group") {
|
|
22911
22743
|
const objects = o.getObjects();
|
|
22912
22744
|
for (const object of objects) {
|
|
22913
22745
|
if (this.scene.getObject(object.oKey)) continue;
|
|
@@ -22969,7 +22801,7 @@ var Layer = class extends Disposable {
|
|
|
22969
22801
|
* parent is SceneViewer, make it dirty
|
|
22970
22802
|
*/
|
|
22971
22803
|
const parent = this.scene.getParent();
|
|
22972
|
-
if (parent.classType ===
|
|
22804
|
+
if (parent.classType === "SceneViewer") parent.makeDirty(true);
|
|
22973
22805
|
return this;
|
|
22974
22806
|
}
|
|
22975
22807
|
makeDirtyWithDebounce(state = true) {
|
|
@@ -23076,7 +22908,7 @@ var WatermarkLayer = class extends Layer {
|
|
|
23076
22908
|
updateConfig(config, user) {
|
|
23077
22909
|
var _this$_config;
|
|
23078
22910
|
this._config = config;
|
|
23079
|
-
if (((_this$_config = this._config) === null || _this$_config === void 0 ? void 0 : _this$_config.type) ===
|
|
22911
|
+
if (((_this$_config = this._config) === null || _this$_config === void 0 ? void 0 : _this$_config.type) === "image" && this._config.config.image) {
|
|
23080
22912
|
this._image = new Image();
|
|
23081
22913
|
this._image.src = this._config.config.image.url;
|
|
23082
22914
|
}
|
|
@@ -23114,7 +22946,7 @@ var SceneViewer = class extends BaseObject {
|
|
|
23114
22946
|
this._initialProps(props);
|
|
23115
22947
|
}
|
|
23116
22948
|
get classType() {
|
|
23117
|
-
return
|
|
22949
|
+
return "SceneViewer";
|
|
23118
22950
|
}
|
|
23119
22951
|
render(mainCtx, bounds) {
|
|
23120
22952
|
var _this$_activeSubScene;
|
|
@@ -23241,7 +23073,7 @@ var Slide = class extends SceneViewer {
|
|
|
23241
23073
|
addNavigation() {
|
|
23242
23074
|
const scene = this.getActiveSubScene();
|
|
23243
23075
|
if (scene == null || this._navigationEnabled === false) return;
|
|
23244
|
-
const leftArrow = new Path(
|
|
23076
|
+
const leftArrow = new Path("__slideNavigationLeft__", {
|
|
23245
23077
|
data: arrowPath,
|
|
23246
23078
|
width: 60,
|
|
23247
23079
|
height: 60,
|
|
@@ -23250,7 +23082,7 @@ var Slide = class extends SceneViewer {
|
|
|
23250
23082
|
fill: this._getArrowColor(),
|
|
23251
23083
|
flipX: true
|
|
23252
23084
|
});
|
|
23253
|
-
const rightArrow = new Path(
|
|
23085
|
+
const rightArrow = new Path("__slideNavigationRight__", {
|
|
23254
23086
|
data: arrowPath,
|
|
23255
23087
|
width: 60,
|
|
23256
23088
|
height: 60,
|
|
@@ -23259,11 +23091,11 @@ var Slide = class extends SceneViewer {
|
|
|
23259
23091
|
fill: this._getArrowColor()
|
|
23260
23092
|
});
|
|
23261
23093
|
const hoverIn = (o, evt) => {
|
|
23262
|
-
o.setCursor(
|
|
23094
|
+
o.setCursor("pointer");
|
|
23263
23095
|
o.setProps({ fill: this._getArrowColor(true) });
|
|
23264
23096
|
};
|
|
23265
23097
|
const hoverOut = (o, evt) => {
|
|
23266
|
-
o.setCursor(
|
|
23098
|
+
o.setCursor("default");
|
|
23267
23099
|
o.setProps({ fill: this._getArrowColor() });
|
|
23268
23100
|
};
|
|
23269
23101
|
attachObjectHover(leftArrow, hoverIn, hoverOut);
|
|
@@ -23275,8 +23107,8 @@ var Slide = class extends SceneViewer {
|
|
|
23275
23107
|
var _scene$getObject, _scene$getObject2;
|
|
23276
23108
|
const scene = this.getActiveSubScene();
|
|
23277
23109
|
if (scene == null || this._navigationEnabled === false) return;
|
|
23278
|
-
(_scene$getObject = scene.getObject(
|
|
23279
|
-
(_scene$getObject2 = scene.getObject(
|
|
23110
|
+
(_scene$getObject = scene.getObject("__slideNavigationLeft__")) === null || _scene$getObject === void 0 || _scene$getObject.dispose();
|
|
23111
|
+
(_scene$getObject2 = scene.getObject("__slideNavigationRight__")) === null || _scene$getObject2 === void 0 || _scene$getObject2.dispose();
|
|
23280
23112
|
}
|
|
23281
23113
|
enableNav() {
|
|
23282
23114
|
this._navigationEnabled = true;
|
|
@@ -23288,15 +23120,15 @@ var Slide = class extends SceneViewer {
|
|
|
23288
23120
|
var _scene$getObject3, _scene$getObject4;
|
|
23289
23121
|
const scene = this.getActiveSubScene();
|
|
23290
23122
|
if (scene == null || this._navigationEnabled === false) return;
|
|
23291
|
-
(_scene$getObject3 = scene.getObject(
|
|
23292
|
-
(_scene$getObject4 = scene.getObject(
|
|
23123
|
+
(_scene$getObject3 = scene.getObject("__slideNavigationLeft__")) === null || _scene$getObject3 === void 0 || _scene$getObject3.hide();
|
|
23124
|
+
(_scene$getObject4 = scene.getObject("__slideNavigationRight__")) === null || _scene$getObject4 === void 0 || _scene$getObject4.hide();
|
|
23293
23125
|
}
|
|
23294
23126
|
showNav() {
|
|
23295
23127
|
var _scene$getObject5, _scene$getObject6;
|
|
23296
23128
|
const scene = this.getActiveSubScene();
|
|
23297
23129
|
if (scene == null || this._navigationEnabled === false) return;
|
|
23298
|
-
(_scene$getObject5 = scene.getObject(
|
|
23299
|
-
(_scene$getObject6 = scene.getObject(
|
|
23130
|
+
(_scene$getObject5 = scene.getObject("__slideNavigationLeft__")) === null || _scene$getObject5 === void 0 || _scene$getObject5.show();
|
|
23131
|
+
(_scene$getObject6 = scene.getObject("__slideNavigationRight__")) === null || _scene$getObject6 === void 0 || _scene$getObject6.show();
|
|
23300
23132
|
}
|
|
23301
23133
|
renderToThumb(mainCtx, pageId, scaleX = 1, scaleY = 1) {
|
|
23302
23134
|
const scene = this.getSubScene(pageId);
|
|
@@ -23510,7 +23342,7 @@ var Group = class extends BaseObject {
|
|
|
23510
23342
|
this.addObjects(...objects);
|
|
23511
23343
|
}
|
|
23512
23344
|
get classType() {
|
|
23513
|
-
return
|
|
23345
|
+
return "Group";
|
|
23514
23346
|
}
|
|
23515
23347
|
set cursor(val) {
|
|
23516
23348
|
this.setCursor(val);
|
|
@@ -23630,7 +23462,7 @@ var Group = class extends BaseObject {
|
|
|
23630
23462
|
}
|
|
23631
23463
|
_transformObject(object, groupWidth, groupHeight) {
|
|
23632
23464
|
const transform = transformObjectOutOfGroup(object.getState(), this.getState(), groupWidth, groupHeight);
|
|
23633
|
-
if (object.classType ===
|
|
23465
|
+
if (object.classType === "Group") object.transformByState({
|
|
23634
23466
|
left: transform.left,
|
|
23635
23467
|
top: transform.top
|
|
23636
23468
|
});
|
|
@@ -23714,7 +23546,7 @@ var DrawingGroupObject = class extends Group {
|
|
|
23714
23546
|
centerY
|
|
23715
23547
|
]);
|
|
23716
23548
|
const parent = this.getParent();
|
|
23717
|
-
if (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) ===
|
|
23549
|
+
if (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) === "Group") return parent.ancestorTransform.multiply(renderTransform);
|
|
23718
23550
|
return renderTransform;
|
|
23719
23551
|
}
|
|
23720
23552
|
render(ctx, bounds) {
|
|
@@ -23745,7 +23577,7 @@ var DrawingGroupObject = class extends Group {
|
|
|
23745
23577
|
centerY
|
|
23746
23578
|
]);
|
|
23747
23579
|
const parent = this.getParent();
|
|
23748
|
-
const oCoord = (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) ===
|
|
23580
|
+
const oCoord = (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) === "Group" ? parent.ancestorTransform.multiply(renderTransform) : renderTransform).invert().applyPoint(coord);
|
|
23749
23581
|
const halfWidth = realWidth / 2;
|
|
23750
23582
|
const halfHeight = realHeight / 2;
|
|
23751
23583
|
if (oCoord.x < -halfWidth || oCoord.x > halfWidth || oCoord.y < -halfHeight || oCoord.y > halfHeight) return false;
|
|
@@ -23989,7 +23821,7 @@ let Engine = class Engine extends Disposable {
|
|
|
23989
23821
|
return this.getCanvas().getHeight();
|
|
23990
23822
|
}
|
|
23991
23823
|
get classType() {
|
|
23992
|
-
return
|
|
23824
|
+
return "Engine";
|
|
23993
23825
|
}
|
|
23994
23826
|
get activeScene() {
|
|
23995
23827
|
return this._activeScene;
|
|
@@ -24059,7 +23891,7 @@ let Engine = class Engine extends Disposable {
|
|
|
24059
23891
|
const options = Object.assign({}, {
|
|
24060
23892
|
elementHeight: 1,
|
|
24061
23893
|
elementWidth: 1,
|
|
24062
|
-
renderMode:
|
|
23894
|
+
renderMode: 0,
|
|
24063
23895
|
dpr: 1
|
|
24064
23896
|
}, _options);
|
|
24065
23897
|
this._canvas = new Canvas({
|
|
@@ -24073,7 +23905,7 @@ let Engine = class Engine extends Disposable {
|
|
|
24073
23905
|
this._handleKeyboardAction();
|
|
24074
23906
|
this._handlePointerAction();
|
|
24075
23907
|
this._handleDragAction();
|
|
24076
|
-
if (options.renderMode !==
|
|
23908
|
+
if (options.renderMode !== 1) this._matchMediaHandler();
|
|
24077
23909
|
}
|
|
24078
23910
|
getScenes() {
|
|
24079
23911
|
return this._scenes;
|
|
@@ -24206,7 +24038,7 @@ let Engine = class Engine extends Disposable {
|
|
|
24206
24038
|
const preHeight = this.height;
|
|
24207
24039
|
this.getCanvas().setSize(width, height);
|
|
24208
24040
|
this.onTransformChange$.emitEvent({
|
|
24209
|
-
type:
|
|
24041
|
+
type: 1,
|
|
24210
24042
|
value: {
|
|
24211
24043
|
width,
|
|
24212
24044
|
height
|
|
@@ -24352,13 +24184,13 @@ let Engine = class Engine extends Disposable {
|
|
|
24352
24184
|
_handleKeyboardAction() {
|
|
24353
24185
|
const keyboardDownEvent = (evt) => {
|
|
24354
24186
|
const deviceEvent = evt;
|
|
24355
|
-
deviceEvent.deviceType =
|
|
24187
|
+
deviceEvent.deviceType = 1;
|
|
24356
24188
|
deviceEvent.inputIndex = evt.keyCode;
|
|
24357
24189
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24358
24190
|
};
|
|
24359
24191
|
const keyboardUpEvent = (evt) => {
|
|
24360
24192
|
const deviceEvent = evt;
|
|
24361
|
-
deviceEvent.deviceType =
|
|
24193
|
+
deviceEvent.deviceType = 1;
|
|
24362
24194
|
deviceEvent.inputIndex = evt.keyCode;
|
|
24363
24195
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24364
24196
|
};
|
|
@@ -24383,13 +24215,13 @@ let Engine = class Engine extends Disposable {
|
|
|
24383
24215
|
this._pointerMoveEvent = (e) => {
|
|
24384
24216
|
const evt = e;
|
|
24385
24217
|
const deviceType = this._getPointerType(evt);
|
|
24386
|
-
this._pointerPosRecord[
|
|
24387
|
-
this._pointerPosRecord[
|
|
24388
|
-
this._pointerPosRecord[
|
|
24389
|
-
this._pointerPosRecord[
|
|
24218
|
+
this._pointerPosRecord[0] = evt.clientX;
|
|
24219
|
+
this._pointerPosRecord[1] = evt.clientY;
|
|
24220
|
+
this._pointerPosRecord[10] = evt.movementX;
|
|
24221
|
+
this._pointerPosRecord[11] = evt.movementY;
|
|
24390
24222
|
const deviceEvent = evt;
|
|
24391
24223
|
deviceEvent.deviceType = deviceType;
|
|
24392
|
-
deviceEvent.inputIndex =
|
|
24224
|
+
deviceEvent.inputIndex = 0;
|
|
24393
24225
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24394
24226
|
if (!this._usingSafari) {
|
|
24395
24227
|
deviceEvent.inputIndex = evt.button + 2;
|
|
@@ -24399,23 +24231,23 @@ let Engine = class Engine extends Disposable {
|
|
|
24399
24231
|
this._pointerDownEvent = (nativeEvent) => {
|
|
24400
24232
|
const evt = nativeEvent;
|
|
24401
24233
|
const deviceType = this._getPointerType(evt);
|
|
24402
|
-
const previousHorizontal = this._pointerPosRecord[
|
|
24403
|
-
const previousVertical = this._pointerPosRecord[
|
|
24404
|
-
if (deviceType ===
|
|
24234
|
+
const previousHorizontal = this._pointerPosRecord[0];
|
|
24235
|
+
const previousVertical = this._pointerPosRecord[1];
|
|
24236
|
+
if (deviceType === 2) {
|
|
24405
24237
|
if (this._mouseId === -1) if (evt.pointerId === void 0) this._mouseId = this._isUsingFirefox ? 0 : 1;
|
|
24406
24238
|
else this._mouseId = evt.pointerId;
|
|
24407
24239
|
if (!document.pointerLockElement) this._remainCapture = this._mouseId;
|
|
24408
24240
|
} else if (evt.pointerId && !document.pointerLockElement) this._remainCapture = evt.pointerId;
|
|
24409
|
-
this._pointerPosRecord[
|
|
24410
|
-
this._pointerPosRecord[
|
|
24241
|
+
this._pointerPosRecord[0] = evt.clientX;
|
|
24242
|
+
this._pointerPosRecord[1] = evt.clientY;
|
|
24411
24243
|
const deviceEvent = evt;
|
|
24412
24244
|
deviceEvent.deviceType = deviceType;
|
|
24413
24245
|
if (previousHorizontal !== evt.clientX) {
|
|
24414
|
-
deviceEvent.inputIndex =
|
|
24246
|
+
deviceEvent.inputIndex = 0;
|
|
24415
24247
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24416
24248
|
}
|
|
24417
24249
|
if (previousVertical !== evt.clientY) {
|
|
24418
|
-
deviceEvent.inputIndex =
|
|
24250
|
+
deviceEvent.inputIndex = 1;
|
|
24419
24251
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24420
24252
|
}
|
|
24421
24253
|
deviceEvent.inputIndex = evt.button + 2;
|
|
@@ -24424,23 +24256,23 @@ let Engine = class Engine extends Disposable {
|
|
|
24424
24256
|
this._pointerUpEvent = (_evt) => {
|
|
24425
24257
|
const evt = _evt;
|
|
24426
24258
|
const deviceType = this._getPointerType(evt);
|
|
24427
|
-
const previousHorizontal = this._pointerPosRecord[
|
|
24428
|
-
const previousVertical = this._pointerPosRecord[
|
|
24429
|
-
this._pointerPosRecord[
|
|
24430
|
-
this._pointerPosRecord[
|
|
24259
|
+
const previousHorizontal = this._pointerPosRecord[0];
|
|
24260
|
+
const previousVertical = this._pointerPosRecord[1];
|
|
24261
|
+
this._pointerPosRecord[0] = evt.clientX;
|
|
24262
|
+
this._pointerPosRecord[1] = evt.clientY;
|
|
24431
24263
|
const deviceEvent = evt;
|
|
24432
24264
|
deviceEvent.deviceType = deviceType;
|
|
24433
24265
|
if (previousHorizontal !== evt.clientX) {
|
|
24434
|
-
deviceEvent.inputIndex =
|
|
24266
|
+
deviceEvent.inputIndex = 0;
|
|
24435
24267
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24436
24268
|
}
|
|
24437
24269
|
if (previousVertical !== evt.clientY) {
|
|
24438
|
-
deviceEvent.inputIndex =
|
|
24270
|
+
deviceEvent.inputIndex = 1;
|
|
24439
24271
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24440
24272
|
}
|
|
24441
24273
|
deviceEvent.inputIndex = evt.button + 2;
|
|
24442
24274
|
const canvasEle = this.getCanvasElement();
|
|
24443
|
-
if (deviceType ===
|
|
24275
|
+
if (deviceType === 2 && this._mouseId >= 0 && canvasEle.hasPointerCapture(this._mouseId)) {
|
|
24444
24276
|
this._remainCapture = this._mouseId;
|
|
24445
24277
|
canvasEle.releasePointerCapture(this._mouseId);
|
|
24446
24278
|
} else if (deviceEvent.pointerId && canvasEle.hasPointerCapture(deviceEvent.pointerId)) {
|
|
@@ -24448,7 +24280,7 @@ let Engine = class Engine extends Disposable {
|
|
|
24448
24280
|
canvasEle.releasePointerCapture(deviceEvent.pointerId);
|
|
24449
24281
|
}
|
|
24450
24282
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24451
|
-
if (deviceType !==
|
|
24283
|
+
if (deviceType !== 2) this._pointerPosRecord = {};
|
|
24452
24284
|
};
|
|
24453
24285
|
this._pointerEnterEvent = (evt) => {
|
|
24454
24286
|
const deviceType = this._getPointerType(evt);
|
|
@@ -24479,15 +24311,15 @@ let Engine = class Engine extends Disposable {
|
|
|
24479
24311
|
this._pointerPosRecord = {};
|
|
24480
24312
|
};
|
|
24481
24313
|
this._pointerWheelEvent = (evt) => {
|
|
24482
|
-
const deviceType =
|
|
24483
|
-
this._pointerPosRecord[
|
|
24484
|
-
this._pointerPosRecord[
|
|
24485
|
-
this._pointerPosRecord[
|
|
24314
|
+
const deviceType = 2;
|
|
24315
|
+
this._pointerPosRecord[7] = evt.deltaX || 0;
|
|
24316
|
+
this._pointerPosRecord[8] = evt.deltaY || evt.wheelDelta || 0;
|
|
24317
|
+
this._pointerPosRecord[9] = evt.deltaZ || 0;
|
|
24486
24318
|
const deviceEvent = evt;
|
|
24487
24319
|
deviceEvent.deviceType = deviceType;
|
|
24488
|
-
if (this._pointerPosRecord[
|
|
24489
|
-
if (this._pointerPosRecord[
|
|
24490
|
-
if (this._pointerPosRecord[
|
|
24320
|
+
if (this._pointerPosRecord[7] !== 0) deviceEvent.currentState = this._pointerPosRecord[7];
|
|
24321
|
+
if (this._pointerPosRecord[8] !== 0) deviceEvent.currentState = this._pointerPosRecord[8];
|
|
24322
|
+
if (this._pointerPosRecord[9] !== 0) deviceEvent.currentState = this._pointerPosRecord[9];
|
|
24491
24323
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24492
24324
|
};
|
|
24493
24325
|
const canvasEle = this.getCanvasElement();
|
|
@@ -24521,32 +24353,32 @@ let Engine = class Engine extends Disposable {
|
|
|
24521
24353
|
this._dragOverEvent = (evt) => {
|
|
24522
24354
|
evt.preventDefault();
|
|
24523
24355
|
const deviceType = this._getPointerType(evt);
|
|
24524
|
-
const previousHorizontal = this._pointerPosRecord[
|
|
24525
|
-
const previousVertical = this._pointerPosRecord[
|
|
24526
|
-
this._pointerPosRecord[
|
|
24527
|
-
this._pointerPosRecord[
|
|
24528
|
-
this._pointerPosRecord[
|
|
24529
|
-
this._pointerPosRecord[
|
|
24356
|
+
const previousHorizontal = this._pointerPosRecord[0];
|
|
24357
|
+
const previousVertical = this._pointerPosRecord[1];
|
|
24358
|
+
this._pointerPosRecord[0] = evt.clientX;
|
|
24359
|
+
this._pointerPosRecord[1] = evt.clientY;
|
|
24360
|
+
this._pointerPosRecord[10] = evt.movementX;
|
|
24361
|
+
this._pointerPosRecord[11] = evt.movementY;
|
|
24530
24362
|
const deviceEvent = evt;
|
|
24531
24363
|
deviceEvent.deviceType = deviceType;
|
|
24532
24364
|
if (previousHorizontal !== evt.clientX) {
|
|
24533
|
-
deviceEvent.inputIndex =
|
|
24534
|
-
deviceEvent.currentState = this._pointerPosRecord[
|
|
24365
|
+
deviceEvent.inputIndex = 0;
|
|
24366
|
+
deviceEvent.currentState = this._pointerPosRecord[0];
|
|
24535
24367
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24536
24368
|
}
|
|
24537
24369
|
if (previousVertical !== evt.clientY) {
|
|
24538
|
-
deviceEvent.inputIndex =
|
|
24539
|
-
deviceEvent.currentState = this._pointerPosRecord[
|
|
24370
|
+
deviceEvent.inputIndex = 1;
|
|
24371
|
+
deviceEvent.currentState = this._pointerPosRecord[1];
|
|
24540
24372
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24541
24373
|
}
|
|
24542
|
-
if (this._pointerPosRecord[
|
|
24543
|
-
deviceEvent.inputIndex =
|
|
24544
|
-
deviceEvent.currentState = this._pointerPosRecord[
|
|
24374
|
+
if (this._pointerPosRecord[10] !== 0) {
|
|
24375
|
+
deviceEvent.inputIndex = 10;
|
|
24376
|
+
deviceEvent.currentState = this._pointerPosRecord[10];
|
|
24545
24377
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24546
24378
|
}
|
|
24547
|
-
if (this._pointerPosRecord[
|
|
24548
|
-
deviceEvent.inputIndex =
|
|
24549
|
-
deviceEvent.currentState = this._pointerPosRecord[
|
|
24379
|
+
if (this._pointerPosRecord[11] !== 0) {
|
|
24380
|
+
deviceEvent.inputIndex = 11;
|
|
24381
|
+
deviceEvent.currentState = this._pointerPosRecord[11];
|
|
24550
24382
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24551
24383
|
}
|
|
24552
24384
|
if (!this._usingSafari) {
|
|
@@ -24585,8 +24417,8 @@ let Engine = class Engine extends Disposable {
|
|
|
24585
24417
|
return passiveSupported;
|
|
24586
24418
|
}
|
|
24587
24419
|
_getPointerType(evt) {
|
|
24588
|
-
let deviceType =
|
|
24589
|
-
if (evt.pointerType === "touch" || evt.pointerType === "pen" || evt.touches) deviceType =
|
|
24420
|
+
let deviceType = 2;
|
|
24421
|
+
if (evt.pointerType === "touch" || evt.pointerType === "pen" || evt.touches) deviceType = 3;
|
|
24590
24422
|
return deviceType;
|
|
24591
24423
|
}
|
|
24592
24424
|
_matchMediaHandler() {
|
|
@@ -24607,7 +24439,7 @@ Engine = __decorate([__decorateParam(2, ICanvasColorService)], Engine);
|
|
|
24607
24439
|
//#endregion
|
|
24608
24440
|
//#region package.json
|
|
24609
24441
|
var name = "@univerjs/engine-render";
|
|
24610
|
-
var version = "0.21.
|
|
24442
|
+
var version = "0.21.1-insiders.20260509-bf98cad";
|
|
24611
24443
|
|
|
24612
24444
|
//#endregion
|
|
24613
24445
|
//#region src/config/config.ts
|
|
@@ -24802,7 +24634,7 @@ var InputManager = class InputManager extends Disposable {
|
|
|
24802
24634
|
if (!engine) return;
|
|
24803
24635
|
this._onInput$ = engine.onInputChanged$.subscribeEvent((eventData) => {
|
|
24804
24636
|
const evt = eventData;
|
|
24805
|
-
if (eventData.deviceType ===
|
|
24637
|
+
if (eventData.deviceType === 1) switch (eventData.type) {
|
|
24806
24638
|
case "keydown":
|
|
24807
24639
|
this._onKeyDown(evt);
|
|
24808
24640
|
break;
|
|
@@ -24810,7 +24642,7 @@ var InputManager = class InputManager extends Disposable {
|
|
|
24810
24642
|
this._onKeyUp(evt);
|
|
24811
24643
|
break;
|
|
24812
24644
|
}
|
|
24813
|
-
if (eventData.deviceType ===
|
|
24645
|
+
if (eventData.deviceType === 2 || eventData.deviceType === 3) switch (eventData.type) {
|
|
24814
24646
|
case "wheel":
|
|
24815
24647
|
case "DOMMouseScroll":
|
|
24816
24648
|
case "mousewheel":
|
|
@@ -24832,10 +24664,10 @@ var InputManager = class InputManager extends Disposable {
|
|
|
24832
24664
|
if (enableMove) this._onPointerMove(evt);
|
|
24833
24665
|
break;
|
|
24834
24666
|
case "pointerup":
|
|
24835
|
-
if (enableUp && eventData.inputIndex >=
|
|
24667
|
+
if (enableUp && eventData.inputIndex >= 2 && eventData.inputIndex <= 4) this._onPointerUp(evt);
|
|
24836
24668
|
break;
|
|
24837
24669
|
case "pointerdown":
|
|
24838
|
-
if (enableDown && eventData.inputIndex >=
|
|
24670
|
+
if (enableDown && eventData.inputIndex >= 2 && eventData.inputIndex <= 4) this._onPointerDown(evt);
|
|
24839
24671
|
break;
|
|
24840
24672
|
}
|
|
24841
24673
|
if (eventData.dataTransfer) switch (eventData.type) {
|
|
@@ -24843,7 +24675,7 @@ var InputManager = class InputManager extends Disposable {
|
|
|
24843
24675
|
if (enableEnter) this._onDragEnter(evt);
|
|
24844
24676
|
break;
|
|
24845
24677
|
case "dragover": {
|
|
24846
|
-
const validIndex = eventData.inputIndex ===
|
|
24678
|
+
const validIndex = eventData.inputIndex === 0 || eventData.inputIndex === 1 || eventData.inputIndex === 10 || eventData.inputIndex === 11;
|
|
24847
24679
|
if (enableMove && validIndex) this._onDragOver(evt);
|
|
24848
24680
|
break;
|
|
24849
24681
|
}
|
|
@@ -24890,9 +24722,9 @@ var InputManager = class InputManager extends Disposable {
|
|
|
24890
24722
|
return !this._isObjectInSceneViewer(currentObject);
|
|
24891
24723
|
}
|
|
24892
24724
|
_isObjectInSceneViewer(obj) {
|
|
24893
|
-
if (obj && obj.classType ===
|
|
24725
|
+
if (obj && obj.classType === "BaseObject") {
|
|
24894
24726
|
const scene = obj.getScene();
|
|
24895
|
-
if (scene) return scene.getParent().classType ===
|
|
24727
|
+
if (scene) return scene.getParent().classType === "SceneViewer";
|
|
24896
24728
|
}
|
|
24897
24729
|
return false;
|
|
24898
24730
|
}
|
|
@@ -24959,7 +24791,7 @@ const THRESHOLD_TO_AUTO_MOVE = {
|
|
|
24959
24791
|
r: 60
|
|
24960
24792
|
};
|
|
24961
24793
|
var ScrollTimer = class ScrollTimer {
|
|
24962
|
-
constructor(_scene, _scrollTimerType =
|
|
24794
|
+
constructor(_scene, _scrollTimerType = 3, _thresholdAutoMove = THRESHOLD_TO_AUTO_MOVE) {
|
|
24963
24795
|
this._scene = _scene;
|
|
24964
24796
|
this._scrollTimerType = _scrollTimerType;
|
|
24965
24797
|
this._thresholdAutoMove = _thresholdAutoMove;
|
|
@@ -24973,7 +24805,7 @@ var ScrollTimer = class ScrollTimer {
|
|
|
24973
24805
|
_defineProperty(this, "_scrollY", 0);
|
|
24974
24806
|
_defineProperty(this, "_scrollFunction", void 0);
|
|
24975
24807
|
}
|
|
24976
|
-
static create(scene, scrollTimerType =
|
|
24808
|
+
static create(scene, scrollTimerType = 3, padding) {
|
|
24977
24809
|
return new ScrollTimer(scene, scrollTimerType, padding);
|
|
24978
24810
|
}
|
|
24979
24811
|
get offsetX() {
|
|
@@ -25012,7 +24844,7 @@ var ScrollTimer = class ScrollTimer {
|
|
|
25012
24844
|
let x = 0;
|
|
25013
24845
|
let y = 0;
|
|
25014
24846
|
let shouldScroll = false;
|
|
25015
|
-
if (this._scrollTimerType &
|
|
24847
|
+
if (this._scrollTimerType & 1) {
|
|
25016
24848
|
if (this._moveX < leftBounding + l) {
|
|
25017
24849
|
x = this._moveX - leftBounding - l;
|
|
25018
24850
|
shouldScroll = true;
|
|
@@ -25022,7 +24854,7 @@ var ScrollTimer = class ScrollTimer {
|
|
|
25022
24854
|
shouldScroll = true;
|
|
25023
24855
|
}
|
|
25024
24856
|
}
|
|
25025
|
-
if (this._scrollTimerType &
|
|
24857
|
+
if (this._scrollTimerType & 2) {
|
|
25026
24858
|
if (this._moveY < topBounding + t) {
|
|
25027
24859
|
y = this._moveY - topBounding - t;
|
|
25028
24860
|
shouldScroll = true;
|
|
@@ -25065,42 +24897,21 @@ var ScrollTimer = class ScrollTimer {
|
|
|
25065
24897
|
|
|
25066
24898
|
//#endregion
|
|
25067
24899
|
//#region src/scene.transformer.ts
|
|
25068
|
-
var TransformerManagerType = /* @__PURE__ */ function(TransformerManagerType) {
|
|
25069
|
-
TransformerManagerType["RESIZE_LT"] = "__SpreadsheetTransformerResizeLT__";
|
|
25070
|
-
TransformerManagerType["RESIZE_CT"] = "__SpreadsheetTransformerResizeCT__";
|
|
25071
|
-
TransformerManagerType["RESIZE_RT"] = "__SpreadsheetTransformerResizeRT__";
|
|
25072
|
-
TransformerManagerType["RESIZE_LM"] = "__SpreadsheetTransformerResizeLM__";
|
|
25073
|
-
TransformerManagerType["RESIZE_RM"] = "__SpreadsheetTransformerResizeRM__";
|
|
25074
|
-
TransformerManagerType["RESIZE_LB"] = "__SpreadsheetTransformerResizeLB__";
|
|
25075
|
-
TransformerManagerType["RESIZE_CB"] = "__SpreadsheetTransformerResizeCB__";
|
|
25076
|
-
TransformerManagerType["RESIZE_RB"] = "__SpreadsheetTransformerResizeRB__";
|
|
25077
|
-
TransformerManagerType["OUTLINE"] = "__SpreadsheetTransformerOutline__";
|
|
25078
|
-
TransformerManagerType["ROTATE_LINE"] = "__SpreadsheetTransformerRotateLine__";
|
|
25079
|
-
TransformerManagerType["ROTATE"] = "__SpreadsheetTransformerRotate__";
|
|
25080
|
-
TransformerManagerType["GROUP"] = "__SpreadsheetTransformer__";
|
|
25081
|
-
return TransformerManagerType;
|
|
25082
|
-
}(TransformerManagerType || {});
|
|
25083
24900
|
const TransformerManagerTypeArray = [
|
|
25084
|
-
|
|
25085
|
-
|
|
25086
|
-
|
|
25087
|
-
|
|
25088
|
-
|
|
25089
|
-
|
|
25090
|
-
|
|
25091
|
-
|
|
24901
|
+
"__SpreadsheetTransformerResizeLT__",
|
|
24902
|
+
"__SpreadsheetTransformerResizeCT__",
|
|
24903
|
+
"__SpreadsheetTransformerResizeRT__",
|
|
24904
|
+
"__SpreadsheetTransformerResizeLM__",
|
|
24905
|
+
"__SpreadsheetTransformerResizeRM__",
|
|
24906
|
+
"__SpreadsheetTransformerResizeLB__",
|
|
24907
|
+
"__SpreadsheetTransformerResizeCB__",
|
|
24908
|
+
"__SpreadsheetTransformerResizeRB__"
|
|
25092
24909
|
];
|
|
25093
|
-
var MoveObserverType = /* @__PURE__ */ function(MoveObserverType) {
|
|
25094
|
-
MoveObserverType[MoveObserverType["MOVE_START"] = 0] = "MOVE_START";
|
|
25095
|
-
MoveObserverType[MoveObserverType["MOVING"] = 1] = "MOVING";
|
|
25096
|
-
MoveObserverType[MoveObserverType["MOVE_END"] = 2] = "MOVE_END";
|
|
25097
|
-
return MoveObserverType;
|
|
25098
|
-
}(MoveObserverType || {});
|
|
25099
24910
|
const DEFAULT_TRANSFORMER_LAYER_INDEX = 2;
|
|
25100
24911
|
const MINI_WIDTH_LIMIT = 20;
|
|
25101
24912
|
const MINI_HEIGHT_LIMIT = 20;
|
|
25102
24913
|
const DEFAULT_CONTROL_PLUS_INDEX = 5e3;
|
|
25103
|
-
const SINGLE_ACTIVE_OBJECT_TYPE_MAP = new Set([
|
|
24914
|
+
const SINGLE_ACTIVE_OBJECT_TYPE_MAP = new Set([6]);
|
|
25104
24915
|
/**
|
|
25105
24916
|
* Transformer constructor. Transformer is a special type of group that allow you transform
|
|
25106
24917
|
* primitives and shapes. Transforming tool is not changing `width` and `height` properties of nodes
|
|
@@ -25193,7 +25004,7 @@ var Transformer = class extends Disposable {
|
|
|
25193
25004
|
changeNotification() {
|
|
25194
25005
|
this._changing$.next({
|
|
25195
25006
|
objects: this._selectedObjectMap,
|
|
25196
|
-
type:
|
|
25007
|
+
type: 0
|
|
25197
25008
|
});
|
|
25198
25009
|
return this;
|
|
25199
25010
|
}
|
|
@@ -25338,14 +25149,14 @@ var Transformer = class extends Disposable {
|
|
|
25338
25149
|
this._changeStart$.next({
|
|
25339
25150
|
target: applyObject,
|
|
25340
25151
|
objects: this._selectedObjectMap,
|
|
25341
|
-
type:
|
|
25152
|
+
type: 0
|
|
25342
25153
|
});
|
|
25343
25154
|
} else {
|
|
25344
25155
|
this._copperSelectedObject = applyObject;
|
|
25345
25156
|
this._changeStart$.next({
|
|
25346
25157
|
target: applyObject,
|
|
25347
25158
|
objects: new Map([[applyObject.oKey, applyObject]]),
|
|
25348
|
-
type:
|
|
25159
|
+
type: 0
|
|
25349
25160
|
});
|
|
25350
25161
|
}
|
|
25351
25162
|
this._moveBufferSkip = false;
|
|
@@ -25366,14 +25177,14 @@ var Transformer = class extends Disposable {
|
|
|
25366
25177
|
const { offsetX, offsetY } = event;
|
|
25367
25178
|
if (!isCropper) this._changeEnd$.next({
|
|
25368
25179
|
objects: this._selectedObjectMap,
|
|
25369
|
-
type:
|
|
25180
|
+
type: 2,
|
|
25370
25181
|
offsetX,
|
|
25371
25182
|
offsetY,
|
|
25372
25183
|
event
|
|
25373
25184
|
});
|
|
25374
25185
|
else this._changeEnd$.next({
|
|
25375
25186
|
objects: new Map([[applyObject.oKey, applyObject]]),
|
|
25376
|
-
type:
|
|
25187
|
+
type: 2,
|
|
25377
25188
|
offsetX,
|
|
25378
25189
|
offsetY,
|
|
25379
25190
|
event
|
|
@@ -25457,7 +25268,7 @@ var Transformer = class extends Disposable {
|
|
|
25457
25268
|
objects: this._selectedObjectMap,
|
|
25458
25269
|
moveX: moveLeft,
|
|
25459
25270
|
moveY: moveTop,
|
|
25460
|
-
type:
|
|
25271
|
+
type: 1,
|
|
25461
25272
|
offsetX: moveOffsetX,
|
|
25462
25273
|
offsetY: moveOffsetY
|
|
25463
25274
|
});
|
|
@@ -25471,7 +25282,7 @@ var Transformer = class extends Disposable {
|
|
|
25471
25282
|
objects: new Map([[cropper.oKey, cropper]]),
|
|
25472
25283
|
moveX: moveLeft,
|
|
25473
25284
|
moveY: moveTop,
|
|
25474
|
-
type:
|
|
25285
|
+
type: 1,
|
|
25475
25286
|
offsetX: moveOffsetX,
|
|
25476
25287
|
offsetY: moveOffsetY
|
|
25477
25288
|
});
|
|
@@ -25496,7 +25307,7 @@ var Transformer = class extends Disposable {
|
|
|
25496
25307
|
});
|
|
25497
25308
|
this._changing$.next({
|
|
25498
25309
|
objects: this._selectedObjectMap,
|
|
25499
|
-
type:
|
|
25310
|
+
type: 1,
|
|
25500
25311
|
offsetX: moveOffsetX,
|
|
25501
25312
|
offsetY: moveOffsetY
|
|
25502
25313
|
});
|
|
@@ -25504,12 +25315,12 @@ var Transformer = class extends Disposable {
|
|
|
25504
25315
|
this._moveFunc(applyObject, type, x, y, keepRatio, isCropper, isGroup);
|
|
25505
25316
|
this._changing$.next({
|
|
25506
25317
|
objects: new Map([[applyObject.oKey, applyObject]]),
|
|
25507
|
-
type:
|
|
25318
|
+
type: 1,
|
|
25508
25319
|
offsetX: moveOffsetX,
|
|
25509
25320
|
offsetY: moveOffsetY
|
|
25510
25321
|
});
|
|
25511
25322
|
}
|
|
25512
|
-
if (!(keepRatio && type !==
|
|
25323
|
+
if (!(keepRatio && type !== "__SpreadsheetTransformerResizeCT__" && type !== "__SpreadsheetTransformerResizeCB__" && type !== "__SpreadsheetTransformerResizeLM__" && type !== "__SpreadsheetTransformerResizeRM__" && !isGroup)) {
|
|
25513
25324
|
this._startOffsetX = x;
|
|
25514
25325
|
this._startOffsetY = y;
|
|
25515
25326
|
}
|
|
@@ -25519,17 +25330,17 @@ var Transformer = class extends Disposable {
|
|
|
25519
25330
|
const originState = this._startStateMap.get(moveObject.oKey) || {};
|
|
25520
25331
|
let state = {};
|
|
25521
25332
|
const { moveLeft, moveTop } = this._getMovePoint(x, y, moveObject);
|
|
25522
|
-
if (keepRatio && type !==
|
|
25523
|
-
case
|
|
25333
|
+
if (keepRatio && type !== "__SpreadsheetTransformerResizeCT__" && type !== "__SpreadsheetTransformerResizeCB__" && type !== "__SpreadsheetTransformerResizeLM__" && type !== "__SpreadsheetTransformerResizeRM__" && !isGroup) switch (type) {
|
|
25334
|
+
case "__SpreadsheetTransformerResizeLT__":
|
|
25524
25335
|
state = this._resizeLeftTop(moveObject, moveLeft, moveTop, originState);
|
|
25525
25336
|
break;
|
|
25526
|
-
case
|
|
25337
|
+
case "__SpreadsheetTransformerResizeRT__":
|
|
25527
25338
|
state = this._resizeRightTop(moveObject, moveLeft, moveTop, originState);
|
|
25528
25339
|
break;
|
|
25529
|
-
case
|
|
25340
|
+
case "__SpreadsheetTransformerResizeLB__":
|
|
25530
25341
|
state = this._resizeLeftBottom(moveObject, moveLeft, moveTop, originState);
|
|
25531
25342
|
break;
|
|
25532
|
-
case
|
|
25343
|
+
case "__SpreadsheetTransformerResizeRB__":
|
|
25533
25344
|
state = this._resizeRightBottom(moveObject, moveLeft, moveTop, originState);
|
|
25534
25345
|
break;
|
|
25535
25346
|
}
|
|
@@ -25581,37 +25392,37 @@ var Transformer = class extends Disposable {
|
|
|
25581
25392
|
height
|
|
25582
25393
|
};
|
|
25583
25394
|
switch (type) {
|
|
25584
|
-
case
|
|
25395
|
+
case "__SpreadsheetTransformerResizeLT__":
|
|
25585
25396
|
state.width = width - moveLeft < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : width - moveLeft;
|
|
25586
25397
|
state.height = height - moveTop < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : height - moveTop;
|
|
25587
25398
|
state.left = left + width - state.width;
|
|
25588
25399
|
state.top = top + height - state.height;
|
|
25589
25400
|
break;
|
|
25590
|
-
case
|
|
25401
|
+
case "__SpreadsheetTransformerResizeCT__":
|
|
25591
25402
|
state.height = height - moveTop < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : height - moveTop;
|
|
25592
25403
|
state.top = top + height - state.height;
|
|
25593
25404
|
break;
|
|
25594
|
-
case
|
|
25405
|
+
case "__SpreadsheetTransformerResizeRT__":
|
|
25595
25406
|
state.width = width + moveLeft < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : width + moveLeft;
|
|
25596
25407
|
state.height = height - moveTop < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : height - moveTop;
|
|
25597
25408
|
state.top = top + height - state.height;
|
|
25598
25409
|
break;
|
|
25599
|
-
case
|
|
25410
|
+
case "__SpreadsheetTransformerResizeLM__":
|
|
25600
25411
|
state.width = width - moveLeft < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : width - moveLeft;
|
|
25601
25412
|
state.left = left + width - state.width;
|
|
25602
25413
|
break;
|
|
25603
|
-
case
|
|
25414
|
+
case "__SpreadsheetTransformerResizeRM__":
|
|
25604
25415
|
state.width = moveLeft + width < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : moveLeft + width;
|
|
25605
25416
|
break;
|
|
25606
|
-
case
|
|
25417
|
+
case "__SpreadsheetTransformerResizeLB__":
|
|
25607
25418
|
state.width = width - moveLeft < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : width - moveLeft;
|
|
25608
25419
|
state.height = height + moveTop < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : height + moveTop;
|
|
25609
25420
|
state.left = state.width <= MINI_WIDTH_LIMIT ? left : left + moveLeft;
|
|
25610
25421
|
break;
|
|
25611
|
-
case
|
|
25422
|
+
case "__SpreadsheetTransformerResizeCB__":
|
|
25612
25423
|
state.height = moveTop + height < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : moveTop + height;
|
|
25613
25424
|
break;
|
|
25614
|
-
case
|
|
25425
|
+
case "__SpreadsheetTransformerResizeRB__":
|
|
25615
25426
|
state.width = moveLeft + width < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : moveLeft + width;
|
|
25616
25427
|
state.height = moveTop + height < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : moveTop + height;
|
|
25617
25428
|
break;
|
|
@@ -25716,7 +25527,7 @@ var Transformer = class extends Disposable {
|
|
|
25716
25527
|
moveTop: moveTopFix
|
|
25717
25528
|
};
|
|
25718
25529
|
}
|
|
25719
|
-
_attachEventToAnchor(anchor, type =
|
|
25530
|
+
_attachEventToAnchor(anchor, type = "__SpreadsheetTransformerResizeLT__", applyObject) {
|
|
25720
25531
|
this.disposeWithMe(toDisposable(anchor.onPointerDown$.subscribeEvent((evt, state) => {
|
|
25721
25532
|
const { offsetX: evtOffsetX, offsetY: evtOffsetY } = evt;
|
|
25722
25533
|
this._startOffsetX = evtOffsetX;
|
|
@@ -25737,7 +25548,7 @@ var Transformer = class extends Disposable {
|
|
|
25737
25548
|
this._clearControlMap();
|
|
25738
25549
|
this._changeStart$.next({
|
|
25739
25550
|
objects: this._selectedObjectMap,
|
|
25740
|
-
type:
|
|
25551
|
+
type: 0
|
|
25741
25552
|
});
|
|
25742
25553
|
this._selectedObjectMap.forEach((moveObject) => {
|
|
25743
25554
|
const { width, height, left, top } = moveObject.getState();
|
|
@@ -25751,7 +25562,7 @@ var Transformer = class extends Disposable {
|
|
|
25751
25562
|
} else {
|
|
25752
25563
|
this._changeStart$.next({
|
|
25753
25564
|
objects: new Map([[applyObject.oKey, applyObject]]),
|
|
25754
|
-
type:
|
|
25565
|
+
type: 0
|
|
25755
25566
|
});
|
|
25756
25567
|
const { width, height, left, top } = applyObject.getState();
|
|
25757
25568
|
this._startStateMap.set(applyObject.oKey, {
|
|
@@ -25783,7 +25594,7 @@ var Transformer = class extends Disposable {
|
|
|
25783
25594
|
this._recoverySizeBoundary(Array.from(this._selectedObjectMap.values()), ancestorLeft, ancestorTop, topSceneWidth, topSceneHeight);
|
|
25784
25595
|
this._changeEnd$.next({
|
|
25785
25596
|
objects: this._selectedObjectMap,
|
|
25786
|
-
type:
|
|
25597
|
+
type: 2,
|
|
25787
25598
|
offsetX,
|
|
25788
25599
|
offsetY,
|
|
25789
25600
|
event
|
|
@@ -25792,7 +25603,7 @@ var Transformer = class extends Disposable {
|
|
|
25792
25603
|
this._recoverySizeBoundary([applyObject], ancestorLeft, ancestorTop, topSceneWidth, topSceneHeight);
|
|
25793
25604
|
this._changeEnd$.next({
|
|
25794
25605
|
objects: new Map([[applyObject.oKey, applyObject]]),
|
|
25795
|
-
type:
|
|
25606
|
+
type: 2,
|
|
25796
25607
|
offsetX,
|
|
25797
25608
|
offsetY,
|
|
25798
25609
|
event
|
|
@@ -25830,14 +25641,14 @@ var Transformer = class extends Disposable {
|
|
|
25830
25641
|
const viewportActualXY = topScene.getScrollXYInfoByViewport(Vector2.create(evtOffsetX, evtOffsetY));
|
|
25831
25642
|
this._viewportScrollX = viewportActualXY.x;
|
|
25832
25643
|
this._viewportScrollY = viewportActualXY.y;
|
|
25833
|
-
const cursor = this._getRotateAnchorCursor(
|
|
25644
|
+
const cursor = this._getRotateAnchorCursor("__SpreadsheetTransformerRotateLine__");
|
|
25834
25645
|
const { ancestorLeft, ancestorTop, width, height, angle: agentOrigin } = applyObject;
|
|
25835
25646
|
const centerX = width / 2 + ancestorLeft;
|
|
25836
25647
|
const centerY = height / 2 + ancestorTop;
|
|
25837
25648
|
this._clearControlMap();
|
|
25838
25649
|
this._changeStart$.next({
|
|
25839
25650
|
objects: this._selectedObjectMap,
|
|
25840
|
-
type:
|
|
25651
|
+
type: 0
|
|
25841
25652
|
});
|
|
25842
25653
|
this._moveBufferSkip = false;
|
|
25843
25654
|
const topScenePointerMoveSub = topScene.onPointerMove$.subscribeEvent((moveEvt) => {
|
|
@@ -25854,7 +25665,7 @@ var Transformer = class extends Disposable {
|
|
|
25854
25665
|
const { offsetX, offsetY } = event;
|
|
25855
25666
|
this._changeEnd$.next({
|
|
25856
25667
|
objects: this._selectedObjectMap,
|
|
25857
|
-
type:
|
|
25668
|
+
type: 2,
|
|
25858
25669
|
offsetX,
|
|
25859
25670
|
offsetY,
|
|
25860
25671
|
event
|
|
@@ -25876,7 +25687,7 @@ var Transformer = class extends Disposable {
|
|
|
25876
25687
|
this._changing$.next({
|
|
25877
25688
|
objects: this._selectedObjectMap,
|
|
25878
25689
|
angle,
|
|
25879
|
-
type:
|
|
25690
|
+
type: 1,
|
|
25880
25691
|
offsetX: moveOffsetX,
|
|
25881
25692
|
offsetY: moveOffsetY
|
|
25882
25693
|
});
|
|
@@ -25890,35 +25701,35 @@ var Transformer = class extends Disposable {
|
|
|
25890
25701
|
};
|
|
25891
25702
|
}
|
|
25892
25703
|
_getRotateAnchorCursor(type) {
|
|
25893
|
-
let cursor =
|
|
25704
|
+
let cursor = "nw-resize";
|
|
25894
25705
|
switch (type) {
|
|
25895
|
-
case
|
|
25896
|
-
cursor =
|
|
25706
|
+
case "__SpreadsheetTransformerRotate__":
|
|
25707
|
+
cursor = "move";
|
|
25897
25708
|
break;
|
|
25898
|
-
case
|
|
25899
|
-
cursor =
|
|
25709
|
+
case "__SpreadsheetTransformerRotateLine__":
|
|
25710
|
+
cursor = "move";
|
|
25900
25711
|
break;
|
|
25901
|
-
case
|
|
25902
|
-
case
|
|
25903
|
-
cursor =
|
|
25712
|
+
case "__SpreadsheetTransformerResizeLT__": break;
|
|
25713
|
+
case "__SpreadsheetTransformerResizeCT__":
|
|
25714
|
+
cursor = "n-resize";
|
|
25904
25715
|
break;
|
|
25905
|
-
case
|
|
25906
|
-
cursor =
|
|
25716
|
+
case "__SpreadsheetTransformerResizeRT__":
|
|
25717
|
+
cursor = "ne-resize";
|
|
25907
25718
|
break;
|
|
25908
|
-
case
|
|
25909
|
-
cursor =
|
|
25719
|
+
case "__SpreadsheetTransformerResizeLM__":
|
|
25720
|
+
cursor = "w-resize";
|
|
25910
25721
|
break;
|
|
25911
|
-
case
|
|
25912
|
-
cursor =
|
|
25722
|
+
case "__SpreadsheetTransformerResizeRM__":
|
|
25723
|
+
cursor = "e-resize";
|
|
25913
25724
|
break;
|
|
25914
|
-
case
|
|
25915
|
-
cursor =
|
|
25725
|
+
case "__SpreadsheetTransformerResizeLB__":
|
|
25726
|
+
cursor = "sw-resize";
|
|
25916
25727
|
break;
|
|
25917
|
-
case
|
|
25918
|
-
cursor =
|
|
25728
|
+
case "__SpreadsheetTransformerResizeCB__":
|
|
25729
|
+
cursor = "s-resize";
|
|
25919
25730
|
break;
|
|
25920
|
-
case
|
|
25921
|
-
cursor =
|
|
25731
|
+
case "__SpreadsheetTransformerResizeRB__":
|
|
25732
|
+
cursor = "se-resize";
|
|
25922
25733
|
break;
|
|
25923
25734
|
}
|
|
25924
25735
|
return cursor;
|
|
@@ -25930,35 +25741,35 @@ var Transformer = class extends Disposable {
|
|
|
25930
25741
|
const longEdge = anchorSize;
|
|
25931
25742
|
const shortEdge = anchorSize / 4;
|
|
25932
25743
|
switch (type) {
|
|
25933
|
-
case
|
|
25744
|
+
case "__SpreadsheetTransformerResizeLT__":
|
|
25934
25745
|
left += -borderSpacing - borderStrokeWidth;
|
|
25935
25746
|
top += -borderSpacing - borderStrokeWidth;
|
|
25936
25747
|
break;
|
|
25937
|
-
case
|
|
25748
|
+
case "__SpreadsheetTransformerResizeCT__":
|
|
25938
25749
|
left += width / 2 - longEdge / 2;
|
|
25939
25750
|
top += -borderSpacing - borderStrokeWidth;
|
|
25940
25751
|
break;
|
|
25941
|
-
case
|
|
25752
|
+
case "__SpreadsheetTransformerResizeRT__":
|
|
25942
25753
|
left += width + borderSpacing - borderStrokeWidth - longEdge;
|
|
25943
25754
|
top += -borderSpacing - borderStrokeWidth;
|
|
25944
25755
|
break;
|
|
25945
|
-
case
|
|
25756
|
+
case "__SpreadsheetTransformerResizeLM__":
|
|
25946
25757
|
left += borderSpacing - borderStrokeWidth;
|
|
25947
25758
|
top += height / 2 - longEdge / 2;
|
|
25948
25759
|
break;
|
|
25949
|
-
case
|
|
25760
|
+
case "__SpreadsheetTransformerResizeRM__":
|
|
25950
25761
|
left += width + borderSpacing - borderStrokeWidth - shortEdge;
|
|
25951
25762
|
top += height / 2 - longEdge / 2;
|
|
25952
25763
|
break;
|
|
25953
|
-
case
|
|
25764
|
+
case "__SpreadsheetTransformerResizeLB__":
|
|
25954
25765
|
left += -this.borderSpacing - borderStrokeWidth;
|
|
25955
25766
|
top += height + borderSpacing - borderStrokeWidth - longEdge;
|
|
25956
25767
|
break;
|
|
25957
|
-
case
|
|
25768
|
+
case "__SpreadsheetTransformerResizeCB__":
|
|
25958
25769
|
left += width / 2 - longEdge / 2;
|
|
25959
25770
|
top += height + borderSpacing - borderStrokeWidth - shortEdge;
|
|
25960
25771
|
break;
|
|
25961
|
-
case
|
|
25772
|
+
case "__SpreadsheetTransformerResizeRB__":
|
|
25962
25773
|
left += width + borderSpacing - borderStrokeWidth - longEdge;
|
|
25963
25774
|
top += height + borderSpacing - borderStrokeWidth - longEdge;
|
|
25964
25775
|
break;
|
|
@@ -25973,43 +25784,43 @@ var Transformer = class extends Disposable {
|
|
|
25973
25784
|
let left = -anchorSize / 2;
|
|
25974
25785
|
let top = -anchorSize / 2;
|
|
25975
25786
|
switch (type) {
|
|
25976
|
-
case
|
|
25787
|
+
case "__SpreadsheetTransformerRotate__":
|
|
25977
25788
|
left = width / 2 - rotateSize / 2;
|
|
25978
25789
|
top = -rotateAnchorOffset - borderSpacing - borderStrokeWidth * 2 - rotateSize;
|
|
25979
25790
|
break;
|
|
25980
|
-
case
|
|
25791
|
+
case "__SpreadsheetTransformerRotateLine__":
|
|
25981
25792
|
left = width / 2;
|
|
25982
25793
|
top = -rotateAnchorOffset - borderSpacing - borderStrokeWidth;
|
|
25983
25794
|
break;
|
|
25984
|
-
case
|
|
25795
|
+
case "__SpreadsheetTransformerResizeLT__":
|
|
25985
25796
|
left += -borderSpacing - borderStrokeWidth;
|
|
25986
25797
|
top += -borderSpacing - borderStrokeWidth;
|
|
25987
25798
|
break;
|
|
25988
|
-
case
|
|
25799
|
+
case "__SpreadsheetTransformerResizeCT__":
|
|
25989
25800
|
left += width / 2;
|
|
25990
25801
|
top += -borderSpacing - borderStrokeWidth;
|
|
25991
25802
|
break;
|
|
25992
|
-
case
|
|
25803
|
+
case "__SpreadsheetTransformerResizeRT__":
|
|
25993
25804
|
left += width + borderSpacing - borderStrokeWidth;
|
|
25994
25805
|
top += -borderSpacing - borderStrokeWidth;
|
|
25995
25806
|
break;
|
|
25996
|
-
case
|
|
25807
|
+
case "__SpreadsheetTransformerResizeLM__":
|
|
25997
25808
|
left += borderSpacing - borderStrokeWidth;
|
|
25998
25809
|
top += height / 2;
|
|
25999
25810
|
break;
|
|
26000
|
-
case
|
|
25811
|
+
case "__SpreadsheetTransformerResizeRM__":
|
|
26001
25812
|
left += width + borderSpacing - borderStrokeWidth;
|
|
26002
25813
|
top += height / 2;
|
|
26003
25814
|
break;
|
|
26004
|
-
case
|
|
25815
|
+
case "__SpreadsheetTransformerResizeLB__":
|
|
26005
25816
|
left += -this.borderSpacing - borderStrokeWidth;
|
|
26006
25817
|
top += height + borderSpacing - borderStrokeWidth;
|
|
26007
25818
|
break;
|
|
26008
|
-
case
|
|
25819
|
+
case "__SpreadsheetTransformerResizeCB__":
|
|
26009
25820
|
left += width / 2;
|
|
26010
25821
|
top += height + borderSpacing - borderStrokeWidth;
|
|
26011
25822
|
break;
|
|
26012
|
-
case
|
|
25823
|
+
case "__SpreadsheetTransformerResizeRB__":
|
|
26013
25824
|
left += width + borderSpacing - borderStrokeWidth;
|
|
26014
25825
|
top += height + borderSpacing - borderStrokeWidth;
|
|
26015
25826
|
break;
|
|
@@ -26035,7 +25846,7 @@ var Transformer = class extends Disposable {
|
|
|
26035
25846
|
left,
|
|
26036
25847
|
top
|
|
26037
25848
|
});
|
|
26038
|
-
this._attachHover(anchor, cursor,
|
|
25849
|
+
this._attachHover(anchor, cursor, "default");
|
|
26039
25850
|
return anchor;
|
|
26040
25851
|
}
|
|
26041
25852
|
_createCopperResizeAnchor(type, applyObject, zIndex) {
|
|
@@ -26057,36 +25868,36 @@ var Transformer = class extends Disposable {
|
|
|
26057
25868
|
};
|
|
26058
25869
|
const longEdge = anchorSize;
|
|
26059
25870
|
const shortEdge = anchorSize / 4;
|
|
26060
|
-
if (cursor ===
|
|
25871
|
+
if (cursor === "e-resize") {
|
|
26061
25872
|
config.width = shortEdge;
|
|
26062
25873
|
config.height = longEdge;
|
|
26063
25874
|
anchor = new Rect(oKey, config);
|
|
26064
|
-
} else if (cursor ===
|
|
25875
|
+
} else if (cursor === "w-resize") {
|
|
26065
25876
|
config.width = shortEdge;
|
|
26066
25877
|
config.height = longEdge;
|
|
26067
25878
|
anchor = new Rect(oKey, config);
|
|
26068
|
-
} else if (cursor ===
|
|
25879
|
+
} else if (cursor === "n-resize") {
|
|
26069
25880
|
config.width = longEdge;
|
|
26070
25881
|
config.height = shortEdge;
|
|
26071
25882
|
anchor = new Rect(oKey, config);
|
|
26072
|
-
} else if (cursor ===
|
|
25883
|
+
} else if (cursor === "s-resize") {
|
|
26073
25884
|
config.width = longEdge;
|
|
26074
25885
|
config.height = shortEdge;
|
|
26075
25886
|
anchor = new Rect(oKey, config);
|
|
26076
|
-
} else if (cursor ===
|
|
25887
|
+
} else if (cursor === "ne-resize") {
|
|
26077
25888
|
config.pointsGroup = this._getNorthEastPoints(longEdge, shortEdge);
|
|
26078
25889
|
anchor = new RegularPolygon(oKey, config);
|
|
26079
|
-
} else if (cursor ===
|
|
25890
|
+
} else if (cursor === "nw-resize") {
|
|
26080
25891
|
config.pointsGroup = this._getNorthWestPoints(longEdge, shortEdge);
|
|
26081
25892
|
anchor = new RegularPolygon(oKey, config);
|
|
26082
|
-
} else if (cursor ===
|
|
25893
|
+
} else if (cursor === "se-resize") {
|
|
26083
25894
|
config.pointsGroup = this._getSouthEastPoints(longEdge, shortEdge);
|
|
26084
25895
|
anchor = new RegularPolygon(oKey, config);
|
|
26085
|
-
} else if (cursor ===
|
|
25896
|
+
} else if (cursor === "sw-resize") {
|
|
26086
25897
|
config.pointsGroup = this._getSouthWestPoints(longEdge, shortEdge);
|
|
26087
25898
|
anchor = new RegularPolygon(oKey, config);
|
|
26088
25899
|
}
|
|
26089
|
-
this._attachHover(anchor, cursor,
|
|
25900
|
+
this._attachHover(anchor, cursor, "default");
|
|
26090
25901
|
return anchor;
|
|
26091
25902
|
}
|
|
26092
25903
|
_getNorthEastPoints(longEdge, shortEdge) {
|
|
@@ -26213,17 +26024,17 @@ var Transformer = class extends Disposable {
|
|
|
26213
26024
|
]];
|
|
26214
26025
|
}
|
|
26215
26026
|
_checkTransformerType(oKey) {
|
|
26216
|
-
if (oKey.indexOf(
|
|
26217
|
-
if (oKey.indexOf(
|
|
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(
|
|
26027
|
+
if (oKey.indexOf("__SpreadsheetTransformerOutline__") > -1) return "__SpreadsheetTransformerOutline__";
|
|
26028
|
+
if (oKey.indexOf("__SpreadsheetTransformerRotate__") > -1) return "__SpreadsheetTransformerRotate__";
|
|
26029
|
+
if (oKey.indexOf("__SpreadsheetTransformerRotateLine__") > -1) return "__SpreadsheetTransformerRotateLine__";
|
|
26030
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeLT__") > -1) return "__SpreadsheetTransformerResizeLT__";
|
|
26031
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeCT__") > -1) return "__SpreadsheetTransformerResizeCT__";
|
|
26032
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeRT__") > -1) return "__SpreadsheetTransformerResizeRT__";
|
|
26033
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeLM__") > -1) return "__SpreadsheetTransformerResizeLM__";
|
|
26034
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeRM__") > -1) return "__SpreadsheetTransformerResizeRM__";
|
|
26035
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeLB__") > -1) return "__SpreadsheetTransformerResizeLB__";
|
|
26036
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeCB__") > -1) return "__SpreadsheetTransformerResizeCB__";
|
|
26037
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeRB__") > -1) return "__SpreadsheetTransformerResizeRB__";
|
|
26227
26038
|
}
|
|
26228
26039
|
_updateControlIterator(func) {
|
|
26229
26040
|
this._transformerControlMap.forEach((control, oKey) => {
|
|
@@ -26288,7 +26099,7 @@ var Transformer = class extends Disposable {
|
|
|
26288
26099
|
const layerIndex = applyObject.getLayerIndex() || DEFAULT_TRANSFORMER_LAYER_INDEX;
|
|
26289
26100
|
const groupElements = [];
|
|
26290
26101
|
if (borderEnabled && !isCropper) {
|
|
26291
|
-
const outline = new Rect(
|
|
26102
|
+
const outline = new Rect(`__SpreadsheetTransformerOutline___${zIndex}`, {
|
|
26292
26103
|
zIndex: zIndex - 1,
|
|
26293
26104
|
evented: false,
|
|
26294
26105
|
strokeWidth: borderStrokeWidth,
|
|
@@ -26298,9 +26109,9 @@ var Transformer = class extends Disposable {
|
|
|
26298
26109
|
groupElements.push(outline);
|
|
26299
26110
|
}
|
|
26300
26111
|
if (resizeEnabled && !isCropper) {
|
|
26301
|
-
const { left: lineLeft, top: lineTop } = this._getRotateAnchorPosition(
|
|
26112
|
+
const { left: lineLeft, top: lineTop } = this._getRotateAnchorPosition("__SpreadsheetTransformerRotateLine__", height, width, applyObject);
|
|
26302
26113
|
if (rotateEnabled) {
|
|
26303
|
-
const rotateLine = new Rect(
|
|
26114
|
+
const rotateLine = new Rect(`__SpreadsheetTransformerRotateLine___${zIndex}`, {
|
|
26304
26115
|
zIndex: zIndex - 1,
|
|
26305
26116
|
evented: false,
|
|
26306
26117
|
left: lineLeft,
|
|
@@ -26310,9 +26121,9 @@ var Transformer = class extends Disposable {
|
|
|
26310
26121
|
strokeWidth: borderStrokeWidth,
|
|
26311
26122
|
stroke: borderStroke
|
|
26312
26123
|
});
|
|
26313
|
-
const { left: rotateLeft, top: rotateTop } = this._getRotateAnchorPosition(
|
|
26314
|
-
const cursor = this._getRotateAnchorCursor(
|
|
26315
|
-
const rotate = new Rect(
|
|
26124
|
+
const { left: rotateLeft, top: rotateTop } = this._getRotateAnchorPosition("__SpreadsheetTransformerRotate__", height, width, applyObject);
|
|
26125
|
+
const cursor = this._getRotateAnchorCursor("__SpreadsheetTransformerRotate__");
|
|
26126
|
+
const rotate = new Rect(`__SpreadsheetTransformerRotate___${zIndex}`, {
|
|
26316
26127
|
zIndex: zIndex - 1,
|
|
26317
26128
|
left: rotateLeft,
|
|
26318
26129
|
top: rotateTop,
|
|
@@ -26323,7 +26134,7 @@ var Transformer = class extends Disposable {
|
|
|
26323
26134
|
stroke: borderStroke
|
|
26324
26135
|
});
|
|
26325
26136
|
this._attachEventToRotate(rotate, applyObject);
|
|
26326
|
-
this._attachHover(rotate, cursor,
|
|
26137
|
+
this._attachHover(rotate, cursor, "default");
|
|
26327
26138
|
groupElements.push(rotateLine, rotate);
|
|
26328
26139
|
}
|
|
26329
26140
|
}
|
|
@@ -26336,7 +26147,7 @@ var Transformer = class extends Disposable {
|
|
|
26336
26147
|
this._attachEventToAnchor(anchor, type, applyObject);
|
|
26337
26148
|
groupElements.push(anchor);
|
|
26338
26149
|
}
|
|
26339
|
-
const transformerControl = new Group(
|
|
26150
|
+
const transformerControl = new Group(`__SpreadsheetTransformer___${oKey}`, ...groupElements);
|
|
26340
26151
|
transformerControl.zIndex = zIndex;
|
|
26341
26152
|
transformerControl.evented = false;
|
|
26342
26153
|
transformerControl.openSelfSizeMode();
|
|
@@ -26364,7 +26175,7 @@ var Transformer = class extends Disposable {
|
|
|
26364
26175
|
this._changeStart$.next({
|
|
26365
26176
|
target: applyObject,
|
|
26366
26177
|
objects: this._selectedObjectMap,
|
|
26367
|
-
type:
|
|
26178
|
+
type: 0
|
|
26368
26179
|
});
|
|
26369
26180
|
}
|
|
26370
26181
|
_updateActiveObjectList(applyObject, evt) {
|
|
@@ -26414,8 +26225,8 @@ var Scene = class extends Disposable {
|
|
|
26414
26225
|
_defineProperty(this, "_evented", true);
|
|
26415
26226
|
_defineProperty(this, "_layers", []);
|
|
26416
26227
|
_defineProperty(this, "_viewports", []);
|
|
26417
|
-
_defineProperty(this, "_cursor",
|
|
26418
|
-
_defineProperty(this, "_defaultCursor",
|
|
26228
|
+
_defineProperty(this, "_cursor", "default");
|
|
26229
|
+
_defineProperty(this, "_defaultCursor", "default");
|
|
26419
26230
|
_defineProperty(this, "_addObject$", new BehaviorSubject(this));
|
|
26420
26231
|
_defineProperty(this, "addObject$", this._addObject$.asObservable());
|
|
26421
26232
|
_defineProperty(this, "onTransformChange$", new EventSubject());
|
|
@@ -26461,18 +26272,18 @@ var Scene = class extends Disposable {
|
|
|
26461
26272
|
_defineProperty(this, "_capturedObject", null);
|
|
26462
26273
|
this._sceneKey = sceneKey;
|
|
26463
26274
|
if (state) this.transformByState(state);
|
|
26464
|
-
if (this._parent.classType ===
|
|
26275
|
+
if (this._parent.classType === "Engine") {
|
|
26465
26276
|
const parent = this._parent;
|
|
26466
26277
|
parent.addScene(this);
|
|
26467
26278
|
if (!parent.hasActiveScene()) parent.setActiveScene(sceneKey);
|
|
26468
26279
|
this._inputManager = new InputManager(this);
|
|
26469
|
-
} else if (this._parent.classType ===
|
|
26280
|
+
} else if (this._parent.classType === "SceneViewer") this._parent.addSubScene(this);
|
|
26470
26281
|
this.disposeWithMe(toDisposable((_this$_parent = this._parent) === null || _this$_parent === void 0 ? void 0 : _this$_parent.onTransformChange$.subscribeEvent((_change) => {
|
|
26471
26282
|
this._transformHandler();
|
|
26472
26283
|
})));
|
|
26473
26284
|
}
|
|
26474
26285
|
get classType() {
|
|
26475
|
-
return
|
|
26286
|
+
return "Scene";
|
|
26476
26287
|
}
|
|
26477
26288
|
get transform() {
|
|
26478
26289
|
return this._transform;
|
|
@@ -26516,7 +26327,7 @@ var Scene = class extends Disposable {
|
|
|
26516
26327
|
get ancestorScaleX() {
|
|
26517
26328
|
const p = this.getParent();
|
|
26518
26329
|
let pScale = 1;
|
|
26519
|
-
if (p.classType ===
|
|
26330
|
+
if (p.classType === "SceneViewer") pScale = p.ancestorScaleX;
|
|
26520
26331
|
return this.scaleX * pScale;
|
|
26521
26332
|
}
|
|
26522
26333
|
/**
|
|
@@ -26525,7 +26336,7 @@ var Scene = class extends Disposable {
|
|
|
26525
26336
|
get ancestorScaleY() {
|
|
26526
26337
|
const p = this.getParent();
|
|
26527
26338
|
let pScale = 1;
|
|
26528
|
-
if (p.classType ===
|
|
26339
|
+
if (p.classType === "SceneViewer") pScale = p.ancestorScaleY;
|
|
26529
26340
|
return this.scaleY * pScale;
|
|
26530
26341
|
}
|
|
26531
26342
|
getAncestorScale() {
|
|
@@ -26537,13 +26348,13 @@ var Scene = class extends Disposable {
|
|
|
26537
26348
|
get ancestorLeft() {
|
|
26538
26349
|
const p = this.getParent();
|
|
26539
26350
|
let pOffsetX = 0;
|
|
26540
|
-
if (p.classType ===
|
|
26351
|
+
if (p.classType === "SceneViewer") pOffsetX = p.ancestorLeft;
|
|
26541
26352
|
return pOffsetX;
|
|
26542
26353
|
}
|
|
26543
26354
|
get ancestorTop() {
|
|
26544
26355
|
const p = this.getParent();
|
|
26545
26356
|
let pOffsetY = 0;
|
|
26546
|
-
if (p.classType ===
|
|
26357
|
+
if (p.classType === "SceneViewer") pOffsetY = p.ancestorTop;
|
|
26547
26358
|
return pOffsetY;
|
|
26548
26359
|
}
|
|
26549
26360
|
set cursor(val) {
|
|
@@ -26551,7 +26362,7 @@ var Scene = class extends Disposable {
|
|
|
26551
26362
|
}
|
|
26552
26363
|
attachControl(options) {
|
|
26553
26364
|
var _this$_inputManager;
|
|
26554
|
-
if (!(this._parent.classType ===
|
|
26365
|
+
if (!(this._parent.classType === "Engine")) return;
|
|
26555
26366
|
(_this$_inputManager = this._inputManager) === null || _this$_inputManager === void 0 || _this$_inputManager.attachControl(options);
|
|
26556
26367
|
return this;
|
|
26557
26368
|
}
|
|
@@ -26564,7 +26375,7 @@ var Scene = class extends Disposable {
|
|
|
26564
26375
|
this._layers.forEach((layer) => {
|
|
26565
26376
|
layer.makeDirty(state);
|
|
26566
26377
|
});
|
|
26567
|
-
if (this._parent.classType ===
|
|
26378
|
+
if (this._parent.classType === "SceneViewer") {
|
|
26568
26379
|
var _this$_parent2;
|
|
26569
26380
|
(_this$_parent2 = this._parent) === null || _this$_parent2 === void 0 || _this$_parent2.makeDirty(state);
|
|
26570
26381
|
}
|
|
@@ -26618,7 +26429,7 @@ var Scene = class extends Disposable {
|
|
|
26618
26429
|
if (height !== void 0) this.height = height;
|
|
26619
26430
|
this._transformHandler();
|
|
26620
26431
|
this.onTransformChange$.emitEvent({
|
|
26621
|
-
type:
|
|
26432
|
+
type: 1,
|
|
26622
26433
|
value: {
|
|
26623
26434
|
width: this.width,
|
|
26624
26435
|
height: this.height
|
|
@@ -26651,7 +26462,7 @@ var Scene = class extends Disposable {
|
|
|
26651
26462
|
this.setScaleValueOnly(scaleX || 1, scaleY || 1);
|
|
26652
26463
|
this._transformHandler();
|
|
26653
26464
|
this.onTransformChange$.emitEvent({
|
|
26654
|
-
type:
|
|
26465
|
+
type: 2,
|
|
26655
26466
|
value: {
|
|
26656
26467
|
scaleX: this.scaleX,
|
|
26657
26468
|
scaleY: this.scaleY
|
|
@@ -26675,7 +26486,7 @@ var Scene = class extends Disposable {
|
|
|
26675
26486
|
this.scaleY = precisionTo(this.scaleY, 1);
|
|
26676
26487
|
this._transformHandler();
|
|
26677
26488
|
this.onTransformChange$.emitEvent({
|
|
26678
|
-
type:
|
|
26489
|
+
type: 2,
|
|
26679
26490
|
value: {
|
|
26680
26491
|
scaleX: this.scaleX,
|
|
26681
26492
|
scaleY: this.scaleY
|
|
@@ -26703,7 +26514,7 @@ var Scene = class extends Disposable {
|
|
|
26703
26514
|
});
|
|
26704
26515
|
this._transformHandler();
|
|
26705
26516
|
this.onTransformChange$.emitEvent({
|
|
26706
|
-
type:
|
|
26517
|
+
type: 5,
|
|
26707
26518
|
value: state,
|
|
26708
26519
|
preValue: preKeys
|
|
26709
26520
|
});
|
|
@@ -26712,10 +26523,10 @@ var Scene = class extends Disposable {
|
|
|
26712
26523
|
return this._parent;
|
|
26713
26524
|
}
|
|
26714
26525
|
getEngine() {
|
|
26715
|
-
if (this._parent.classType ===
|
|
26526
|
+
if (this._parent.classType === "Engine") return this._parent;
|
|
26716
26527
|
let parent = this._parent;
|
|
26717
26528
|
while (parent) {
|
|
26718
|
-
if (parent.classType ===
|
|
26529
|
+
if (parent.classType === "Engine") return parent;
|
|
26719
26530
|
parent = parent === null || parent === void 0 ? void 0 : parent.getParent();
|
|
26720
26531
|
}
|
|
26721
26532
|
return null;
|
|
@@ -27002,18 +26813,18 @@ var Scene = class extends Disposable {
|
|
|
27002
26813
|
let parent = this.getParent();
|
|
27003
26814
|
const parentList = [];
|
|
27004
26815
|
while (parent) {
|
|
27005
|
-
if (parent.classType ===
|
|
26816
|
+
if (parent.classType === "Scene" || parent.classType === "SceneViewer") parentList.push(parent);
|
|
27006
26817
|
parent = (parent === null || parent === void 0 ? void 0 : parent.getParent) && (parent === null || parent === void 0 ? void 0 : parent.getParent());
|
|
27007
26818
|
}
|
|
27008
26819
|
parentList.reverse();
|
|
27009
|
-
for (const parent of parentList) if (parent.classType ===
|
|
26820
|
+
for (const parent of parentList) if (parent.classType === "Scene") {
|
|
27010
26821
|
const viewPort = parent.getActiveViewportByCoord(coord);
|
|
27011
26822
|
if (viewPort) {
|
|
27012
26823
|
const actualX = viewPort.viewportScrollX || 0;
|
|
27013
26824
|
const actualY = viewPort.viewportScrollY || 0;
|
|
27014
26825
|
coord = coord.addByPoint(actualX, actualY);
|
|
27015
26826
|
}
|
|
27016
|
-
} else if (parent.classType ===
|
|
26827
|
+
} else if (parent.classType === "SceneViewer") coord = parent.transform.clone().invert().applyPoint(coord);
|
|
27017
26828
|
return coord;
|
|
27018
26829
|
}
|
|
27019
26830
|
clearLayer() {
|
|
@@ -27091,16 +26902,16 @@ var Scene = class extends Disposable {
|
|
|
27091
26902
|
for (let i = 0; i < objectLength; i++) {
|
|
27092
26903
|
var _testObject$parent;
|
|
27093
26904
|
const testObject = objectOrder[i];
|
|
27094
|
-
if (!testObject.visible || !testObject.evented || testObject.isInGroup && ((_testObject$parent = testObject.parent) === null || _testObject$parent === void 0 ? void 0 : _testObject$parent.classType) ===
|
|
26905
|
+
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;
|
|
27095
26906
|
const svCoord = vecFromSheetContent;
|
|
27096
26907
|
if (testObject.isHit(svCoord)) {
|
|
27097
|
-
if (testObject.classType ===
|
|
26908
|
+
if (testObject.classType === "SceneViewer") {
|
|
27098
26909
|
const pickedObject = testObject.pick(svCoord);
|
|
27099
26910
|
if (pickedObject) isPickedObject = pickedObject;
|
|
27100
26911
|
else isPickedObject = testObject.getActiveSubScene();
|
|
27101
26912
|
} else isPickedObject = testObject;
|
|
27102
26913
|
break;
|
|
27103
|
-
} else if (testObject.classType ===
|
|
26914
|
+
} else if (testObject.classType === "SceneViewer" && testObject.allowSelectedClipElement()) {
|
|
27104
26915
|
const pickedObject = testObject.pick(svCoord);
|
|
27105
26916
|
if (pickedObject) {
|
|
27106
26917
|
isPickedObject = pickedObject;
|
|
@@ -27108,12 +26919,12 @@ var Scene = class extends Disposable {
|
|
|
27108
26919
|
}
|
|
27109
26920
|
}
|
|
27110
26921
|
}
|
|
27111
|
-
if (!isPickedObject && this._parent.classType ===
|
|
26922
|
+
if (!isPickedObject && this._parent.classType === "Engine") return this;
|
|
27112
26923
|
return isPickedObject;
|
|
27113
26924
|
}
|
|
27114
26925
|
triggerPointerUp(evt) {
|
|
27115
26926
|
var _this$onPointerUp$$em;
|
|
27116
|
-
if (!((_this$onPointerUp$$em = this.onPointerUp$.emitEvent(evt)) === null || _this$onPointerUp$$em === void 0 ? void 0 : _this$onPointerUp$$em.stopPropagation) && this._parent.classType ===
|
|
26927
|
+
if (!((_this$onPointerUp$$em = this.onPointerUp$.emitEvent(evt)) === null || _this$onPointerUp$$em === void 0 ? void 0 : _this$onPointerUp$$em.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27117
26928
|
var _this$_parent3;
|
|
27118
26929
|
(_this$_parent3 = this._parent) === null || _this$_parent3 === void 0 || _this$_parent3.triggerPointerUp(evt);
|
|
27119
26930
|
return false;
|
|
@@ -27122,7 +26933,7 @@ var Scene = class extends Disposable {
|
|
|
27122
26933
|
}
|
|
27123
26934
|
triggerMouseWheel(evt) {
|
|
27124
26935
|
var _this$onMouseWheel$$e;
|
|
27125
|
-
if (!((_this$onMouseWheel$$e = this.onMouseWheel$.emitEvent(evt)) === null || _this$onMouseWheel$$e === void 0 ? void 0 : _this$onMouseWheel$$e.stopPropagation) && this._parent.classType ===
|
|
26936
|
+
if (!((_this$onMouseWheel$$e = this.onMouseWheel$.emitEvent(evt)) === null || _this$onMouseWheel$$e === void 0 ? void 0 : _this$onMouseWheel$$e.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27126
26937
|
var _this$_parent4;
|
|
27127
26938
|
(_this$_parent4 = this._parent) === null || _this$_parent4 === void 0 || _this$_parent4.triggerMouseWheel(evt);
|
|
27128
26939
|
return false;
|
|
@@ -27131,7 +26942,7 @@ var Scene = class extends Disposable {
|
|
|
27131
26942
|
}
|
|
27132
26943
|
triggerSingleClick(evt) {
|
|
27133
26944
|
var _this$onSingleClick$$;
|
|
27134
|
-
if (!((_this$onSingleClick$$ = this.onSingleClick$.emitEvent(evt)) === null || _this$onSingleClick$$ === void 0 ? void 0 : _this$onSingleClick$$.stopPropagation) && this._parent.classType ===
|
|
26945
|
+
if (!((_this$onSingleClick$$ = this.onSingleClick$.emitEvent(evt)) === null || _this$onSingleClick$$ === void 0 ? void 0 : _this$onSingleClick$$.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27135
26946
|
var _this$_parent5;
|
|
27136
26947
|
(_this$_parent5 = this._parent) === null || _this$_parent5 === void 0 || _this$_parent5.triggerSingleClick(evt);
|
|
27137
26948
|
return false;
|
|
@@ -27140,7 +26951,7 @@ var Scene = class extends Disposable {
|
|
|
27140
26951
|
}
|
|
27141
26952
|
triggerClick(evt) {
|
|
27142
26953
|
var _this$onClick$$emitEv;
|
|
27143
|
-
if (!((_this$onClick$$emitEv = this.onClick$.emitEvent(evt)) === null || _this$onClick$$emitEv === void 0 ? void 0 : _this$onClick$$emitEv.stopPropagation) && this._parent.classType ===
|
|
26954
|
+
if (!((_this$onClick$$emitEv = this.onClick$.emitEvent(evt)) === null || _this$onClick$$emitEv === void 0 ? void 0 : _this$onClick$$emitEv.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27144
26955
|
var _this$_parent6;
|
|
27145
26956
|
(_this$_parent6 = this._parent) === null || _this$_parent6 === void 0 || _this$_parent6.triggerClick(evt);
|
|
27146
26957
|
return false;
|
|
@@ -27149,7 +26960,7 @@ var Scene = class extends Disposable {
|
|
|
27149
26960
|
}
|
|
27150
26961
|
triggerDblclick(evt) {
|
|
27151
26962
|
var _this$onDblclick$$emi;
|
|
27152
|
-
if (!((_this$onDblclick$$emi = this.onDblclick$.emitEvent(evt)) === null || _this$onDblclick$$emi === void 0 ? void 0 : _this$onDblclick$$emi.stopPropagation) && this._parent.classType ===
|
|
26963
|
+
if (!((_this$onDblclick$$emi = this.onDblclick$.emitEvent(evt)) === null || _this$onDblclick$$emi === void 0 ? void 0 : _this$onDblclick$$emi.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27153
26964
|
var _this$_parent7;
|
|
27154
26965
|
(_this$_parent7 = this._parent) === null || _this$_parent7 === void 0 || _this$_parent7.triggerDblclick(evt);
|
|
27155
26966
|
return false;
|
|
@@ -27158,7 +26969,7 @@ var Scene = class extends Disposable {
|
|
|
27158
26969
|
}
|
|
27159
26970
|
triggerTripleClick(evt) {
|
|
27160
26971
|
var _this$onTripleClick$$;
|
|
27161
|
-
if (!((_this$onTripleClick$$ = this.onTripleClick$.emitEvent(evt)) === null || _this$onTripleClick$$ === void 0 ? void 0 : _this$onTripleClick$$.stopPropagation) && this._parent.classType ===
|
|
26972
|
+
if (!((_this$onTripleClick$$ = this.onTripleClick$.emitEvent(evt)) === null || _this$onTripleClick$$ === void 0 ? void 0 : _this$onTripleClick$$.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27162
26973
|
var _this$_parent8;
|
|
27163
26974
|
(_this$_parent8 = this._parent) === null || _this$_parent8 === void 0 || _this$_parent8.triggerTripleClick(evt);
|
|
27164
26975
|
return false;
|
|
@@ -27167,7 +26978,7 @@ var Scene = class extends Disposable {
|
|
|
27167
26978
|
}
|
|
27168
26979
|
triggerPointerMove(evt) {
|
|
27169
26980
|
var _this$onPointerMove$$;
|
|
27170
|
-
if (!((_this$onPointerMove$$ = this.onPointerMove$.emitEvent(evt)) === null || _this$onPointerMove$$ === void 0 ? void 0 : _this$onPointerMove$$.stopPropagation) && this._parent.classType ===
|
|
26981
|
+
if (!((_this$onPointerMove$$ = this.onPointerMove$.emitEvent(evt)) === null || _this$onPointerMove$$ === void 0 ? void 0 : _this$onPointerMove$$.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27171
26982
|
var _this$_parent9;
|
|
27172
26983
|
(_this$_parent9 = this._parent) === null || _this$_parent9 === void 0 || _this$_parent9.triggerPointerMove(evt);
|
|
27173
26984
|
return false;
|
|
@@ -27176,7 +26987,7 @@ var Scene = class extends Disposable {
|
|
|
27176
26987
|
}
|
|
27177
26988
|
triggerPointerDown(evt) {
|
|
27178
26989
|
var _this$onPointerDown$$;
|
|
27179
|
-
if (!((_this$onPointerDown$$ = this.onPointerDown$.emitEvent(evt)) === null || _this$onPointerDown$$ === void 0 ? void 0 : _this$onPointerDown$$.stopPropagation) && this._parent.classType ===
|
|
26990
|
+
if (!((_this$onPointerDown$$ = this.onPointerDown$.emitEvent(evt)) === null || _this$onPointerDown$$ === void 0 ? void 0 : _this$onPointerDown$$.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27180
26991
|
var _this$_parent10;
|
|
27181
26992
|
(_this$_parent10 = this._parent) === null || _this$_parent10 === void 0 || _this$_parent10.triggerPointerDown(evt);
|
|
27182
26993
|
return false;
|
|
@@ -27184,7 +26995,7 @@ var Scene = class extends Disposable {
|
|
|
27184
26995
|
return true;
|
|
27185
26996
|
}
|
|
27186
26997
|
triggerPointerOut(evt) {
|
|
27187
|
-
if (this._parent.classType ===
|
|
26998
|
+
if (this._parent.classType === "SceneViewer") {
|
|
27188
26999
|
var _this$_parent11;
|
|
27189
27000
|
(_this$_parent11 = this._parent) === null || _this$_parent11 === void 0 || _this$_parent11.triggerPointerOut(evt);
|
|
27190
27001
|
return false;
|
|
@@ -27193,7 +27004,7 @@ var Scene = class extends Disposable {
|
|
|
27193
27004
|
}
|
|
27194
27005
|
triggerPointerLeave(evt) {
|
|
27195
27006
|
var _this$onPointerLeave$;
|
|
27196
|
-
if (!((_this$onPointerLeave$ = this.onPointerLeave$.emitEvent(evt)) === null || _this$onPointerLeave$ === void 0 ? void 0 : _this$onPointerLeave$.stopPropagation) && this._parent.classType ===
|
|
27007
|
+
if (!((_this$onPointerLeave$ = this.onPointerLeave$.emitEvent(evt)) === null || _this$onPointerLeave$ === void 0 ? void 0 : _this$onPointerLeave$.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27197
27008
|
var _this$_parent12;
|
|
27198
27009
|
(_this$_parent12 = this._parent) === null || _this$_parent12 === void 0 || _this$_parent12.triggerPointerLeave(evt);
|
|
27199
27010
|
return false;
|
|
@@ -27201,7 +27012,7 @@ var Scene = class extends Disposable {
|
|
|
27201
27012
|
return true;
|
|
27202
27013
|
}
|
|
27203
27014
|
triggerPointerOver(evt) {
|
|
27204
|
-
if (this._parent.classType ===
|
|
27015
|
+
if (this._parent.classType === "SceneViewer") {
|
|
27205
27016
|
var _this$_parent13;
|
|
27206
27017
|
(_this$_parent13 = this._parent) === null || _this$_parent13 === void 0 || _this$_parent13.triggerPointerOver(evt);
|
|
27207
27018
|
return false;
|
|
@@ -27209,7 +27020,7 @@ var Scene = class extends Disposable {
|
|
|
27209
27020
|
return true;
|
|
27210
27021
|
}
|
|
27211
27022
|
triggerPointerCancel(evt) {
|
|
27212
|
-
if (this._parent.classType ===
|
|
27023
|
+
if (this._parent.classType === "SceneViewer") {
|
|
27213
27024
|
var _this$_parent14;
|
|
27214
27025
|
(_this$_parent14 = this._parent) === null || _this$_parent14 === void 0 || _this$_parent14.triggerPointerCancel(evt);
|
|
27215
27026
|
return false;
|
|
@@ -27218,7 +27029,7 @@ var Scene = class extends Disposable {
|
|
|
27218
27029
|
}
|
|
27219
27030
|
triggerPointerEnter(evt) {
|
|
27220
27031
|
var _this$onPointerEnter$;
|
|
27221
|
-
if (!((_this$onPointerEnter$ = this.onPointerEnter$.emitEvent(evt)) === null || _this$onPointerEnter$ === void 0 ? void 0 : _this$onPointerEnter$.stopPropagation) && this._parent.classType ===
|
|
27032
|
+
if (!((_this$onPointerEnter$ = this.onPointerEnter$.emitEvent(evt)) === null || _this$onPointerEnter$ === void 0 ? void 0 : _this$onPointerEnter$.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27222
27033
|
var _this$_parent15;
|
|
27223
27034
|
(_this$_parent15 = this._parent) === null || _this$_parent15 === void 0 || _this$_parent15.triggerPointerEnter(evt);
|
|
27224
27035
|
return false;
|
|
@@ -27227,7 +27038,7 @@ var Scene = class extends Disposable {
|
|
|
27227
27038
|
}
|
|
27228
27039
|
triggerDragLeave(evt) {
|
|
27229
27040
|
var _this$onDragLeave$$em;
|
|
27230
|
-
if (!((_this$onDragLeave$$em = this.onDragLeave$.emitEvent(evt)) === null || _this$onDragLeave$$em === void 0 ? void 0 : _this$onDragLeave$$em.stopPropagation) && this._parent.classType ===
|
|
27041
|
+
if (!((_this$onDragLeave$$em = this.onDragLeave$.emitEvent(evt)) === null || _this$onDragLeave$$em === void 0 ? void 0 : _this$onDragLeave$$em.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27231
27042
|
var _this$_parent16;
|
|
27232
27043
|
(_this$_parent16 = this._parent) === null || _this$_parent16 === void 0 || _this$_parent16.triggerDragLeave(evt);
|
|
27233
27044
|
return false;
|
|
@@ -27236,7 +27047,7 @@ var Scene = class extends Disposable {
|
|
|
27236
27047
|
}
|
|
27237
27048
|
triggerDragOver(evt) {
|
|
27238
27049
|
var _this$onDragOver$$emi;
|
|
27239
|
-
if (!((_this$onDragOver$$emi = this.onDragOver$.emitEvent(evt)) === null || _this$onDragOver$$emi === void 0 ? void 0 : _this$onDragOver$$emi.stopPropagation) && this._parent.classType ===
|
|
27050
|
+
if (!((_this$onDragOver$$emi = this.onDragOver$.emitEvent(evt)) === null || _this$onDragOver$$emi === void 0 ? void 0 : _this$onDragOver$$emi.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27240
27051
|
var _this$_parent17;
|
|
27241
27052
|
(_this$_parent17 = this._parent) === null || _this$_parent17 === void 0 || _this$_parent17.triggerDragOver(evt);
|
|
27242
27053
|
return false;
|
|
@@ -27245,7 +27056,7 @@ var Scene = class extends Disposable {
|
|
|
27245
27056
|
}
|
|
27246
27057
|
triggerDragEnter(evt) {
|
|
27247
27058
|
var _this$onDragEnter$$em;
|
|
27248
|
-
if (!((_this$onDragEnter$$em = this.onDragEnter$.emitEvent(evt)) === null || _this$onDragEnter$$em === void 0 ? void 0 : _this$onDragEnter$$em.stopPropagation) && this._parent.classType ===
|
|
27059
|
+
if (!((_this$onDragEnter$$em = this.onDragEnter$.emitEvent(evt)) === null || _this$onDragEnter$$em === void 0 ? void 0 : _this$onDragEnter$$em.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27249
27060
|
var _this$_parent18;
|
|
27250
27061
|
(_this$_parent18 = this._parent) === null || _this$_parent18 === void 0 || _this$_parent18.triggerDragEnter(evt);
|
|
27251
27062
|
return false;
|
|
@@ -27254,7 +27065,7 @@ var Scene = class extends Disposable {
|
|
|
27254
27065
|
}
|
|
27255
27066
|
triggerDrop(evt) {
|
|
27256
27067
|
var _this$onDrop$$emitEve;
|
|
27257
|
-
if (!((_this$onDrop$$emitEve = this.onDrop$.emitEvent(evt)) === null || _this$onDrop$$emitEve === void 0 ? void 0 : _this$onDrop$$emitEve.stopPropagation) && this._parent.classType ===
|
|
27068
|
+
if (!((_this$onDrop$$emitEve = this.onDrop$.emitEvent(evt)) === null || _this$onDrop$$emitEve === void 0 ? void 0 : _this$onDrop$$emitEve.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27258
27069
|
var _this$_parent19;
|
|
27259
27070
|
(_this$_parent19 = this._parent) === null || _this$_parent19 === void 0 || _this$_parent19.triggerDrop(evt);
|
|
27260
27071
|
return false;
|
|
@@ -27267,10 +27078,11 @@ var Scene = class extends Disposable {
|
|
|
27267
27078
|
*
|
|
27268
27079
|
*/
|
|
27269
27080
|
_transformHandler() {
|
|
27270
|
-
|
|
27081
|
+
const composeResult = Transform.create().composeMatrix({
|
|
27271
27082
|
scaleX: this.scaleX,
|
|
27272
27083
|
scaleY: this.scaleY
|
|
27273
27084
|
});
|
|
27085
|
+
this.transform = composeResult;
|
|
27274
27086
|
this.getViewports().forEach((vp) => {
|
|
27275
27087
|
vp.resetCanvasSizeAndUpdateScroll();
|
|
27276
27088
|
});
|
|
@@ -27335,6 +27147,7 @@ let RenderUnit = class RenderUnit extends Disposable {
|
|
|
27335
27147
|
return this._renderContext.components;
|
|
27336
27148
|
}
|
|
27337
27149
|
constructor(init, parentInjector) {
|
|
27150
|
+
var _init$createUnitOptio;
|
|
27338
27151
|
super();
|
|
27339
27152
|
_defineProperty(this, "isRenderUnit", true);
|
|
27340
27153
|
_defineProperty(this, "_activated$", new BehaviorSubject(true));
|
|
@@ -27355,6 +27168,7 @@ let RenderUnit = class RenderUnit extends Disposable {
|
|
|
27355
27168
|
activate: () => this._activated$.next(true),
|
|
27356
27169
|
deactivate: () => this._activated$.next(false)
|
|
27357
27170
|
};
|
|
27171
|
+
if (((_init$createUnitOptio = init.createUnitOptions) === null || _init$createUnitOptio === void 0 ? void 0 : _init$createUnitOptio.makeCurrent) === false) this.deactivate();
|
|
27358
27172
|
}
|
|
27359
27173
|
dispose() {
|
|
27360
27174
|
this._injector.dispose();
|
|
@@ -27486,8 +27300,8 @@ let RenderManagerService = class RenderManagerService extends Disposable {
|
|
|
27486
27300
|
* @param unitId
|
|
27487
27301
|
* @returns renderUnit:IRender
|
|
27488
27302
|
*/
|
|
27489
|
-
createRender(unitId) {
|
|
27490
|
-
const renderer = this._createRender(unitId, this._injector.createInstance(Engine, unitId, void 0));
|
|
27303
|
+
createRender(unitId, createUnitOptions) {
|
|
27304
|
+
const renderer = this._createRender(unitId, this._injector.createInstance(Engine, unitId, void 0), true, createUnitOptions);
|
|
27491
27305
|
this._renderCreated$.next(renderer);
|
|
27492
27306
|
return renderer;
|
|
27493
27307
|
}
|
|
@@ -27511,7 +27325,7 @@ let RenderManagerService = class RenderManagerService extends Disposable {
|
|
|
27511
27325
|
* @param isMainScene
|
|
27512
27326
|
* @returns renderUnit:IRender
|
|
27513
27327
|
*/
|
|
27514
|
-
_createRender(unitId, engine, isMainScene = true) {
|
|
27328
|
+
_createRender(unitId, engine, isMainScene = true, createUnitOptions) {
|
|
27515
27329
|
const existItem = this.getRenderById(unitId);
|
|
27516
27330
|
let shouldDestroyEngine = true;
|
|
27517
27331
|
if (existItem != null) {
|
|
@@ -27532,7 +27346,8 @@ let RenderManagerService = class RenderManagerService extends Disposable {
|
|
|
27532
27346
|
unit,
|
|
27533
27347
|
engine,
|
|
27534
27348
|
scene,
|
|
27535
|
-
isMainScene
|
|
27349
|
+
isMainScene,
|
|
27350
|
+
createUnitOptions
|
|
27536
27351
|
});
|
|
27537
27352
|
this._addRenderUnit(unitId, renderUnit);
|
|
27538
27353
|
this._tryAddRenderDependencies(renderUnit, ctorOfDeps);
|
|
@@ -28362,7 +28177,7 @@ var Viewport = class {
|
|
|
28362
28177
|
});
|
|
28363
28178
|
if (isLimitedStore && !isLimitedStore.isLimitedX && !isLimitedStore.isLimitedY) {
|
|
28364
28179
|
evt.preventDefault();
|
|
28365
|
-
if (this._scene.getParent().classType ===
|
|
28180
|
+
if (this._scene.getParent().classType === "SceneViewer") state.stopPropagation();
|
|
28366
28181
|
}
|
|
28367
28182
|
if (this._isWheelPreventDefaultX && this._isWheelPreventDefaultY) evt.preventDefault();
|
|
28368
28183
|
this._scene.makeDirty(true);
|
|
@@ -28720,8 +28535,8 @@ var Viewport = class {
|
|
|
28720
28535
|
_drawScrollbar(ctx) {
|
|
28721
28536
|
if (!this._scrollBar) return;
|
|
28722
28537
|
const parent = this._scene.getParent();
|
|
28723
|
-
if (parent.classType ===
|
|
28724
|
-
else if (parent.classType ===
|
|
28538
|
+
if (parent.classType === "SceneViewer") this._scrollBar.render(ctx);
|
|
28539
|
+
else if (parent.classType === "Engine") this._scrollBar.render(ctx);
|
|
28725
28540
|
}
|
|
28726
28541
|
setViewportSize(props) {
|
|
28727
28542
|
if (Tools.isDefine(props === null || props === void 0 ? void 0 : props.top)) this.top = props.top;
|