@univerjs/engine-render 0.21.1 → 0.22.0-insiders.20260513-09bbeca
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -18
- package/lib/cjs/index.js +755 -939
- package/lib/es/index.js +755 -939
- package/lib/umd/index.js +2 -3
- package/package.json +14 -10
- package/LICENSE +0 -176
package/lib/cjs/index.js
CHANGED
|
@@ -31,7 +31,7 @@ let _univerjs_core = require("@univerjs/core");
|
|
|
31
31
|
let cjk_regex = require("cjk-regex");
|
|
32
32
|
cjk_regex = __toESM(cjk_regex);
|
|
33
33
|
let rxjs = require("rxjs");
|
|
34
|
-
let
|
|
34
|
+
let opentype_js = require("opentype.js");
|
|
35
35
|
let franc_min = require("franc-min");
|
|
36
36
|
let _floating_ui_dom = require("@floating-ui/dom");
|
|
37
37
|
let _floating_ui_utils = require("@floating-ui/utils");
|
|
@@ -650,7 +650,7 @@ function getSystemHighlightColor() {
|
|
|
650
650
|
}
|
|
651
651
|
|
|
652
652
|
//#endregion
|
|
653
|
-
//#region \0@oxc-project+runtime@0.
|
|
653
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/typeof.js
|
|
654
654
|
function _typeof(o) {
|
|
655
655
|
"@babel/helpers - typeof";
|
|
656
656
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -661,7 +661,7 @@ function _typeof(o) {
|
|
|
661
661
|
}
|
|
662
662
|
|
|
663
663
|
//#endregion
|
|
664
|
-
//#region \0@oxc-project+runtime@0.
|
|
664
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/toPrimitive.js
|
|
665
665
|
function toPrimitive(t, r) {
|
|
666
666
|
if ("object" != _typeof(t) || !t) return t;
|
|
667
667
|
var e = t[Symbol.toPrimitive];
|
|
@@ -674,14 +674,14 @@ function toPrimitive(t, r) {
|
|
|
674
674
|
}
|
|
675
675
|
|
|
676
676
|
//#endregion
|
|
677
|
-
//#region \0@oxc-project+runtime@0.
|
|
677
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/toPropertyKey.js
|
|
678
678
|
function toPropertyKey(t) {
|
|
679
679
|
var i = toPrimitive(t, "string");
|
|
680
680
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
681
681
|
}
|
|
682
682
|
|
|
683
683
|
//#endregion
|
|
684
|
-
//#region \0@oxc-project+runtime@0.
|
|
684
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/defineProperty.js
|
|
685
685
|
function _defineProperty(e, r, t) {
|
|
686
686
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
687
687
|
value: t,
|
|
@@ -822,7 +822,10 @@ var FontCache = class {
|
|
|
822
822
|
* @returns IMeasureTextCache
|
|
823
823
|
*/
|
|
824
824
|
static getMeasureText(content, fontString) {
|
|
825
|
-
if (!this._context)
|
|
825
|
+
if (!this._context) {
|
|
826
|
+
const canvas = document.createElement("canvas");
|
|
827
|
+
this._context = canvas.getContext("2d");
|
|
828
|
+
}
|
|
826
829
|
if (!this._context) return {
|
|
827
830
|
width: 0,
|
|
828
831
|
fontBoundingBoxAscent: 0,
|
|
@@ -990,7 +993,7 @@ function hasListGlyph(glyph) {
|
|
|
990
993
|
var _glyphGroup$;
|
|
991
994
|
const divide = glyph === null || glyph === void 0 ? void 0 : glyph.parent;
|
|
992
995
|
if (divide == null) return false;
|
|
993
|
-
return ((_glyphGroup$ = divide.glyphGroup[0]) === null || _glyphGroup$ === void 0 ? void 0 : _glyphGroup$.glyphType) ===
|
|
996
|
+
return ((_glyphGroup$ = divide.glyphGroup[0]) === null || _glyphGroup$ === void 0 ? void 0 : _glyphGroup$.glyphType) === 2;
|
|
994
997
|
}
|
|
995
998
|
function isIndentByGlyph(glyph, body) {
|
|
996
999
|
const paragraph = getParagraphByGlyph(glyph, body);
|
|
@@ -1019,7 +1022,7 @@ function isFirstGlyph(glyph) {
|
|
|
1019
1022
|
const glyphIndex = glyphGroup.indexOf(glyph);
|
|
1020
1023
|
const divideIndex = divides.indexOf(divide);
|
|
1021
1024
|
if (divideIndex === 0 && glyphIndex === 0) return true;
|
|
1022
|
-
if (divideIndex === 0 && glyphIndex === 1 && glyphGroup[0].glyphType ===
|
|
1025
|
+
if (divideIndex === 0 && glyphIndex === 1 && glyphGroup[0].glyphType === 2) return true;
|
|
1023
1026
|
}
|
|
1024
1027
|
return false;
|
|
1025
1028
|
}
|
|
@@ -1711,22 +1714,22 @@ function drawLineByBorderType(ctx, type, lineWidthBuffer, position) {
|
|
|
1711
1714
|
let drawEndX = 0;
|
|
1712
1715
|
let drawEndY = 0;
|
|
1713
1716
|
const { startX, startY, endX, endY } = position;
|
|
1714
|
-
if (type ===
|
|
1717
|
+
if (type === "t") {
|
|
1715
1718
|
drawStartX = startX - lineWidthBuffer;
|
|
1716
1719
|
drawStartY = startY;
|
|
1717
1720
|
drawEndX = endX + lineWidthBuffer;
|
|
1718
1721
|
drawEndY = startY;
|
|
1719
|
-
} else if (type ===
|
|
1722
|
+
} else if (type === "b") {
|
|
1720
1723
|
drawStartX = startX - lineWidthBuffer;
|
|
1721
1724
|
drawStartY = endY;
|
|
1722
1725
|
drawEndX = endX - lineWidthBuffer;
|
|
1723
1726
|
drawEndY = endY;
|
|
1724
|
-
} else if (type ===
|
|
1727
|
+
} else if (type === "l") {
|
|
1725
1728
|
drawStartX = startX;
|
|
1726
1729
|
drawStartY = startY - lineWidthBuffer;
|
|
1727
1730
|
drawEndX = startX;
|
|
1728
1731
|
drawEndY = endY + lineWidthBuffer;
|
|
1729
|
-
} else if (type ===
|
|
1732
|
+
} else if (type === "r") {
|
|
1730
1733
|
drawStartX = endX;
|
|
1731
1734
|
drawStartY = startY - lineWidthBuffer;
|
|
1732
1735
|
drawEndX = endX;
|
|
@@ -1745,37 +1748,37 @@ function drawDiagonalSingleLineByBorderType(ctx, type, position) {
|
|
|
1745
1748
|
let drawEndY = 0;
|
|
1746
1749
|
const { startX, startY, endX, endY } = position;
|
|
1747
1750
|
switch (type) {
|
|
1748
|
-
case
|
|
1751
|
+
case "tl_br":
|
|
1749
1752
|
drawStartX = startX;
|
|
1750
1753
|
drawStartY = startY;
|
|
1751
1754
|
drawEndX = endX;
|
|
1752
1755
|
drawEndY = endY;
|
|
1753
1756
|
break;
|
|
1754
|
-
case
|
|
1757
|
+
case "tl_bc":
|
|
1755
1758
|
drawStartX = startX;
|
|
1756
1759
|
drawStartY = startY;
|
|
1757
1760
|
drawEndX = (startX + endX) / 2;
|
|
1758
1761
|
drawEndY = endY;
|
|
1759
1762
|
break;
|
|
1760
|
-
case
|
|
1763
|
+
case "tl_mr":
|
|
1761
1764
|
drawStartX = startX;
|
|
1762
1765
|
drawStartY = startY;
|
|
1763
1766
|
drawEndX = endX;
|
|
1764
1767
|
drawEndY = (startY + endY) / 2;
|
|
1765
1768
|
break;
|
|
1766
|
-
case
|
|
1769
|
+
case "bl_tr":
|
|
1767
1770
|
drawStartX = startX;
|
|
1768
1771
|
drawStartY = endY;
|
|
1769
1772
|
drawEndX = endX;
|
|
1770
1773
|
drawEndY = startY;
|
|
1771
1774
|
break;
|
|
1772
|
-
case
|
|
1775
|
+
case "ml_tr":
|
|
1773
1776
|
drawStartX = startX;
|
|
1774
1777
|
drawStartY = (startY + endY) / 2;
|
|
1775
1778
|
drawEndX = endX;
|
|
1776
1779
|
drawEndY = startY;
|
|
1777
1780
|
break;
|
|
1778
|
-
case
|
|
1781
|
+
case "bc_tr":
|
|
1779
1782
|
drawStartX = (startX + endX) / 2;
|
|
1780
1783
|
drawStartY = endY;
|
|
1781
1784
|
drawEndX = endX;
|
|
@@ -1799,7 +1802,7 @@ function drawDiagonalDoubleLineByBorderType(ctx, type, position) {
|
|
|
1799
1802
|
let drawSecondEndY = 0;
|
|
1800
1803
|
const { startX, startY, endX, endY } = position;
|
|
1801
1804
|
switch (type) {
|
|
1802
|
-
case
|
|
1805
|
+
case "tl_br":
|
|
1803
1806
|
drawFirstStartX = startX;
|
|
1804
1807
|
drawFirstStartY = startY + 1.5;
|
|
1805
1808
|
drawFirstEndX = endX - 1.5;
|
|
@@ -1809,7 +1812,7 @@ function drawDiagonalDoubleLineByBorderType(ctx, type, position) {
|
|
|
1809
1812
|
drawSecondEndX = endX;
|
|
1810
1813
|
drawSecondEndY = endY - 1.5;
|
|
1811
1814
|
break;
|
|
1812
|
-
case
|
|
1815
|
+
case "bl_tr":
|
|
1813
1816
|
drawFirstStartX = startX;
|
|
1814
1817
|
drawFirstStartY = endY - 1.5;
|
|
1815
1818
|
drawFirstEndX = endX - 1.5;
|
|
@@ -1832,7 +1835,7 @@ function drawDiagonalDoubleLineByBorderType(ctx, type, position) {
|
|
|
1832
1835
|
ctx.stroke();
|
|
1833
1836
|
}
|
|
1834
1837
|
function drawDiagonalLineByBorderType(ctx, style, type, position) {
|
|
1835
|
-
if (style === _univerjs_core.BorderStyleTypes.DOUBLE && (type ===
|
|
1838
|
+
if (style === _univerjs_core.BorderStyleTypes.DOUBLE && (type === "tl_br" || type === "bl_tr")) drawDiagonalDoubleLineByBorderType(ctx, type, position);
|
|
1836
1839
|
else drawDiagonalSingleLineByBorderType(ctx, type, position);
|
|
1837
1840
|
}
|
|
1838
1841
|
function clearLineByBorderType(ctx, type, position) {
|
|
@@ -1842,25 +1845,25 @@ function clearLineByBorderType(ctx, type, position) {
|
|
|
1842
1845
|
let drawEndY = 0;
|
|
1843
1846
|
const { startX, startY, endX, endY } = position;
|
|
1844
1847
|
switch (type) {
|
|
1845
|
-
case
|
|
1848
|
+
case "t":
|
|
1846
1849
|
drawStartX = startX;
|
|
1847
1850
|
drawStartY = startY;
|
|
1848
1851
|
drawEndX = endX;
|
|
1849
1852
|
drawEndY = startY;
|
|
1850
1853
|
break;
|
|
1851
|
-
case
|
|
1854
|
+
case "b":
|
|
1852
1855
|
drawStartX = startX;
|
|
1853
1856
|
drawStartY = endY;
|
|
1854
1857
|
drawEndX = endX;
|
|
1855
1858
|
drawEndY = endY;
|
|
1856
1859
|
break;
|
|
1857
|
-
case
|
|
1860
|
+
case "l":
|
|
1858
1861
|
drawStartX = startX;
|
|
1859
1862
|
drawStartY = startY;
|
|
1860
1863
|
drawEndX = startX;
|
|
1861
1864
|
drawEndY = endY;
|
|
1862
1865
|
break;
|
|
1863
|
-
case
|
|
1866
|
+
case "r":
|
|
1864
1867
|
drawStartX = endX;
|
|
1865
1868
|
drawStartY = startY;
|
|
1866
1869
|
drawEndX = endX;
|
|
@@ -1908,7 +1911,7 @@ function calculateRectRotate(startPoint, centerPoint, radiusCenter, radiusVertex
|
|
|
1908
1911
|
return newVector.rotateByPoint(finalAngle, rotationVector).add(offsetPoint).transformCoordinateOnRotate(finalAngle);
|
|
1909
1912
|
}
|
|
1910
1913
|
function getRotateOrientation(angle) {
|
|
1911
|
-
return angle > 0 ?
|
|
1914
|
+
return angle > 0 ? 1 : 0;
|
|
1912
1915
|
}
|
|
1913
1916
|
function getRotateOffsetAndFarthestHypotenuse(lines, rectWidth, vertexAngle) {
|
|
1914
1917
|
const rotateTranslateXList = [];
|
|
@@ -1923,7 +1926,7 @@ function getRotateOffsetAndFarthestHypotenuse(lines, rectWidth, vertexAngle) {
|
|
|
1923
1926
|
const tanTheta = Math.tan(vertexAngle);
|
|
1924
1927
|
const sinTheta = Math.sin(vertexAngle);
|
|
1925
1928
|
const cosTheta = Math.cos(vertexAngle);
|
|
1926
|
-
if (orientation ===
|
|
1929
|
+
if (orientation === 0) {
|
|
1927
1930
|
let cumRectHeight = 0;
|
|
1928
1931
|
for (let i = 0; i < linesCount; i++) {
|
|
1929
1932
|
const { lineHeight: rectHeight = 0 } = lines[i];
|
|
@@ -2982,7 +2985,7 @@ var BaseObject = class extends _univerjs_core.Disposable {
|
|
|
2982
2985
|
_defineProperty(this, "groupKey", void 0);
|
|
2983
2986
|
_defineProperty(this, "isInGroup", false);
|
|
2984
2987
|
_defineProperty(this, "isDrawingObject", false);
|
|
2985
|
-
_defineProperty(this, "objectType",
|
|
2988
|
+
_defineProperty(this, "objectType", 0);
|
|
2986
2989
|
_defineProperty(this, "onTransformChange$", new _univerjs_core.EventSubject());
|
|
2987
2990
|
_defineProperty(this, "onPointerDown$", new _univerjs_core.EventSubject());
|
|
2988
2991
|
_defineProperty(this, "onPointerMove$", new _univerjs_core.EventSubject());
|
|
@@ -3028,7 +3031,7 @@ var BaseObject = class extends _univerjs_core.Disposable {
|
|
|
3028
3031
|
_defineProperty(this, "_visible", true);
|
|
3029
3032
|
_defineProperty(this, "_debounceParentDirty", true);
|
|
3030
3033
|
_defineProperty(this, "_transform", new Transform());
|
|
3031
|
-
_defineProperty(this, "_cursor",
|
|
3034
|
+
_defineProperty(this, "_cursor", "default");
|
|
3032
3035
|
_defineProperty(this, "_transformerConfig", void 0);
|
|
3033
3036
|
_defineProperty(this, "_forceRender", false);
|
|
3034
3037
|
_defineProperty(this, "_layer", void 0);
|
|
@@ -3069,7 +3072,7 @@ var BaseObject = class extends _univerjs_core.Disposable {
|
|
|
3069
3072
|
return this._heightOrigin;
|
|
3070
3073
|
}
|
|
3071
3074
|
get classType() {
|
|
3072
|
-
return
|
|
3075
|
+
return "BaseObject";
|
|
3073
3076
|
}
|
|
3074
3077
|
get top() {
|
|
3075
3078
|
return this._top;
|
|
@@ -3115,15 +3118,15 @@ var BaseObject = class extends _univerjs_core.Disposable {
|
|
|
3115
3118
|
}
|
|
3116
3119
|
get ancestorTransform() {
|
|
3117
3120
|
const parent = this.getParent();
|
|
3118
|
-
if (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) ===
|
|
3121
|
+
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);
|
|
3119
3122
|
return this.transform;
|
|
3120
3123
|
}
|
|
3121
3124
|
get ancestorGroup() {
|
|
3122
3125
|
let group = null;
|
|
3123
3126
|
let parent = this.getParent();
|
|
3124
3127
|
while (parent != null && parent) {
|
|
3125
|
-
if (parent.classType ===
|
|
3126
|
-
if (parent.classType ===
|
|
3128
|
+
if (parent.classType === "Group") group = parent;
|
|
3129
|
+
if (parent.classType === "Group") parent = parent.getParent();
|
|
3127
3130
|
else parent = null;
|
|
3128
3131
|
}
|
|
3129
3132
|
return group;
|
|
@@ -3270,7 +3273,7 @@ var BaseObject = class extends _univerjs_core.Disposable {
|
|
|
3270
3273
|
if (x !== void 0) this.left = x;
|
|
3271
3274
|
this._setTransForm();
|
|
3272
3275
|
this.onTransformChange$.emitEvent({
|
|
3273
|
-
type:
|
|
3276
|
+
type: 0,
|
|
3274
3277
|
value: {
|
|
3275
3278
|
top: this._top,
|
|
3276
3279
|
left: this._left
|
|
@@ -3289,7 +3292,7 @@ var BaseObject = class extends _univerjs_core.Disposable {
|
|
|
3289
3292
|
if (height !== void 0) this.height = height;
|
|
3290
3293
|
this._setTransForm();
|
|
3291
3294
|
this.onTransformChange$.emitEvent({
|
|
3292
|
-
type:
|
|
3295
|
+
type: 1,
|
|
3293
3296
|
value: {
|
|
3294
3297
|
width: this._width,
|
|
3295
3298
|
height: this._height
|
|
@@ -3308,7 +3311,7 @@ var BaseObject = class extends _univerjs_core.Disposable {
|
|
|
3308
3311
|
if (scaleY !== void 0) this.scaleY = scaleY;
|
|
3309
3312
|
this._setTransForm();
|
|
3310
3313
|
this.onTransformChange$.emitEvent({
|
|
3311
|
-
type:
|
|
3314
|
+
type: 2,
|
|
3312
3315
|
value: {
|
|
3313
3316
|
scaleX: this._scaleX,
|
|
3314
3317
|
scaleY: this._scaleY
|
|
@@ -3327,7 +3330,7 @@ var BaseObject = class extends _univerjs_core.Disposable {
|
|
|
3327
3330
|
if (skewY !== void 0) this.skewY = skewY;
|
|
3328
3331
|
this._setTransForm();
|
|
3329
3332
|
this.onTransformChange$.emitEvent({
|
|
3330
|
-
type:
|
|
3333
|
+
type: 3,
|
|
3331
3334
|
value: {
|
|
3332
3335
|
skewX: this._skewX,
|
|
3333
3336
|
skewY: this._skewY
|
|
@@ -3346,7 +3349,7 @@ var BaseObject = class extends _univerjs_core.Disposable {
|
|
|
3346
3349
|
if (flipY !== void 0) this.flipY = flipY;
|
|
3347
3350
|
this._setTransForm();
|
|
3348
3351
|
this.onTransformChange$.emitEvent({
|
|
3349
|
-
type:
|
|
3352
|
+
type: 4,
|
|
3350
3353
|
value: {
|
|
3351
3354
|
flipX: this._flipX,
|
|
3352
3355
|
flipY: this._flipY
|
|
@@ -3374,7 +3377,7 @@ var BaseObject = class extends _univerjs_core.Disposable {
|
|
|
3374
3377
|
});
|
|
3375
3378
|
this._setTransForm();
|
|
3376
3379
|
this.onTransformChange$.emitEvent({
|
|
3377
|
-
type:
|
|
3380
|
+
type: 5,
|
|
3378
3381
|
value: option,
|
|
3379
3382
|
preValue: preKeys
|
|
3380
3383
|
});
|
|
@@ -3406,7 +3409,7 @@ var BaseObject = class extends _univerjs_core.Disposable {
|
|
|
3406
3409
|
var _this$parent, _this$parent2;
|
|
3407
3410
|
let { width: realWidth, height: realHeight, left: realLeft, top: realTop } = this;
|
|
3408
3411
|
let baseBound;
|
|
3409
|
-
if (this.isInGroup && ((_this$parent = this.parent) === null || _this$parent === void 0 ? void 0 : _this$parent.classType) ===
|
|
3412
|
+
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();
|
|
3410
3413
|
if (baseBound) {
|
|
3411
3414
|
const parentState = this.getParent();
|
|
3412
3415
|
const parentBound = {
|
|
@@ -3638,7 +3641,7 @@ var BaseObject = class extends _univerjs_core.Disposable {
|
|
|
3638
3641
|
getScene() {
|
|
3639
3642
|
let parent = this.parent;
|
|
3640
3643
|
while (parent) {
|
|
3641
|
-
if (parent.classType ===
|
|
3644
|
+
if (parent.classType === "Scene") return parent;
|
|
3642
3645
|
parent = parent.getParent();
|
|
3643
3646
|
}
|
|
3644
3647
|
return null;
|
|
@@ -3655,7 +3658,7 @@ var BaseObject = class extends _univerjs_core.Disposable {
|
|
|
3655
3658
|
getEngine() {
|
|
3656
3659
|
let parent = this.getParent();
|
|
3657
3660
|
while (parent != null) {
|
|
3658
|
-
if (parent.classType ===
|
|
3661
|
+
if (parent.classType === "Engine") return parent;
|
|
3659
3662
|
parent = parent.getParent();
|
|
3660
3663
|
}
|
|
3661
3664
|
return null;
|
|
@@ -3679,7 +3682,7 @@ var BaseObject = class extends _univerjs_core.Disposable {
|
|
|
3679
3682
|
return this.ancestorTransform.invert().applyPoint(coord);
|
|
3680
3683
|
}
|
|
3681
3684
|
_setTransForm() {
|
|
3682
|
-
|
|
3685
|
+
const composeResult = Transform.create().composeMatrix({
|
|
3683
3686
|
left: this.left + this.strokeWidth / 2,
|
|
3684
3687
|
top: this.top + this.strokeWidth / 2,
|
|
3685
3688
|
scaleX: this.scaleX,
|
|
@@ -3690,6 +3693,7 @@ var BaseObject = class extends _univerjs_core.Disposable {
|
|
|
3690
3693
|
flipX: this.flipX,
|
|
3691
3694
|
flipY: this.flipY
|
|
3692
3695
|
});
|
|
3696
|
+
this.transform = composeResult;
|
|
3693
3697
|
this._makeDirtyMix();
|
|
3694
3698
|
}
|
|
3695
3699
|
_makeDirtyMix() {
|
|
@@ -4453,7 +4457,7 @@ var Canvas = class {
|
|
|
4453
4457
|
this._canvasEle.style.outline = "0";
|
|
4454
4458
|
const context = this._canvasEle.getContext("2d");
|
|
4455
4459
|
if (context == null) throw new Error("context is not support");
|
|
4456
|
-
if (props.mode ===
|
|
4460
|
+
if (props.mode === 1) this._context = new UniverPrintingContext(context);
|
|
4457
4461
|
else this._context = new UniverRenderingContext(context, { canvasColorService: props.colorService });
|
|
4458
4462
|
this.setSize(props.width, props.height, props.pixelRatio);
|
|
4459
4463
|
}
|
|
@@ -4653,7 +4657,7 @@ var SheetComponent = class extends RenderComponent {
|
|
|
4653
4657
|
}
|
|
4654
4658
|
getParentScale() {
|
|
4655
4659
|
let { scaleX = 1, scaleY = 1 } = this.parent;
|
|
4656
|
-
if (this.parent.classType ===
|
|
4660
|
+
if (this.parent.classType === "SceneViewer") {
|
|
4657
4661
|
scaleX = this.parent.ancestorScaleX || 1;
|
|
4658
4662
|
scaleY = this.parent.ancestorScaleY || 1;
|
|
4659
4663
|
}
|
|
@@ -4762,38 +4766,23 @@ let SHEET_VIEWPORT_KEY = /* @__PURE__ */ function(SHEET_VIEWPORT_KEY) {
|
|
|
4762
4766
|
|
|
4763
4767
|
//#endregion
|
|
4764
4768
|
//#region src/components/sheets/constants.ts
|
|
4765
|
-
/**
|
|
4766
|
-
* Copyright 2023-present DreamNum Co., Ltd.
|
|
4767
|
-
*
|
|
4768
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4769
|
-
* you may not use this file except in compliance with the License.
|
|
4770
|
-
* You may obtain a copy of the License at
|
|
4771
|
-
*
|
|
4772
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
4773
|
-
*
|
|
4774
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
4775
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
4776
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4777
|
-
* See the License for the specific language governing permissions and
|
|
4778
|
-
* limitations under the License.
|
|
4779
|
-
*/
|
|
4780
4769
|
const BORDER_Z_INDEX = 50;
|
|
4781
4770
|
const FONT_EXTENSION_Z_INDEX = 45;
|
|
4782
4771
|
const BG_Z_INDEX = 21;
|
|
4783
4772
|
const PRINTING_BG_Z_INDEX = 21;
|
|
4784
4773
|
const EXPAND_SIZE_FOR_RENDER_OVERFLOW = 20;
|
|
4785
4774
|
const sheetContentViewportKeys = [
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4775
|
+
"viewMain",
|
|
4776
|
+
"viewMainLeftTop",
|
|
4777
|
+
"viewMainTop",
|
|
4778
|
+
"viewMainLeft"
|
|
4790
4779
|
];
|
|
4791
4780
|
const sheetHeaderViewportKeys = [
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4781
|
+
"viewRowTop",
|
|
4782
|
+
"viewRowBottom",
|
|
4783
|
+
"viewColumnLeft",
|
|
4784
|
+
"viewColumnRight",
|
|
4785
|
+
"viewLeftTop"
|
|
4797
4786
|
];
|
|
4798
4787
|
const MEASURE_EXTENT = 1e4;
|
|
4799
4788
|
const MEASURE_EXTENT_FOR_PARAGRAPH = MEASURE_EXTENT / 10;
|
|
@@ -4811,7 +4800,7 @@ const SHEET_EXTENSION_PREFIX = "sheet-ext-";
|
|
|
4811
4800
|
var SheetExtension = class extends ComponentExtension {
|
|
4812
4801
|
constructor(..._args) {
|
|
4813
4802
|
super(..._args);
|
|
4814
|
-
_defineProperty(this, "type",
|
|
4803
|
+
_defineProperty(this, "type", 0);
|
|
4815
4804
|
}
|
|
4816
4805
|
isRenderDiffRangesByCell(rangeP, diffRanges) {
|
|
4817
4806
|
if (diffRanges == null || diffRanges.length === 0) return true;
|
|
@@ -5081,7 +5070,7 @@ var Border = class extends SheetExtension {
|
|
|
5081
5070
|
let endY = cellEndY;
|
|
5082
5071
|
let startX = cellStartX;
|
|
5083
5072
|
let endX = cellEndX;
|
|
5084
|
-
if (type !==
|
|
5073
|
+
if (type !== "t" && type !== "b" && type !== "l" && type !== "r") {
|
|
5085
5074
|
if (isMerged) return true;
|
|
5086
5075
|
if (isMergedMainCell) {
|
|
5087
5076
|
startY = mergeInfo.startY;
|
|
@@ -5107,7 +5096,7 @@ var Border = class extends SheetExtension {
|
|
|
5107
5096
|
endX,
|
|
5108
5097
|
endY
|
|
5109
5098
|
});
|
|
5110
|
-
if (style === _univerjs_core.BorderStyleTypes.DOUBLE && (type ===
|
|
5099
|
+
if (style === _univerjs_core.BorderStyleTypes.DOUBLE && (type === "l" || type === "r" || type === "t" || type === "b")) this._renderDoubleBorder({
|
|
5111
5100
|
renderBorderContext,
|
|
5112
5101
|
row,
|
|
5113
5102
|
col,
|
|
@@ -5122,16 +5111,16 @@ var Border = class extends SheetExtension {
|
|
|
5122
5111
|
}
|
|
5123
5112
|
_getOverflowExclusion(overflowCache, type, borderRow, borderColumn) {
|
|
5124
5113
|
let isDraw = false;
|
|
5125
|
-
if (type ===
|
|
5114
|
+
if (type === "t" || type === "b") return isDraw;
|
|
5126
5115
|
overflowCache === null || overflowCache === void 0 || overflowCache.forRow((row, rowArray) => {
|
|
5127
5116
|
if (row !== borderRow) return true;
|
|
5128
5117
|
rowArray.forEach((column) => {
|
|
5129
5118
|
const { startColumn, endColumn } = overflowCache.getValue(row, column);
|
|
5130
|
-
if (type ===
|
|
5119
|
+
if (type === "l" && borderColumn > startColumn && borderColumn <= endColumn) {
|
|
5131
5120
|
isDraw = true;
|
|
5132
5121
|
return false;
|
|
5133
5122
|
}
|
|
5134
|
-
if (type ===
|
|
5123
|
+
if (type === "r" && borderColumn >= startColumn && borderColumn < endColumn) {
|
|
5135
5124
|
isDraw = true;
|
|
5136
5125
|
return false;
|
|
5137
5126
|
}
|
|
@@ -5191,7 +5180,7 @@ var Border = class extends SheetExtension {
|
|
|
5191
5180
|
endXOffset: defaultOffset,
|
|
5192
5181
|
endYOffset: defaultOffset
|
|
5193
5182
|
};
|
|
5194
|
-
if (type ===
|
|
5183
|
+
if (type === "l" || type === "r") {
|
|
5195
5184
|
if (topCellBorder.bottom && topCellBorder.bottom.style !== _univerjs_core.BorderStyleTypes.DOUBLE) {
|
|
5196
5185
|
outerLineOffsets.startYOffset = 0;
|
|
5197
5186
|
innerLineOffsets.startYOffset = 0;
|
|
@@ -5199,8 +5188,8 @@ var Border = class extends SheetExtension {
|
|
|
5199
5188
|
var _leftCellBorder$top, _leftTopCellBorder$bo, _rightCellBorder$top, _rightTopCellBorder$b;
|
|
5200
5189
|
const leftTopCellBorder = this._getSpecificCellBorder(borderCache, row - 1, col - 1);
|
|
5201
5190
|
const rightTopCellBorder = this._getSpecificCellBorder(borderCache, row - 1, col + 1);
|
|
5202
|
-
if (type ===
|
|
5203
|
-
else if (type ===
|
|
5191
|
+
if (type === "l" && (((_leftCellBorder$top = leftCellBorder.top) === null || _leftCellBorder$top === void 0 ? void 0 : _leftCellBorder$top.style) === _univerjs_core.BorderStyleTypes.DOUBLE || ((_leftTopCellBorder$bo = leftTopCellBorder.bottom) === null || _leftTopCellBorder$bo === void 0 ? void 0 : _leftTopCellBorder$bo.style) === _univerjs_core.BorderStyleTypes.DOUBLE) || type === "r" && (((_rightCellBorder$top = rightCellBorder.top) === null || _rightCellBorder$top === void 0 ? void 0 : _rightCellBorder$top.style) === _univerjs_core.BorderStyleTypes.DOUBLE || ((_rightTopCellBorder$b = rightTopCellBorder.bottom) === null || _rightTopCellBorder$b === void 0 ? void 0 : _rightTopCellBorder$b.style) === _univerjs_core.BorderStyleTypes.DOUBLE)) outerLineOffsets.startYOffset = -defaultOffset;
|
|
5192
|
+
else if (type === "l" && leftTopCellBorder.bottom && leftTopCellBorder.bottom.style !== _univerjs_core.BorderStyleTypes.DOUBLE || type === "r" && rightTopCellBorder.bottom && rightTopCellBorder.bottom.style !== _univerjs_core.BorderStyleTypes.DOUBLE) outerLineOffsets.startYOffset = 0;
|
|
5204
5193
|
else outerLineOffsets.startYOffset = defaultOffset;
|
|
5205
5194
|
innerLineOffsets.startYOffset = defaultOffset;
|
|
5206
5195
|
}
|
|
@@ -5211,17 +5200,17 @@ var Border = class extends SheetExtension {
|
|
|
5211
5200
|
var _leftCellBorder$botto, _leftBottomCellBorder, _rightCellBorder$bott, _rightBottomCellBorde;
|
|
5212
5201
|
const leftBottomCellBorder = this._getSpecificCellBorder(borderCache, row + 1, col - 1);
|
|
5213
5202
|
const rightBottomCellBorder = this._getSpecificCellBorder(borderCache, row + 1, col + 1);
|
|
5214
|
-
if (type ===
|
|
5215
|
-
else if (type ===
|
|
5203
|
+
if (type === "l" && (((_leftCellBorder$botto = leftCellBorder.bottom) === null || _leftCellBorder$botto === void 0 ? void 0 : _leftCellBorder$botto.style) === _univerjs_core.BorderStyleTypes.DOUBLE || ((_leftBottomCellBorder = leftBottomCellBorder.top) === null || _leftBottomCellBorder === void 0 ? void 0 : _leftBottomCellBorder.style) === _univerjs_core.BorderStyleTypes.DOUBLE) || type === "r" && (((_rightCellBorder$bott = rightCellBorder.bottom) === null || _rightCellBorder$bott === void 0 ? void 0 : _rightCellBorder$bott.style) === _univerjs_core.BorderStyleTypes.DOUBLE || ((_rightBottomCellBorde = rightBottomCellBorder.top) === null || _rightBottomCellBorde === void 0 ? void 0 : _rightBottomCellBorde.style) === _univerjs_core.BorderStyleTypes.DOUBLE)) outerLineOffsets.endYOffset = -defaultOffset;
|
|
5204
|
+
else if (type === "l" && leftBottomCellBorder.top && leftBottomCellBorder.top.style !== _univerjs_core.BorderStyleTypes.DOUBLE || type === "r" && rightBottomCellBorder.top && rightBottomCellBorder.top.style !== _univerjs_core.BorderStyleTypes.DOUBLE) outerLineOffsets.endYOffset = 0;
|
|
5216
5205
|
else outerLineOffsets.endYOffset = defaultOffset;
|
|
5217
5206
|
innerLineOffsets.endYOffset = defaultOffset;
|
|
5218
5207
|
}
|
|
5219
5208
|
clearLine.startY = startY - defaultOffset;
|
|
5220
5209
|
clearLine.endY = endY + defaultOffset;
|
|
5221
5210
|
clearMiddleLine(clearLine);
|
|
5222
|
-
if (type ===
|
|
5211
|
+
if (type === "l" && !leftCellBorder.right || type === "r" && !rightCellBorder.left) drawOuterLine(outerLineOffsets);
|
|
5223
5212
|
drawInnerLine(innerLineOffsets);
|
|
5224
|
-
} else if (type ===
|
|
5213
|
+
} else if (type === "t" || type === "b") {
|
|
5225
5214
|
if (leftCellBorder.right && leftCellBorder.right.style !== _univerjs_core.BorderStyleTypes.DOUBLE) {
|
|
5226
5215
|
outerLineOffsets.startXOffset = 0;
|
|
5227
5216
|
innerLineOffsets.startXOffset = 0;
|
|
@@ -5229,8 +5218,8 @@ var Border = class extends SheetExtension {
|
|
|
5229
5218
|
var _topCellBorder$left, _topLeftCellBorder$ri, _bottomCellBorder$lef, _bottomLeftCellBorder;
|
|
5230
5219
|
const topLeftCellBorder = this._getSpecificCellBorder(borderCache, row - 1, col - 1);
|
|
5231
5220
|
const bottomLeftCellBorder = this._getSpecificCellBorder(borderCache, row + 1, col - 1);
|
|
5232
|
-
if (type ===
|
|
5233
|
-
else if (type ===
|
|
5221
|
+
if (type === "t" && (((_topCellBorder$left = topCellBorder.left) === null || _topCellBorder$left === void 0 ? void 0 : _topCellBorder$left.style) === _univerjs_core.BorderStyleTypes.DOUBLE || ((_topLeftCellBorder$ri = topLeftCellBorder.right) === null || _topLeftCellBorder$ri === void 0 ? void 0 : _topLeftCellBorder$ri.style) === _univerjs_core.BorderStyleTypes.DOUBLE) || type === "b" && (((_bottomCellBorder$lef = bottomCellBorder.left) === null || _bottomCellBorder$lef === void 0 ? void 0 : _bottomCellBorder$lef.style) === _univerjs_core.BorderStyleTypes.DOUBLE || ((_bottomLeftCellBorder = bottomLeftCellBorder.right) === null || _bottomLeftCellBorder === void 0 ? void 0 : _bottomLeftCellBorder.style) === _univerjs_core.BorderStyleTypes.DOUBLE)) outerLineOffsets.startXOffset = -defaultOffset;
|
|
5222
|
+
else if (type === "t" && topLeftCellBorder.right && topLeftCellBorder.right.style !== _univerjs_core.BorderStyleTypes.DOUBLE || type === "b" && bottomLeftCellBorder.right && bottomLeftCellBorder.right.style !== _univerjs_core.BorderStyleTypes.DOUBLE) outerLineOffsets.startXOffset = 0;
|
|
5234
5223
|
else outerLineOffsets.startXOffset = defaultOffset;
|
|
5235
5224
|
innerLineOffsets.startXOffset = defaultOffset;
|
|
5236
5225
|
}
|
|
@@ -5241,15 +5230,15 @@ var Border = class extends SheetExtension {
|
|
|
5241
5230
|
var _topCellBorder$right, _topRightCellBorder$l, _bottomCellBorder$rig, _bottomRightCellBorde;
|
|
5242
5231
|
const topRightCellBorder = this._getSpecificCellBorder(borderCache, row - 1, col + 1);
|
|
5243
5232
|
const bottomRightCellBorder = this._getSpecificCellBorder(borderCache, row + 1, col + 1);
|
|
5244
|
-
if (type ===
|
|
5245
|
-
else if (type ===
|
|
5233
|
+
if (type === "t" && (((_topCellBorder$right = topCellBorder.right) === null || _topCellBorder$right === void 0 ? void 0 : _topCellBorder$right.style) === _univerjs_core.BorderStyleTypes.DOUBLE || ((_topRightCellBorder$l = topRightCellBorder.left) === null || _topRightCellBorder$l === void 0 ? void 0 : _topRightCellBorder$l.style) === _univerjs_core.BorderStyleTypes.DOUBLE) || type === "b" && (((_bottomCellBorder$rig = bottomCellBorder.right) === null || _bottomCellBorder$rig === void 0 ? void 0 : _bottomCellBorder$rig.style) === _univerjs_core.BorderStyleTypes.DOUBLE || ((_bottomRightCellBorde = bottomRightCellBorder.left) === null || _bottomRightCellBorde === void 0 ? void 0 : _bottomRightCellBorde.style) === _univerjs_core.BorderStyleTypes.DOUBLE)) outerLineOffsets.endXOffset = -defaultOffset;
|
|
5234
|
+
else if (type === "t" && topRightCellBorder.left && topRightCellBorder.left.style !== _univerjs_core.BorderStyleTypes.DOUBLE || type === "b" && bottomRightCellBorder.left && bottomRightCellBorder.left.style !== _univerjs_core.BorderStyleTypes.DOUBLE) outerLineOffsets.endXOffset = 0;
|
|
5246
5235
|
else outerLineOffsets.endXOffset = defaultOffset;
|
|
5247
5236
|
innerLineOffsets.endXOffset = defaultOffset;
|
|
5248
5237
|
}
|
|
5249
5238
|
clearLine.startX = startX - defaultOffset;
|
|
5250
5239
|
clearLine.endX = endX + defaultOffset;
|
|
5251
5240
|
clearMiddleLine(clearLine);
|
|
5252
|
-
if (type ===
|
|
5241
|
+
if (type === "t" && !topCellBorder.bottom || type === "b" && !bottomCellBorder.top) drawOuterLine(outerLineOffsets);
|
|
5253
5242
|
drawInnerLine(innerLineOffsets);
|
|
5254
5243
|
}
|
|
5255
5244
|
}
|
|
@@ -5260,10 +5249,10 @@ var Border = class extends SheetExtension {
|
|
|
5260
5249
|
let top = null;
|
|
5261
5250
|
let bottom = null;
|
|
5262
5251
|
if (cellBorder) {
|
|
5263
|
-
if (cellBorder[
|
|
5264
|
-
if (cellBorder[
|
|
5265
|
-
if (cellBorder[
|
|
5266
|
-
if (cellBorder[
|
|
5252
|
+
if (cellBorder["l"] && Object.prototype.hasOwnProperty.call(cellBorder["l"], "type")) left = cellBorder["l"];
|
|
5253
|
+
if (cellBorder["r"] && Object.prototype.hasOwnProperty.call(cellBorder["r"], "type")) right = cellBorder["r"];
|
|
5254
|
+
if (cellBorder["t"] && Object.prototype.hasOwnProperty.call(cellBorder["t"], "type")) top = cellBorder["t"];
|
|
5255
|
+
if (cellBorder["b"] && Object.prototype.hasOwnProperty.call(cellBorder["b"], "type")) bottom = cellBorder["b"];
|
|
5267
5256
|
}
|
|
5268
5257
|
return {
|
|
5269
5258
|
left,
|
|
@@ -5522,30 +5511,8 @@ SpreadsheetExtensionRegistry.add(Custom);
|
|
|
5522
5511
|
|
|
5523
5512
|
//#endregion
|
|
5524
5513
|
//#region src/components/docs/layout/line-breaker/break.ts
|
|
5525
|
-
/**
|
|
5526
|
-
* Copyright 2023-present DreamNum Co., Ltd.
|
|
5527
|
-
*
|
|
5528
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5529
|
-
* you may not use this file except in compliance with the License.
|
|
5530
|
-
* You may obtain a copy of the License at
|
|
5531
|
-
*
|
|
5532
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5533
|
-
*
|
|
5534
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
5535
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
5536
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
5537
|
-
* See the License for the specific language governing permissions and
|
|
5538
|
-
* limitations under the License.
|
|
5539
|
-
*/
|
|
5540
|
-
let BreakPointType = /* @__PURE__ */ function(BreakPointType) {
|
|
5541
|
-
BreakPointType["Normal"] = "Normal";
|
|
5542
|
-
BreakPointType["Mandatory"] = "Mandatory";
|
|
5543
|
-
BreakPointType["Hyphen"] = "Hyphen";
|
|
5544
|
-
BreakPointType["Link"] = "Link";
|
|
5545
|
-
return BreakPointType;
|
|
5546
|
-
}({});
|
|
5547
5514
|
var Break = class {
|
|
5548
|
-
constructor(position, type =
|
|
5515
|
+
constructor(position, type = "Normal") {
|
|
5549
5516
|
this.position = position;
|
|
5550
5517
|
this.type = type;
|
|
5551
5518
|
}
|
|
@@ -11223,7 +11190,7 @@ var LineBreaker = class {
|
|
|
11223
11190
|
this._nextClass = this._nextCharClass();
|
|
11224
11191
|
if (this._curClass === 34 || this._curClass === 36 && this._nextClass !== 37) {
|
|
11225
11192
|
this._curClass = mapFirst(mapClass(this._nextClass));
|
|
11226
|
-
return new Break(this._lastPos,
|
|
11193
|
+
return new Break(this._lastPos, "Mandatory");
|
|
11227
11194
|
}
|
|
11228
11195
|
if (this._rule.shouldBreak(this._codePoint, this._lastCodePoint, this._nextClass)) {
|
|
11229
11196
|
this._curClass = mapFirst(mapClass(this._nextClass));
|
|
@@ -11373,100 +11340,115 @@ var DocSimpleSkeleton = class {
|
|
|
11373
11340
|
while (true) {
|
|
11374
11341
|
const breakPoint = this._lineBreaker.nextBreakPoint();
|
|
11375
11342
|
if (!breakPoint) break;
|
|
11376
|
-
const { position } = breakPoint;
|
|
11377
|
-
const
|
|
11378
|
-
const
|
|
11379
|
-
|
|
11380
|
-
|
|
11343
|
+
const { position, type } = breakPoint;
|
|
11344
|
+
const rawText = this._text.slice(lastPosition, position);
|
|
11345
|
+
const isMandatoryBreak = type === "Mandatory";
|
|
11346
|
+
const text = isMandatoryBreak ? rawText.replace(/[\r\n]+$/, "") : rawText;
|
|
11347
|
+
if (text.length > 0) {
|
|
11348
|
+
const textSize = FontCache.getMeasureText(text, this._fontStyle);
|
|
11349
|
+
if (textSize.width + currentLine.width > this._width) if (textSize.width > this._width) {
|
|
11350
|
+
if (currentLine.text.length > 0) {
|
|
11351
|
+
this._lines.push(currentLine);
|
|
11352
|
+
totalHeight += currentLine.height;
|
|
11353
|
+
if (totalHeight > this._height) break;
|
|
11354
|
+
currentLine = {
|
|
11355
|
+
text: "",
|
|
11356
|
+
width: 0,
|
|
11357
|
+
height: 0,
|
|
11358
|
+
baseline: 0
|
|
11359
|
+
};
|
|
11360
|
+
}
|
|
11361
|
+
let remainingText = text;
|
|
11362
|
+
while (remainingText.length > 0) {
|
|
11363
|
+
let charCount = 0;
|
|
11364
|
+
let lineText = "";
|
|
11365
|
+
let lineWidth = 0;
|
|
11366
|
+
let startGuess = Math.min(this._lastBreakLength, remainingText.length);
|
|
11367
|
+
if (startGuess === 0) startGuess = Math.min(10, remainingText.length);
|
|
11368
|
+
let testText = remainingText.slice(0, startGuess);
|
|
11369
|
+
let testSize = FontCache.getMeasureText(testText, this._fontStyle);
|
|
11370
|
+
if (testSize.width + currentLine.width <= this._width) {
|
|
11371
|
+
charCount = startGuess;
|
|
11372
|
+
for (let i = startGuess + 1; i <= remainingText.length; i++) {
|
|
11373
|
+
testText = remainingText.slice(0, i);
|
|
11374
|
+
testSize = FontCache.getMeasureText(testText, this._fontStyle);
|
|
11375
|
+
if (testSize.width + currentLine.width <= this._width) charCount = i;
|
|
11376
|
+
else break;
|
|
11377
|
+
}
|
|
11378
|
+
} else {
|
|
11379
|
+
charCount = 0;
|
|
11380
|
+
for (let i = startGuess - 1; i >= 1; i--) {
|
|
11381
|
+
testText = remainingText.slice(0, i);
|
|
11382
|
+
testSize = FontCache.getMeasureText(testText, this._fontStyle);
|
|
11383
|
+
if (testSize.width + currentLine.width <= this._width) {
|
|
11384
|
+
charCount = i;
|
|
11385
|
+
break;
|
|
11386
|
+
}
|
|
11387
|
+
}
|
|
11388
|
+
}
|
|
11389
|
+
if (charCount > 0) this._lastBreakLength = charCount;
|
|
11390
|
+
if (charCount > 0) {
|
|
11391
|
+
lineText = remainingText.slice(0, charCount);
|
|
11392
|
+
lineWidth = FontCache.getMeasureText(lineText, this._fontStyle).width;
|
|
11393
|
+
}
|
|
11394
|
+
if (charCount === 0 && currentLine.text.length === 0) {
|
|
11395
|
+
charCount = 1;
|
|
11396
|
+
lineText = remainingText[0];
|
|
11397
|
+
lineWidth = FontCache.getMeasureText(lineText, this._fontStyle).width;
|
|
11398
|
+
}
|
|
11399
|
+
if (charCount > 0) {
|
|
11400
|
+
currentLine.text += lineText;
|
|
11401
|
+
currentLine.width += lineWidth;
|
|
11402
|
+
const textSize = FontCache.getMeasureText(currentLine.text, this._fontStyle);
|
|
11403
|
+
currentLine.height = textSize.fontBoundingBoxAscent + textSize.fontBoundingBoxDescent;
|
|
11404
|
+
currentLine.baseline = textSize.fontBoundingBoxAscent;
|
|
11405
|
+
remainingText = remainingText.slice(charCount);
|
|
11406
|
+
if (remainingText.length > 0) {
|
|
11407
|
+
this._lines.push(currentLine);
|
|
11408
|
+
totalHeight += currentLine.height;
|
|
11409
|
+
if (totalHeight > this._height) break;
|
|
11410
|
+
currentLine = {
|
|
11411
|
+
text: "",
|
|
11412
|
+
width: 0,
|
|
11413
|
+
height: 0,
|
|
11414
|
+
baseline: 0
|
|
11415
|
+
};
|
|
11416
|
+
}
|
|
11417
|
+
} else break;
|
|
11418
|
+
}
|
|
11419
|
+
} else if (currentLine.text.length > 0) {
|
|
11381
11420
|
this._lines.push(currentLine);
|
|
11382
11421
|
totalHeight += currentLine.height;
|
|
11383
11422
|
if (totalHeight > this._height) break;
|
|
11384
11423
|
currentLine = {
|
|
11385
|
-
text
|
|
11386
|
-
width:
|
|
11387
|
-
height:
|
|
11388
|
-
baseline:
|
|
11424
|
+
text,
|
|
11425
|
+
width: textSize.width,
|
|
11426
|
+
height: textSize.fontBoundingBoxAscent + textSize.fontBoundingBoxDescent,
|
|
11427
|
+
baseline: textSize.fontBoundingBoxAscent
|
|
11389
11428
|
};
|
|
11429
|
+
} else currentLine = {
|
|
11430
|
+
text,
|
|
11431
|
+
width: textSize.width,
|
|
11432
|
+
height: textSize.fontBoundingBoxAscent + textSize.fontBoundingBoxDescent,
|
|
11433
|
+
baseline: textSize.fontBoundingBoxAscent
|
|
11434
|
+
};
|
|
11435
|
+
else {
|
|
11436
|
+
currentLine.text = currentLine.text + text;
|
|
11437
|
+
currentLine.width = currentLine.width + textSize.width;
|
|
11438
|
+
currentLine.baseline = textSize.fontBoundingBoxAscent;
|
|
11439
|
+
currentLine.height = textSize.fontBoundingBoxAscent + textSize.fontBoundingBoxDescent;
|
|
11390
11440
|
}
|
|
11391
|
-
|
|
11392
|
-
|
|
11393
|
-
let charCount = 0;
|
|
11394
|
-
let lineText = "";
|
|
11395
|
-
let lineWidth = 0;
|
|
11396
|
-
let startGuess = Math.min(this._lastBreakLength, remainingText.length);
|
|
11397
|
-
if (startGuess === 0) startGuess = Math.min(10, remainingText.length);
|
|
11398
|
-
let testText = remainingText.slice(0, startGuess);
|
|
11399
|
-
let testSize = FontCache.getMeasureText(testText, this._fontStyle);
|
|
11400
|
-
if (testSize.width + currentLine.width <= this._width) {
|
|
11401
|
-
charCount = startGuess;
|
|
11402
|
-
for (let i = startGuess + 1; i <= remainingText.length; i++) {
|
|
11403
|
-
testText = remainingText.slice(0, i);
|
|
11404
|
-
testSize = FontCache.getMeasureText(testText, this._fontStyle);
|
|
11405
|
-
if (testSize.width + currentLine.width <= this._width) charCount = i;
|
|
11406
|
-
else break;
|
|
11407
|
-
}
|
|
11408
|
-
} else {
|
|
11409
|
-
charCount = 0;
|
|
11410
|
-
for (let i = startGuess - 1; i >= 1; i--) {
|
|
11411
|
-
testText = remainingText.slice(0, i);
|
|
11412
|
-
testSize = FontCache.getMeasureText(testText, this._fontStyle);
|
|
11413
|
-
if (testSize.width + currentLine.width <= this._width) {
|
|
11414
|
-
charCount = i;
|
|
11415
|
-
break;
|
|
11416
|
-
}
|
|
11417
|
-
}
|
|
11418
|
-
}
|
|
11419
|
-
if (charCount > 0) this._lastBreakLength = charCount;
|
|
11420
|
-
if (charCount > 0) {
|
|
11421
|
-
lineText = remainingText.slice(0, charCount);
|
|
11422
|
-
lineWidth = FontCache.getMeasureText(lineText, this._fontStyle).width;
|
|
11423
|
-
}
|
|
11424
|
-
if (charCount === 0 && currentLine.text.length === 0) {
|
|
11425
|
-
charCount = 1;
|
|
11426
|
-
lineText = remainingText[0];
|
|
11427
|
-
lineWidth = FontCache.getMeasureText(lineText, this._fontStyle).width;
|
|
11428
|
-
}
|
|
11429
|
-
if (charCount > 0) {
|
|
11430
|
-
currentLine.text += lineText;
|
|
11431
|
-
currentLine.width += lineWidth;
|
|
11432
|
-
const textSize = FontCache.getMeasureText(currentLine.text, this._fontStyle);
|
|
11433
|
-
currentLine.height = textSize.fontBoundingBoxAscent + textSize.fontBoundingBoxDescent;
|
|
11434
|
-
currentLine.baseline = textSize.fontBoundingBoxAscent;
|
|
11435
|
-
remainingText = remainingText.slice(charCount);
|
|
11436
|
-
if (remainingText.length > 0) {
|
|
11437
|
-
this._lines.push(currentLine);
|
|
11438
|
-
totalHeight += currentLine.height;
|
|
11439
|
-
if (totalHeight > this._height) break;
|
|
11440
|
-
currentLine = {
|
|
11441
|
-
text: "",
|
|
11442
|
-
width: 0,
|
|
11443
|
-
height: 0,
|
|
11444
|
-
baseline: 0
|
|
11445
|
-
};
|
|
11446
|
-
}
|
|
11447
|
-
} else break;
|
|
11448
|
-
}
|
|
11449
|
-
} else if (currentLine.text.length > 0) {
|
|
11441
|
+
}
|
|
11442
|
+
if (isMandatoryBreak) {
|
|
11450
11443
|
this._lines.push(currentLine);
|
|
11451
11444
|
totalHeight += currentLine.height;
|
|
11452
11445
|
if (totalHeight > this._height) break;
|
|
11453
11446
|
currentLine = {
|
|
11454
|
-
text,
|
|
11455
|
-
width:
|
|
11456
|
-
height:
|
|
11457
|
-
baseline:
|
|
11447
|
+
text: "",
|
|
11448
|
+
width: 0,
|
|
11449
|
+
height: 0,
|
|
11450
|
+
baseline: 0
|
|
11458
11451
|
};
|
|
11459
|
-
} else currentLine = {
|
|
11460
|
-
text,
|
|
11461
|
-
width: textSize.width,
|
|
11462
|
-
height: textSize.fontBoundingBoxAscent + textSize.fontBoundingBoxDescent,
|
|
11463
|
-
baseline: textSize.fontBoundingBoxAscent
|
|
11464
|
-
};
|
|
11465
|
-
else {
|
|
11466
|
-
currentLine.text = currentLine.text + text;
|
|
11467
|
-
currentLine.width = currentLine.width + textSize.width;
|
|
11468
|
-
currentLine.baseline = textSize.fontBoundingBoxAscent;
|
|
11469
|
-
currentLine.height = textSize.fontBoundingBoxAscent + textSize.fontBoundingBoxDescent;
|
|
11470
11452
|
}
|
|
11471
11453
|
lastPosition = position;
|
|
11472
11454
|
}
|
|
@@ -11542,8 +11524,8 @@ var Shape = class extends BaseObject {
|
|
|
11542
11524
|
_defineProperty(this, "_strokeDashArray", void 0);
|
|
11543
11525
|
_defineProperty(this, "_strokeDashOffset", 0);
|
|
11544
11526
|
_defineProperty(this, "_strokeMiterLimit", 0);
|
|
11545
|
-
_defineProperty(this, "_type",
|
|
11546
|
-
_defineProperty(this, "objectType",
|
|
11527
|
+
_defineProperty(this, "_type", "rect");
|
|
11528
|
+
_defineProperty(this, "objectType", 2);
|
|
11547
11529
|
this._initialProps(props);
|
|
11548
11530
|
}
|
|
11549
11531
|
get hoverCursor() {
|
|
@@ -12007,12 +11989,12 @@ var Liquid = class {
|
|
|
12007
11989
|
const { marginTop: pagePaddingTop = 0, marginBottom: _pagePaddingBottom = 0, marginLeft: pagePaddingLeft = 0, marginRight: _pagePaddingRight = 0 } = page;
|
|
12008
11990
|
this.translate(-pagePaddingLeft, -pagePaddingTop);
|
|
12009
11991
|
}
|
|
12010
|
-
translatePage(page, type =
|
|
11992
|
+
translatePage(page, type = 0, left = 0, top = 0, _right = 0, _bottom = 0) {
|
|
12011
11993
|
const { pageWidth, pageHeight } = page;
|
|
12012
11994
|
let pageTop = 0;
|
|
12013
11995
|
let pageLeft = 0;
|
|
12014
|
-
if (type ===
|
|
12015
|
-
else if (type ===
|
|
11996
|
+
if (type === 0) pageTop += pageHeight + top;
|
|
11997
|
+
else if (type === 1) pageLeft += pageWidth + left;
|
|
12016
11998
|
this.translate(pageLeft, pageTop);
|
|
12017
11999
|
return {
|
|
12018
12000
|
x: pageLeft,
|
|
@@ -12317,7 +12299,7 @@ var DocumentViewModel = class DocumentViewModel {
|
|
|
12317
12299
|
_defineProperty(this, "_tableCache", /* @__PURE__ */ new Map());
|
|
12318
12300
|
_defineProperty(this, "_tableNodeCache", /* @__PURE__ */ new Map());
|
|
12319
12301
|
_defineProperty(this, "_children", []);
|
|
12320
|
-
_defineProperty(this, "_editArea",
|
|
12302
|
+
_defineProperty(this, "_editArea", "BODY");
|
|
12321
12303
|
_defineProperty(this, "_editAreaChange$", new rxjs.BehaviorSubject(null));
|
|
12322
12304
|
_defineProperty(this, "editAreaChange$", this._editAreaChange$.asObservable());
|
|
12323
12305
|
_defineProperty(this, "_headerTreeMap", /* @__PURE__ */ new Map());
|
|
@@ -12557,16 +12539,16 @@ function baseAdjustability(content, width) {
|
|
|
12557
12539
|
};
|
|
12558
12540
|
}
|
|
12559
12541
|
function createSkeletonWordGlyph(content, config, glyphWidth) {
|
|
12560
|
-
return _createSkeletonWordOrLetter(
|
|
12542
|
+
return _createSkeletonWordOrLetter(1, content, config, glyphWidth);
|
|
12561
12543
|
}
|
|
12562
12544
|
function createSkeletonLetterGlyph(content, config, glyphWidth, glyphInfo) {
|
|
12563
|
-
return _createSkeletonWordOrLetter(
|
|
12545
|
+
return _createSkeletonWordOrLetter(0, content, config, glyphWidth, glyphInfo);
|
|
12564
12546
|
}
|
|
12565
12547
|
function createSkeletonTabGlyph(config, glyphWidth) {
|
|
12566
|
-
return _createSkeletonWordOrLetter(
|
|
12548
|
+
return _createSkeletonWordOrLetter(4, _univerjs_core.DataStreamTreeTokenType.TAB, config, glyphWidth);
|
|
12567
12549
|
}
|
|
12568
12550
|
function createHyphenDashGlyph(config) {
|
|
12569
|
-
const dashLetterGlyph = _createSkeletonWordOrLetter(
|
|
12551
|
+
const dashLetterGlyph = _createSkeletonWordOrLetter(0, "-", config);
|
|
12570
12552
|
dashLetterGlyph.count = 0;
|
|
12571
12553
|
return dashLetterGlyph;
|
|
12572
12554
|
}
|
|
@@ -12595,7 +12577,7 @@ function createSkeletonCustomBlockGlyph(config, glyphWidth = 0, glyphHeight = 0,
|
|
|
12595
12577
|
left: 0,
|
|
12596
12578
|
isJustifiable: false,
|
|
12597
12579
|
adjustability: baseAdjustability(content, 0),
|
|
12598
|
-
glyphType:
|
|
12580
|
+
glyphType: 3,
|
|
12599
12581
|
streamType: content,
|
|
12600
12582
|
count: 1,
|
|
12601
12583
|
drawingId
|
|
@@ -12641,7 +12623,7 @@ function _createSkeletonWordOrLetter(glyphType, content, config, glyphWidth, gly
|
|
|
12641
12623
|
left: 0,
|
|
12642
12624
|
isJustifiable: false,
|
|
12643
12625
|
adjustability: baseAdjustability(content, 0),
|
|
12644
|
-
glyphType:
|
|
12626
|
+
glyphType: 3,
|
|
12645
12627
|
streamType: content,
|
|
12646
12628
|
count: 1
|
|
12647
12629
|
};
|
|
@@ -12709,7 +12691,7 @@ function createSkeletonBulletGlyph(glyph, bulletSkeleton, charSpaceApply) {
|
|
|
12709
12691
|
left,
|
|
12710
12692
|
isJustifiable: isJustifiable(content),
|
|
12711
12693
|
adjustability: baseAdjustability(content, width),
|
|
12712
|
-
glyphType:
|
|
12694
|
+
glyphType: 2,
|
|
12713
12695
|
streamType: _univerjs_core.DataStreamTreeTokenType.LETTER,
|
|
12714
12696
|
count: 0,
|
|
12715
12697
|
raw: content
|
|
@@ -12747,17 +12729,6 @@ function glyphShrinkLeft(glyph, amount) {
|
|
|
12747
12729
|
|
|
12748
12730
|
//#endregion
|
|
12749
12731
|
//#region src/components/docs/layout/model/line.ts
|
|
12750
|
-
var WrapTextRuler = /* @__PURE__ */ function(WrapTextRuler) {
|
|
12751
|
-
WrapTextRuler[WrapTextRuler["BOTH"] = 0] = "BOTH";
|
|
12752
|
-
WrapTextRuler[WrapTextRuler["LEFT"] = 1] = "LEFT";
|
|
12753
|
-
WrapTextRuler[WrapTextRuler["RIGHT"] = 2] = "RIGHT";
|
|
12754
|
-
return WrapTextRuler;
|
|
12755
|
-
}(WrapTextRuler || {});
|
|
12756
|
-
var AxisType = /* @__PURE__ */ function(AxisType) {
|
|
12757
|
-
AxisType[AxisType["X"] = 0] = "X";
|
|
12758
|
-
AxisType[AxisType["Y"] = 1] = "Y";
|
|
12759
|
-
return AxisType;
|
|
12760
|
-
}(AxisType || {});
|
|
12761
12732
|
function createSkeletonLine(paragraphIndex, lineType, lineBoundingBox, columnWidth, lineIndex = 0, isParagraphStart = false, paragraphConfig, page, headerPage, footerPage) {
|
|
12762
12733
|
var _page$skeDrawings, _page$skeTables;
|
|
12763
12734
|
const { lineHeight = 15.6, lineTop = 0, contentHeight = 0, paddingLeft = 0, paddingRight = 0, paddingTop = 0, paddingBottom = 0, marginTop = 0, spaceBelowApply = 0 } = lineBoundingBox;
|
|
@@ -12949,11 +12920,11 @@ function __getCrossPoint(points, lineTop, lineHeight, columnWidth) {
|
|
|
12949
12920
|
width: range.max
|
|
12950
12921
|
};
|
|
12951
12922
|
}
|
|
12952
|
-
function ___getMaxAndMinAxis(points, axis =
|
|
12923
|
+
function ___getMaxAndMinAxis(points, axis = 0) {
|
|
12953
12924
|
const result = [];
|
|
12954
12925
|
for (let i = 0; i < points.length; i++) {
|
|
12955
12926
|
const point = points[i];
|
|
12956
|
-
if (axis ===
|
|
12927
|
+
if (axis === 0) result.push(point.x);
|
|
12957
12928
|
else result.push(point.y);
|
|
12958
12929
|
}
|
|
12959
12930
|
return {
|
|
@@ -12968,8 +12939,8 @@ function __getSplitWidthNoAngle(top, height, left, width, lineTop, lineHeight, c
|
|
|
12968
12939
|
let resultLeft = left - distL;
|
|
12969
12940
|
let resultWidth = width + distL + distR;
|
|
12970
12941
|
const ruler = ___getWrapTextRuler(wrapText, resultLeft, resultWidth, columnWidth);
|
|
12971
|
-
if (ruler ===
|
|
12972
|
-
else if (ruler ===
|
|
12942
|
+
if (ruler === 1) resultWidth = columnWidth - resultLeft;
|
|
12943
|
+
else if (ruler === 2) {
|
|
12973
12944
|
resultLeft = 0;
|
|
12974
12945
|
resultWidth = left + width + distR;
|
|
12975
12946
|
}
|
|
@@ -12979,11 +12950,11 @@ function __getSplitWidthNoAngle(top, height, left, width, lineTop, lineHeight, c
|
|
|
12979
12950
|
};
|
|
12980
12951
|
}
|
|
12981
12952
|
function ___getWrapTextRuler(wrapText, resultLeft, resultWidth, columnWidth) {
|
|
12982
|
-
let ruler =
|
|
12983
|
-
if (wrapText === _univerjs_core.WrapTextType.LEFT) ruler =
|
|
12984
|
-
else if (wrapText === _univerjs_core.WrapTextType.RIGHT) ruler =
|
|
12985
|
-
else if (wrapText === _univerjs_core.WrapTextType.LARGEST) if (resultLeft > columnWidth - resultLeft - resultWidth) ruler =
|
|
12986
|
-
else ruler =
|
|
12953
|
+
let ruler = 0;
|
|
12954
|
+
if (wrapText === _univerjs_core.WrapTextType.LEFT) ruler = 1;
|
|
12955
|
+
else if (wrapText === _univerjs_core.WrapTextType.RIGHT) ruler = 2;
|
|
12956
|
+
else if (wrapText === _univerjs_core.WrapTextType.LARGEST) if (resultLeft > columnWidth - resultLeft - resultWidth) ruler = 1;
|
|
12957
|
+
else ruler = 2;
|
|
12987
12958
|
return ruler;
|
|
12988
12959
|
}
|
|
12989
12960
|
function _calculateDivideByDrawings(columnWidth, drawingSplit) {
|
|
@@ -13390,7 +13361,7 @@ function getTableIdAndSliceIndex(tableSliceId) {
|
|
|
13390
13361
|
|
|
13391
13362
|
//#endregion
|
|
13392
13363
|
//#region src/components/docs/layout/block/paragraph/layout-ruler.ts
|
|
13393
|
-
function layoutParagraph(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType =
|
|
13364
|
+
function layoutParagraph(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType = "Normal") {
|
|
13394
13365
|
if (isParagraphFirstShapedText) if (paragraphConfig.bulletSkeleton) {
|
|
13395
13366
|
const { bulletSkeleton, paragraphStyle = {} } = paragraphConfig;
|
|
13396
13367
|
const { gridType = _univerjs_core.GridType.LINES, charSpace = 0, defaultTabStop = 10.5 } = sectionBreakConfig;
|
|
@@ -13437,7 +13408,7 @@ function _getConsecutiveHyphenLineCount(divide) {
|
|
|
13437
13408
|
let count = 0;
|
|
13438
13409
|
for (let i = column.lines.length - 1; i >= 0; i--) {
|
|
13439
13410
|
const line = column.lines[i];
|
|
13440
|
-
if (line.divides[line.divides.length - 1].breakType ===
|
|
13411
|
+
if (line.divides[line.divides.length - 1].breakType === "Hyphen") count++;
|
|
13441
13412
|
else break;
|
|
13442
13413
|
}
|
|
13443
13414
|
return count;
|
|
@@ -13455,7 +13426,7 @@ function _popHyphenSlice(divide) {
|
|
|
13455
13426
|
}
|
|
13456
13427
|
return glyphGroup;
|
|
13457
13428
|
}
|
|
13458
|
-
function _divideOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType =
|
|
13429
|
+
function _divideOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType = "Normal", defaultSpanLineHeight) {
|
|
13459
13430
|
const divideInfo = getLastNotFullDivideInfo(getLastPage(pages));
|
|
13460
13431
|
if (divideInfo) {
|
|
13461
13432
|
var _divide$glyphGroup;
|
|
@@ -13484,12 +13455,12 @@ function _divideOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphCo
|
|
|
13484
13455
|
} else if (hyphenLineCount > consecutiveHyphenLimit) {
|
|
13485
13456
|
const hyphenSliceGlyphGroup = _popHyphenSlice(divide);
|
|
13486
13457
|
if (hyphenSliceGlyphGroup.length > 0) {
|
|
13487
|
-
updateDivideInfo(divide, { breakType:
|
|
13488
|
-
_divideOperator(ctx, hyphenSliceGlyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText,
|
|
13458
|
+
updateDivideInfo(divide, { breakType: "Normal" });
|
|
13459
|
+
_divideOperator(ctx, hyphenSliceGlyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, "Hyphen");
|
|
13489
13460
|
}
|
|
13490
13461
|
_divideOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType, defaultSpanLineHeight);
|
|
13491
13462
|
} else _divideOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType, defaultSpanLineHeight);
|
|
13492
|
-
} else if (isLast && hyphenationZone && hyphenationZone > 0 && preOffsetLeft >= divide.width - hyphenationZone && breakPointType ===
|
|
13463
|
+
} else if (isLast && hyphenationZone && hyphenationZone > 0 && preOffsetLeft >= divide.width - hyphenationZone && breakPointType === "Hyphen" && divide.breakType === "Normal") {
|
|
13493
13464
|
updateDivideInfo(divide, { isFull: true });
|
|
13494
13465
|
_divideOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType, defaultSpanLineHeight);
|
|
13495
13466
|
} else {
|
|
@@ -13504,7 +13475,7 @@ function _divideOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphCo
|
|
|
13504
13475
|
const spanGroupCachedLen = spanGroupCached.length;
|
|
13505
13476
|
let newGlyphGroup = [];
|
|
13506
13477
|
let startIndex = 1;
|
|
13507
|
-
if (spanGroupCachedLen > 2 && spanGroupCached[0].glyphType ===
|
|
13478
|
+
if (spanGroupCachedLen > 2 && spanGroupCached[0].glyphType === 2) {
|
|
13508
13479
|
newGlyphGroup = [spanGroupCached[0], spanGroupCached[1]];
|
|
13509
13480
|
startIndex = 2;
|
|
13510
13481
|
} else newGlyphGroup = [spanGroupCached[0]];
|
|
@@ -13520,7 +13491,7 @@ function _divideOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphCo
|
|
|
13520
13491
|
}
|
|
13521
13492
|
} else _lineOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType, defaultSpanLineHeight);
|
|
13522
13493
|
}
|
|
13523
|
-
function _lineOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType =
|
|
13494
|
+
function _lineOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType = "Normal", defaultGlyphLineHeight) {
|
|
13524
13495
|
var _originParagraphStyle, _originParagraphStyle2, _skeHeaders$get, _skeFooters$get;
|
|
13525
13496
|
let lastPage = getLastPage(pages);
|
|
13526
13497
|
let columnInfo = getLastNotFullColumnInfo(lastPage);
|
|
@@ -13597,7 +13568,7 @@ function _lineOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConf
|
|
|
13597
13568
|
paddingLeft = column.width * leftPercent - .5;
|
|
13598
13569
|
paddingRight = column.width - paddingLeft - .5;
|
|
13599
13570
|
}
|
|
13600
|
-
const newLine = createSkeletonLine(paragraphIndex,
|
|
13571
|
+
const newLine = createSkeletonLine(paragraphIndex, 0, {
|
|
13601
13572
|
lineHeight,
|
|
13602
13573
|
contentHeight,
|
|
13603
13574
|
lineTop: newLineTop,
|
|
@@ -13630,7 +13601,7 @@ function __updateAndPositionDrawings(ctx, lineTop, lineHeight, column, targetDra
|
|
|
13630
13601
|
width,
|
|
13631
13602
|
height,
|
|
13632
13603
|
angle,
|
|
13633
|
-
type:
|
|
13604
|
+
type: "IMAGE",
|
|
13634
13605
|
positionV
|
|
13635
13606
|
};
|
|
13636
13607
|
}), column, paragraphIndex);
|
|
@@ -13648,7 +13619,7 @@ function __updateWrapTablePosition(ctx, table, lineTop, lineHeight, column, para
|
|
|
13648
13619
|
width,
|
|
13649
13620
|
height,
|
|
13650
13621
|
angle: 0,
|
|
13651
|
-
type:
|
|
13622
|
+
type: "TABLE",
|
|
13652
13623
|
positionV: tableSource.position.positionV
|
|
13653
13624
|
}], column, paragraphIndex);
|
|
13654
13625
|
table.top = top;
|
|
@@ -13804,11 +13775,11 @@ function checkRelativeDrawingNeedRePosition(ctx, floatObject) {
|
|
|
13804
13775
|
}
|
|
13805
13776
|
return false;
|
|
13806
13777
|
}
|
|
13807
|
-
function _columnOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType =
|
|
13778
|
+
function _columnOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType = "Normal", defaultSpanLineHeight) {
|
|
13808
13779
|
if (isColumnFull(getLastPage(pages)) === true) _pageOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType, defaultSpanLineHeight);
|
|
13809
13780
|
else _lineOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType, defaultSpanLineHeight);
|
|
13810
13781
|
}
|
|
13811
|
-
function _pageOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType =
|
|
13782
|
+
function _pageOperator(ctx, glyphGroup, pages, sectionBreakConfig, paragraphConfig, isParagraphFirstShapedText, breakPointType = "Normal", defaultSpanLineHeight) {
|
|
13812
13783
|
const curSkeletonPage = getLastPage(pages);
|
|
13813
13784
|
const { skeHeaders, skeFooters } = paragraphConfig;
|
|
13814
13785
|
pages.push(createSkeletonPage(ctx, sectionBreakConfig, {
|
|
@@ -14165,7 +14136,7 @@ function updateBlockIndex(pages, start = -1) {
|
|
|
14165
14136
|
const divStartIndex = preDivideStartIndex;
|
|
14166
14137
|
let divEndIndex = divStartIndex;
|
|
14167
14138
|
for (const glyph of glyphGroup) {
|
|
14168
|
-
const increaseValue = glyph.glyphType ===
|
|
14139
|
+
const increaseValue = glyph.glyphType === 2 ? 0 : glyph.count;
|
|
14169
14140
|
divEndIndex += increaseValue;
|
|
14170
14141
|
const { ba, bd } = glyph.bBox;
|
|
14171
14142
|
maxLineAsc = Math.max(maxLineAsc, ba);
|
|
@@ -14431,11 +14402,6 @@ function getNullSkeleton() {
|
|
|
14431
14402
|
function setPageParent(pages, parent) {
|
|
14432
14403
|
for (const page of pages) page.parent = parent;
|
|
14433
14404
|
}
|
|
14434
|
-
let FloatObjectType = /* @__PURE__ */ function(FloatObjectType) {
|
|
14435
|
-
FloatObjectType["IMAGE"] = "IMAGE";
|
|
14436
|
-
FloatObjectType["TABLE"] = "TABLE";
|
|
14437
|
-
return FloatObjectType;
|
|
14438
|
-
}({});
|
|
14439
14405
|
const DEFAULT_SECTION_BREAK = {
|
|
14440
14406
|
columnProperties: [],
|
|
14441
14407
|
columnSeparatorType: _univerjs_core.ColumnSeparatorType.NONE,
|
|
@@ -14583,7 +14549,7 @@ function getPageFromPath(skeletonData, path) {
|
|
|
14583
14549
|
function getHeaderFooterMaxHeight(pageHeight) {
|
|
14584
14550
|
return (pageHeight - 100) / 2;
|
|
14585
14551
|
}
|
|
14586
|
-
function createSkeletonPage(ctx, sectionBreakConfig, skeletonResourceReference, pageNumber = 1, breakType =
|
|
14552
|
+
function createSkeletonPage(ctx, sectionBreakConfig, skeletonResourceReference, pageNumber = 1, breakType = 0) {
|
|
14587
14553
|
const page = _getNullPage();
|
|
14588
14554
|
const { pageNumberStart = 1, pageSize = {
|
|
14589
14555
|
width: Number.POSITIVE_INFINITY,
|
|
@@ -14653,7 +14619,7 @@ function createSkeletonPage(ctx, sectionBreakConfig, skeletonResourceReference,
|
|
|
14653
14619
|
sections.push(newSection);
|
|
14654
14620
|
return page;
|
|
14655
14621
|
}
|
|
14656
|
-
function _getNullPage(type =
|
|
14622
|
+
function _getNullPage(type = 0, segmentId = "") {
|
|
14657
14623
|
return {
|
|
14658
14624
|
sections: [],
|
|
14659
14625
|
headerId: "",
|
|
@@ -14674,7 +14640,7 @@ function _getNullPage(type = DocumentSkeletonPageType.BODY, segmentId = "") {
|
|
|
14674
14640
|
marginTop: 0,
|
|
14675
14641
|
originMarginBottom: 0,
|
|
14676
14642
|
marginBottom: 0,
|
|
14677
|
-
breakType:
|
|
14643
|
+
breakType: 0,
|
|
14678
14644
|
st: 0,
|
|
14679
14645
|
ed: 0,
|
|
14680
14646
|
skeDrawings: /* @__PURE__ */ new Map(),
|
|
@@ -14700,7 +14666,7 @@ function _createSkeletonHeaderFooter(ctx, headerOrFooterViewModel, sectionBreakC
|
|
|
14700
14666
|
};
|
|
14701
14667
|
if (areaPage == null) {
|
|
14702
14668
|
areaPage = createSkeletonPage(ctx, headerFooterConfig, skeletonResourceReference);
|
|
14703
|
-
areaPage.type = isHeader ?
|
|
14669
|
+
areaPage.type = isHeader ? 1 : 2;
|
|
14704
14670
|
areaPage.segmentId = segmentId;
|
|
14705
14671
|
}
|
|
14706
14672
|
const layoutAnchor = ctx.layoutStartPointer[segmentId];
|
|
@@ -14749,7 +14715,7 @@ function createNullCellPage(ctx, sectionBreakConfig, tableConfig, row, col, avai
|
|
|
14749
14715
|
width: pageWidth,
|
|
14750
14716
|
height: Number.isFinite(availableHeight) ? availableHeight : pageHeight
|
|
14751
14717
|
} }), skeletonResourceReference);
|
|
14752
|
-
areaPage.type =
|
|
14718
|
+
areaPage.type = 3;
|
|
14753
14719
|
areaPage.segmentId = tableId;
|
|
14754
14720
|
return {
|
|
14755
14721
|
page: areaPage,
|
|
@@ -14761,7 +14727,7 @@ function createSkeletonCellPages(ctx, viewModel, cellNode, sectionBreakConfig, t
|
|
|
14761
14727
|
const { page: areaPage, sectionBreakConfig: cellSectionBreakConfig } = createNullCellPage(ctx, sectionBreakConfig, tableConfig, row, col, availableHeight, maxCellPageHeight);
|
|
14762
14728
|
const { pages } = dealWithSection(ctx, viewModel, sectionNode, areaPage, cellSectionBreakConfig);
|
|
14763
14729
|
for (const p of pages) {
|
|
14764
|
-
p.type =
|
|
14730
|
+
p.type = 3;
|
|
14765
14731
|
p.segmentId = tableConfig.tableId;
|
|
14766
14732
|
}
|
|
14767
14733
|
updateBlockIndex(pages, cellNode.startIndex);
|
|
@@ -14960,7 +14926,7 @@ function addHyphenDash(line, viewModel, paragraphNode, sectionBreakConfig, parag
|
|
|
14960
14926
|
for (const divide of line.divides) {
|
|
14961
14927
|
const { glyphGroup, breakType } = divide;
|
|
14962
14928
|
const lastGlyph = glyphGroup[glyphGroup.length - 1];
|
|
14963
|
-
if (lastGlyph && isLetter(lastGlyph.content) && breakType ===
|
|
14929
|
+
if (lastGlyph && isLetter(lastGlyph.content) && breakType === "Hyphen") {
|
|
14964
14930
|
const hyphenDashGlyph = createHyphenDashGlyph(getFontConfigFromLastGlyph(lastGlyph, sectionBreakConfig, paragraphStyle));
|
|
14965
14931
|
hyphenDashGlyph.parent = lastGlyph.parent;
|
|
14966
14932
|
hyphenDashGlyph.left = lastGlyph.left + lastGlyph.width;
|
|
@@ -15285,7 +15251,7 @@ function lineBreaking(ctx, viewModel, shapedTextList, curPage, paragraphNode, se
|
|
|
15285
15251
|
};
|
|
15286
15252
|
if (text.endsWith(_univerjs_core.DataStreamTreeTokenType.PAGE_BREAK)) {
|
|
15287
15253
|
pushPending();
|
|
15288
|
-
allPages.push(createSkeletonPage(ctx, sectionBreakConfig, skeletonResourceReference, _getNextPageNumber(allPages[allPages.length - 1]),
|
|
15254
|
+
allPages.push(createSkeletonPage(ctx, sectionBreakConfig, skeletonResourceReference, _getNextPageNumber(allPages[allPages.length - 1]), 1));
|
|
15289
15255
|
paragraphNonInlineSkeDrawings.clear();
|
|
15290
15256
|
paragraphInlineSkeDrawings.clear();
|
|
15291
15257
|
continue;
|
|
@@ -15294,7 +15260,7 @@ function lineBreaking(ctx, viewModel, shapedTextList, curPage, paragraphNode, se
|
|
|
15294
15260
|
const lastPage = allPages[allPages.length - 1];
|
|
15295
15261
|
const columnInfo = getLastNotFullColumnInfo(lastPage);
|
|
15296
15262
|
if (columnInfo && !columnInfo.isLast) setColumnFullState(columnInfo.column, true);
|
|
15297
|
-
else allPages.push(createSkeletonPage(ctx, sectionBreakConfig, skeletonResourceReference, _getNextPageNumber(lastPage),
|
|
15263
|
+
else allPages.push(createSkeletonPage(ctx, sectionBreakConfig, skeletonResourceReference, _getNextPageNumber(lastPage), 2));
|
|
15298
15264
|
continue;
|
|
15299
15265
|
}
|
|
15300
15266
|
pushPending();
|
|
@@ -15302,106 +15268,6 @@ function lineBreaking(ctx, viewModel, shapedTextList, curPage, paragraphNode, se
|
|
|
15302
15268
|
return allPages;
|
|
15303
15269
|
}
|
|
15304
15270
|
|
|
15305
|
-
//#endregion
|
|
15306
|
-
//#region src/components/docs/layout/hyphenation/lang.ts
|
|
15307
|
-
/**
|
|
15308
|
-
* Copyright 2023-present DreamNum Co., Ltd.
|
|
15309
|
-
*
|
|
15310
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
15311
|
-
* you may not use this file except in compliance with the License.
|
|
15312
|
-
* You may obtain a copy of the License at
|
|
15313
|
-
*
|
|
15314
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
15315
|
-
*
|
|
15316
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
15317
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15318
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15319
|
-
* See the License for the specific language governing permissions and
|
|
15320
|
-
* limitations under the License.
|
|
15321
|
-
*/
|
|
15322
|
-
let Lang = /* @__PURE__ */ function(Lang) {
|
|
15323
|
-
Lang["Af"] = "af";
|
|
15324
|
-
Lang["As"] = "as";
|
|
15325
|
-
Lang["Be"] = "be";
|
|
15326
|
-
Lang["Bg"] = "bg";
|
|
15327
|
-
Lang["Bn"] = "bn";
|
|
15328
|
-
Lang["Ca"] = "ca";
|
|
15329
|
-
Lang["Cop"] = "cop";
|
|
15330
|
-
Lang["Cs"] = "cs";
|
|
15331
|
-
Lang["Cu"] = "cu";
|
|
15332
|
-
Lang["Cy"] = "cy";
|
|
15333
|
-
Lang["Da"] = "da";
|
|
15334
|
-
Lang["De1901"] = "de-1901";
|
|
15335
|
-
Lang["De1996"] = "de-1996";
|
|
15336
|
-
Lang["DeCh1901"] = "de-ch-1901";
|
|
15337
|
-
Lang["ElMonoton"] = "el-monoton";
|
|
15338
|
-
Lang["ElPolyton"] = "el-polyton";
|
|
15339
|
-
Lang["EnGb"] = "en-gb";
|
|
15340
|
-
Lang["EnUs"] = "en-us";
|
|
15341
|
-
Lang["Es"] = "es";
|
|
15342
|
-
Lang["Et"] = "et";
|
|
15343
|
-
Lang["Eu"] = "eu";
|
|
15344
|
-
Lang["Fi"] = "fi";
|
|
15345
|
-
Lang["Fr"] = "fr";
|
|
15346
|
-
Lang["Fur"] = "fur";
|
|
15347
|
-
Lang["Ga"] = "ga";
|
|
15348
|
-
Lang["Gl"] = "gl";
|
|
15349
|
-
Lang["Grc"] = "grc";
|
|
15350
|
-
Lang["Gu"] = "gu";
|
|
15351
|
-
Lang["Hi"] = "hi";
|
|
15352
|
-
Lang["Hr"] = "hr";
|
|
15353
|
-
Lang["Hsb"] = "hsb";
|
|
15354
|
-
Lang["Hu"] = "hu";
|
|
15355
|
-
Lang["Hy"] = "hy";
|
|
15356
|
-
Lang["Ia"] = "ia";
|
|
15357
|
-
Lang["Id"] = "id";
|
|
15358
|
-
Lang["Is"] = "is";
|
|
15359
|
-
Lang["It"] = "it";
|
|
15360
|
-
Lang["Ka"] = "ka";
|
|
15361
|
-
Lang["Kmr"] = "kmr";
|
|
15362
|
-
Lang["Kn"] = "kn";
|
|
15363
|
-
Lang["LaXClassic"] = "la-x-classic";
|
|
15364
|
-
Lang["LaXLiturgic"] = "la-x-liturgic";
|
|
15365
|
-
Lang["La"] = "la";
|
|
15366
|
-
Lang["Lt"] = "lt";
|
|
15367
|
-
Lang["Lv"] = "lv";
|
|
15368
|
-
Lang["Ml"] = "ml";
|
|
15369
|
-
Lang["MnCyrlXLmc"] = "mn-cyrl-x-lmc";
|
|
15370
|
-
Lang["MnCyrl"] = "mn-cyrl";
|
|
15371
|
-
Lang["Mr"] = "mr";
|
|
15372
|
-
Lang["MulEthi"] = "mul-ethi";
|
|
15373
|
-
Lang["Nb"] = "nb";
|
|
15374
|
-
Lang["Nl"] = "nl";
|
|
15375
|
-
Lang["Nn"] = "nn";
|
|
15376
|
-
Lang["No"] = "no";
|
|
15377
|
-
Lang["Oc"] = "oc";
|
|
15378
|
-
Lang["Or"] = "or";
|
|
15379
|
-
Lang["Pa"] = "pa";
|
|
15380
|
-
Lang["Pi"] = "pi";
|
|
15381
|
-
Lang["Pl"] = "pl";
|
|
15382
|
-
Lang["Pms"] = "pms";
|
|
15383
|
-
Lang["Pt"] = "pt";
|
|
15384
|
-
Lang["Rm"] = "rm";
|
|
15385
|
-
Lang["Ro"] = "ro";
|
|
15386
|
-
Lang["Ru"] = "ru";
|
|
15387
|
-
Lang["Sa"] = "sa";
|
|
15388
|
-
Lang["ShCyrl"] = "sh-cyrl";
|
|
15389
|
-
Lang["ShLatn"] = "sh-latn";
|
|
15390
|
-
Lang["Sk"] = "sk";
|
|
15391
|
-
Lang["Sl"] = "sl";
|
|
15392
|
-
Lang["SrCyrl"] = "sr-cyrl";
|
|
15393
|
-
Lang["Sv"] = "sv";
|
|
15394
|
-
Lang["Ta"] = "ta";
|
|
15395
|
-
Lang["Te"] = "te";
|
|
15396
|
-
Lang["Th"] = "th";
|
|
15397
|
-
Lang["Tk"] = "tk";
|
|
15398
|
-
Lang["Tr"] = "tr";
|
|
15399
|
-
Lang["Uk"] = "uk";
|
|
15400
|
-
Lang["ZhLatnPinyin"] = "zh-latn-pinyin";
|
|
15401
|
-
Lang["UNKNOWN"] = "unknown";
|
|
15402
|
-
return Lang;
|
|
15403
|
-
}({});
|
|
15404
|
-
|
|
15405
15271
|
//#endregion
|
|
15406
15272
|
//#region src/components/docs/layout/line-breaker/enhancers/hyphen-enhancer.ts
|
|
15407
15273
|
function isUpperCase(word) {
|
|
@@ -15428,7 +15294,7 @@ var LineBreakerHyphenEnhancer = class {
|
|
|
15428
15294
|
this._nextBreak = this._lineBreaker.nextBreakPoint();
|
|
15429
15295
|
if (this._nextBreak == null || this._curBreak == null) return null;
|
|
15430
15296
|
const word = getWord(this.content.slice(this._curBreak.position, this._nextBreak.position));
|
|
15431
|
-
if (word.length && !(isUpperCase(word) && this._doNotHyphenateCaps) && this._nextBreak.type !==
|
|
15297
|
+
if (word.length && !(isUpperCase(word) && this._doNotHyphenateCaps) && this._nextBreak.type !== "Link") {
|
|
15432
15298
|
this._isInWord = true;
|
|
15433
15299
|
this._word = word;
|
|
15434
15300
|
this._hyphenSlice = this._hyphen.hyphenate(this._word, this._lang);
|
|
@@ -15438,7 +15304,7 @@ var LineBreakerHyphenEnhancer = class {
|
|
|
15438
15304
|
} else if (this._hyphenIndex < this._hyphenSlice.length - 1) {
|
|
15439
15305
|
const position = getSlicePosition(this._curBreak.position, this._hyphenSlice, this._hyphenIndex);
|
|
15440
15306
|
this._hyphenIndex++;
|
|
15441
|
-
return new Break(position,
|
|
15307
|
+
return new Break(position, "Hyphen");
|
|
15442
15308
|
} else {
|
|
15443
15309
|
this._isInWord = false;
|
|
15444
15310
|
this._word = "";
|
|
@@ -15451,27 +15317,20 @@ var LineBreakerHyphenEnhancer = class {
|
|
|
15451
15317
|
|
|
15452
15318
|
//#endregion
|
|
15453
15319
|
//#region src/components/docs/layout/line-breaker/enhancers/link-enhancer.ts
|
|
15454
|
-
var LinkCharType = /* @__PURE__ */ function(LinkCharType) {
|
|
15455
|
-
LinkCharType["Alphabetic"] = "Alphabetic";
|
|
15456
|
-
LinkCharType["Digit"] = "Digit";
|
|
15457
|
-
LinkCharType["Open"] = "Open";
|
|
15458
|
-
LinkCharType["Other"] = "Other";
|
|
15459
|
-
return LinkCharType;
|
|
15460
|
-
}(LinkCharType || {});
|
|
15461
15320
|
function ofLinkCharType(char) {
|
|
15462
|
-
if (/[a-z]/i.test(char)) return
|
|
15463
|
-
else if (/[0-9]/.test(char)) return
|
|
15464
|
-
else if (char === "(" || char === "[") return
|
|
15465
|
-
else return
|
|
15321
|
+
if (/[a-z]/i.test(char)) return "Alphabetic";
|
|
15322
|
+
else if (/[0-9]/.test(char)) return "Digit";
|
|
15323
|
+
else if (char === "(" || char === "[") return "Open";
|
|
15324
|
+
else return "Other";
|
|
15466
15325
|
}
|
|
15467
15326
|
function linebreakLink(link) {
|
|
15468
15327
|
const pieces = [];
|
|
15469
15328
|
let offset = 0;
|
|
15470
|
-
let prevCharType =
|
|
15329
|
+
let prevCharType = "Other";
|
|
15471
15330
|
for (let i = 0; i < link.length; i++) {
|
|
15472
15331
|
const char = link[i];
|
|
15473
15332
|
const charType = ofLinkCharType(char);
|
|
15474
|
-
if (i > 0 && prevCharType !==
|
|
15333
|
+
if (i > 0 && prevCharType !== "Open" && (charType === "Other" ? charType === "Other" : charType !== prevCharType)) {
|
|
15475
15334
|
const piece = link.slice(offset, i);
|
|
15476
15335
|
if (piece.length < 16) pieces.push(piece);
|
|
15477
15336
|
else for (let j = 0; j < piece.length; j++) pieces.push(piece[j]);
|
|
@@ -15522,7 +15381,7 @@ var LineBreakerLinkEnhancer = class {
|
|
|
15522
15381
|
} else if (this._index < this._linkSlice.length - 1) {
|
|
15523
15382
|
const position = getSlicePosition(this._curBreak.position, this._linkSlice, this._index);
|
|
15524
15383
|
this._index++;
|
|
15525
|
-
return new Break(position,
|
|
15384
|
+
return new Break(position, "Link");
|
|
15526
15385
|
} else {
|
|
15527
15386
|
this._isInLink = false;
|
|
15528
15387
|
this._link = "";
|
|
@@ -15553,59 +15412,35 @@ function tabLineBreakExtension(breaker) {
|
|
|
15553
15412
|
|
|
15554
15413
|
//#endregion
|
|
15555
15414
|
//#region src/components/docs/layout/shaping-engine/font-library.ts
|
|
15556
|
-
var CompareResult = /* @__PURE__ */ function(CompareResult) {
|
|
15557
|
-
CompareResult[CompareResult["EQUAL"] = 0] = "EQUAL";
|
|
15558
|
-
CompareResult[CompareResult["GREATER"] = 1] = "GREATER";
|
|
15559
|
-
CompareResult[CompareResult["LESS"] = 2] = "LESS";
|
|
15560
|
-
return CompareResult;
|
|
15561
|
-
}(CompareResult || {});
|
|
15562
|
-
var FontStyle = /* @__PURE__ */ function(FontStyle) {
|
|
15563
|
-
FontStyle[FontStyle["Normal"] = 0] = "Normal";
|
|
15564
|
-
FontStyle[FontStyle["Italic"] = 1] = "Italic";
|
|
15565
|
-
FontStyle[FontStyle["Oblique"] = 2] = "Oblique";
|
|
15566
|
-
return FontStyle;
|
|
15567
|
-
}(FontStyle || {});
|
|
15568
|
-
var FontWeight = /* @__PURE__ */ function(FontWeight) {
|
|
15569
|
-
FontWeight[FontWeight["THIN"] = 100] = "THIN";
|
|
15570
|
-
FontWeight[FontWeight["EXTRALIGHT"] = 200] = "EXTRALIGHT";
|
|
15571
|
-
FontWeight[FontWeight["LIGHT"] = 300] = "LIGHT";
|
|
15572
|
-
FontWeight[FontWeight["REGULAR"] = 400] = "REGULAR";
|
|
15573
|
-
FontWeight[FontWeight["MEDIUM"] = 500] = "MEDIUM";
|
|
15574
|
-
FontWeight[FontWeight["SEMIBOLD"] = 600] = "SEMIBOLD";
|
|
15575
|
-
FontWeight[FontWeight["BOLD"] = 700] = "BOLD";
|
|
15576
|
-
FontWeight[FontWeight["EXTRABOLD"] = 800] = "EXTRABOLD";
|
|
15577
|
-
FontWeight[FontWeight["BLACK"] = 900] = "BLACK";
|
|
15578
|
-
return FontWeight;
|
|
15579
|
-
}(FontWeight || {});
|
|
15580
15415
|
function getFontInfoFromFontData(fontData) {
|
|
15581
15416
|
const { family, style: styleString } = fontData;
|
|
15582
|
-
let style =
|
|
15583
|
-
let weight =
|
|
15584
|
-
if (/italic/i.test(styleString)) style =
|
|
15417
|
+
let style = 0;
|
|
15418
|
+
let weight = 400;
|
|
15419
|
+
if (/italic/i.test(styleString)) style = 1;
|
|
15585
15420
|
switch (true) {
|
|
15586
15421
|
case /thin|hairline/i.test(styleString):
|
|
15587
|
-
weight =
|
|
15422
|
+
weight = 100;
|
|
15588
15423
|
break;
|
|
15589
15424
|
case /(extra|ultra) *light/i.test(styleString):
|
|
15590
|
-
weight =
|
|
15425
|
+
weight = 200;
|
|
15591
15426
|
break;
|
|
15592
15427
|
case /light/i.test(styleString):
|
|
15593
|
-
weight =
|
|
15428
|
+
weight = 300;
|
|
15594
15429
|
break;
|
|
15595
15430
|
case /medium/i.test(styleString):
|
|
15596
|
-
weight =
|
|
15431
|
+
weight = 500;
|
|
15597
15432
|
break;
|
|
15598
15433
|
case /(semi|demi) *bold/i.test(styleString):
|
|
15599
|
-
weight =
|
|
15434
|
+
weight = 600;
|
|
15600
15435
|
break;
|
|
15601
15436
|
case /bold/i.test(styleString):
|
|
15602
|
-
weight =
|
|
15437
|
+
weight = 700;
|
|
15603
15438
|
break;
|
|
15604
15439
|
case /(extra|ultra) *bold/i.test(styleString):
|
|
15605
|
-
weight =
|
|
15440
|
+
weight = 800;
|
|
15606
15441
|
break;
|
|
15607
15442
|
case /black|heavy/i.test(styleString):
|
|
15608
|
-
weight =
|
|
15443
|
+
weight = 900;
|
|
15609
15444
|
break;
|
|
15610
15445
|
}
|
|
15611
15446
|
return {
|
|
@@ -15621,23 +15456,23 @@ function getFontInfoFromTextStyle(style) {
|
|
|
15621
15456
|
return {
|
|
15622
15457
|
family: ff !== null && ff !== void 0 ? ff : "Arial",
|
|
15623
15458
|
variant: {
|
|
15624
|
-
style: it === _univerjs_core.BooleanNumber.TRUE ?
|
|
15625
|
-
weight: bl === _univerjs_core.BooleanNumber.TRUE ?
|
|
15459
|
+
style: it === _univerjs_core.BooleanNumber.TRUE ? 1 : 0,
|
|
15460
|
+
weight: bl === _univerjs_core.BooleanNumber.TRUE ? 700 : 400
|
|
15626
15461
|
}
|
|
15627
15462
|
};
|
|
15628
15463
|
}
|
|
15629
15464
|
function fontInfoDistance(a, b) {
|
|
15630
15465
|
let styleDistance = Number.POSITIVE_INFINITY;
|
|
15631
15466
|
if (a.variant.style === b.variant.style) styleDistance = 0;
|
|
15632
|
-
else if (a.variant.style !==
|
|
15467
|
+
else if (a.variant.style !== 0 && b.variant.style !== 0) styleDistance = 1;
|
|
15633
15468
|
else styleDistance = 2;
|
|
15634
15469
|
const weightDistance = Math.abs(a.variant.weight - b.variant.weight);
|
|
15635
15470
|
return [styleDistance, weightDistance];
|
|
15636
15471
|
}
|
|
15637
15472
|
function compareFontInfoDistance(a, b) {
|
|
15638
|
-
if (a[0] === b[0] && a[1] === b[1]) return
|
|
15639
|
-
if (a[0] === b[0]) return a[1] > b[1] ?
|
|
15640
|
-
return a[0] > b[0] ?
|
|
15473
|
+
if (a[0] === b[0] && a[1] === b[1]) return 0;
|
|
15474
|
+
if (a[0] === b[0]) return a[1] > b[1] ? 1 : 2;
|
|
15475
|
+
return a[0] > b[0] ? 1 : 2;
|
|
15641
15476
|
}
|
|
15642
15477
|
async function checkLocalFontsPermission() {
|
|
15643
15478
|
var _window$navigator;
|
|
@@ -15692,7 +15527,7 @@ var FontLibrary = class {
|
|
|
15692
15527
|
if (bestFont == null) {
|
|
15693
15528
|
bestFont = fontWithBuffer;
|
|
15694
15529
|
bestDistance = distance;
|
|
15695
|
-
} else if (compareFontInfoDistance(bestDistance, distance) ===
|
|
15530
|
+
} else if (compareFontInfoDistance(bestDistance, distance) === 1) {
|
|
15696
15531
|
bestFont = fontWithBuffer;
|
|
15697
15532
|
bestDistance = distance;
|
|
15698
15533
|
}
|
|
@@ -15780,7 +15615,7 @@ function shapeChunk(content, charPosition, used, families, style) {
|
|
|
15780
15615
|
});
|
|
15781
15616
|
let font = fontCache.get(fontInfo.fullName);
|
|
15782
15617
|
if (!font) {
|
|
15783
|
-
font = (0,
|
|
15618
|
+
font = (0, opentype_js.parse)(fontBuffer);
|
|
15784
15619
|
fontCache.set(fontInfo.fullName, font);
|
|
15785
15620
|
}
|
|
15786
15621
|
const results = [];
|
|
@@ -15993,7 +15828,7 @@ function shaping(ctx, content, viewModel, paragraphNode, sectionBreakConfig, use
|
|
|
15993
15828
|
const lang = languageDetector.detect(content);
|
|
15994
15829
|
const needHyphen = hyphenConfig(paragraphStyle, sectionBreakConfig);
|
|
15995
15830
|
const doNotHyphenateCaps = sectionBreakConfig.doNotHyphenateCaps === _univerjs_core.BooleanNumber.TRUE;
|
|
15996
|
-
if (lang !==
|
|
15831
|
+
if (lang !== "unknown" && needHyphen) if (hyphen.hasPattern(lang)) breaker = new LineBreakerHyphenEnhancer(breaker, hyphen, lang, doNotHyphenateCaps);
|
|
15997
15832
|
else hyphen.loadPattern(lang);
|
|
15998
15833
|
while (bk = breaker.nextBreakPoint()) {
|
|
15999
15834
|
const word = content.slice(last, bk.position);
|
|
@@ -16098,7 +15933,7 @@ function shaping(ctx, content, viewModel, paragraphNode, sectionBreakConfig, use
|
|
|
16098
15933
|
shapedTextList.push({
|
|
16099
15934
|
text: word,
|
|
16100
15935
|
glyphs: shapedGlyphs,
|
|
16101
|
-
breakPointType: shapedGlyphs === lastShapedGlyphs ? bk.type :
|
|
15936
|
+
breakPointType: shapedGlyphs === lastShapedGlyphs ? bk.type : "Normal"
|
|
16102
15937
|
});
|
|
16103
15938
|
}
|
|
16104
15939
|
last = bk.position;
|
|
@@ -16197,84 +16032,84 @@ function _pushPage(allCurrentSkeletonPages, blockSkeletonPages) {
|
|
|
16197
16032
|
//#endregion
|
|
16198
16033
|
//#region src/components/docs/layout/hyphenation/pattern-loaders.gen.ts
|
|
16199
16034
|
const PATTERN_LOADERS = {
|
|
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
|
-
[
|
|
16249
|
-
[
|
|
16250
|
-
[
|
|
16251
|
-
[
|
|
16252
|
-
[
|
|
16253
|
-
[
|
|
16254
|
-
[
|
|
16255
|
-
[
|
|
16256
|
-
[
|
|
16257
|
-
[
|
|
16258
|
-
[
|
|
16259
|
-
[
|
|
16260
|
-
[
|
|
16261
|
-
[
|
|
16262
|
-
[
|
|
16263
|
-
[
|
|
16264
|
-
[
|
|
16265
|
-
[
|
|
16266
|
-
[
|
|
16267
|
-
[
|
|
16268
|
-
[
|
|
16269
|
-
[
|
|
16270
|
-
[
|
|
16271
|
-
[
|
|
16272
|
-
[
|
|
16273
|
-
[
|
|
16274
|
-
[
|
|
16275
|
-
[
|
|
16276
|
-
[
|
|
16277
|
-
[
|
|
16035
|
+
["af"]: () => Promise.resolve().then(() => require("./af-Bsj1JSBP.js")),
|
|
16036
|
+
["as"]: () => Promise.resolve().then(() => require("./as-s7lqjieq.js")),
|
|
16037
|
+
["be"]: () => Promise.resolve().then(() => require("./be-L5eMFm5U.js")),
|
|
16038
|
+
["bg"]: () => Promise.resolve().then(() => require("./bg-DPu8oywG.js")),
|
|
16039
|
+
["bn"]: () => Promise.resolve().then(() => require("./bn-CIWO--x0.js")),
|
|
16040
|
+
["ca"]: () => Promise.resolve().then(() => require("./ca-C4gmkbL6.js")),
|
|
16041
|
+
["cop"]: () => Promise.resolve().then(() => require("./cop-BYQt2Eln.js")),
|
|
16042
|
+
["cs"]: () => Promise.resolve().then(() => require("./cs-psn0RDcR.js")),
|
|
16043
|
+
["cu"]: () => Promise.resolve().then(() => require("./cu-CI412h46.js")),
|
|
16044
|
+
["cy"]: () => Promise.resolve().then(() => require("./cy-u9h1j59b.js")),
|
|
16045
|
+
["da"]: () => Promise.resolve().then(() => require("./da-BQ70NE2J.js")),
|
|
16046
|
+
["de-1901"]: () => Promise.resolve().then(() => require("./de-1901-C5Xgq4-z.js")),
|
|
16047
|
+
["de-1996"]: () => Promise.resolve().then(() => require("./de-1996-BmpXhD5R.js")),
|
|
16048
|
+
["de-ch-1901"]: () => Promise.resolve().then(() => require("./de-ch-1901-mUpubovn.js")),
|
|
16049
|
+
["el-monoton"]: () => Promise.resolve().then(() => require("./el-monoton-1KLys64v.js")),
|
|
16050
|
+
["el-polyton"]: () => Promise.resolve().then(() => require("./el-polyton-C8sv-vqz.js")),
|
|
16051
|
+
["en-gb"]: () => Promise.resolve().then(() => require("./en-gb-DidBtNJX.js")),
|
|
16052
|
+
["en-us"]: () => Promise.resolve().then(() => require("./en-us-DKyh_RpA.js")),
|
|
16053
|
+
["es"]: () => Promise.resolve().then(() => require("./es-C1gCT0OW.js")),
|
|
16054
|
+
["et"]: () => Promise.resolve().then(() => require("./et-UwA1uq3o.js")),
|
|
16055
|
+
["eu"]: () => Promise.resolve().then(() => require("./eu-pizKbeo6.js")),
|
|
16056
|
+
["fi"]: () => Promise.resolve().then(() => require("./fi-bkmcjeIB.js")),
|
|
16057
|
+
["fr"]: () => Promise.resolve().then(() => require("./fr-DTRdyReV.js")),
|
|
16058
|
+
["fur"]: () => Promise.resolve().then(() => require("./fur-CzaEPYy4.js")),
|
|
16059
|
+
["ga"]: () => Promise.resolve().then(() => require("./ga-DfpmmLL7.js")),
|
|
16060
|
+
["gl"]: () => Promise.resolve().then(() => require("./gl-BvPLj87g.js")),
|
|
16061
|
+
["grc"]: () => Promise.resolve().then(() => require("./grc-CWjbj1rE.js")),
|
|
16062
|
+
["gu"]: () => Promise.resolve().then(() => require("./gu-B9b71pv0.js")),
|
|
16063
|
+
["hi"]: () => Promise.resolve().then(() => require("./hi-B0PM9Naw.js")),
|
|
16064
|
+
["hr"]: () => Promise.resolve().then(() => require("./hr-hhdjugdi.js")),
|
|
16065
|
+
["hsb"]: () => Promise.resolve().then(() => require("./hsb-CUC0Vhy0.js")),
|
|
16066
|
+
["hu"]: () => Promise.resolve().then(() => require("./hu-DNqLSdxp.js")),
|
|
16067
|
+
["hy"]: () => Promise.resolve().then(() => require("./hy-Cr37-HYR.js")),
|
|
16068
|
+
["ia"]: () => Promise.resolve().then(() => require("./ia-_xcaTvlU.js")),
|
|
16069
|
+
["id"]: () => Promise.resolve().then(() => require("./id-DTTt6JOe.js")),
|
|
16070
|
+
["is"]: () => Promise.resolve().then(() => require("./is-BlJOUdIf.js")),
|
|
16071
|
+
["it"]: () => Promise.resolve().then(() => require("./it-1kO7pboy.js")),
|
|
16072
|
+
["ka"]: () => Promise.resolve().then(() => require("./ka-06TLrBSU.js")),
|
|
16073
|
+
["kmr"]: () => Promise.resolve().then(() => require("./kmr-CqLLMgB-.js")),
|
|
16074
|
+
["kn"]: () => Promise.resolve().then(() => require("./kn-DsgCykwv.js")),
|
|
16075
|
+
["la"]: () => Promise.resolve().then(() => require("./la-BtfI1L1Y.js")),
|
|
16076
|
+
["la-x-classic"]: () => Promise.resolve().then(() => require("./la-x-classic-Csxxqk4A.js")),
|
|
16077
|
+
["la-x-liturgic"]: () => Promise.resolve().then(() => require("./la-x-liturgic-DP4lkHMh.js")),
|
|
16078
|
+
["lt"]: () => Promise.resolve().then(() => require("./lt-BLnhu8cj.js")),
|
|
16079
|
+
["lv"]: () => Promise.resolve().then(() => require("./lv-BWU1ykNC.js")),
|
|
16080
|
+
["ml"]: () => Promise.resolve().then(() => require("./ml-DCPEVUGQ.js")),
|
|
16081
|
+
["mn-cyrl"]: () => Promise.resolve().then(() => require("./mn-cyrl-R4Uzk2PR.js")),
|
|
16082
|
+
["mn-cyrl-x-lmc"]: () => Promise.resolve().then(() => require("./mn-cyrl-x-lmc-DcrbbdVO.js")),
|
|
16083
|
+
["mr"]: () => Promise.resolve().then(() => require("./mr-a95kT02n.js")),
|
|
16084
|
+
["mul-ethi"]: () => Promise.resolve().then(() => require("./mul-ethi-Ha-646Ih.js")),
|
|
16085
|
+
["nb"]: () => Promise.resolve().then(() => require("./nb-DVDq5SId.js")),
|
|
16086
|
+
["nl"]: () => Promise.resolve().then(() => require("./nl-xvtaATgd.js")),
|
|
16087
|
+
["nn"]: () => Promise.resolve().then(() => require("./nn-Dd3GYfsu.js")),
|
|
16088
|
+
["no"]: () => Promise.resolve().then(() => require("./no-Ccuz1dXv.js")),
|
|
16089
|
+
["oc"]: () => Promise.resolve().then(() => require("./oc-DMNrvVUu.js")),
|
|
16090
|
+
["or"]: () => Promise.resolve().then(() => require("./or-BBnbptii.js")),
|
|
16091
|
+
["pa"]: () => Promise.resolve().then(() => require("./pa-Bpqjl4TY.js")),
|
|
16092
|
+
["pi"]: () => Promise.resolve().then(() => require("./pi-Dw9S8R8a.js")),
|
|
16093
|
+
["pl"]: () => Promise.resolve().then(() => require("./pl-BxIw_3q_.js")),
|
|
16094
|
+
["pms"]: () => Promise.resolve().then(() => require("./pms-ts8oJNTo.js")),
|
|
16095
|
+
["pt"]: () => Promise.resolve().then(() => require("./pt-INYdw9le.js")),
|
|
16096
|
+
["rm"]: () => Promise.resolve().then(() => require("./rm-SrIsmyuH.js")),
|
|
16097
|
+
["ro"]: () => Promise.resolve().then(() => require("./ro--lDLf93Z.js")),
|
|
16098
|
+
["ru"]: () => Promise.resolve().then(() => require("./ru-CnviOn4F.js")),
|
|
16099
|
+
["sa"]: () => Promise.resolve().then(() => require("./sa--YzUfT9m.js")),
|
|
16100
|
+
["sh-cyrl"]: () => Promise.resolve().then(() => require("./sh-cyrl-C-Y7f9iS.js")),
|
|
16101
|
+
["sh-latn"]: () => Promise.resolve().then(() => require("./sh-latn-DE0Oa7St.js")),
|
|
16102
|
+
["sk"]: () => Promise.resolve().then(() => require("./sk-CL5uDe3A.js")),
|
|
16103
|
+
["sl"]: () => Promise.resolve().then(() => require("./sl-D8ckCfPR.js")),
|
|
16104
|
+
["sr-cyrl"]: () => Promise.resolve().then(() => require("./sr-cyrl-CZdv8WGY.js")),
|
|
16105
|
+
["sv"]: () => Promise.resolve().then(() => require("./sv-DYQd48Sm.js")),
|
|
16106
|
+
["ta"]: () => Promise.resolve().then(() => require("./ta-DOa0x7zq.js")),
|
|
16107
|
+
["te"]: () => Promise.resolve().then(() => require("./te-BtexCVtn.js")),
|
|
16108
|
+
["th"]: () => Promise.resolve().then(() => require("./th-BJUX68-0.js")),
|
|
16109
|
+
["tk"]: () => Promise.resolve().then(() => require("./tk-CEs8UQxA.js")),
|
|
16110
|
+
["tr"]: () => Promise.resolve().then(() => require("./tr-BMiKDMrF.js")),
|
|
16111
|
+
["uk"]: () => Promise.resolve().then(() => require("./uk-B8pzUYbn.js")),
|
|
16112
|
+
["zh-latn-pinyin"]: () => Promise.resolve().then(() => require("./zh-latn-pinyin-s8_52NaR.js"))
|
|
16278
16113
|
};
|
|
16279
16114
|
|
|
16280
16115
|
//#endregion
|
|
@@ -16324,11 +16159,11 @@ var Hyphen = class Hyphen {
|
|
|
16324
16159
|
_defineProperty(this, "_patterns", /* @__PURE__ */ new Map());
|
|
16325
16160
|
_defineProperty(this, "_hyphenCache", /* @__PURE__ */ new Map());
|
|
16326
16161
|
this._preloadPatterns();
|
|
16327
|
-
this.loadPattern(
|
|
16162
|
+
this.loadPattern("en-gb");
|
|
16328
16163
|
}
|
|
16329
16164
|
_preloadPatterns() {
|
|
16330
|
-
this._patterns.set(
|
|
16331
|
-
this._loadExceptionsToCache(
|
|
16165
|
+
this._patterns.set("en-us", parsePattern(require_en_us.EnUs));
|
|
16166
|
+
this._loadExceptionsToCache("en-us", require_en_us.EnUs);
|
|
16332
16167
|
}
|
|
16333
16168
|
_loadExceptionsToCache(lang, pattern) {
|
|
16334
16169
|
if (pattern.length < 3) return;
|
|
@@ -16419,40 +16254,40 @@ _defineProperty(Hyphen, "_instance", null);
|
|
|
16419
16254
|
//#endregion
|
|
16420
16255
|
//#region src/components/docs/layout/hyphenation/language-detector.ts
|
|
16421
16256
|
const LANG_MAP_TO_HYPHEN_LANG = {
|
|
16422
|
-
spa:
|
|
16423
|
-
eng:
|
|
16424
|
-
rus:
|
|
16425
|
-
ben:
|
|
16426
|
-
hin:
|
|
16427
|
-
por:
|
|
16428
|
-
ind:
|
|
16429
|
-
fra:
|
|
16430
|
-
deu:
|
|
16431
|
-
tel:
|
|
16432
|
-
mar:
|
|
16433
|
-
ita:
|
|
16434
|
-
tam:
|
|
16435
|
-
tur:
|
|
16436
|
-
guj:
|
|
16437
|
-
pol:
|
|
16438
|
-
ukr:
|
|
16439
|
-
kan:
|
|
16440
|
-
mal:
|
|
16441
|
-
ron:
|
|
16442
|
-
pan:
|
|
16443
|
-
hrv:
|
|
16444
|
-
nld:
|
|
16445
|
-
srp:
|
|
16446
|
-
tha:
|
|
16447
|
-
uzn:
|
|
16448
|
-
zlm:
|
|
16449
|
-
hun:
|
|
16450
|
-
ell:
|
|
16451
|
-
ces:
|
|
16452
|
-
bel:
|
|
16453
|
-
bul:
|
|
16454
|
-
swe:
|
|
16455
|
-
und:
|
|
16257
|
+
spa: "es",
|
|
16258
|
+
eng: "en-us",
|
|
16259
|
+
rus: "ru",
|
|
16260
|
+
ben: "bn",
|
|
16261
|
+
hin: "hi",
|
|
16262
|
+
por: "pt",
|
|
16263
|
+
ind: "id",
|
|
16264
|
+
fra: "fr",
|
|
16265
|
+
deu: "de-1901",
|
|
16266
|
+
tel: "te",
|
|
16267
|
+
mar: "mr",
|
|
16268
|
+
ita: "it",
|
|
16269
|
+
tam: "ta",
|
|
16270
|
+
tur: "tr",
|
|
16271
|
+
guj: "gu",
|
|
16272
|
+
pol: "pl",
|
|
16273
|
+
ukr: "uk",
|
|
16274
|
+
kan: "kn",
|
|
16275
|
+
mal: "ml",
|
|
16276
|
+
ron: "ro",
|
|
16277
|
+
pan: "pa",
|
|
16278
|
+
hrv: "hr",
|
|
16279
|
+
nld: "nl",
|
|
16280
|
+
srp: "sr-cyrl",
|
|
16281
|
+
tha: "th",
|
|
16282
|
+
uzn: "kmr",
|
|
16283
|
+
zlm: "ml",
|
|
16284
|
+
hun: "hu",
|
|
16285
|
+
ell: "el-monoton",
|
|
16286
|
+
ces: "cs",
|
|
16287
|
+
bel: "be",
|
|
16288
|
+
bul: "bg",
|
|
16289
|
+
swe: "sv",
|
|
16290
|
+
und: "unknown"
|
|
16456
16291
|
};
|
|
16457
16292
|
var LanguageDetector = class LanguageDetector {
|
|
16458
16293
|
constructor() {
|
|
@@ -16466,7 +16301,7 @@ var LanguageDetector = class LanguageDetector {
|
|
|
16466
16301
|
var _LANG_MAP_TO_HYPHEN_L;
|
|
16467
16302
|
let lang = this._detectCache.get(text);
|
|
16468
16303
|
if (lang) return lang;
|
|
16469
|
-
lang = (_LANG_MAP_TO_HYPHEN_L = LANG_MAP_TO_HYPHEN_LANG[(0, franc_min.franc)(text)]) !== null && _LANG_MAP_TO_HYPHEN_L !== void 0 ? _LANG_MAP_TO_HYPHEN_L :
|
|
16304
|
+
lang = (_LANG_MAP_TO_HYPHEN_L = LANG_MAP_TO_HYPHEN_LANG[(0, franc_min.franc)(text)]) !== null && _LANG_MAP_TO_HYPHEN_L !== void 0 ? _LANG_MAP_TO_HYPHEN_L : "unknown";
|
|
16470
16305
|
this._detectCache.set(text, lang);
|
|
16471
16306
|
return lang;
|
|
16472
16307
|
}
|
|
@@ -16592,14 +16427,14 @@ var DocumentSkeleton = class DocumentSkeleton extends _univerjs_core.Skeleton {
|
|
|
16592
16427
|
let pageIndex = -1;
|
|
16593
16428
|
const path = getPagePath(page);
|
|
16594
16429
|
switch (pageType) {
|
|
16595
|
-
case
|
|
16596
|
-
case
|
|
16430
|
+
case 1:
|
|
16431
|
+
case 2:
|
|
16597
16432
|
pageIndex = 0;
|
|
16598
16433
|
break;
|
|
16599
|
-
case
|
|
16434
|
+
case 0:
|
|
16600
16435
|
pageIndex = skeletonData.pages.indexOf(page);
|
|
16601
16436
|
break;
|
|
16602
|
-
case
|
|
16437
|
+
case 3:
|
|
16603
16438
|
pageIndex = path[1];
|
|
16604
16439
|
break;
|
|
16605
16440
|
default: throw new Error("Invalid page type");
|
|
@@ -16638,14 +16473,14 @@ var DocumentSkeleton = class DocumentSkeleton extends _univerjs_core.Skeleton {
|
|
|
16638
16473
|
const path = getPagePath(page);
|
|
16639
16474
|
let pageIndex = -1;
|
|
16640
16475
|
switch (pageType) {
|
|
16641
|
-
case
|
|
16642
|
-
case
|
|
16476
|
+
case 1:
|
|
16477
|
+
case 2:
|
|
16643
16478
|
pageIndex = 0;
|
|
16644
16479
|
break;
|
|
16645
|
-
case
|
|
16480
|
+
case 0:
|
|
16646
16481
|
pageIndex = pages.indexOf(page);
|
|
16647
16482
|
break;
|
|
16648
|
-
case
|
|
16483
|
+
case 3:
|
|
16649
16484
|
pageIndex = path[1];
|
|
16650
16485
|
break;
|
|
16651
16486
|
default: throw new Error("Invalid page type");
|
|
@@ -16675,15 +16510,15 @@ var DocumentSkeleton = class DocumentSkeleton extends _univerjs_core.Skeleton {
|
|
|
16675
16510
|
const { divide, line, column, section, segmentPage, pageType, path, isBack } = position;
|
|
16676
16511
|
let { glyph } = position;
|
|
16677
16512
|
let skePage = null;
|
|
16678
|
-
if (pageType ===
|
|
16513
|
+
if (pageType === 1 || pageType === 2) {
|
|
16679
16514
|
skePage = pages[segmentPage];
|
|
16680
16515
|
const { headerId, footerId, pageWidth } = skePage;
|
|
16681
|
-
if (pageType ===
|
|
16516
|
+
if (pageType === 1) {
|
|
16682
16517
|
var _skeHeaders$get;
|
|
16683
16518
|
const skeHeader = (_skeHeaders$get = skeHeaders.get(headerId)) === null || _skeHeaders$get === void 0 ? void 0 : _skeHeaders$get.get(pageWidth);
|
|
16684
16519
|
if (skeHeader == null) return;
|
|
16685
16520
|
else skePage = skeHeader;
|
|
16686
|
-
} else if (pageType ===
|
|
16521
|
+
} else if (pageType === 2) {
|
|
16687
16522
|
var _skeFooters$get;
|
|
16688
16523
|
const skeFooter = (_skeFooters$get = skeFooters.get(footerId)) === null || _skeFooters$get === void 0 ? void 0 : _skeFooters$get.get(pageWidth);
|
|
16689
16524
|
if (skeFooter == null) return;
|
|
@@ -16693,12 +16528,12 @@ var DocumentSkeleton = class DocumentSkeleton extends _univerjs_core.Skeleton {
|
|
|
16693
16528
|
if (skePage == null) return;
|
|
16694
16529
|
const glyphGroup = skePage.sections[section].columns[column].lines[line].divides[divide].glyphGroup;
|
|
16695
16530
|
glyph = Math.min(glyph, glyphGroup.length - 1);
|
|
16696
|
-
if (glyphGroup[glyph].glyphType ===
|
|
16531
|
+
if (glyphGroup[glyph].glyphType === 2) glyph += 1;
|
|
16697
16532
|
return glyphGroup[glyph];
|
|
16698
16533
|
}
|
|
16699
16534
|
findEditAreaByCoord(coord, pageLayoutType, pageMarginLeft, pageMarginTop) {
|
|
16700
16535
|
const { x, y } = coord;
|
|
16701
|
-
let editArea =
|
|
16536
|
+
let editArea = "BODY";
|
|
16702
16537
|
let pageNumber = -1;
|
|
16703
16538
|
let pageSkeleton = null;
|
|
16704
16539
|
const skeletonData = this.getSkeletonData();
|
|
@@ -16713,19 +16548,19 @@ var DocumentSkeleton = class DocumentSkeleton extends _univerjs_core.Skeleton {
|
|
|
16713
16548
|
const page = pages[i];
|
|
16714
16549
|
const { marginTop, marginBottom, pageWidth, pageHeight } = page;
|
|
16715
16550
|
if (x > this._findLiquid.x && x < this._findLiquid.x + pageWidth && y > this._findLiquid.y && y < this._findLiquid.y + marginTop) {
|
|
16716
|
-
editArea =
|
|
16551
|
+
editArea = "HEADER";
|
|
16717
16552
|
pageSkeleton = page;
|
|
16718
16553
|
pageNumber = i;
|
|
16719
16554
|
break;
|
|
16720
16555
|
}
|
|
16721
16556
|
if (x > this._findLiquid.x && x < this._findLiquid.x + pageWidth && y > this._findLiquid.y + marginTop && y < this._findLiquid.y + pageHeight - marginBottom) {
|
|
16722
|
-
editArea =
|
|
16557
|
+
editArea = "BODY";
|
|
16723
16558
|
pageSkeleton = page;
|
|
16724
16559
|
pageNumber = i;
|
|
16725
16560
|
break;
|
|
16726
16561
|
}
|
|
16727
16562
|
if (x > this._findLiquid.x && x < this._findLiquid.x + pageWidth && y > this._findLiquid.y + pageHeight - marginBottom && y < this._findLiquid.y + pageHeight) {
|
|
16728
|
-
editArea =
|
|
16563
|
+
editArea = "FOOTER";
|
|
16729
16564
|
pageSkeleton = page;
|
|
16730
16565
|
pageNumber = i;
|
|
16731
16566
|
break;
|
|
@@ -16754,16 +16589,16 @@ var DocumentSkeleton = class DocumentSkeleton extends _univerjs_core.Skeleton {
|
|
|
16754
16589
|
const page = pages[pi];
|
|
16755
16590
|
const { headerId, footerId, pageWidth } = page;
|
|
16756
16591
|
let exactMatch = null;
|
|
16757
|
-
if (editArea ===
|
|
16592
|
+
if (editArea === "HEADER" || editArea === "FOOTER") {
|
|
16758
16593
|
var _skeHeaders$get2, _skeFooters$get2;
|
|
16759
16594
|
const headerSke = (_skeHeaders$get2 = skeHeaders.get(headerId)) === null || _skeHeaders$get2 === void 0 ? void 0 : _skeHeaders$get2.get(pageWidth);
|
|
16760
|
-
if (headerSke) exactMatch = this._collectNearestNode(headerSke,
|
|
16595
|
+
if (headerSke) exactMatch = this._collectNearestNode(headerSke, 1, page, headerId, pi, cache, x, y, pageLength);
|
|
16761
16596
|
const footerSke = (_skeFooters$get2 = skeFooters.get(footerId)) === null || _skeFooters$get2 === void 0 ? void 0 : _skeFooters$get2.get(pageWidth);
|
|
16762
16597
|
if (footerSke) {
|
|
16763
16598
|
var _exactMatch;
|
|
16764
|
-
exactMatch = (_exactMatch = exactMatch) !== null && _exactMatch !== void 0 ? _exactMatch : this._collectNearestNode(footerSke,
|
|
16599
|
+
exactMatch = (_exactMatch = exactMatch) !== null && _exactMatch !== void 0 ? _exactMatch : this._collectNearestNode(footerSke, 2, page, footerId, pi, cache, x, y, pageLength);
|
|
16765
16600
|
}
|
|
16766
|
-
} else exactMatch = this._collectNearestNode(page,
|
|
16601
|
+
} else exactMatch = this._collectNearestNode(page, 0, page, "", pi, cache, x, y, pageLength);
|
|
16767
16602
|
if (exactMatch) return exactMatch;
|
|
16768
16603
|
this._translatePage(page, pageLayoutType, pageMarginLeft, pageMarginTop);
|
|
16769
16604
|
}
|
|
@@ -16776,13 +16611,13 @@ var DocumentSkeleton = class DocumentSkeleton extends _univerjs_core.Skeleton {
|
|
|
16776
16611
|
if (segmentId !== "") {
|
|
16777
16612
|
var _skeHeaders$get3, _skeFooters$get3;
|
|
16778
16613
|
const headerSke = (_skeHeaders$get3 = skeHeaders.get(headerId)) === null || _skeHeaders$get3 === void 0 ? void 0 : _skeHeaders$get3.get(pageWidth);
|
|
16779
|
-
if (headerSke) exactMatch = this._collectNearestNode(headerSke,
|
|
16614
|
+
if (headerSke) exactMatch = this._collectNearestNode(headerSke, 1, page, headerId, pi, cache, x, y, pageLength);
|
|
16780
16615
|
const footerSke = (_skeFooters$get3 = skeFooters.get(footerId)) === null || _skeFooters$get3 === void 0 ? void 0 : _skeFooters$get3.get(pageWidth);
|
|
16781
16616
|
if (footerSke) {
|
|
16782
16617
|
var _exactMatch2;
|
|
16783
|
-
exactMatch = (_exactMatch2 = exactMatch) !== null && _exactMatch2 !== void 0 ? _exactMatch2 : this._collectNearestNode(footerSke,
|
|
16618
|
+
exactMatch = (_exactMatch2 = exactMatch) !== null && _exactMatch2 !== void 0 ? _exactMatch2 : this._collectNearestNode(footerSke, 2, page, footerId, pi, cache, x, y, pageLength);
|
|
16784
16619
|
}
|
|
16785
|
-
} else exactMatch = this._collectNearestNode(page,
|
|
16620
|
+
} else exactMatch = this._collectNearestNode(page, 0, page, "", pi, cache, x, y, pageLength);
|
|
16786
16621
|
if (exactMatch) return exactMatch;
|
|
16787
16622
|
this._translatePage(page, pageLayoutType, pageMarginLeft, pageMarginTop);
|
|
16788
16623
|
}
|
|
@@ -16796,8 +16631,8 @@ var DocumentSkeleton = class DocumentSkeleton extends _univerjs_core.Skeleton {
|
|
|
16796
16631
|
}
|
|
16797
16632
|
const { headerId, pageWidth } = page;
|
|
16798
16633
|
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);
|
|
16799
|
-
if (segmentSke) exactMatch = this._collectNearestNode(segmentSke, segmentId === headerId ?
|
|
16800
|
-
} else exactMatch = this._collectNearestNode(page,
|
|
16634
|
+
if (segmentSke) exactMatch = this._collectNearestNode(segmentSke, segmentId === headerId ? 1 : 2, page, segmentId, segmentPage, cache, x, y, pageLength);
|
|
16635
|
+
} else exactMatch = this._collectNearestNode(page, 0, page, "", pi, cache, x, y, pageLength);
|
|
16801
16636
|
if (exactMatch) return exactMatch;
|
|
16802
16637
|
this._translatePage(page, pageLayoutType, pageMarginLeft, pageMarginTop);
|
|
16803
16638
|
}
|
|
@@ -16809,10 +16644,10 @@ var DocumentSkeleton = class DocumentSkeleton extends _univerjs_core.Skeleton {
|
|
|
16809
16644
|
this._findLiquid.translateSave();
|
|
16810
16645
|
const pageLeft = this._findLiquid.x;
|
|
16811
16646
|
const pageRight = pageLeft + page.pageWidth;
|
|
16812
|
-
const pageTop = this._findLiquid.y + (pageType ===
|
|
16647
|
+
const pageTop = this._findLiquid.y + (pageType === 2 ? page.pageHeight - segmentPage.pageHeight : 0);
|
|
16813
16648
|
const pageBottom = pageTop + segmentPage.pageHeight;
|
|
16814
16649
|
let pointInPage = x >= pageLeft && x <= pageRight && y >= pageTop && y <= pageBottom;
|
|
16815
|
-
if (nestLevel === 0 && pageType ===
|
|
16650
|
+
if (nestLevel === 0 && pageType === 0) {
|
|
16816
16651
|
const isFirstPage = pi === 0;
|
|
16817
16652
|
const isLastPage = pi === pageLength - 1;
|
|
16818
16653
|
const halfMarginTop = page.originMarginTop / 2;
|
|
@@ -16822,13 +16657,13 @@ var DocumentSkeleton = class DocumentSkeleton extends _univerjs_core.Skeleton {
|
|
|
16822
16657
|
else pointInPage = y >= pageTop - halfMarginTop && y <= pageBottom + halfMarginTop;
|
|
16823
16658
|
}
|
|
16824
16659
|
switch (pageType) {
|
|
16825
|
-
case
|
|
16660
|
+
case 1:
|
|
16826
16661
|
this._findLiquid.translatePagePadding({
|
|
16827
16662
|
...segmentPage,
|
|
16828
16663
|
marginLeft: page.marginLeft
|
|
16829
16664
|
});
|
|
16830
16665
|
break;
|
|
16831
|
-
case
|
|
16666
|
+
case 2: {
|
|
16832
16667
|
const footerTop = page.pageHeight - segmentPage.height - segmentPage.marginBottom;
|
|
16833
16668
|
this._findLiquid.translate(page.marginLeft, footerTop);
|
|
16834
16669
|
break;
|
|
@@ -16850,7 +16685,7 @@ var DocumentSkeleton = class DocumentSkeleton extends _univerjs_core.Skeleton {
|
|
|
16850
16685
|
for (let i = 0; i < lines.length; i++) {
|
|
16851
16686
|
const line = lines[i];
|
|
16852
16687
|
const { divides, type, lineHeight = 0 } = line;
|
|
16853
|
-
if (type ===
|
|
16688
|
+
if (type === 1) continue;
|
|
16854
16689
|
else {
|
|
16855
16690
|
this._findLiquid.translateSave();
|
|
16856
16691
|
this._findLiquid.translateLine(line);
|
|
@@ -16874,7 +16709,7 @@ var DocumentSkeleton = class DocumentSkeleton extends _univerjs_core.Skeleton {
|
|
|
16874
16709
|
if (y >= startY_fin && y <= endY_fin) {
|
|
16875
16710
|
if (x >= startX_fin && x <= endX_fin) return {
|
|
16876
16711
|
node: glyph,
|
|
16877
|
-
segmentPage: pageType ===
|
|
16712
|
+
segmentPage: pageType === 0 ? -1 : pi,
|
|
16878
16713
|
segmentId,
|
|
16879
16714
|
ratioX: x / (startX_fin + endX_fin),
|
|
16880
16715
|
ratioY: y / (startY_fin + endY_fin)
|
|
@@ -16885,7 +16720,7 @@ var DocumentSkeleton = class DocumentSkeleton extends _univerjs_core.Skeleton {
|
|
|
16885
16720
|
}
|
|
16886
16721
|
cache.nearestNodeList.push({
|
|
16887
16722
|
node: glyph,
|
|
16888
|
-
segmentPage: pageType ===
|
|
16723
|
+
segmentPage: pageType === 0 ? -1 : pi,
|
|
16889
16724
|
segmentId,
|
|
16890
16725
|
ratioX: x / (startX_fin + endX_fin),
|
|
16891
16726
|
ratioY: y / (startY_fin + endY_fin)
|
|
@@ -16906,7 +16741,7 @@ var DocumentSkeleton = class DocumentSkeleton extends _univerjs_core.Skeleton {
|
|
|
16906
16741
|
if (distanceY === nearestNodeDistanceY) {
|
|
16907
16742
|
cache.nearestNodeList.push({
|
|
16908
16743
|
node: glyph,
|
|
16909
|
-
segmentPage: pageType ===
|
|
16744
|
+
segmentPage: pageType === 0 ? -1 : pi,
|
|
16910
16745
|
segmentId,
|
|
16911
16746
|
ratioX: x / (startX_fin + endX_fin),
|
|
16912
16747
|
ratioY: y / (startY_fin + endY_fin)
|
|
@@ -16945,7 +16780,7 @@ var DocumentSkeleton = class DocumentSkeleton extends _univerjs_core.Skeleton {
|
|
|
16945
16780
|
const { left: cellLeft } = cell;
|
|
16946
16781
|
(_this$_findLiquid5 = this._findLiquid) === null || _this$_findLiquid5 === void 0 || _this$_findLiquid5.translateSave();
|
|
16947
16782
|
(_this$_findLiquid6 = this._findLiquid) === null || _this$_findLiquid6 === void 0 || _this$_findLiquid6.translate(cellLeft, 0);
|
|
16948
|
-
exactMatch = (_exactMatch3 = exactMatch) !== null && _exactMatch3 !== void 0 ? _exactMatch3 : this._collectNearestNode(cell,
|
|
16783
|
+
exactMatch = (_exactMatch3 = exactMatch) !== null && _exactMatch3 !== void 0 ? _exactMatch3 : this._collectNearestNode(cell, 3, cell, segmentId, pi, cache, x, y, pageLength, nestLevel + 1);
|
|
16949
16784
|
(_this$_findLiquid7 = this._findLiquid) === null || _this$_findLiquid7 === void 0 || _this$_findLiquid7.translateRestore();
|
|
16950
16785
|
}
|
|
16951
16786
|
(_this$_findLiquid8 = this._findLiquid) === null || _this$_findLiquid8 === void 0 || _this$_findLiquid8.translateRestore();
|
|
@@ -16987,10 +16822,10 @@ var DocumentSkeleton = class DocumentSkeleton extends _univerjs_core.Skeleton {
|
|
|
16987
16822
|
const { x: startX, y: startY } = this._findLiquid;
|
|
16988
16823
|
let endX = -1;
|
|
16989
16824
|
let endY = -1;
|
|
16990
|
-
if (pageLayoutType ===
|
|
16825
|
+
if (pageLayoutType === 0) {
|
|
16991
16826
|
endX = pageWidth;
|
|
16992
16827
|
endY = startY + pageHeight;
|
|
16993
|
-
} else if (pageLayoutType ===
|
|
16828
|
+
} else if (pageLayoutType === 1) {
|
|
16994
16829
|
endX = startX + pageWidth;
|
|
16995
16830
|
endY = pageHeight;
|
|
16996
16831
|
}
|
|
@@ -17280,7 +17115,7 @@ function getFontFormat(format) {
|
|
|
17280
17115
|
}
|
|
17281
17116
|
|
|
17282
17117
|
//#endregion
|
|
17283
|
-
//#region \0@oxc-project+runtime@0.
|
|
17118
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/decorateParam.js
|
|
17284
17119
|
function __decorateParam(paramIndex, decorator) {
|
|
17285
17120
|
return function(target, key) {
|
|
17286
17121
|
decorator(target, key, paramIndex);
|
|
@@ -17288,7 +17123,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
17288
17123
|
}
|
|
17289
17124
|
|
|
17290
17125
|
//#endregion
|
|
17291
|
-
//#region \0@oxc-project+runtime@0.
|
|
17126
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/decorate.js
|
|
17292
17127
|
function __decorate(decorators, target, key, desc) {
|
|
17293
17128
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
17294
17129
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -17624,7 +17459,7 @@ let SpreadsheetSkeleton = class SpreadsheetSkeleton extends _univerjs_core.Sheet
|
|
|
17624
17459
|
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;
|
|
17625
17460
|
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;
|
|
17626
17461
|
if ((style === null || style === void 0 ? void 0 : style.tb) === _univerjs_core.WrapStrategy.WRAP) {
|
|
17627
|
-
const skeleton = new DocSimpleSkeleton(
|
|
17462
|
+
const skeleton = new DocSimpleSkeleton((0, _univerjs_core.getDisplayValueFromCell)(cell), getFontStyleString(style).fontCache, (style === null || style === void 0 ? void 0 : style.tb) === _univerjs_core.WrapStrategy.WRAP, colWidth - paddingLeft - paddingRight, Infinity);
|
|
17628
17463
|
skeleton.calculate();
|
|
17629
17464
|
return skeleton.getTotalHeight() + paddingTop + paddingBottom;
|
|
17630
17465
|
} else {
|
|
@@ -17670,14 +17505,14 @@ let SpreadsheetSkeleton = class SpreadsheetSkeleton extends _univerjs_core.Sheet
|
|
|
17670
17505
|
_calculateColWidth(colIndex) {
|
|
17671
17506
|
const worksheet = this.worksheet;
|
|
17672
17507
|
let colWidth = 0;
|
|
17673
|
-
const visibleRangeViewMain = this.visibleRangeByViewportKey(
|
|
17508
|
+
const visibleRangeViewMain = this.visibleRangeByViewportKey("viewMain");
|
|
17674
17509
|
if (!visibleRangeViewMain) return colWidth;
|
|
17675
17510
|
const { startRow: startRowOfViewMain, endRow: endRowOfViewMain } = visibleRangeViewMain;
|
|
17676
17511
|
const rowCount = this.worksheet.getRowCount();
|
|
17677
17512
|
const otherRowIndex = /* @__PURE__ */ new Set();
|
|
17678
17513
|
otherRowIndex.add(0);
|
|
17679
17514
|
otherRowIndex.add(rowCount - 1);
|
|
17680
|
-
const visibleRangeViewMainTop = this.visibleRangeByViewportKey(
|
|
17515
|
+
const visibleRangeViewMainTop = this.visibleRangeByViewportKey("viewMainTop");
|
|
17681
17516
|
if (visibleRangeViewMainTop) {
|
|
17682
17517
|
const { startRow: startRowOfViewMainTop, endRow: endRowOfViewMainTop } = visibleRangeViewMainTop;
|
|
17683
17518
|
for (let i = startRowOfViewMainTop; i <= endRowOfViewMainTop; i++) otherRowIndex.add(i);
|
|
@@ -18106,22 +17941,22 @@ let SpreadsheetSkeleton = class SpreadsheetSkeleton extends _univerjs_core.Sheet
|
|
|
18106
17941
|
if (style && style.bd) {
|
|
18107
17942
|
const mergeRange = options === null || options === void 0 ? void 0 : options.mergeRange;
|
|
18108
17943
|
if (mergeRange) {
|
|
18109
|
-
this._setMergeBorderProps(
|
|
18110
|
-
this._setMergeBorderProps(
|
|
18111
|
-
this._setMergeBorderProps(
|
|
18112
|
-
this._setMergeBorderProps(
|
|
17944
|
+
this._setMergeBorderProps("t", this._stylesCache, mergeRange);
|
|
17945
|
+
this._setMergeBorderProps("b", this._stylesCache, mergeRange);
|
|
17946
|
+
this._setMergeBorderProps("l", this._stylesCache, mergeRange);
|
|
17947
|
+
this._setMergeBorderProps("r", this._stylesCache, mergeRange);
|
|
18113
17948
|
} else if (!this.intersectMergeRange(row, col)) {
|
|
18114
|
-
this._setBorderProps(row, col,
|
|
18115
|
-
this._setBorderProps(row, col,
|
|
18116
|
-
this._setBorderProps(row, col,
|
|
18117
|
-
this._setBorderProps(row, col,
|
|
17949
|
+
this._setBorderProps(row, col, "t", style, this._stylesCache);
|
|
17950
|
+
this._setBorderProps(row, col, "b", style, this._stylesCache);
|
|
17951
|
+
this._setBorderProps(row, col, "l", style, this._stylesCache);
|
|
17952
|
+
this._setBorderProps(row, col, "r", style, this._stylesCache);
|
|
18118
17953
|
}
|
|
18119
|
-
this._setBorderProps(row, col,
|
|
18120
|
-
this._setBorderProps(row, col,
|
|
18121
|
-
this._setBorderProps(row, col,
|
|
18122
|
-
this._setBorderProps(row, col,
|
|
18123
|
-
this._setBorderProps(row, col,
|
|
18124
|
-
this._setBorderProps(row, col,
|
|
17954
|
+
this._setBorderProps(row, col, "tl_br", style, this._stylesCache);
|
|
17955
|
+
this._setBorderProps(row, col, "tl_bc", style, this._stylesCache);
|
|
17956
|
+
this._setBorderProps(row, col, "tl_mr", style, this._stylesCache);
|
|
17957
|
+
this._setBorderProps(row, col, "bl_tr", style, this._stylesCache);
|
|
17958
|
+
this._setBorderProps(row, col, "ml_tr", style, this._stylesCache);
|
|
17959
|
+
this._setBorderProps(row, col, "bc_tr", style, this._stylesCache);
|
|
18125
17960
|
}
|
|
18126
17961
|
}
|
|
18127
17962
|
_setBgStylesCache(row, col, style, options) {
|
|
@@ -18242,29 +18077,29 @@ let SpreadsheetSkeleton = class SpreadsheetSkeleton extends _univerjs_core.Sheet
|
|
|
18242
18077
|
let forEnd = mergeRange.endRow;
|
|
18243
18078
|
let row = mergeRange.startRow;
|
|
18244
18079
|
let column = mergeRange.startColumn;
|
|
18245
|
-
if (type ===
|
|
18080
|
+
if (type === "t") {
|
|
18246
18081
|
row = mergeRange.startRow;
|
|
18247
18082
|
forStart = mergeRange.startColumn;
|
|
18248
18083
|
forEnd = mergeRange.endColumn;
|
|
18249
|
-
} else if (type ===
|
|
18084
|
+
} else if (type === "b") {
|
|
18250
18085
|
row = mergeRange.endRow;
|
|
18251
18086
|
forStart = mergeRange.startColumn;
|
|
18252
18087
|
forEnd = mergeRange.endColumn;
|
|
18253
|
-
} else if (type ===
|
|
18088
|
+
} else if (type === "l") {
|
|
18254
18089
|
column = mergeRange.startColumn;
|
|
18255
18090
|
forStart = mergeRange.startRow;
|
|
18256
18091
|
forEnd = mergeRange.endRow;
|
|
18257
|
-
} else if (type ===
|
|
18092
|
+
} else if (type === "r") {
|
|
18258
18093
|
column = mergeRange.endColumn;
|
|
18259
18094
|
forStart = mergeRange.startRow;
|
|
18260
18095
|
forEnd = mergeRange.endRow;
|
|
18261
18096
|
}
|
|
18262
18097
|
for (let i = forStart; i <= forEnd; i++) {
|
|
18263
18098
|
var _cell$themeStyle, _style$bd$type, _style$bd;
|
|
18264
|
-
if (type ===
|
|
18265
|
-
else if (type ===
|
|
18266
|
-
else if (type ===
|
|
18267
|
-
else if (type ===
|
|
18099
|
+
if (type === "t") column = i;
|
|
18100
|
+
else if (type === "b") column = i;
|
|
18101
|
+
else if (type === "l") row = i;
|
|
18102
|
+
else if (type === "r") row = i;
|
|
18268
18103
|
const cell = this.worksheet.getCell(row, column);
|
|
18269
18104
|
if (!cell) break;
|
|
18270
18105
|
const themeStyleBackground = (_cell$themeStyle = cell.themeStyle) === null || _cell$themeStyle === void 0 ? void 0 : _cell$themeStyle.bd;
|
|
@@ -18304,12 +18139,12 @@ let SpreadsheetSkeleton = class SpreadsheetSkeleton extends _univerjs_core.Sheet
|
|
|
18304
18139
|
* When the top border of a cell and the bottom border of the cell above it (r-1) overlap,
|
|
18305
18140
|
* if the top border of cell r is white, then the rendering is ignored.
|
|
18306
18141
|
*/
|
|
18307
|
-
if (type ===
|
|
18142
|
+
if (type === "t") {
|
|
18308
18143
|
var _borderCache$getValue;
|
|
18309
|
-
if (((_borderCache$getValue = borderCache.getValue(r - 1, c)) === null || _borderCache$getValue === void 0 ? void 0 : _borderCache$getValue[
|
|
18310
|
-
} else if (type ===
|
|
18144
|
+
if (((_borderCache$getValue = borderCache.getValue(r - 1, c)) === null || _borderCache$getValue === void 0 ? void 0 : _borderCache$getValue["b"]) && (0, _univerjs_core.isWhiteColor)(rgb)) return;
|
|
18145
|
+
} else if (type === "l") {
|
|
18311
18146
|
var _borderCache$getValue2;
|
|
18312
|
-
if (((_borderCache$getValue2 = borderCache.getValue(r, c - 1)) === null || _borderCache$getValue2 === void 0 ? void 0 : _borderCache$getValue2[
|
|
18147
|
+
if (((_borderCache$getValue2 = borderCache.getValue(r, c - 1)) === null || _borderCache$getValue2 === void 0 ? void 0 : _borderCache$getValue2["r"]) && (0, _univerjs_core.isWhiteColor)(rgb)) return;
|
|
18313
18148
|
}
|
|
18314
18149
|
borderCache.getValue(r, c)[type] = {
|
|
18315
18150
|
type,
|
|
@@ -18585,40 +18420,24 @@ var Font = class extends SheetExtension {
|
|
|
18585
18420
|
return false;
|
|
18586
18421
|
}
|
|
18587
18422
|
_renderImages(ctx, fontsConfig, startX, startY, endX, endY) {
|
|
18588
|
-
var _getSkeletonData;
|
|
18423
|
+
var _fontsConfig$style, _padding$l, _padding$r, _padding$t, _padding$b, _getSkeletonData;
|
|
18589
18424
|
const { documentSkeleton, verticalAlign, horizontalAlign } = fontsConfig;
|
|
18590
|
-
const fontHeight = documentSkeleton.getSkeletonData().pages[0].height;
|
|
18591
|
-
const fontWidth = documentSkeleton.getSkeletonData().pages[0].width;
|
|
18592
18425
|
const PADDING = 2;
|
|
18593
|
-
|
|
18594
|
-
|
|
18595
|
-
|
|
18596
|
-
|
|
18597
|
-
|
|
18598
|
-
|
|
18599
|
-
|
|
18600
|
-
|
|
18601
|
-
|
|
18602
|
-
default:
|
|
18603
|
-
fontY = endY - fontHeight - PADDING;
|
|
18604
|
-
break;
|
|
18605
|
-
}
|
|
18606
|
-
switch (horizontalAlign) {
|
|
18607
|
-
case _univerjs_core.HorizontalAlign.RIGHT:
|
|
18608
|
-
fontX = endX - fontWidth - PADDING;
|
|
18609
|
-
break;
|
|
18610
|
-
case _univerjs_core.HorizontalAlign.CENTER:
|
|
18611
|
-
fontX = (startX + endX) / 2 - fontWidth / 2;
|
|
18612
|
-
break;
|
|
18613
|
-
default:
|
|
18614
|
-
fontX = startX + PADDING;
|
|
18615
|
-
break;
|
|
18616
|
-
}
|
|
18426
|
+
const padding = (_fontsConfig$style = fontsConfig.style) === null || _fontsConfig$style === void 0 ? void 0 : _fontsConfig$style.pd;
|
|
18427
|
+
const paddingLeft = (_padding$l = padding === null || padding === void 0 ? void 0 : padding.l) !== null && _padding$l !== void 0 ? _padding$l : PADDING;
|
|
18428
|
+
const paddingRight = (_padding$r = padding === null || padding === void 0 ? void 0 : padding.r) !== null && _padding$r !== void 0 ? _padding$r : PADDING;
|
|
18429
|
+
const paddingTop = (_padding$t = padding === null || padding === void 0 ? void 0 : padding.t) !== null && _padding$t !== void 0 ? _padding$t : PADDING;
|
|
18430
|
+
const paddingBottom = (_padding$b = padding === null || padding === void 0 ? void 0 : padding.b) !== null && _padding$b !== void 0 ? _padding$b : PADDING;
|
|
18431
|
+
const contentStartX = startX + paddingLeft;
|
|
18432
|
+
const contentEndX = endX - paddingRight;
|
|
18433
|
+
const contentStartY = startY + paddingTop;
|
|
18434
|
+
const contentEndY = endY - paddingBottom;
|
|
18617
18435
|
const drawingDatas = documentSkeleton.getViewModel().getDataModel().getDrawings();
|
|
18618
18436
|
const drawings = (_getSkeletonData = documentSkeleton.getSkeletonData()) === null || _getSkeletonData === void 0 ? void 0 : _getSkeletonData.pages[0].skeDrawings;
|
|
18619
18437
|
drawings === null || drawings === void 0 || drawings.forEach((drawing) => {
|
|
18620
18438
|
const drawingData = drawingDatas === null || drawingDatas === void 0 ? void 0 : drawingDatas[drawing.drawingId];
|
|
18621
18439
|
if (drawingData) {
|
|
18440
|
+
var _drawingData$docTrans, _drawingData$docTrans2, _drawingData$docTrans3, _drawingData$docTrans4, _drawingData$docTrans5, _drawingData$docTrans6;
|
|
18622
18441
|
const image = fontsConfig.imageCacheMap.getImage(drawingData.imageSourceType, drawingData.source, () => {
|
|
18623
18442
|
var _this$parent;
|
|
18624
18443
|
(_this$parent = this.parent) === null || _this$parent === void 0 || _this$parent.makeDirty();
|
|
@@ -18626,11 +18445,33 @@ var Font = class extends SheetExtension {
|
|
|
18626
18445
|
var _this$parent2;
|
|
18627
18446
|
(_this$parent2 = this.parent) === null || _this$parent2 === void 0 || _this$parent2.makeDirty();
|
|
18628
18447
|
});
|
|
18629
|
-
const
|
|
18630
|
-
const
|
|
18631
|
-
const
|
|
18632
|
-
|
|
18633
|
-
|
|
18448
|
+
const width = (_drawingData$docTrans = (_drawingData$docTrans2 = drawingData.docTransform) === null || _drawingData$docTrans2 === void 0 ? void 0 : _drawingData$docTrans2.size.width) !== null && _drawingData$docTrans !== void 0 ? _drawingData$docTrans : drawing.width;
|
|
18449
|
+
const height = (_drawingData$docTrans3 = (_drawingData$docTrans4 = drawingData.docTransform) === null || _drawingData$docTrans4 === void 0 ? void 0 : _drawingData$docTrans4.size.height) !== null && _drawingData$docTrans3 !== void 0 ? _drawingData$docTrans3 : drawing.height;
|
|
18450
|
+
const angle = (_drawingData$docTrans5 = (_drawingData$docTrans6 = drawingData.docTransform) === null || _drawingData$docTrans6 === void 0 ? void 0 : _drawingData$docTrans6.angle) !== null && _drawingData$docTrans5 !== void 0 ? _drawingData$docTrans5 : drawing.angle;
|
|
18451
|
+
let x = startX;
|
|
18452
|
+
let y = startY;
|
|
18453
|
+
switch (verticalAlign) {
|
|
18454
|
+
case _univerjs_core.VerticalAlign.TOP:
|
|
18455
|
+
y = contentStartY;
|
|
18456
|
+
break;
|
|
18457
|
+
case _univerjs_core.VerticalAlign.MIDDLE:
|
|
18458
|
+
y = (contentStartY + contentEndY) / 2 - height / 2;
|
|
18459
|
+
break;
|
|
18460
|
+
default:
|
|
18461
|
+
y = contentEndY - height;
|
|
18462
|
+
break;
|
|
18463
|
+
}
|
|
18464
|
+
switch (horizontalAlign) {
|
|
18465
|
+
case _univerjs_core.HorizontalAlign.RIGHT:
|
|
18466
|
+
x = contentEndX - width;
|
|
18467
|
+
break;
|
|
18468
|
+
case _univerjs_core.HorizontalAlign.CENTER:
|
|
18469
|
+
x = (contentStartX + contentEndX) / 2 - width / 2;
|
|
18470
|
+
break;
|
|
18471
|
+
default:
|
|
18472
|
+
x = contentStartX;
|
|
18473
|
+
break;
|
|
18474
|
+
}
|
|
18634
18475
|
const { rotatedHeight, rotatedWidth } = rotatedBoundingBox(width, height, angle);
|
|
18635
18476
|
if (image && image.complete) {
|
|
18636
18477
|
const angleRadians = angle * Math.PI / 180;
|
|
@@ -18698,17 +18539,17 @@ var Font = class extends SheetExtension {
|
|
|
18698
18539
|
renderFontContext.endY = endY;
|
|
18699
18540
|
}
|
|
18700
18541
|
_renderText(ctx, row, col, renderFontCtx, overflowCache) {
|
|
18701
|
-
var _fontCache$style$pd, _fontCache$style, _padding$
|
|
18542
|
+
var _fontCache$style$pd, _fontCache$style, _padding$l2, _padding$r2, _padding$t2, _padding$b2, _fontCache$style2, _fontCache$style3, _fontCache$style4, _fontCache$style5;
|
|
18702
18543
|
const { fontCache } = renderFontCtx;
|
|
18703
18544
|
if (!fontCache) return;
|
|
18704
18545
|
const padding = (_fontCache$style$pd = (_fontCache$style = fontCache.style) === null || _fontCache$style === void 0 ? void 0 : _fontCache$style.pd) !== null && _fontCache$style$pd !== void 0 ? _fontCache$style$pd : DEFAULT_PADDING_DATA;
|
|
18705
|
-
const paddingLeft = (_padding$
|
|
18706
|
-
const paddingRight = (_padding$
|
|
18707
|
-
const paddingTop = (_padding$
|
|
18708
|
-
const paddingBottom = (_padding$
|
|
18546
|
+
const paddingLeft = (_padding$l2 = padding.l) !== null && _padding$l2 !== void 0 ? _padding$l2 : DEFAULT_PADDING_DATA.l;
|
|
18547
|
+
const paddingRight = (_padding$r2 = padding.r) !== null && _padding$r2 !== void 0 ? _padding$r2 : DEFAULT_PADDING_DATA.r;
|
|
18548
|
+
const paddingTop = (_padding$t2 = padding.t) !== null && _padding$t2 !== void 0 ? _padding$t2 : DEFAULT_PADDING_DATA.t;
|
|
18549
|
+
const paddingBottom = (_padding$b2 = padding.b) !== null && _padding$b2 !== void 0 ? _padding$b2 : DEFAULT_PADDING_DATA.b;
|
|
18709
18550
|
const { vertexAngle = 0, wrapStrategy, cellData } = fontCache;
|
|
18710
18551
|
if ((cellData === null || cellData === void 0 ? void 0 : cellData.v) === void 0 || (cellData === null || cellData === void 0 ? void 0 : cellData.v) === null) return;
|
|
18711
|
-
const text = (0, _univerjs_core.
|
|
18552
|
+
const text = (0, _univerjs_core.getDisplayValueFromCell)(cellData);
|
|
18712
18553
|
const { startX, startY, endX, endY } = renderFontCtx;
|
|
18713
18554
|
const cellWidth = endX - startX - paddingLeft - paddingRight;
|
|
18714
18555
|
const cellHeight = endY - startY - paddingTop - paddingBottom;
|
|
@@ -19156,7 +18997,7 @@ var DocComponent = class extends RenderComponent {
|
|
|
19156
18997
|
this._skeleton = _skeleton;
|
|
19157
18998
|
_defineProperty(this, "pageMarginLeft", 0);
|
|
19158
18999
|
_defineProperty(this, "pageMarginTop", 0);
|
|
19159
|
-
_defineProperty(this, "pageLayoutType",
|
|
19000
|
+
_defineProperty(this, "pageLayoutType", 0);
|
|
19160
19001
|
this._setConfig(config);
|
|
19161
19002
|
}
|
|
19162
19003
|
getSkeleton() {
|
|
@@ -19171,7 +19012,7 @@ var DocComponent = class extends RenderComponent {
|
|
|
19171
19012
|
if ((config === null || config === void 0 ? void 0 : config.pageMarginTop) != null) this.pageMarginTop = config === null || config === void 0 ? void 0 : config.pageMarginTop;
|
|
19172
19013
|
else this.pageMarginTop = 14;
|
|
19173
19014
|
if ((config === null || config === void 0 ? void 0 : config.pageLayoutType) != null) this.pageLayoutType = config === null || config === void 0 ? void 0 : config.pageLayoutType;
|
|
19174
|
-
else this.pageLayoutType =
|
|
19015
|
+
else this.pageLayoutType = 0;
|
|
19175
19016
|
}
|
|
19176
19017
|
render(mainCtx, bounds) {
|
|
19177
19018
|
if (!this.visible) {
|
|
@@ -19191,7 +19032,7 @@ var DocComponent = class extends RenderComponent {
|
|
|
19191
19032
|
scaleY: 1
|
|
19192
19033
|
};
|
|
19193
19034
|
let { scaleX = 1, scaleY = 1 } = this.parent;
|
|
19194
|
-
if (this.parent.classType ===
|
|
19035
|
+
if (this.parent.classType === "Scene") {
|
|
19195
19036
|
scaleX = this.parent.ancestorScaleX || 1;
|
|
19196
19037
|
scaleY = this.parent.ancestorScaleY || 1;
|
|
19197
19038
|
}
|
|
@@ -19215,15 +19056,10 @@ var DocComponent = class extends RenderComponent {
|
|
|
19215
19056
|
|
|
19216
19057
|
//#endregion
|
|
19217
19058
|
//#region src/components/docs/doc-extension.ts
|
|
19218
|
-
let DOCS_EXTENSION_TYPE = /* @__PURE__ */ function(DOCS_EXTENSION_TYPE) {
|
|
19219
|
-
DOCS_EXTENSION_TYPE[DOCS_EXTENSION_TYPE["SPAN"] = 0] = "SPAN";
|
|
19220
|
-
DOCS_EXTENSION_TYPE[DOCS_EXTENSION_TYPE["LINE"] = 1] = "LINE";
|
|
19221
|
-
return DOCS_EXTENSION_TYPE;
|
|
19222
|
-
}({});
|
|
19223
19059
|
var docExtension = class extends ComponentExtension {
|
|
19224
19060
|
constructor(..._args) {
|
|
19225
19061
|
super(..._args);
|
|
19226
|
-
_defineProperty(this, "type",
|
|
19062
|
+
_defineProperty(this, "type", 0);
|
|
19227
19063
|
_defineProperty(this, "translateX", 0);
|
|
19228
19064
|
_defineProperty(this, "translateY", 0);
|
|
19229
19065
|
}
|
|
@@ -19318,10 +19154,10 @@ var Border$1 = class extends docExtension {
|
|
|
19318
19154
|
_createBorderCache(borderData) {
|
|
19319
19155
|
const { t, b, l, r } = borderData;
|
|
19320
19156
|
const borderCache = /* @__PURE__ */ new Map();
|
|
19321
|
-
t && borderCache.set(
|
|
19322
|
-
b && borderCache.set(
|
|
19323
|
-
l && borderCache.set(
|
|
19324
|
-
r && borderCache.set(
|
|
19157
|
+
t && borderCache.set("t", t);
|
|
19158
|
+
b && borderCache.set("b", b);
|
|
19159
|
+
l && borderCache.set("l", l);
|
|
19160
|
+
r && borderCache.set("r", r);
|
|
19325
19161
|
return borderCache;
|
|
19326
19162
|
}
|
|
19327
19163
|
};
|
|
@@ -19373,12 +19209,12 @@ var Circle = class Circle extends Shape {
|
|
|
19373
19209
|
constructor(key, props) {
|
|
19374
19210
|
super(key, props);
|
|
19375
19211
|
_defineProperty(this, "_radius", void 0);
|
|
19376
|
-
_defineProperty(this, "objectType",
|
|
19212
|
+
_defineProperty(this, "objectType", 5);
|
|
19377
19213
|
this._radius = (props === null || props === void 0 ? void 0 : props.radius) || 10;
|
|
19378
19214
|
this._setFixBoundingBox();
|
|
19379
19215
|
this.onTransformChange$.subscribeEvent((changeState) => {
|
|
19380
19216
|
const { type, value, preValue } = changeState;
|
|
19381
|
-
if (type ===
|
|
19217
|
+
if (type === 1 || type === 5) {
|
|
19382
19218
|
const value = Math.min(this.width, this.height);
|
|
19383
19219
|
this._radius = value / 2;
|
|
19384
19220
|
this.width = value;
|
|
@@ -19447,7 +19283,7 @@ const RECT_OBJECT_ARRAY = ["radius"];
|
|
|
19447
19283
|
var Rect = class Rect extends Shape {
|
|
19448
19284
|
constructor(key, props) {
|
|
19449
19285
|
super(key, props);
|
|
19450
|
-
_defineProperty(this, "objectType",
|
|
19286
|
+
_defineProperty(this, "objectType", 4);
|
|
19451
19287
|
_defineProperty(this, "_radius", 0);
|
|
19452
19288
|
_defineProperty(this, "_opacity", 1);
|
|
19453
19289
|
_defineProperty(this, "_visualHeight", void 0);
|
|
@@ -19635,7 +19471,7 @@ var Image$1 = class extends Shape {
|
|
|
19635
19471
|
_defineProperty(this, "_renderByCropper", false);
|
|
19636
19472
|
_defineProperty(this, "_transformCalculateSrcRect", true);
|
|
19637
19473
|
_defineProperty(this, "_clipService", null);
|
|
19638
|
-
_defineProperty(this, "objectType",
|
|
19474
|
+
_defineProperty(this, "objectType", 3);
|
|
19639
19475
|
_defineProperty(this, "isDrawingObject", true);
|
|
19640
19476
|
this._props = { ...config };
|
|
19641
19477
|
if (config.image) {
|
|
@@ -19683,7 +19519,7 @@ var Image$1 = class extends Shape {
|
|
|
19683
19519
|
return this._clipService;
|
|
19684
19520
|
}
|
|
19685
19521
|
get classType() {
|
|
19686
|
-
return
|
|
19522
|
+
return "Image";
|
|
19687
19523
|
}
|
|
19688
19524
|
transformByStateCloseCropper(option) {
|
|
19689
19525
|
this._transformCalculateSrcRect = false;
|
|
@@ -19901,7 +19737,7 @@ var Image$1 = class extends Shape {
|
|
|
19901
19737
|
centerY
|
|
19902
19738
|
]);
|
|
19903
19739
|
const parent = this.getParent();
|
|
19904
|
-
const oCoord = (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) ===
|
|
19740
|
+
const oCoord = (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) === "Group" ? parent.ancestorTransform.multiply(renderTransform) : renderTransform).invert().applyPoint(coord);
|
|
19905
19741
|
const halfWidth = realWidth / 2;
|
|
19906
19742
|
const halfHeight = realHeight / 2;
|
|
19907
19743
|
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;
|
|
@@ -19930,7 +19766,7 @@ var Path = class Path extends Shape {
|
|
|
19930
19766
|
this._setFixBoundingBox();
|
|
19931
19767
|
this.onTransformChange$.subscribeEvent((changeState) => {
|
|
19932
19768
|
const { type, preValue } = changeState;
|
|
19933
|
-
if (type ===
|
|
19769
|
+
if (type === 1 || type === 5) {
|
|
19934
19770
|
this._reCalculateCache = true;
|
|
19935
19771
|
const { left, top, width, height } = this._getSelfRect();
|
|
19936
19772
|
const { width: preWidth, height: preHeight } = preValue;
|
|
@@ -20598,7 +20434,7 @@ var RegularPolygon = class RegularPolygon extends Shape {
|
|
|
20598
20434
|
this._setFixBoundingBox();
|
|
20599
20435
|
this.onTransformChange$.subscribeEvent((changeState) => {
|
|
20600
20436
|
const { type, value, preValue } = changeState;
|
|
20601
|
-
if (type ===
|
|
20437
|
+
if (type === 1 || type === 5) this.resizePolygon(preValue);
|
|
20602
20438
|
});
|
|
20603
20439
|
}
|
|
20604
20440
|
get pointsGroup() {
|
|
@@ -20765,7 +20601,7 @@ var RichText = class extends BaseObject {
|
|
|
20765
20601
|
_defineProperty(this, "_bg", void 0);
|
|
20766
20602
|
_defineProperty(this, "_bd", void 0);
|
|
20767
20603
|
_defineProperty(this, "_cl", void 0);
|
|
20768
|
-
_defineProperty(this, "objectType",
|
|
20604
|
+
_defineProperty(this, "objectType", 1);
|
|
20769
20605
|
if (props === null || props === void 0 ? void 0 : props.richText) this._documentData = props.richText;
|
|
20770
20606
|
else if (props) {
|
|
20771
20607
|
this._fs = props.fs;
|
|
@@ -20790,7 +20626,7 @@ var RichText = class extends BaseObject {
|
|
|
20790
20626
|
this._initialProps(props);
|
|
20791
20627
|
this.onTransformChange$.subscribeEvent((changeState) => {
|
|
20792
20628
|
const { type } = changeState;
|
|
20793
|
-
if (type ===
|
|
20629
|
+
if (type === 1 || type === 5) {
|
|
20794
20630
|
docModel.updateDocumentDataPageSize(this.width);
|
|
20795
20631
|
this._documentSkeleton.makeDirty(true);
|
|
20796
20632
|
this._documentSkeleton.calculate();
|
|
@@ -21483,7 +21319,7 @@ var FontAndBaseLine = class extends docExtension {
|
|
|
21483
21319
|
ctx.restore();
|
|
21484
21320
|
} else {
|
|
21485
21321
|
const CHECKED_GLYPH = "☑";
|
|
21486
|
-
if ((content === "☐" || content === CHECKED_GLYPH) && glyph.glyphType ===
|
|
21322
|
+
if ((content === "☐" || content === CHECKED_GLYPH) && glyph.glyphType === 2) {
|
|
21487
21323
|
var _glyph$ts$fs, _glyph$ts;
|
|
21488
21324
|
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);
|
|
21489
21325
|
ctx.save();
|
|
@@ -21742,7 +21578,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
21742
21578
|
const extensions = this.getExtensionsByOrder();
|
|
21743
21579
|
for (const extension of extensions) extension.clearCache();
|
|
21744
21580
|
const backgroundExtension = extensions.find((e) => e.uKey === "DefaultDocsBackgroundExtension");
|
|
21745
|
-
const glyphExtensionsExcludeBackground = extensions.filter((e) => e.type ===
|
|
21581
|
+
const glyphExtensionsExcludeBackground = extensions.filter((e) => e.type === 0 && e.uKey !== "DefaultDocsBackgroundExtension");
|
|
21746
21582
|
let pageTop = 0;
|
|
21747
21583
|
let pageLeft = 0;
|
|
21748
21584
|
for (let i = 0, len = pages.length; i < len; i++) {
|
|
@@ -21800,8 +21636,8 @@ var Documents = class Documents extends DocComponent {
|
|
|
21800
21636
|
const maxLineAsc = asc;
|
|
21801
21637
|
const maxLineAscSin = maxLineAsc * Math.sin(centerAngle);
|
|
21802
21638
|
const maxLineAscCos = maxLineAsc * Math.cos(centerAngle);
|
|
21803
|
-
if (type ===
|
|
21804
|
-
for (const extension of extensions) if (extension.type ===
|
|
21639
|
+
if (type === 1) {
|
|
21640
|
+
for (const extension of extensions) if (extension.type === 1) {
|
|
21805
21641
|
extension.extensionOffset = {
|
|
21806
21642
|
alignOffset,
|
|
21807
21643
|
renderConfig
|
|
@@ -21911,7 +21747,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
21911
21747
|
ctx.save();
|
|
21912
21748
|
ctx.setLineWidthByPrecision(1);
|
|
21913
21749
|
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";
|
|
21914
|
-
drawLineByBorderType(ctx,
|
|
21750
|
+
drawLineByBorderType(ctx, "b", 0, {
|
|
21915
21751
|
startX: x,
|
|
21916
21752
|
startY: y,
|
|
21917
21753
|
endX: x + pageWidth - marginLeft - marginRight,
|
|
@@ -21947,8 +21783,8 @@ var Documents = class Documents extends DocComponent {
|
|
|
21947
21783
|
const maxLineAsc = asc;
|
|
21948
21784
|
const maxLineAscSin = maxLineAsc * Math.sin(centerAngle);
|
|
21949
21785
|
const maxLineAscCos = maxLineAsc * Math.cos(centerAngle);
|
|
21950
|
-
if (type ===
|
|
21951
|
-
for (const extension of extensions) if (extension.type ===
|
|
21786
|
+
if (type === 1) {
|
|
21787
|
+
for (const extension of extensions) if (extension.type === 1) {
|
|
21952
21788
|
extension.extensionOffset = {
|
|
21953
21789
|
alignOffset,
|
|
21954
21790
|
renderConfig
|
|
@@ -22028,7 +21864,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
22028
21864
|
ctx.setLineWidthByPrecision(1);
|
|
22029
21865
|
ctx.save();
|
|
22030
21866
|
ctx.strokeStyle = (_borderLeft$color$rgb = borderLeft.color.rgb) !== null && _borderLeft$color$rgb !== void 0 ? _borderLeft$color$rgb : DEFAULT_BORDER_COLOR.color.rgb;
|
|
22031
|
-
drawLineByBorderType(ctx,
|
|
21867
|
+
drawLineByBorderType(ctx, "l", 0, {
|
|
22032
21868
|
startX: x,
|
|
22033
21869
|
startY: y,
|
|
22034
21870
|
endX: x + pageWidth,
|
|
@@ -22037,7 +21873,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
22037
21873
|
ctx.restore();
|
|
22038
21874
|
ctx.save();
|
|
22039
21875
|
ctx.strokeStyle = (_borderTop$color$rgb = borderTop.color.rgb) !== null && _borderTop$color$rgb !== void 0 ? _borderTop$color$rgb : DEFAULT_BORDER_COLOR.color.rgb;
|
|
22040
|
-
drawLineByBorderType(ctx,
|
|
21876
|
+
drawLineByBorderType(ctx, "t", 0, {
|
|
22041
21877
|
startX: x,
|
|
22042
21878
|
startY: y,
|
|
22043
21879
|
endX: x + pageWidth,
|
|
@@ -22046,7 +21882,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
22046
21882
|
ctx.restore();
|
|
22047
21883
|
ctx.save();
|
|
22048
21884
|
ctx.strokeStyle = (_borderRight$color$rg = borderRight.color.rgb) !== null && _borderRight$color$rg !== void 0 ? _borderRight$color$rg : DEFAULT_BORDER_COLOR.color.rgb;
|
|
22049
|
-
drawLineByBorderType(ctx,
|
|
21885
|
+
drawLineByBorderType(ctx, "r", 0, {
|
|
22050
21886
|
startX: x,
|
|
22051
21887
|
startY: y,
|
|
22052
21888
|
endX: x + pageWidth,
|
|
@@ -22055,7 +21891,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
22055
21891
|
ctx.restore();
|
|
22056
21892
|
ctx.save();
|
|
22057
21893
|
ctx.strokeStyle = (_borderBottom$color$r = borderBottom.color.rgb) !== null && _borderBottom$color$r !== void 0 ? _borderBottom$color$r : DEFAULT_BORDER_COLOR.color.rgb;
|
|
22058
|
-
drawLineByBorderType(ctx,
|
|
21894
|
+
drawLineByBorderType(ctx, "b", 0, {
|
|
22059
21895
|
startX: x,
|
|
22060
21896
|
startY: y,
|
|
22061
21897
|
endX: x + pageWidth,
|
|
@@ -22084,8 +21920,8 @@ var Documents = class Documents extends DocComponent {
|
|
|
22084
21920
|
const maxLineAsc = asc;
|
|
22085
21921
|
const maxLineAscSin = maxLineAsc * Math.sin(centerAngle);
|
|
22086
21922
|
const maxLineAscCos = maxLineAsc * Math.cos(centerAngle);
|
|
22087
|
-
if (type ===
|
|
22088
|
-
for (const extension of extensions) if (extension.type ===
|
|
21923
|
+
if (type === 1) {
|
|
21924
|
+
for (const extension of extensions) if (extension.type === 1) {
|
|
22089
21925
|
extension.extensionOffset = {
|
|
22090
21926
|
alignOffset,
|
|
22091
21927
|
renderConfig
|
|
@@ -22508,14 +22344,14 @@ var Spreadsheet = class extends SheetComponent {
|
|
|
22508
22344
|
_getAncestorSize() {
|
|
22509
22345
|
const parent = this._getAncestorParent();
|
|
22510
22346
|
if (!parent) return;
|
|
22511
|
-
if (parent.classType ===
|
|
22347
|
+
if (parent.classType === "Engine") {
|
|
22512
22348
|
const mainCanvas = parent.getCanvas();
|
|
22513
22349
|
return {
|
|
22514
22350
|
width: mainCanvas.getWidth(),
|
|
22515
22351
|
height: mainCanvas.getHeight()
|
|
22516
22352
|
};
|
|
22517
22353
|
}
|
|
22518
|
-
if (parent.classType ===
|
|
22354
|
+
if (parent.classType === "SceneViewer") return {
|
|
22519
22355
|
width: parent.width,
|
|
22520
22356
|
height: parent.height
|
|
22521
22357
|
};
|
|
@@ -22523,7 +22359,7 @@ var Spreadsheet = class extends SheetComponent {
|
|
|
22523
22359
|
_getAncestorParent() {
|
|
22524
22360
|
let parent = this.parent;
|
|
22525
22361
|
while (parent) {
|
|
22526
|
-
if (parent.classType ===
|
|
22362
|
+
if (parent.classType === "Engine" || parent.classType === "SceneViewer") return parent;
|
|
22527
22363
|
parent = (parent === null || parent === void 0 ? void 0 : parent.getParent) && (parent === null || parent === void 0 ? void 0 : parent.getParent());
|
|
22528
22364
|
}
|
|
22529
22365
|
}
|
|
@@ -22780,9 +22616,9 @@ let IWatermarkTypeEnum = /* @__PURE__ */ function(IWatermarkTypeEnum) {
|
|
|
22780
22616
|
function renderWatermark(ctx, config, image, userInfo) {
|
|
22781
22617
|
const type = config.type;
|
|
22782
22618
|
const watermarkConfig = config.config;
|
|
22783
|
-
if (type ===
|
|
22784
|
-
else if (type ===
|
|
22785
|
-
else if (type ===
|
|
22619
|
+
if (type === "userInfo" && watermarkConfig.userInfo) renderUserInfoWatermark(ctx, watermarkConfig.userInfo, userInfo);
|
|
22620
|
+
else if (type === "image" && watermarkConfig.image) renderImageWatermark(ctx, watermarkConfig.image, image);
|
|
22621
|
+
else if (type === "text" && watermarkConfig.text) renderTextWatermark(ctx, watermarkConfig.text);
|
|
22786
22622
|
}
|
|
22787
22623
|
function renderUserInfoWatermark(ctx, config, userInfo) {
|
|
22788
22624
|
const { x, y, repeat, spacingX, spacingY, rotate, opacity, name, fontSize, color, bold, italic, direction } = config;
|
|
@@ -22938,7 +22774,7 @@ var Layer = class extends _univerjs_core.Disposable {
|
|
|
22938
22774
|
* @returns {Layer} this
|
|
22939
22775
|
*/
|
|
22940
22776
|
addObject(o) {
|
|
22941
|
-
if (o.classType ===
|
|
22777
|
+
if (o.classType === "Group") {
|
|
22942
22778
|
const objects = o.getObjects();
|
|
22943
22779
|
for (const object of objects) {
|
|
22944
22780
|
if (this.scene.getObject(object.oKey)) continue;
|
|
@@ -23000,7 +22836,7 @@ var Layer = class extends _univerjs_core.Disposable {
|
|
|
23000
22836
|
* parent is SceneViewer, make it dirty
|
|
23001
22837
|
*/
|
|
23002
22838
|
const parent = this.scene.getParent();
|
|
23003
|
-
if (parent.classType ===
|
|
22839
|
+
if (parent.classType === "SceneViewer") parent.makeDirty(true);
|
|
23004
22840
|
return this;
|
|
23005
22841
|
}
|
|
23006
22842
|
makeDirtyWithDebounce(state = true) {
|
|
@@ -23107,7 +22943,7 @@ var WatermarkLayer = class extends Layer {
|
|
|
23107
22943
|
updateConfig(config, user) {
|
|
23108
22944
|
var _this$_config;
|
|
23109
22945
|
this._config = config;
|
|
23110
|
-
if (((_this$_config = this._config) === null || _this$_config === void 0 ? void 0 : _this$_config.type) ===
|
|
22946
|
+
if (((_this$_config = this._config) === null || _this$_config === void 0 ? void 0 : _this$_config.type) === "image" && this._config.config.image) {
|
|
23111
22947
|
this._image = new Image();
|
|
23112
22948
|
this._image.src = this._config.config.image.url;
|
|
23113
22949
|
}
|
|
@@ -23145,7 +22981,7 @@ var SceneViewer = class extends BaseObject {
|
|
|
23145
22981
|
this._initialProps(props);
|
|
23146
22982
|
}
|
|
23147
22983
|
get classType() {
|
|
23148
|
-
return
|
|
22984
|
+
return "SceneViewer";
|
|
23149
22985
|
}
|
|
23150
22986
|
render(mainCtx, bounds) {
|
|
23151
22987
|
var _this$_activeSubScene;
|
|
@@ -23272,7 +23108,7 @@ var Slide = class extends SceneViewer {
|
|
|
23272
23108
|
addNavigation() {
|
|
23273
23109
|
const scene = this.getActiveSubScene();
|
|
23274
23110
|
if (scene == null || this._navigationEnabled === false) return;
|
|
23275
|
-
const leftArrow = new Path(
|
|
23111
|
+
const leftArrow = new Path("__slideNavigationLeft__", {
|
|
23276
23112
|
data: arrowPath,
|
|
23277
23113
|
width: 60,
|
|
23278
23114
|
height: 60,
|
|
@@ -23281,7 +23117,7 @@ var Slide = class extends SceneViewer {
|
|
|
23281
23117
|
fill: this._getArrowColor(),
|
|
23282
23118
|
flipX: true
|
|
23283
23119
|
});
|
|
23284
|
-
const rightArrow = new Path(
|
|
23120
|
+
const rightArrow = new Path("__slideNavigationRight__", {
|
|
23285
23121
|
data: arrowPath,
|
|
23286
23122
|
width: 60,
|
|
23287
23123
|
height: 60,
|
|
@@ -23290,11 +23126,11 @@ var Slide = class extends SceneViewer {
|
|
|
23290
23126
|
fill: this._getArrowColor()
|
|
23291
23127
|
});
|
|
23292
23128
|
const hoverIn = (o, evt) => {
|
|
23293
|
-
o.setCursor(
|
|
23129
|
+
o.setCursor("pointer");
|
|
23294
23130
|
o.setProps({ fill: this._getArrowColor(true) });
|
|
23295
23131
|
};
|
|
23296
23132
|
const hoverOut = (o, evt) => {
|
|
23297
|
-
o.setCursor(
|
|
23133
|
+
o.setCursor("default");
|
|
23298
23134
|
o.setProps({ fill: this._getArrowColor() });
|
|
23299
23135
|
};
|
|
23300
23136
|
attachObjectHover(leftArrow, hoverIn, hoverOut);
|
|
@@ -23306,8 +23142,8 @@ var Slide = class extends SceneViewer {
|
|
|
23306
23142
|
var _scene$getObject, _scene$getObject2;
|
|
23307
23143
|
const scene = this.getActiveSubScene();
|
|
23308
23144
|
if (scene == null || this._navigationEnabled === false) return;
|
|
23309
|
-
(_scene$getObject = scene.getObject(
|
|
23310
|
-
(_scene$getObject2 = scene.getObject(
|
|
23145
|
+
(_scene$getObject = scene.getObject("__slideNavigationLeft__")) === null || _scene$getObject === void 0 || _scene$getObject.dispose();
|
|
23146
|
+
(_scene$getObject2 = scene.getObject("__slideNavigationRight__")) === null || _scene$getObject2 === void 0 || _scene$getObject2.dispose();
|
|
23311
23147
|
}
|
|
23312
23148
|
enableNav() {
|
|
23313
23149
|
this._navigationEnabled = true;
|
|
@@ -23319,15 +23155,15 @@ var Slide = class extends SceneViewer {
|
|
|
23319
23155
|
var _scene$getObject3, _scene$getObject4;
|
|
23320
23156
|
const scene = this.getActiveSubScene();
|
|
23321
23157
|
if (scene == null || this._navigationEnabled === false) return;
|
|
23322
|
-
(_scene$getObject3 = scene.getObject(
|
|
23323
|
-
(_scene$getObject4 = scene.getObject(
|
|
23158
|
+
(_scene$getObject3 = scene.getObject("__slideNavigationLeft__")) === null || _scene$getObject3 === void 0 || _scene$getObject3.hide();
|
|
23159
|
+
(_scene$getObject4 = scene.getObject("__slideNavigationRight__")) === null || _scene$getObject4 === void 0 || _scene$getObject4.hide();
|
|
23324
23160
|
}
|
|
23325
23161
|
showNav() {
|
|
23326
23162
|
var _scene$getObject5, _scene$getObject6;
|
|
23327
23163
|
const scene = this.getActiveSubScene();
|
|
23328
23164
|
if (scene == null || this._navigationEnabled === false) return;
|
|
23329
|
-
(_scene$getObject5 = scene.getObject(
|
|
23330
|
-
(_scene$getObject6 = scene.getObject(
|
|
23165
|
+
(_scene$getObject5 = scene.getObject("__slideNavigationLeft__")) === null || _scene$getObject5 === void 0 || _scene$getObject5.show();
|
|
23166
|
+
(_scene$getObject6 = scene.getObject("__slideNavigationRight__")) === null || _scene$getObject6 === void 0 || _scene$getObject6.show();
|
|
23331
23167
|
}
|
|
23332
23168
|
renderToThumb(mainCtx, pageId, scaleX = 1, scaleY = 1) {
|
|
23333
23169
|
const scene = this.getSubScene(pageId);
|
|
@@ -23541,7 +23377,7 @@ var Group = class extends BaseObject {
|
|
|
23541
23377
|
this.addObjects(...objects);
|
|
23542
23378
|
}
|
|
23543
23379
|
get classType() {
|
|
23544
|
-
return
|
|
23380
|
+
return "Group";
|
|
23545
23381
|
}
|
|
23546
23382
|
set cursor(val) {
|
|
23547
23383
|
this.setCursor(val);
|
|
@@ -23661,7 +23497,7 @@ var Group = class extends BaseObject {
|
|
|
23661
23497
|
}
|
|
23662
23498
|
_transformObject(object, groupWidth, groupHeight) {
|
|
23663
23499
|
const transform = transformObjectOutOfGroup(object.getState(), this.getState(), groupWidth, groupHeight);
|
|
23664
|
-
if (object.classType ===
|
|
23500
|
+
if (object.classType === "Group") object.transformByState({
|
|
23665
23501
|
left: transform.left,
|
|
23666
23502
|
top: transform.top
|
|
23667
23503
|
});
|
|
@@ -23745,7 +23581,7 @@ var DrawingGroupObject = class extends Group {
|
|
|
23745
23581
|
centerY
|
|
23746
23582
|
]);
|
|
23747
23583
|
const parent = this.getParent();
|
|
23748
|
-
if (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) ===
|
|
23584
|
+
if (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) === "Group") return parent.ancestorTransform.multiply(renderTransform);
|
|
23749
23585
|
return renderTransform;
|
|
23750
23586
|
}
|
|
23751
23587
|
render(ctx, bounds) {
|
|
@@ -23776,7 +23612,7 @@ var DrawingGroupObject = class extends Group {
|
|
|
23776
23612
|
centerY
|
|
23777
23613
|
]);
|
|
23778
23614
|
const parent = this.getParent();
|
|
23779
|
-
const oCoord = (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) ===
|
|
23615
|
+
const oCoord = (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) === "Group" ? parent.ancestorTransform.multiply(renderTransform) : renderTransform).invert().applyPoint(coord);
|
|
23780
23616
|
const halfWidth = realWidth / 2;
|
|
23781
23617
|
const halfHeight = realHeight / 2;
|
|
23782
23618
|
if (oCoord.x < -halfWidth || oCoord.x > halfWidth || oCoord.y < -halfHeight || oCoord.y > halfHeight) return false;
|
|
@@ -24020,7 +23856,7 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24020
23856
|
return this.getCanvas().getHeight();
|
|
24021
23857
|
}
|
|
24022
23858
|
get classType() {
|
|
24023
|
-
return
|
|
23859
|
+
return "Engine";
|
|
24024
23860
|
}
|
|
24025
23861
|
get activeScene() {
|
|
24026
23862
|
return this._activeScene;
|
|
@@ -24090,7 +23926,7 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24090
23926
|
const options = Object.assign({}, {
|
|
24091
23927
|
elementHeight: 1,
|
|
24092
23928
|
elementWidth: 1,
|
|
24093
|
-
renderMode:
|
|
23929
|
+
renderMode: 0,
|
|
24094
23930
|
dpr: 1
|
|
24095
23931
|
}, _options);
|
|
24096
23932
|
this._canvas = new Canvas({
|
|
@@ -24104,7 +23940,7 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24104
23940
|
this._handleKeyboardAction();
|
|
24105
23941
|
this._handlePointerAction();
|
|
24106
23942
|
this._handleDragAction();
|
|
24107
|
-
if (options.renderMode !==
|
|
23943
|
+
if (options.renderMode !== 1) this._matchMediaHandler();
|
|
24108
23944
|
}
|
|
24109
23945
|
getScenes() {
|
|
24110
23946
|
return this._scenes;
|
|
@@ -24237,7 +24073,7 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24237
24073
|
const preHeight = this.height;
|
|
24238
24074
|
this.getCanvas().setSize(width, height);
|
|
24239
24075
|
this.onTransformChange$.emitEvent({
|
|
24240
|
-
type:
|
|
24076
|
+
type: 1,
|
|
24241
24077
|
value: {
|
|
24242
24078
|
width,
|
|
24243
24079
|
height
|
|
@@ -24383,13 +24219,13 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24383
24219
|
_handleKeyboardAction() {
|
|
24384
24220
|
const keyboardDownEvent = (evt) => {
|
|
24385
24221
|
const deviceEvent = evt;
|
|
24386
|
-
deviceEvent.deviceType =
|
|
24222
|
+
deviceEvent.deviceType = 1;
|
|
24387
24223
|
deviceEvent.inputIndex = evt.keyCode;
|
|
24388
24224
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24389
24225
|
};
|
|
24390
24226
|
const keyboardUpEvent = (evt) => {
|
|
24391
24227
|
const deviceEvent = evt;
|
|
24392
|
-
deviceEvent.deviceType =
|
|
24228
|
+
deviceEvent.deviceType = 1;
|
|
24393
24229
|
deviceEvent.inputIndex = evt.keyCode;
|
|
24394
24230
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24395
24231
|
};
|
|
@@ -24414,13 +24250,13 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24414
24250
|
this._pointerMoveEvent = (e) => {
|
|
24415
24251
|
const evt = e;
|
|
24416
24252
|
const deviceType = this._getPointerType(evt);
|
|
24417
|
-
this._pointerPosRecord[
|
|
24418
|
-
this._pointerPosRecord[
|
|
24419
|
-
this._pointerPosRecord[
|
|
24420
|
-
this._pointerPosRecord[
|
|
24253
|
+
this._pointerPosRecord[0] = evt.clientX;
|
|
24254
|
+
this._pointerPosRecord[1] = evt.clientY;
|
|
24255
|
+
this._pointerPosRecord[10] = evt.movementX;
|
|
24256
|
+
this._pointerPosRecord[11] = evt.movementY;
|
|
24421
24257
|
const deviceEvent = evt;
|
|
24422
24258
|
deviceEvent.deviceType = deviceType;
|
|
24423
|
-
deviceEvent.inputIndex =
|
|
24259
|
+
deviceEvent.inputIndex = 0;
|
|
24424
24260
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24425
24261
|
if (!this._usingSafari) {
|
|
24426
24262
|
deviceEvent.inputIndex = evt.button + 2;
|
|
@@ -24430,23 +24266,23 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24430
24266
|
this._pointerDownEvent = (nativeEvent) => {
|
|
24431
24267
|
const evt = nativeEvent;
|
|
24432
24268
|
const deviceType = this._getPointerType(evt);
|
|
24433
|
-
const previousHorizontal = this._pointerPosRecord[
|
|
24434
|
-
const previousVertical = this._pointerPosRecord[
|
|
24435
|
-
if (deviceType ===
|
|
24269
|
+
const previousHorizontal = this._pointerPosRecord[0];
|
|
24270
|
+
const previousVertical = this._pointerPosRecord[1];
|
|
24271
|
+
if (deviceType === 2) {
|
|
24436
24272
|
if (this._mouseId === -1) if (evt.pointerId === void 0) this._mouseId = this._isUsingFirefox ? 0 : 1;
|
|
24437
24273
|
else this._mouseId = evt.pointerId;
|
|
24438
24274
|
if (!document.pointerLockElement) this._remainCapture = this._mouseId;
|
|
24439
24275
|
} else if (evt.pointerId && !document.pointerLockElement) this._remainCapture = evt.pointerId;
|
|
24440
|
-
this._pointerPosRecord[
|
|
24441
|
-
this._pointerPosRecord[
|
|
24276
|
+
this._pointerPosRecord[0] = evt.clientX;
|
|
24277
|
+
this._pointerPosRecord[1] = evt.clientY;
|
|
24442
24278
|
const deviceEvent = evt;
|
|
24443
24279
|
deviceEvent.deviceType = deviceType;
|
|
24444
24280
|
if (previousHorizontal !== evt.clientX) {
|
|
24445
|
-
deviceEvent.inputIndex =
|
|
24281
|
+
deviceEvent.inputIndex = 0;
|
|
24446
24282
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24447
24283
|
}
|
|
24448
24284
|
if (previousVertical !== evt.clientY) {
|
|
24449
|
-
deviceEvent.inputIndex =
|
|
24285
|
+
deviceEvent.inputIndex = 1;
|
|
24450
24286
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24451
24287
|
}
|
|
24452
24288
|
deviceEvent.inputIndex = evt.button + 2;
|
|
@@ -24455,23 +24291,23 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24455
24291
|
this._pointerUpEvent = (_evt) => {
|
|
24456
24292
|
const evt = _evt;
|
|
24457
24293
|
const deviceType = this._getPointerType(evt);
|
|
24458
|
-
const previousHorizontal = this._pointerPosRecord[
|
|
24459
|
-
const previousVertical = this._pointerPosRecord[
|
|
24460
|
-
this._pointerPosRecord[
|
|
24461
|
-
this._pointerPosRecord[
|
|
24294
|
+
const previousHorizontal = this._pointerPosRecord[0];
|
|
24295
|
+
const previousVertical = this._pointerPosRecord[1];
|
|
24296
|
+
this._pointerPosRecord[0] = evt.clientX;
|
|
24297
|
+
this._pointerPosRecord[1] = evt.clientY;
|
|
24462
24298
|
const deviceEvent = evt;
|
|
24463
24299
|
deviceEvent.deviceType = deviceType;
|
|
24464
24300
|
if (previousHorizontal !== evt.clientX) {
|
|
24465
|
-
deviceEvent.inputIndex =
|
|
24301
|
+
deviceEvent.inputIndex = 0;
|
|
24466
24302
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24467
24303
|
}
|
|
24468
24304
|
if (previousVertical !== evt.clientY) {
|
|
24469
|
-
deviceEvent.inputIndex =
|
|
24305
|
+
deviceEvent.inputIndex = 1;
|
|
24470
24306
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24471
24307
|
}
|
|
24472
24308
|
deviceEvent.inputIndex = evt.button + 2;
|
|
24473
24309
|
const canvasEle = this.getCanvasElement();
|
|
24474
|
-
if (deviceType ===
|
|
24310
|
+
if (deviceType === 2 && this._mouseId >= 0 && canvasEle.hasPointerCapture(this._mouseId)) {
|
|
24475
24311
|
this._remainCapture = this._mouseId;
|
|
24476
24312
|
canvasEle.releasePointerCapture(this._mouseId);
|
|
24477
24313
|
} else if (deviceEvent.pointerId && canvasEle.hasPointerCapture(deviceEvent.pointerId)) {
|
|
@@ -24479,7 +24315,7 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24479
24315
|
canvasEle.releasePointerCapture(deviceEvent.pointerId);
|
|
24480
24316
|
}
|
|
24481
24317
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24482
|
-
if (deviceType !==
|
|
24318
|
+
if (deviceType !== 2) this._pointerPosRecord = {};
|
|
24483
24319
|
};
|
|
24484
24320
|
this._pointerEnterEvent = (evt) => {
|
|
24485
24321
|
const deviceType = this._getPointerType(evt);
|
|
@@ -24510,15 +24346,15 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24510
24346
|
this._pointerPosRecord = {};
|
|
24511
24347
|
};
|
|
24512
24348
|
this._pointerWheelEvent = (evt) => {
|
|
24513
|
-
const deviceType =
|
|
24514
|
-
this._pointerPosRecord[
|
|
24515
|
-
this._pointerPosRecord[
|
|
24516
|
-
this._pointerPosRecord[
|
|
24349
|
+
const deviceType = 2;
|
|
24350
|
+
this._pointerPosRecord[7] = evt.deltaX || 0;
|
|
24351
|
+
this._pointerPosRecord[8] = evt.deltaY || evt.wheelDelta || 0;
|
|
24352
|
+
this._pointerPosRecord[9] = evt.deltaZ || 0;
|
|
24517
24353
|
const deviceEvent = evt;
|
|
24518
24354
|
deviceEvent.deviceType = deviceType;
|
|
24519
|
-
if (this._pointerPosRecord[
|
|
24520
|
-
if (this._pointerPosRecord[
|
|
24521
|
-
if (this._pointerPosRecord[
|
|
24355
|
+
if (this._pointerPosRecord[7] !== 0) deviceEvent.currentState = this._pointerPosRecord[7];
|
|
24356
|
+
if (this._pointerPosRecord[8] !== 0) deviceEvent.currentState = this._pointerPosRecord[8];
|
|
24357
|
+
if (this._pointerPosRecord[9] !== 0) deviceEvent.currentState = this._pointerPosRecord[9];
|
|
24522
24358
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24523
24359
|
};
|
|
24524
24360
|
const canvasEle = this.getCanvasElement();
|
|
@@ -24552,32 +24388,32 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24552
24388
|
this._dragOverEvent = (evt) => {
|
|
24553
24389
|
evt.preventDefault();
|
|
24554
24390
|
const deviceType = this._getPointerType(evt);
|
|
24555
|
-
const previousHorizontal = this._pointerPosRecord[
|
|
24556
|
-
const previousVertical = this._pointerPosRecord[
|
|
24557
|
-
this._pointerPosRecord[
|
|
24558
|
-
this._pointerPosRecord[
|
|
24559
|
-
this._pointerPosRecord[
|
|
24560
|
-
this._pointerPosRecord[
|
|
24391
|
+
const previousHorizontal = this._pointerPosRecord[0];
|
|
24392
|
+
const previousVertical = this._pointerPosRecord[1];
|
|
24393
|
+
this._pointerPosRecord[0] = evt.clientX;
|
|
24394
|
+
this._pointerPosRecord[1] = evt.clientY;
|
|
24395
|
+
this._pointerPosRecord[10] = evt.movementX;
|
|
24396
|
+
this._pointerPosRecord[11] = evt.movementY;
|
|
24561
24397
|
const deviceEvent = evt;
|
|
24562
24398
|
deviceEvent.deviceType = deviceType;
|
|
24563
24399
|
if (previousHorizontal !== evt.clientX) {
|
|
24564
|
-
deviceEvent.inputIndex =
|
|
24565
|
-
deviceEvent.currentState = this._pointerPosRecord[
|
|
24400
|
+
deviceEvent.inputIndex = 0;
|
|
24401
|
+
deviceEvent.currentState = this._pointerPosRecord[0];
|
|
24566
24402
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24567
24403
|
}
|
|
24568
24404
|
if (previousVertical !== evt.clientY) {
|
|
24569
|
-
deviceEvent.inputIndex =
|
|
24570
|
-
deviceEvent.currentState = this._pointerPosRecord[
|
|
24405
|
+
deviceEvent.inputIndex = 1;
|
|
24406
|
+
deviceEvent.currentState = this._pointerPosRecord[1];
|
|
24571
24407
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24572
24408
|
}
|
|
24573
|
-
if (this._pointerPosRecord[
|
|
24574
|
-
deviceEvent.inputIndex =
|
|
24575
|
-
deviceEvent.currentState = this._pointerPosRecord[
|
|
24409
|
+
if (this._pointerPosRecord[10] !== 0) {
|
|
24410
|
+
deviceEvent.inputIndex = 10;
|
|
24411
|
+
deviceEvent.currentState = this._pointerPosRecord[10];
|
|
24576
24412
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24577
24413
|
}
|
|
24578
|
-
if (this._pointerPosRecord[
|
|
24579
|
-
deviceEvent.inputIndex =
|
|
24580
|
-
deviceEvent.currentState = this._pointerPosRecord[
|
|
24414
|
+
if (this._pointerPosRecord[11] !== 0) {
|
|
24415
|
+
deviceEvent.inputIndex = 11;
|
|
24416
|
+
deviceEvent.currentState = this._pointerPosRecord[11];
|
|
24581
24417
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24582
24418
|
}
|
|
24583
24419
|
if (!this._usingSafari) {
|
|
@@ -24616,8 +24452,8 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24616
24452
|
return passiveSupported;
|
|
24617
24453
|
}
|
|
24618
24454
|
_getPointerType(evt) {
|
|
24619
|
-
let deviceType =
|
|
24620
|
-
if (evt.pointerType === "touch" || evt.pointerType === "pen" || evt.touches) deviceType =
|
|
24455
|
+
let deviceType = 2;
|
|
24456
|
+
if (evt.pointerType === "touch" || evt.pointerType === "pen" || evt.touches) deviceType = 3;
|
|
24621
24457
|
return deviceType;
|
|
24622
24458
|
}
|
|
24623
24459
|
_matchMediaHandler() {
|
|
@@ -24638,7 +24474,7 @@ Engine = __decorate([__decorateParam(2, ICanvasColorService)], Engine);
|
|
|
24638
24474
|
//#endregion
|
|
24639
24475
|
//#region package.json
|
|
24640
24476
|
var name = "@univerjs/engine-render";
|
|
24641
|
-
var version = "0.
|
|
24477
|
+
var version = "0.22.0-insiders.20260513-09bbeca";
|
|
24642
24478
|
|
|
24643
24479
|
//#endregion
|
|
24644
24480
|
//#region src/config/config.ts
|
|
@@ -24833,7 +24669,7 @@ var InputManager = class InputManager extends _univerjs_core.Disposable {
|
|
|
24833
24669
|
if (!engine) return;
|
|
24834
24670
|
this._onInput$ = engine.onInputChanged$.subscribeEvent((eventData) => {
|
|
24835
24671
|
const evt = eventData;
|
|
24836
|
-
if (eventData.deviceType ===
|
|
24672
|
+
if (eventData.deviceType === 1) switch (eventData.type) {
|
|
24837
24673
|
case "keydown":
|
|
24838
24674
|
this._onKeyDown(evt);
|
|
24839
24675
|
break;
|
|
@@ -24841,7 +24677,7 @@ var InputManager = class InputManager extends _univerjs_core.Disposable {
|
|
|
24841
24677
|
this._onKeyUp(evt);
|
|
24842
24678
|
break;
|
|
24843
24679
|
}
|
|
24844
|
-
if (eventData.deviceType ===
|
|
24680
|
+
if (eventData.deviceType === 2 || eventData.deviceType === 3) switch (eventData.type) {
|
|
24845
24681
|
case "wheel":
|
|
24846
24682
|
case "DOMMouseScroll":
|
|
24847
24683
|
case "mousewheel":
|
|
@@ -24863,10 +24699,10 @@ var InputManager = class InputManager extends _univerjs_core.Disposable {
|
|
|
24863
24699
|
if (enableMove) this._onPointerMove(evt);
|
|
24864
24700
|
break;
|
|
24865
24701
|
case "pointerup":
|
|
24866
|
-
if (enableUp && eventData.inputIndex >=
|
|
24702
|
+
if (enableUp && eventData.inputIndex >= 2 && eventData.inputIndex <= 4) this._onPointerUp(evt);
|
|
24867
24703
|
break;
|
|
24868
24704
|
case "pointerdown":
|
|
24869
|
-
if (enableDown && eventData.inputIndex >=
|
|
24705
|
+
if (enableDown && eventData.inputIndex >= 2 && eventData.inputIndex <= 4) this._onPointerDown(evt);
|
|
24870
24706
|
break;
|
|
24871
24707
|
}
|
|
24872
24708
|
if (eventData.dataTransfer) switch (eventData.type) {
|
|
@@ -24874,7 +24710,7 @@ var InputManager = class InputManager extends _univerjs_core.Disposable {
|
|
|
24874
24710
|
if (enableEnter) this._onDragEnter(evt);
|
|
24875
24711
|
break;
|
|
24876
24712
|
case "dragover": {
|
|
24877
|
-
const validIndex = eventData.inputIndex ===
|
|
24713
|
+
const validIndex = eventData.inputIndex === 0 || eventData.inputIndex === 1 || eventData.inputIndex === 10 || eventData.inputIndex === 11;
|
|
24878
24714
|
if (enableMove && validIndex) this._onDragOver(evt);
|
|
24879
24715
|
break;
|
|
24880
24716
|
}
|
|
@@ -24921,9 +24757,9 @@ var InputManager = class InputManager extends _univerjs_core.Disposable {
|
|
|
24921
24757
|
return !this._isObjectInSceneViewer(currentObject);
|
|
24922
24758
|
}
|
|
24923
24759
|
_isObjectInSceneViewer(obj) {
|
|
24924
|
-
if (obj && obj.classType ===
|
|
24760
|
+
if (obj && obj.classType === "BaseObject") {
|
|
24925
24761
|
const scene = obj.getScene();
|
|
24926
|
-
if (scene) return scene.getParent().classType ===
|
|
24762
|
+
if (scene) return scene.getParent().classType === "SceneViewer";
|
|
24927
24763
|
}
|
|
24928
24764
|
return false;
|
|
24929
24765
|
}
|
|
@@ -24990,7 +24826,7 @@ const THRESHOLD_TO_AUTO_MOVE = {
|
|
|
24990
24826
|
r: 60
|
|
24991
24827
|
};
|
|
24992
24828
|
var ScrollTimer = class ScrollTimer {
|
|
24993
|
-
constructor(_scene, _scrollTimerType =
|
|
24829
|
+
constructor(_scene, _scrollTimerType = 3, _thresholdAutoMove = THRESHOLD_TO_AUTO_MOVE) {
|
|
24994
24830
|
this._scene = _scene;
|
|
24995
24831
|
this._scrollTimerType = _scrollTimerType;
|
|
24996
24832
|
this._thresholdAutoMove = _thresholdAutoMove;
|
|
@@ -25004,7 +24840,7 @@ var ScrollTimer = class ScrollTimer {
|
|
|
25004
24840
|
_defineProperty(this, "_scrollY", 0);
|
|
25005
24841
|
_defineProperty(this, "_scrollFunction", void 0);
|
|
25006
24842
|
}
|
|
25007
|
-
static create(scene, scrollTimerType =
|
|
24843
|
+
static create(scene, scrollTimerType = 3, padding) {
|
|
25008
24844
|
return new ScrollTimer(scene, scrollTimerType, padding);
|
|
25009
24845
|
}
|
|
25010
24846
|
get offsetX() {
|
|
@@ -25043,7 +24879,7 @@ var ScrollTimer = class ScrollTimer {
|
|
|
25043
24879
|
let x = 0;
|
|
25044
24880
|
let y = 0;
|
|
25045
24881
|
let shouldScroll = false;
|
|
25046
|
-
if (this._scrollTimerType &
|
|
24882
|
+
if (this._scrollTimerType & 1) {
|
|
25047
24883
|
if (this._moveX < leftBounding + l) {
|
|
25048
24884
|
x = this._moveX - leftBounding - l;
|
|
25049
24885
|
shouldScroll = true;
|
|
@@ -25053,7 +24889,7 @@ var ScrollTimer = class ScrollTimer {
|
|
|
25053
24889
|
shouldScroll = true;
|
|
25054
24890
|
}
|
|
25055
24891
|
}
|
|
25056
|
-
if (this._scrollTimerType &
|
|
24892
|
+
if (this._scrollTimerType & 2) {
|
|
25057
24893
|
if (this._moveY < topBounding + t) {
|
|
25058
24894
|
y = this._moveY - topBounding - t;
|
|
25059
24895
|
shouldScroll = true;
|
|
@@ -25096,42 +24932,21 @@ var ScrollTimer = class ScrollTimer {
|
|
|
25096
24932
|
|
|
25097
24933
|
//#endregion
|
|
25098
24934
|
//#region src/scene.transformer.ts
|
|
25099
|
-
var TransformerManagerType = /* @__PURE__ */ function(TransformerManagerType) {
|
|
25100
|
-
TransformerManagerType["RESIZE_LT"] = "__SpreadsheetTransformerResizeLT__";
|
|
25101
|
-
TransformerManagerType["RESIZE_CT"] = "__SpreadsheetTransformerResizeCT__";
|
|
25102
|
-
TransformerManagerType["RESIZE_RT"] = "__SpreadsheetTransformerResizeRT__";
|
|
25103
|
-
TransformerManagerType["RESIZE_LM"] = "__SpreadsheetTransformerResizeLM__";
|
|
25104
|
-
TransformerManagerType["RESIZE_RM"] = "__SpreadsheetTransformerResizeRM__";
|
|
25105
|
-
TransformerManagerType["RESIZE_LB"] = "__SpreadsheetTransformerResizeLB__";
|
|
25106
|
-
TransformerManagerType["RESIZE_CB"] = "__SpreadsheetTransformerResizeCB__";
|
|
25107
|
-
TransformerManagerType["RESIZE_RB"] = "__SpreadsheetTransformerResizeRB__";
|
|
25108
|
-
TransformerManagerType["OUTLINE"] = "__SpreadsheetTransformerOutline__";
|
|
25109
|
-
TransformerManagerType["ROTATE_LINE"] = "__SpreadsheetTransformerRotateLine__";
|
|
25110
|
-
TransformerManagerType["ROTATE"] = "__SpreadsheetTransformerRotate__";
|
|
25111
|
-
TransformerManagerType["GROUP"] = "__SpreadsheetTransformer__";
|
|
25112
|
-
return TransformerManagerType;
|
|
25113
|
-
}(TransformerManagerType || {});
|
|
25114
24935
|
const TransformerManagerTypeArray = [
|
|
25115
|
-
|
|
25116
|
-
|
|
25117
|
-
|
|
25118
|
-
|
|
25119
|
-
|
|
25120
|
-
|
|
25121
|
-
|
|
25122
|
-
|
|
24936
|
+
"__SpreadsheetTransformerResizeLT__",
|
|
24937
|
+
"__SpreadsheetTransformerResizeCT__",
|
|
24938
|
+
"__SpreadsheetTransformerResizeRT__",
|
|
24939
|
+
"__SpreadsheetTransformerResizeLM__",
|
|
24940
|
+
"__SpreadsheetTransformerResizeRM__",
|
|
24941
|
+
"__SpreadsheetTransformerResizeLB__",
|
|
24942
|
+
"__SpreadsheetTransformerResizeCB__",
|
|
24943
|
+
"__SpreadsheetTransformerResizeRB__"
|
|
25123
24944
|
];
|
|
25124
|
-
var MoveObserverType = /* @__PURE__ */ function(MoveObserverType) {
|
|
25125
|
-
MoveObserverType[MoveObserverType["MOVE_START"] = 0] = "MOVE_START";
|
|
25126
|
-
MoveObserverType[MoveObserverType["MOVING"] = 1] = "MOVING";
|
|
25127
|
-
MoveObserverType[MoveObserverType["MOVE_END"] = 2] = "MOVE_END";
|
|
25128
|
-
return MoveObserverType;
|
|
25129
|
-
}(MoveObserverType || {});
|
|
25130
24945
|
const DEFAULT_TRANSFORMER_LAYER_INDEX = 2;
|
|
25131
24946
|
const MINI_WIDTH_LIMIT = 20;
|
|
25132
24947
|
const MINI_HEIGHT_LIMIT = 20;
|
|
25133
24948
|
const DEFAULT_CONTROL_PLUS_INDEX = 5e3;
|
|
25134
|
-
const SINGLE_ACTIVE_OBJECT_TYPE_MAP = new Set([
|
|
24949
|
+
const SINGLE_ACTIVE_OBJECT_TYPE_MAP = new Set([6]);
|
|
25135
24950
|
/**
|
|
25136
24951
|
* Transformer constructor. Transformer is a special type of group that allow you transform
|
|
25137
24952
|
* primitives and shapes. Transforming tool is not changing `width` and `height` properties of nodes
|
|
@@ -25224,7 +25039,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25224
25039
|
changeNotification() {
|
|
25225
25040
|
this._changing$.next({
|
|
25226
25041
|
objects: this._selectedObjectMap,
|
|
25227
|
-
type:
|
|
25042
|
+
type: 0
|
|
25228
25043
|
});
|
|
25229
25044
|
return this;
|
|
25230
25045
|
}
|
|
@@ -25369,14 +25184,14 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25369
25184
|
this._changeStart$.next({
|
|
25370
25185
|
target: applyObject,
|
|
25371
25186
|
objects: this._selectedObjectMap,
|
|
25372
|
-
type:
|
|
25187
|
+
type: 0
|
|
25373
25188
|
});
|
|
25374
25189
|
} else {
|
|
25375
25190
|
this._copperSelectedObject = applyObject;
|
|
25376
25191
|
this._changeStart$.next({
|
|
25377
25192
|
target: applyObject,
|
|
25378
25193
|
objects: new Map([[applyObject.oKey, applyObject]]),
|
|
25379
|
-
type:
|
|
25194
|
+
type: 0
|
|
25380
25195
|
});
|
|
25381
25196
|
}
|
|
25382
25197
|
this._moveBufferSkip = false;
|
|
@@ -25397,14 +25212,14 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25397
25212
|
const { offsetX, offsetY } = event;
|
|
25398
25213
|
if (!isCropper) this._changeEnd$.next({
|
|
25399
25214
|
objects: this._selectedObjectMap,
|
|
25400
|
-
type:
|
|
25215
|
+
type: 2,
|
|
25401
25216
|
offsetX,
|
|
25402
25217
|
offsetY,
|
|
25403
25218
|
event
|
|
25404
25219
|
});
|
|
25405
25220
|
else this._changeEnd$.next({
|
|
25406
25221
|
objects: new Map([[applyObject.oKey, applyObject]]),
|
|
25407
|
-
type:
|
|
25222
|
+
type: 2,
|
|
25408
25223
|
offsetX,
|
|
25409
25224
|
offsetY,
|
|
25410
25225
|
event
|
|
@@ -25488,7 +25303,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25488
25303
|
objects: this._selectedObjectMap,
|
|
25489
25304
|
moveX: moveLeft,
|
|
25490
25305
|
moveY: moveTop,
|
|
25491
|
-
type:
|
|
25306
|
+
type: 1,
|
|
25492
25307
|
offsetX: moveOffsetX,
|
|
25493
25308
|
offsetY: moveOffsetY
|
|
25494
25309
|
});
|
|
@@ -25502,7 +25317,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25502
25317
|
objects: new Map([[cropper.oKey, cropper]]),
|
|
25503
25318
|
moveX: moveLeft,
|
|
25504
25319
|
moveY: moveTop,
|
|
25505
|
-
type:
|
|
25320
|
+
type: 1,
|
|
25506
25321
|
offsetX: moveOffsetX,
|
|
25507
25322
|
offsetY: moveOffsetY
|
|
25508
25323
|
});
|
|
@@ -25527,7 +25342,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25527
25342
|
});
|
|
25528
25343
|
this._changing$.next({
|
|
25529
25344
|
objects: this._selectedObjectMap,
|
|
25530
|
-
type:
|
|
25345
|
+
type: 1,
|
|
25531
25346
|
offsetX: moveOffsetX,
|
|
25532
25347
|
offsetY: moveOffsetY
|
|
25533
25348
|
});
|
|
@@ -25535,12 +25350,12 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25535
25350
|
this._moveFunc(applyObject, type, x, y, keepRatio, isCropper, isGroup);
|
|
25536
25351
|
this._changing$.next({
|
|
25537
25352
|
objects: new Map([[applyObject.oKey, applyObject]]),
|
|
25538
|
-
type:
|
|
25353
|
+
type: 1,
|
|
25539
25354
|
offsetX: moveOffsetX,
|
|
25540
25355
|
offsetY: moveOffsetY
|
|
25541
25356
|
});
|
|
25542
25357
|
}
|
|
25543
|
-
if (!(keepRatio && type !==
|
|
25358
|
+
if (!(keepRatio && type !== "__SpreadsheetTransformerResizeCT__" && type !== "__SpreadsheetTransformerResizeCB__" && type !== "__SpreadsheetTransformerResizeLM__" && type !== "__SpreadsheetTransformerResizeRM__" && !isGroup)) {
|
|
25544
25359
|
this._startOffsetX = x;
|
|
25545
25360
|
this._startOffsetY = y;
|
|
25546
25361
|
}
|
|
@@ -25550,17 +25365,17 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25550
25365
|
const originState = this._startStateMap.get(moveObject.oKey) || {};
|
|
25551
25366
|
let state = {};
|
|
25552
25367
|
const { moveLeft, moveTop } = this._getMovePoint(x, y, moveObject);
|
|
25553
|
-
if (keepRatio && type !==
|
|
25554
|
-
case
|
|
25368
|
+
if (keepRatio && type !== "__SpreadsheetTransformerResizeCT__" && type !== "__SpreadsheetTransformerResizeCB__" && type !== "__SpreadsheetTransformerResizeLM__" && type !== "__SpreadsheetTransformerResizeRM__" && !isGroup) switch (type) {
|
|
25369
|
+
case "__SpreadsheetTransformerResizeLT__":
|
|
25555
25370
|
state = this._resizeLeftTop(moveObject, moveLeft, moveTop, originState);
|
|
25556
25371
|
break;
|
|
25557
|
-
case
|
|
25372
|
+
case "__SpreadsheetTransformerResizeRT__":
|
|
25558
25373
|
state = this._resizeRightTop(moveObject, moveLeft, moveTop, originState);
|
|
25559
25374
|
break;
|
|
25560
|
-
case
|
|
25375
|
+
case "__SpreadsheetTransformerResizeLB__":
|
|
25561
25376
|
state = this._resizeLeftBottom(moveObject, moveLeft, moveTop, originState);
|
|
25562
25377
|
break;
|
|
25563
|
-
case
|
|
25378
|
+
case "__SpreadsheetTransformerResizeRB__":
|
|
25564
25379
|
state = this._resizeRightBottom(moveObject, moveLeft, moveTop, originState);
|
|
25565
25380
|
break;
|
|
25566
25381
|
}
|
|
@@ -25612,37 +25427,37 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25612
25427
|
height
|
|
25613
25428
|
};
|
|
25614
25429
|
switch (type) {
|
|
25615
|
-
case
|
|
25430
|
+
case "__SpreadsheetTransformerResizeLT__":
|
|
25616
25431
|
state.width = width - moveLeft < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : width - moveLeft;
|
|
25617
25432
|
state.height = height - moveTop < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : height - moveTop;
|
|
25618
25433
|
state.left = left + width - state.width;
|
|
25619
25434
|
state.top = top + height - state.height;
|
|
25620
25435
|
break;
|
|
25621
|
-
case
|
|
25436
|
+
case "__SpreadsheetTransformerResizeCT__":
|
|
25622
25437
|
state.height = height - moveTop < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : height - moveTop;
|
|
25623
25438
|
state.top = top + height - state.height;
|
|
25624
25439
|
break;
|
|
25625
|
-
case
|
|
25440
|
+
case "__SpreadsheetTransformerResizeRT__":
|
|
25626
25441
|
state.width = width + moveLeft < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : width + moveLeft;
|
|
25627
25442
|
state.height = height - moveTop < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : height - moveTop;
|
|
25628
25443
|
state.top = top + height - state.height;
|
|
25629
25444
|
break;
|
|
25630
|
-
case
|
|
25445
|
+
case "__SpreadsheetTransformerResizeLM__":
|
|
25631
25446
|
state.width = width - moveLeft < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : width - moveLeft;
|
|
25632
25447
|
state.left = left + width - state.width;
|
|
25633
25448
|
break;
|
|
25634
|
-
case
|
|
25449
|
+
case "__SpreadsheetTransformerResizeRM__":
|
|
25635
25450
|
state.width = moveLeft + width < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : moveLeft + width;
|
|
25636
25451
|
break;
|
|
25637
|
-
case
|
|
25452
|
+
case "__SpreadsheetTransformerResizeLB__":
|
|
25638
25453
|
state.width = width - moveLeft < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : width - moveLeft;
|
|
25639
25454
|
state.height = height + moveTop < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : height + moveTop;
|
|
25640
25455
|
state.left = state.width <= MINI_WIDTH_LIMIT ? left : left + moveLeft;
|
|
25641
25456
|
break;
|
|
25642
|
-
case
|
|
25457
|
+
case "__SpreadsheetTransformerResizeCB__":
|
|
25643
25458
|
state.height = moveTop + height < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : moveTop + height;
|
|
25644
25459
|
break;
|
|
25645
|
-
case
|
|
25460
|
+
case "__SpreadsheetTransformerResizeRB__":
|
|
25646
25461
|
state.width = moveLeft + width < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : moveLeft + width;
|
|
25647
25462
|
state.height = moveTop + height < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : moveTop + height;
|
|
25648
25463
|
break;
|
|
@@ -25747,7 +25562,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25747
25562
|
moveTop: moveTopFix
|
|
25748
25563
|
};
|
|
25749
25564
|
}
|
|
25750
|
-
_attachEventToAnchor(anchor, type =
|
|
25565
|
+
_attachEventToAnchor(anchor, type = "__SpreadsheetTransformerResizeLT__", applyObject) {
|
|
25751
25566
|
this.disposeWithMe((0, _univerjs_core.toDisposable)(anchor.onPointerDown$.subscribeEvent((evt, state) => {
|
|
25752
25567
|
const { offsetX: evtOffsetX, offsetY: evtOffsetY } = evt;
|
|
25753
25568
|
this._startOffsetX = evtOffsetX;
|
|
@@ -25768,7 +25583,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25768
25583
|
this._clearControlMap();
|
|
25769
25584
|
this._changeStart$.next({
|
|
25770
25585
|
objects: this._selectedObjectMap,
|
|
25771
|
-
type:
|
|
25586
|
+
type: 0
|
|
25772
25587
|
});
|
|
25773
25588
|
this._selectedObjectMap.forEach((moveObject) => {
|
|
25774
25589
|
const { width, height, left, top } = moveObject.getState();
|
|
@@ -25782,7 +25597,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25782
25597
|
} else {
|
|
25783
25598
|
this._changeStart$.next({
|
|
25784
25599
|
objects: new Map([[applyObject.oKey, applyObject]]),
|
|
25785
|
-
type:
|
|
25600
|
+
type: 0
|
|
25786
25601
|
});
|
|
25787
25602
|
const { width, height, left, top } = applyObject.getState();
|
|
25788
25603
|
this._startStateMap.set(applyObject.oKey, {
|
|
@@ -25814,7 +25629,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25814
25629
|
this._recoverySizeBoundary(Array.from(this._selectedObjectMap.values()), ancestorLeft, ancestorTop, topSceneWidth, topSceneHeight);
|
|
25815
25630
|
this._changeEnd$.next({
|
|
25816
25631
|
objects: this._selectedObjectMap,
|
|
25817
|
-
type:
|
|
25632
|
+
type: 2,
|
|
25818
25633
|
offsetX,
|
|
25819
25634
|
offsetY,
|
|
25820
25635
|
event
|
|
@@ -25823,7 +25638,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25823
25638
|
this._recoverySizeBoundary([applyObject], ancestorLeft, ancestorTop, topSceneWidth, topSceneHeight);
|
|
25824
25639
|
this._changeEnd$.next({
|
|
25825
25640
|
objects: new Map([[applyObject.oKey, applyObject]]),
|
|
25826
|
-
type:
|
|
25641
|
+
type: 2,
|
|
25827
25642
|
offsetX,
|
|
25828
25643
|
offsetY,
|
|
25829
25644
|
event
|
|
@@ -25861,14 +25676,14 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25861
25676
|
const viewportActualXY = topScene.getScrollXYInfoByViewport(Vector2.create(evtOffsetX, evtOffsetY));
|
|
25862
25677
|
this._viewportScrollX = viewportActualXY.x;
|
|
25863
25678
|
this._viewportScrollY = viewportActualXY.y;
|
|
25864
|
-
const cursor = this._getRotateAnchorCursor(
|
|
25679
|
+
const cursor = this._getRotateAnchorCursor("__SpreadsheetTransformerRotateLine__");
|
|
25865
25680
|
const { ancestorLeft, ancestorTop, width, height, angle: agentOrigin } = applyObject;
|
|
25866
25681
|
const centerX = width / 2 + ancestorLeft;
|
|
25867
25682
|
const centerY = height / 2 + ancestorTop;
|
|
25868
25683
|
this._clearControlMap();
|
|
25869
25684
|
this._changeStart$.next({
|
|
25870
25685
|
objects: this._selectedObjectMap,
|
|
25871
|
-
type:
|
|
25686
|
+
type: 0
|
|
25872
25687
|
});
|
|
25873
25688
|
this._moveBufferSkip = false;
|
|
25874
25689
|
const topScenePointerMoveSub = topScene.onPointerMove$.subscribeEvent((moveEvt) => {
|
|
@@ -25885,7 +25700,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25885
25700
|
const { offsetX, offsetY } = event;
|
|
25886
25701
|
this._changeEnd$.next({
|
|
25887
25702
|
objects: this._selectedObjectMap,
|
|
25888
|
-
type:
|
|
25703
|
+
type: 2,
|
|
25889
25704
|
offsetX,
|
|
25890
25705
|
offsetY,
|
|
25891
25706
|
event
|
|
@@ -25907,7 +25722,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25907
25722
|
this._changing$.next({
|
|
25908
25723
|
objects: this._selectedObjectMap,
|
|
25909
25724
|
angle,
|
|
25910
|
-
type:
|
|
25725
|
+
type: 1,
|
|
25911
25726
|
offsetX: moveOffsetX,
|
|
25912
25727
|
offsetY: moveOffsetY
|
|
25913
25728
|
});
|
|
@@ -25921,35 +25736,35 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25921
25736
|
};
|
|
25922
25737
|
}
|
|
25923
25738
|
_getRotateAnchorCursor(type) {
|
|
25924
|
-
let cursor =
|
|
25739
|
+
let cursor = "nw-resize";
|
|
25925
25740
|
switch (type) {
|
|
25926
|
-
case
|
|
25927
|
-
cursor =
|
|
25741
|
+
case "__SpreadsheetTransformerRotate__":
|
|
25742
|
+
cursor = "move";
|
|
25928
25743
|
break;
|
|
25929
|
-
case
|
|
25930
|
-
cursor =
|
|
25744
|
+
case "__SpreadsheetTransformerRotateLine__":
|
|
25745
|
+
cursor = "move";
|
|
25931
25746
|
break;
|
|
25932
|
-
case
|
|
25933
|
-
case
|
|
25934
|
-
cursor =
|
|
25747
|
+
case "__SpreadsheetTransformerResizeLT__": break;
|
|
25748
|
+
case "__SpreadsheetTransformerResizeCT__":
|
|
25749
|
+
cursor = "n-resize";
|
|
25935
25750
|
break;
|
|
25936
|
-
case
|
|
25937
|
-
cursor =
|
|
25751
|
+
case "__SpreadsheetTransformerResizeRT__":
|
|
25752
|
+
cursor = "ne-resize";
|
|
25938
25753
|
break;
|
|
25939
|
-
case
|
|
25940
|
-
cursor =
|
|
25754
|
+
case "__SpreadsheetTransformerResizeLM__":
|
|
25755
|
+
cursor = "w-resize";
|
|
25941
25756
|
break;
|
|
25942
|
-
case
|
|
25943
|
-
cursor =
|
|
25757
|
+
case "__SpreadsheetTransformerResizeRM__":
|
|
25758
|
+
cursor = "e-resize";
|
|
25944
25759
|
break;
|
|
25945
|
-
case
|
|
25946
|
-
cursor =
|
|
25760
|
+
case "__SpreadsheetTransformerResizeLB__":
|
|
25761
|
+
cursor = "sw-resize";
|
|
25947
25762
|
break;
|
|
25948
|
-
case
|
|
25949
|
-
cursor =
|
|
25763
|
+
case "__SpreadsheetTransformerResizeCB__":
|
|
25764
|
+
cursor = "s-resize";
|
|
25950
25765
|
break;
|
|
25951
|
-
case
|
|
25952
|
-
cursor =
|
|
25766
|
+
case "__SpreadsheetTransformerResizeRB__":
|
|
25767
|
+
cursor = "se-resize";
|
|
25953
25768
|
break;
|
|
25954
25769
|
}
|
|
25955
25770
|
return cursor;
|
|
@@ -25961,35 +25776,35 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25961
25776
|
const longEdge = anchorSize;
|
|
25962
25777
|
const shortEdge = anchorSize / 4;
|
|
25963
25778
|
switch (type) {
|
|
25964
|
-
case
|
|
25779
|
+
case "__SpreadsheetTransformerResizeLT__":
|
|
25965
25780
|
left += -borderSpacing - borderStrokeWidth;
|
|
25966
25781
|
top += -borderSpacing - borderStrokeWidth;
|
|
25967
25782
|
break;
|
|
25968
|
-
case
|
|
25783
|
+
case "__SpreadsheetTransformerResizeCT__":
|
|
25969
25784
|
left += width / 2 - longEdge / 2;
|
|
25970
25785
|
top += -borderSpacing - borderStrokeWidth;
|
|
25971
25786
|
break;
|
|
25972
|
-
case
|
|
25787
|
+
case "__SpreadsheetTransformerResizeRT__":
|
|
25973
25788
|
left += width + borderSpacing - borderStrokeWidth - longEdge;
|
|
25974
25789
|
top += -borderSpacing - borderStrokeWidth;
|
|
25975
25790
|
break;
|
|
25976
|
-
case
|
|
25791
|
+
case "__SpreadsheetTransformerResizeLM__":
|
|
25977
25792
|
left += borderSpacing - borderStrokeWidth;
|
|
25978
25793
|
top += height / 2 - longEdge / 2;
|
|
25979
25794
|
break;
|
|
25980
|
-
case
|
|
25795
|
+
case "__SpreadsheetTransformerResizeRM__":
|
|
25981
25796
|
left += width + borderSpacing - borderStrokeWidth - shortEdge;
|
|
25982
25797
|
top += height / 2 - longEdge / 2;
|
|
25983
25798
|
break;
|
|
25984
|
-
case
|
|
25799
|
+
case "__SpreadsheetTransformerResizeLB__":
|
|
25985
25800
|
left += -this.borderSpacing - borderStrokeWidth;
|
|
25986
25801
|
top += height + borderSpacing - borderStrokeWidth - longEdge;
|
|
25987
25802
|
break;
|
|
25988
|
-
case
|
|
25803
|
+
case "__SpreadsheetTransformerResizeCB__":
|
|
25989
25804
|
left += width / 2 - longEdge / 2;
|
|
25990
25805
|
top += height + borderSpacing - borderStrokeWidth - shortEdge;
|
|
25991
25806
|
break;
|
|
25992
|
-
case
|
|
25807
|
+
case "__SpreadsheetTransformerResizeRB__":
|
|
25993
25808
|
left += width + borderSpacing - borderStrokeWidth - longEdge;
|
|
25994
25809
|
top += height + borderSpacing - borderStrokeWidth - longEdge;
|
|
25995
25810
|
break;
|
|
@@ -26004,43 +25819,43 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
26004
25819
|
let left = -anchorSize / 2;
|
|
26005
25820
|
let top = -anchorSize / 2;
|
|
26006
25821
|
switch (type) {
|
|
26007
|
-
case
|
|
25822
|
+
case "__SpreadsheetTransformerRotate__":
|
|
26008
25823
|
left = width / 2 - rotateSize / 2;
|
|
26009
25824
|
top = -rotateAnchorOffset - borderSpacing - borderStrokeWidth * 2 - rotateSize;
|
|
26010
25825
|
break;
|
|
26011
|
-
case
|
|
25826
|
+
case "__SpreadsheetTransformerRotateLine__":
|
|
26012
25827
|
left = width / 2;
|
|
26013
25828
|
top = -rotateAnchorOffset - borderSpacing - borderStrokeWidth;
|
|
26014
25829
|
break;
|
|
26015
|
-
case
|
|
25830
|
+
case "__SpreadsheetTransformerResizeLT__":
|
|
26016
25831
|
left += -borderSpacing - borderStrokeWidth;
|
|
26017
25832
|
top += -borderSpacing - borderStrokeWidth;
|
|
26018
25833
|
break;
|
|
26019
|
-
case
|
|
25834
|
+
case "__SpreadsheetTransformerResizeCT__":
|
|
26020
25835
|
left += width / 2;
|
|
26021
25836
|
top += -borderSpacing - borderStrokeWidth;
|
|
26022
25837
|
break;
|
|
26023
|
-
case
|
|
25838
|
+
case "__SpreadsheetTransformerResizeRT__":
|
|
26024
25839
|
left += width + borderSpacing - borderStrokeWidth;
|
|
26025
25840
|
top += -borderSpacing - borderStrokeWidth;
|
|
26026
25841
|
break;
|
|
26027
|
-
case
|
|
25842
|
+
case "__SpreadsheetTransformerResizeLM__":
|
|
26028
25843
|
left += borderSpacing - borderStrokeWidth;
|
|
26029
25844
|
top += height / 2;
|
|
26030
25845
|
break;
|
|
26031
|
-
case
|
|
25846
|
+
case "__SpreadsheetTransformerResizeRM__":
|
|
26032
25847
|
left += width + borderSpacing - borderStrokeWidth;
|
|
26033
25848
|
top += height / 2;
|
|
26034
25849
|
break;
|
|
26035
|
-
case
|
|
25850
|
+
case "__SpreadsheetTransformerResizeLB__":
|
|
26036
25851
|
left += -this.borderSpacing - borderStrokeWidth;
|
|
26037
25852
|
top += height + borderSpacing - borderStrokeWidth;
|
|
26038
25853
|
break;
|
|
26039
|
-
case
|
|
25854
|
+
case "__SpreadsheetTransformerResizeCB__":
|
|
26040
25855
|
left += width / 2;
|
|
26041
25856
|
top += height + borderSpacing - borderStrokeWidth;
|
|
26042
25857
|
break;
|
|
26043
|
-
case
|
|
25858
|
+
case "__SpreadsheetTransformerResizeRB__":
|
|
26044
25859
|
left += width + borderSpacing - borderStrokeWidth;
|
|
26045
25860
|
top += height + borderSpacing - borderStrokeWidth;
|
|
26046
25861
|
break;
|
|
@@ -26066,7 +25881,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
26066
25881
|
left,
|
|
26067
25882
|
top
|
|
26068
25883
|
});
|
|
26069
|
-
this._attachHover(anchor, cursor,
|
|
25884
|
+
this._attachHover(anchor, cursor, "default");
|
|
26070
25885
|
return anchor;
|
|
26071
25886
|
}
|
|
26072
25887
|
_createCopperResizeAnchor(type, applyObject, zIndex) {
|
|
@@ -26088,36 +25903,36 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
26088
25903
|
};
|
|
26089
25904
|
const longEdge = anchorSize;
|
|
26090
25905
|
const shortEdge = anchorSize / 4;
|
|
26091
|
-
if (cursor ===
|
|
25906
|
+
if (cursor === "e-resize") {
|
|
26092
25907
|
config.width = shortEdge;
|
|
26093
25908
|
config.height = longEdge;
|
|
26094
25909
|
anchor = new Rect(oKey, config);
|
|
26095
|
-
} else if (cursor ===
|
|
25910
|
+
} else if (cursor === "w-resize") {
|
|
26096
25911
|
config.width = shortEdge;
|
|
26097
25912
|
config.height = longEdge;
|
|
26098
25913
|
anchor = new Rect(oKey, config);
|
|
26099
|
-
} else if (cursor ===
|
|
25914
|
+
} else if (cursor === "n-resize") {
|
|
26100
25915
|
config.width = longEdge;
|
|
26101
25916
|
config.height = shortEdge;
|
|
26102
25917
|
anchor = new Rect(oKey, config);
|
|
26103
|
-
} else if (cursor ===
|
|
25918
|
+
} else if (cursor === "s-resize") {
|
|
26104
25919
|
config.width = longEdge;
|
|
26105
25920
|
config.height = shortEdge;
|
|
26106
25921
|
anchor = new Rect(oKey, config);
|
|
26107
|
-
} else if (cursor ===
|
|
25922
|
+
} else if (cursor === "ne-resize") {
|
|
26108
25923
|
config.pointsGroup = this._getNorthEastPoints(longEdge, shortEdge);
|
|
26109
25924
|
anchor = new RegularPolygon(oKey, config);
|
|
26110
|
-
} else if (cursor ===
|
|
25925
|
+
} else if (cursor === "nw-resize") {
|
|
26111
25926
|
config.pointsGroup = this._getNorthWestPoints(longEdge, shortEdge);
|
|
26112
25927
|
anchor = new RegularPolygon(oKey, config);
|
|
26113
|
-
} else if (cursor ===
|
|
25928
|
+
} else if (cursor === "se-resize") {
|
|
26114
25929
|
config.pointsGroup = this._getSouthEastPoints(longEdge, shortEdge);
|
|
26115
25930
|
anchor = new RegularPolygon(oKey, config);
|
|
26116
|
-
} else if (cursor ===
|
|
25931
|
+
} else if (cursor === "sw-resize") {
|
|
26117
25932
|
config.pointsGroup = this._getSouthWestPoints(longEdge, shortEdge);
|
|
26118
25933
|
anchor = new RegularPolygon(oKey, config);
|
|
26119
25934
|
}
|
|
26120
|
-
this._attachHover(anchor, cursor,
|
|
25935
|
+
this._attachHover(anchor, cursor, "default");
|
|
26121
25936
|
return anchor;
|
|
26122
25937
|
}
|
|
26123
25938
|
_getNorthEastPoints(longEdge, shortEdge) {
|
|
@@ -26244,17 +26059,17 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
26244
26059
|
]];
|
|
26245
26060
|
}
|
|
26246
26061
|
_checkTransformerType(oKey) {
|
|
26247
|
-
if (oKey.indexOf(
|
|
26248
|
-
if (oKey.indexOf(
|
|
26249
|
-
if (oKey.indexOf(
|
|
26250
|
-
if (oKey.indexOf(
|
|
26251
|
-
if (oKey.indexOf(
|
|
26252
|
-
if (oKey.indexOf(
|
|
26253
|
-
if (oKey.indexOf(
|
|
26254
|
-
if (oKey.indexOf(
|
|
26255
|
-
if (oKey.indexOf(
|
|
26256
|
-
if (oKey.indexOf(
|
|
26257
|
-
if (oKey.indexOf(
|
|
26062
|
+
if (oKey.indexOf("__SpreadsheetTransformerOutline__") > -1) return "__SpreadsheetTransformerOutline__";
|
|
26063
|
+
if (oKey.indexOf("__SpreadsheetTransformerRotate__") > -1) return "__SpreadsheetTransformerRotate__";
|
|
26064
|
+
if (oKey.indexOf("__SpreadsheetTransformerRotateLine__") > -1) return "__SpreadsheetTransformerRotateLine__";
|
|
26065
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeLT__") > -1) return "__SpreadsheetTransformerResizeLT__";
|
|
26066
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeCT__") > -1) return "__SpreadsheetTransformerResizeCT__";
|
|
26067
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeRT__") > -1) return "__SpreadsheetTransformerResizeRT__";
|
|
26068
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeLM__") > -1) return "__SpreadsheetTransformerResizeLM__";
|
|
26069
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeRM__") > -1) return "__SpreadsheetTransformerResizeRM__";
|
|
26070
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeLB__") > -1) return "__SpreadsheetTransformerResizeLB__";
|
|
26071
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeCB__") > -1) return "__SpreadsheetTransformerResizeCB__";
|
|
26072
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeRB__") > -1) return "__SpreadsheetTransformerResizeRB__";
|
|
26258
26073
|
}
|
|
26259
26074
|
_updateControlIterator(func) {
|
|
26260
26075
|
this._transformerControlMap.forEach((control, oKey) => {
|
|
@@ -26319,7 +26134,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
26319
26134
|
const layerIndex = applyObject.getLayerIndex() || DEFAULT_TRANSFORMER_LAYER_INDEX;
|
|
26320
26135
|
const groupElements = [];
|
|
26321
26136
|
if (borderEnabled && !isCropper) {
|
|
26322
|
-
const outline = new Rect(
|
|
26137
|
+
const outline = new Rect(`__SpreadsheetTransformerOutline___${zIndex}`, {
|
|
26323
26138
|
zIndex: zIndex - 1,
|
|
26324
26139
|
evented: false,
|
|
26325
26140
|
strokeWidth: borderStrokeWidth,
|
|
@@ -26329,9 +26144,9 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
26329
26144
|
groupElements.push(outline);
|
|
26330
26145
|
}
|
|
26331
26146
|
if (resizeEnabled && !isCropper) {
|
|
26332
|
-
const { left: lineLeft, top: lineTop } = this._getRotateAnchorPosition(
|
|
26147
|
+
const { left: lineLeft, top: lineTop } = this._getRotateAnchorPosition("__SpreadsheetTransformerRotateLine__", height, width, applyObject);
|
|
26333
26148
|
if (rotateEnabled) {
|
|
26334
|
-
const rotateLine = new Rect(
|
|
26149
|
+
const rotateLine = new Rect(`__SpreadsheetTransformerRotateLine___${zIndex}`, {
|
|
26335
26150
|
zIndex: zIndex - 1,
|
|
26336
26151
|
evented: false,
|
|
26337
26152
|
left: lineLeft,
|
|
@@ -26341,9 +26156,9 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
26341
26156
|
strokeWidth: borderStrokeWidth,
|
|
26342
26157
|
stroke: borderStroke
|
|
26343
26158
|
});
|
|
26344
|
-
const { left: rotateLeft, top: rotateTop } = this._getRotateAnchorPosition(
|
|
26345
|
-
const cursor = this._getRotateAnchorCursor(
|
|
26346
|
-
const rotate = new Rect(
|
|
26159
|
+
const { left: rotateLeft, top: rotateTop } = this._getRotateAnchorPosition("__SpreadsheetTransformerRotate__", height, width, applyObject);
|
|
26160
|
+
const cursor = this._getRotateAnchorCursor("__SpreadsheetTransformerRotate__");
|
|
26161
|
+
const rotate = new Rect(`__SpreadsheetTransformerRotate___${zIndex}`, {
|
|
26347
26162
|
zIndex: zIndex - 1,
|
|
26348
26163
|
left: rotateLeft,
|
|
26349
26164
|
top: rotateTop,
|
|
@@ -26354,7 +26169,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
26354
26169
|
stroke: borderStroke
|
|
26355
26170
|
});
|
|
26356
26171
|
this._attachEventToRotate(rotate, applyObject);
|
|
26357
|
-
this._attachHover(rotate, cursor,
|
|
26172
|
+
this._attachHover(rotate, cursor, "default");
|
|
26358
26173
|
groupElements.push(rotateLine, rotate);
|
|
26359
26174
|
}
|
|
26360
26175
|
}
|
|
@@ -26367,7 +26182,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
26367
26182
|
this._attachEventToAnchor(anchor, type, applyObject);
|
|
26368
26183
|
groupElements.push(anchor);
|
|
26369
26184
|
}
|
|
26370
|
-
const transformerControl = new Group(
|
|
26185
|
+
const transformerControl = new Group(`__SpreadsheetTransformer___${oKey}`, ...groupElements);
|
|
26371
26186
|
transformerControl.zIndex = zIndex;
|
|
26372
26187
|
transformerControl.evented = false;
|
|
26373
26188
|
transformerControl.openSelfSizeMode();
|
|
@@ -26395,7 +26210,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
26395
26210
|
this._changeStart$.next({
|
|
26396
26211
|
target: applyObject,
|
|
26397
26212
|
objects: this._selectedObjectMap,
|
|
26398
|
-
type:
|
|
26213
|
+
type: 0
|
|
26399
26214
|
});
|
|
26400
26215
|
}
|
|
26401
26216
|
_updateActiveObjectList(applyObject, evt) {
|
|
@@ -26445,8 +26260,8 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26445
26260
|
_defineProperty(this, "_evented", true);
|
|
26446
26261
|
_defineProperty(this, "_layers", []);
|
|
26447
26262
|
_defineProperty(this, "_viewports", []);
|
|
26448
|
-
_defineProperty(this, "_cursor",
|
|
26449
|
-
_defineProperty(this, "_defaultCursor",
|
|
26263
|
+
_defineProperty(this, "_cursor", "default");
|
|
26264
|
+
_defineProperty(this, "_defaultCursor", "default");
|
|
26450
26265
|
_defineProperty(this, "_addObject$", new rxjs.BehaviorSubject(this));
|
|
26451
26266
|
_defineProperty(this, "addObject$", this._addObject$.asObservable());
|
|
26452
26267
|
_defineProperty(this, "onTransformChange$", new _univerjs_core.EventSubject());
|
|
@@ -26492,18 +26307,18 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26492
26307
|
_defineProperty(this, "_capturedObject", null);
|
|
26493
26308
|
this._sceneKey = sceneKey;
|
|
26494
26309
|
if (state) this.transformByState(state);
|
|
26495
|
-
if (this._parent.classType ===
|
|
26310
|
+
if (this._parent.classType === "Engine") {
|
|
26496
26311
|
const parent = this._parent;
|
|
26497
26312
|
parent.addScene(this);
|
|
26498
26313
|
if (!parent.hasActiveScene()) parent.setActiveScene(sceneKey);
|
|
26499
26314
|
this._inputManager = new InputManager(this);
|
|
26500
|
-
} else if (this._parent.classType ===
|
|
26315
|
+
} else if (this._parent.classType === "SceneViewer") this._parent.addSubScene(this);
|
|
26501
26316
|
this.disposeWithMe((0, _univerjs_core.toDisposable)((_this$_parent = this._parent) === null || _this$_parent === void 0 ? void 0 : _this$_parent.onTransformChange$.subscribeEvent((_change) => {
|
|
26502
26317
|
this._transformHandler();
|
|
26503
26318
|
})));
|
|
26504
26319
|
}
|
|
26505
26320
|
get classType() {
|
|
26506
|
-
return
|
|
26321
|
+
return "Scene";
|
|
26507
26322
|
}
|
|
26508
26323
|
get transform() {
|
|
26509
26324
|
return this._transform;
|
|
@@ -26547,7 +26362,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26547
26362
|
get ancestorScaleX() {
|
|
26548
26363
|
const p = this.getParent();
|
|
26549
26364
|
let pScale = 1;
|
|
26550
|
-
if (p.classType ===
|
|
26365
|
+
if (p.classType === "SceneViewer") pScale = p.ancestorScaleX;
|
|
26551
26366
|
return this.scaleX * pScale;
|
|
26552
26367
|
}
|
|
26553
26368
|
/**
|
|
@@ -26556,7 +26371,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26556
26371
|
get ancestorScaleY() {
|
|
26557
26372
|
const p = this.getParent();
|
|
26558
26373
|
let pScale = 1;
|
|
26559
|
-
if (p.classType ===
|
|
26374
|
+
if (p.classType === "SceneViewer") pScale = p.ancestorScaleY;
|
|
26560
26375
|
return this.scaleY * pScale;
|
|
26561
26376
|
}
|
|
26562
26377
|
getAncestorScale() {
|
|
@@ -26568,13 +26383,13 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26568
26383
|
get ancestorLeft() {
|
|
26569
26384
|
const p = this.getParent();
|
|
26570
26385
|
let pOffsetX = 0;
|
|
26571
|
-
if (p.classType ===
|
|
26386
|
+
if (p.classType === "SceneViewer") pOffsetX = p.ancestorLeft;
|
|
26572
26387
|
return pOffsetX;
|
|
26573
26388
|
}
|
|
26574
26389
|
get ancestorTop() {
|
|
26575
26390
|
const p = this.getParent();
|
|
26576
26391
|
let pOffsetY = 0;
|
|
26577
|
-
if (p.classType ===
|
|
26392
|
+
if (p.classType === "SceneViewer") pOffsetY = p.ancestorTop;
|
|
26578
26393
|
return pOffsetY;
|
|
26579
26394
|
}
|
|
26580
26395
|
set cursor(val) {
|
|
@@ -26582,7 +26397,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26582
26397
|
}
|
|
26583
26398
|
attachControl(options) {
|
|
26584
26399
|
var _this$_inputManager;
|
|
26585
|
-
if (!(this._parent.classType ===
|
|
26400
|
+
if (!(this._parent.classType === "Engine")) return;
|
|
26586
26401
|
(_this$_inputManager = this._inputManager) === null || _this$_inputManager === void 0 || _this$_inputManager.attachControl(options);
|
|
26587
26402
|
return this;
|
|
26588
26403
|
}
|
|
@@ -26595,7 +26410,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26595
26410
|
this._layers.forEach((layer) => {
|
|
26596
26411
|
layer.makeDirty(state);
|
|
26597
26412
|
});
|
|
26598
|
-
if (this._parent.classType ===
|
|
26413
|
+
if (this._parent.classType === "SceneViewer") {
|
|
26599
26414
|
var _this$_parent2;
|
|
26600
26415
|
(_this$_parent2 = this._parent) === null || _this$_parent2 === void 0 || _this$_parent2.makeDirty(state);
|
|
26601
26416
|
}
|
|
@@ -26649,7 +26464,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26649
26464
|
if (height !== void 0) this.height = height;
|
|
26650
26465
|
this._transformHandler();
|
|
26651
26466
|
this.onTransformChange$.emitEvent({
|
|
26652
|
-
type:
|
|
26467
|
+
type: 1,
|
|
26653
26468
|
value: {
|
|
26654
26469
|
width: this.width,
|
|
26655
26470
|
height: this.height
|
|
@@ -26682,7 +26497,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26682
26497
|
this.setScaleValueOnly(scaleX || 1, scaleY || 1);
|
|
26683
26498
|
this._transformHandler();
|
|
26684
26499
|
this.onTransformChange$.emitEvent({
|
|
26685
|
-
type:
|
|
26500
|
+
type: 2,
|
|
26686
26501
|
value: {
|
|
26687
26502
|
scaleX: this.scaleX,
|
|
26688
26503
|
scaleY: this.scaleY
|
|
@@ -26706,7 +26521,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26706
26521
|
this.scaleY = precisionTo(this.scaleY, 1);
|
|
26707
26522
|
this._transformHandler();
|
|
26708
26523
|
this.onTransformChange$.emitEvent({
|
|
26709
|
-
type:
|
|
26524
|
+
type: 2,
|
|
26710
26525
|
value: {
|
|
26711
26526
|
scaleX: this.scaleX,
|
|
26712
26527
|
scaleY: this.scaleY
|
|
@@ -26734,7 +26549,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26734
26549
|
});
|
|
26735
26550
|
this._transformHandler();
|
|
26736
26551
|
this.onTransformChange$.emitEvent({
|
|
26737
|
-
type:
|
|
26552
|
+
type: 5,
|
|
26738
26553
|
value: state,
|
|
26739
26554
|
preValue: preKeys
|
|
26740
26555
|
});
|
|
@@ -26743,10 +26558,10 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26743
26558
|
return this._parent;
|
|
26744
26559
|
}
|
|
26745
26560
|
getEngine() {
|
|
26746
|
-
if (this._parent.classType ===
|
|
26561
|
+
if (this._parent.classType === "Engine") return this._parent;
|
|
26747
26562
|
let parent = this._parent;
|
|
26748
26563
|
while (parent) {
|
|
26749
|
-
if (parent.classType ===
|
|
26564
|
+
if (parent.classType === "Engine") return parent;
|
|
26750
26565
|
parent = parent === null || parent === void 0 ? void 0 : parent.getParent();
|
|
26751
26566
|
}
|
|
26752
26567
|
return null;
|
|
@@ -27033,18 +26848,18 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27033
26848
|
let parent = this.getParent();
|
|
27034
26849
|
const parentList = [];
|
|
27035
26850
|
while (parent) {
|
|
27036
|
-
if (parent.classType ===
|
|
26851
|
+
if (parent.classType === "Scene" || parent.classType === "SceneViewer") parentList.push(parent);
|
|
27037
26852
|
parent = (parent === null || parent === void 0 ? void 0 : parent.getParent) && (parent === null || parent === void 0 ? void 0 : parent.getParent());
|
|
27038
26853
|
}
|
|
27039
26854
|
parentList.reverse();
|
|
27040
|
-
for (const parent of parentList) if (parent.classType ===
|
|
26855
|
+
for (const parent of parentList) if (parent.classType === "Scene") {
|
|
27041
26856
|
const viewPort = parent.getActiveViewportByCoord(coord);
|
|
27042
26857
|
if (viewPort) {
|
|
27043
26858
|
const actualX = viewPort.viewportScrollX || 0;
|
|
27044
26859
|
const actualY = viewPort.viewportScrollY || 0;
|
|
27045
26860
|
coord = coord.addByPoint(actualX, actualY);
|
|
27046
26861
|
}
|
|
27047
|
-
} else if (parent.classType ===
|
|
26862
|
+
} else if (parent.classType === "SceneViewer") coord = parent.transform.clone().invert().applyPoint(coord);
|
|
27048
26863
|
return coord;
|
|
27049
26864
|
}
|
|
27050
26865
|
clearLayer() {
|
|
@@ -27122,16 +26937,16 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27122
26937
|
for (let i = 0; i < objectLength; i++) {
|
|
27123
26938
|
var _testObject$parent;
|
|
27124
26939
|
const testObject = objectOrder[i];
|
|
27125
|
-
if (!testObject.visible || !testObject.evented || testObject.isInGroup && ((_testObject$parent = testObject.parent) === null || _testObject$parent === void 0 ? void 0 : _testObject$parent.classType) ===
|
|
26940
|
+
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;
|
|
27126
26941
|
const svCoord = vecFromSheetContent;
|
|
27127
26942
|
if (testObject.isHit(svCoord)) {
|
|
27128
|
-
if (testObject.classType ===
|
|
26943
|
+
if (testObject.classType === "SceneViewer") {
|
|
27129
26944
|
const pickedObject = testObject.pick(svCoord);
|
|
27130
26945
|
if (pickedObject) isPickedObject = pickedObject;
|
|
27131
26946
|
else isPickedObject = testObject.getActiveSubScene();
|
|
27132
26947
|
} else isPickedObject = testObject;
|
|
27133
26948
|
break;
|
|
27134
|
-
} else if (testObject.classType ===
|
|
26949
|
+
} else if (testObject.classType === "SceneViewer" && testObject.allowSelectedClipElement()) {
|
|
27135
26950
|
const pickedObject = testObject.pick(svCoord);
|
|
27136
26951
|
if (pickedObject) {
|
|
27137
26952
|
isPickedObject = pickedObject;
|
|
@@ -27139,12 +26954,12 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27139
26954
|
}
|
|
27140
26955
|
}
|
|
27141
26956
|
}
|
|
27142
|
-
if (!isPickedObject && this._parent.classType ===
|
|
26957
|
+
if (!isPickedObject && this._parent.classType === "Engine") return this;
|
|
27143
26958
|
return isPickedObject;
|
|
27144
26959
|
}
|
|
27145
26960
|
triggerPointerUp(evt) {
|
|
27146
26961
|
var _this$onPointerUp$$em;
|
|
27147
|
-
if (!((_this$onPointerUp$$em = this.onPointerUp$.emitEvent(evt)) === null || _this$onPointerUp$$em === void 0 ? void 0 : _this$onPointerUp$$em.stopPropagation) && this._parent.classType ===
|
|
26962
|
+
if (!((_this$onPointerUp$$em = this.onPointerUp$.emitEvent(evt)) === null || _this$onPointerUp$$em === void 0 ? void 0 : _this$onPointerUp$$em.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27148
26963
|
var _this$_parent3;
|
|
27149
26964
|
(_this$_parent3 = this._parent) === null || _this$_parent3 === void 0 || _this$_parent3.triggerPointerUp(evt);
|
|
27150
26965
|
return false;
|
|
@@ -27153,7 +26968,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27153
26968
|
}
|
|
27154
26969
|
triggerMouseWheel(evt) {
|
|
27155
26970
|
var _this$onMouseWheel$$e;
|
|
27156
|
-
if (!((_this$onMouseWheel$$e = this.onMouseWheel$.emitEvent(evt)) === null || _this$onMouseWheel$$e === void 0 ? void 0 : _this$onMouseWheel$$e.stopPropagation) && this._parent.classType ===
|
|
26971
|
+
if (!((_this$onMouseWheel$$e = this.onMouseWheel$.emitEvent(evt)) === null || _this$onMouseWheel$$e === void 0 ? void 0 : _this$onMouseWheel$$e.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27157
26972
|
var _this$_parent4;
|
|
27158
26973
|
(_this$_parent4 = this._parent) === null || _this$_parent4 === void 0 || _this$_parent4.triggerMouseWheel(evt);
|
|
27159
26974
|
return false;
|
|
@@ -27162,7 +26977,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27162
26977
|
}
|
|
27163
26978
|
triggerSingleClick(evt) {
|
|
27164
26979
|
var _this$onSingleClick$$;
|
|
27165
|
-
if (!((_this$onSingleClick$$ = this.onSingleClick$.emitEvent(evt)) === null || _this$onSingleClick$$ === void 0 ? void 0 : _this$onSingleClick$$.stopPropagation) && this._parent.classType ===
|
|
26980
|
+
if (!((_this$onSingleClick$$ = this.onSingleClick$.emitEvent(evt)) === null || _this$onSingleClick$$ === void 0 ? void 0 : _this$onSingleClick$$.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27166
26981
|
var _this$_parent5;
|
|
27167
26982
|
(_this$_parent5 = this._parent) === null || _this$_parent5 === void 0 || _this$_parent5.triggerSingleClick(evt);
|
|
27168
26983
|
return false;
|
|
@@ -27171,7 +26986,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27171
26986
|
}
|
|
27172
26987
|
triggerClick(evt) {
|
|
27173
26988
|
var _this$onClick$$emitEv;
|
|
27174
|
-
if (!((_this$onClick$$emitEv = this.onClick$.emitEvent(evt)) === null || _this$onClick$$emitEv === void 0 ? void 0 : _this$onClick$$emitEv.stopPropagation) && this._parent.classType ===
|
|
26989
|
+
if (!((_this$onClick$$emitEv = this.onClick$.emitEvent(evt)) === null || _this$onClick$$emitEv === void 0 ? void 0 : _this$onClick$$emitEv.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27175
26990
|
var _this$_parent6;
|
|
27176
26991
|
(_this$_parent6 = this._parent) === null || _this$_parent6 === void 0 || _this$_parent6.triggerClick(evt);
|
|
27177
26992
|
return false;
|
|
@@ -27180,7 +26995,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27180
26995
|
}
|
|
27181
26996
|
triggerDblclick(evt) {
|
|
27182
26997
|
var _this$onDblclick$$emi;
|
|
27183
|
-
if (!((_this$onDblclick$$emi = this.onDblclick$.emitEvent(evt)) === null || _this$onDblclick$$emi === void 0 ? void 0 : _this$onDblclick$$emi.stopPropagation) && this._parent.classType ===
|
|
26998
|
+
if (!((_this$onDblclick$$emi = this.onDblclick$.emitEvent(evt)) === null || _this$onDblclick$$emi === void 0 ? void 0 : _this$onDblclick$$emi.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27184
26999
|
var _this$_parent7;
|
|
27185
27000
|
(_this$_parent7 = this._parent) === null || _this$_parent7 === void 0 || _this$_parent7.triggerDblclick(evt);
|
|
27186
27001
|
return false;
|
|
@@ -27189,7 +27004,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27189
27004
|
}
|
|
27190
27005
|
triggerTripleClick(evt) {
|
|
27191
27006
|
var _this$onTripleClick$$;
|
|
27192
|
-
if (!((_this$onTripleClick$$ = this.onTripleClick$.emitEvent(evt)) === null || _this$onTripleClick$$ === void 0 ? void 0 : _this$onTripleClick$$.stopPropagation) && this._parent.classType ===
|
|
27007
|
+
if (!((_this$onTripleClick$$ = this.onTripleClick$.emitEvent(evt)) === null || _this$onTripleClick$$ === void 0 ? void 0 : _this$onTripleClick$$.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27193
27008
|
var _this$_parent8;
|
|
27194
27009
|
(_this$_parent8 = this._parent) === null || _this$_parent8 === void 0 || _this$_parent8.triggerTripleClick(evt);
|
|
27195
27010
|
return false;
|
|
@@ -27198,7 +27013,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27198
27013
|
}
|
|
27199
27014
|
triggerPointerMove(evt) {
|
|
27200
27015
|
var _this$onPointerMove$$;
|
|
27201
|
-
if (!((_this$onPointerMove$$ = this.onPointerMove$.emitEvent(evt)) === null || _this$onPointerMove$$ === void 0 ? void 0 : _this$onPointerMove$$.stopPropagation) && this._parent.classType ===
|
|
27016
|
+
if (!((_this$onPointerMove$$ = this.onPointerMove$.emitEvent(evt)) === null || _this$onPointerMove$$ === void 0 ? void 0 : _this$onPointerMove$$.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27202
27017
|
var _this$_parent9;
|
|
27203
27018
|
(_this$_parent9 = this._parent) === null || _this$_parent9 === void 0 || _this$_parent9.triggerPointerMove(evt);
|
|
27204
27019
|
return false;
|
|
@@ -27207,7 +27022,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27207
27022
|
}
|
|
27208
27023
|
triggerPointerDown(evt) {
|
|
27209
27024
|
var _this$onPointerDown$$;
|
|
27210
|
-
if (!((_this$onPointerDown$$ = this.onPointerDown$.emitEvent(evt)) === null || _this$onPointerDown$$ === void 0 ? void 0 : _this$onPointerDown$$.stopPropagation) && this._parent.classType ===
|
|
27025
|
+
if (!((_this$onPointerDown$$ = this.onPointerDown$.emitEvent(evt)) === null || _this$onPointerDown$$ === void 0 ? void 0 : _this$onPointerDown$$.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27211
27026
|
var _this$_parent10;
|
|
27212
27027
|
(_this$_parent10 = this._parent) === null || _this$_parent10 === void 0 || _this$_parent10.triggerPointerDown(evt);
|
|
27213
27028
|
return false;
|
|
@@ -27215,7 +27030,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27215
27030
|
return true;
|
|
27216
27031
|
}
|
|
27217
27032
|
triggerPointerOut(evt) {
|
|
27218
|
-
if (this._parent.classType ===
|
|
27033
|
+
if (this._parent.classType === "SceneViewer") {
|
|
27219
27034
|
var _this$_parent11;
|
|
27220
27035
|
(_this$_parent11 = this._parent) === null || _this$_parent11 === void 0 || _this$_parent11.triggerPointerOut(evt);
|
|
27221
27036
|
return false;
|
|
@@ -27224,7 +27039,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27224
27039
|
}
|
|
27225
27040
|
triggerPointerLeave(evt) {
|
|
27226
27041
|
var _this$onPointerLeave$;
|
|
27227
|
-
if (!((_this$onPointerLeave$ = this.onPointerLeave$.emitEvent(evt)) === null || _this$onPointerLeave$ === void 0 ? void 0 : _this$onPointerLeave$.stopPropagation) && this._parent.classType ===
|
|
27042
|
+
if (!((_this$onPointerLeave$ = this.onPointerLeave$.emitEvent(evt)) === null || _this$onPointerLeave$ === void 0 ? void 0 : _this$onPointerLeave$.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27228
27043
|
var _this$_parent12;
|
|
27229
27044
|
(_this$_parent12 = this._parent) === null || _this$_parent12 === void 0 || _this$_parent12.triggerPointerLeave(evt);
|
|
27230
27045
|
return false;
|
|
@@ -27232,7 +27047,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27232
27047
|
return true;
|
|
27233
27048
|
}
|
|
27234
27049
|
triggerPointerOver(evt) {
|
|
27235
|
-
if (this._parent.classType ===
|
|
27050
|
+
if (this._parent.classType === "SceneViewer") {
|
|
27236
27051
|
var _this$_parent13;
|
|
27237
27052
|
(_this$_parent13 = this._parent) === null || _this$_parent13 === void 0 || _this$_parent13.triggerPointerOver(evt);
|
|
27238
27053
|
return false;
|
|
@@ -27240,7 +27055,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27240
27055
|
return true;
|
|
27241
27056
|
}
|
|
27242
27057
|
triggerPointerCancel(evt) {
|
|
27243
|
-
if (this._parent.classType ===
|
|
27058
|
+
if (this._parent.classType === "SceneViewer") {
|
|
27244
27059
|
var _this$_parent14;
|
|
27245
27060
|
(_this$_parent14 = this._parent) === null || _this$_parent14 === void 0 || _this$_parent14.triggerPointerCancel(evt);
|
|
27246
27061
|
return false;
|
|
@@ -27249,7 +27064,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27249
27064
|
}
|
|
27250
27065
|
triggerPointerEnter(evt) {
|
|
27251
27066
|
var _this$onPointerEnter$;
|
|
27252
|
-
if (!((_this$onPointerEnter$ = this.onPointerEnter$.emitEvent(evt)) === null || _this$onPointerEnter$ === void 0 ? void 0 : _this$onPointerEnter$.stopPropagation) && this._parent.classType ===
|
|
27067
|
+
if (!((_this$onPointerEnter$ = this.onPointerEnter$.emitEvent(evt)) === null || _this$onPointerEnter$ === void 0 ? void 0 : _this$onPointerEnter$.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27253
27068
|
var _this$_parent15;
|
|
27254
27069
|
(_this$_parent15 = this._parent) === null || _this$_parent15 === void 0 || _this$_parent15.triggerPointerEnter(evt);
|
|
27255
27070
|
return false;
|
|
@@ -27258,7 +27073,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27258
27073
|
}
|
|
27259
27074
|
triggerDragLeave(evt) {
|
|
27260
27075
|
var _this$onDragLeave$$em;
|
|
27261
|
-
if (!((_this$onDragLeave$$em = this.onDragLeave$.emitEvent(evt)) === null || _this$onDragLeave$$em === void 0 ? void 0 : _this$onDragLeave$$em.stopPropagation) && this._parent.classType ===
|
|
27076
|
+
if (!((_this$onDragLeave$$em = this.onDragLeave$.emitEvent(evt)) === null || _this$onDragLeave$$em === void 0 ? void 0 : _this$onDragLeave$$em.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27262
27077
|
var _this$_parent16;
|
|
27263
27078
|
(_this$_parent16 = this._parent) === null || _this$_parent16 === void 0 || _this$_parent16.triggerDragLeave(evt);
|
|
27264
27079
|
return false;
|
|
@@ -27267,7 +27082,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27267
27082
|
}
|
|
27268
27083
|
triggerDragOver(evt) {
|
|
27269
27084
|
var _this$onDragOver$$emi;
|
|
27270
|
-
if (!((_this$onDragOver$$emi = this.onDragOver$.emitEvent(evt)) === null || _this$onDragOver$$emi === void 0 ? void 0 : _this$onDragOver$$emi.stopPropagation) && this._parent.classType ===
|
|
27085
|
+
if (!((_this$onDragOver$$emi = this.onDragOver$.emitEvent(evt)) === null || _this$onDragOver$$emi === void 0 ? void 0 : _this$onDragOver$$emi.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27271
27086
|
var _this$_parent17;
|
|
27272
27087
|
(_this$_parent17 = this._parent) === null || _this$_parent17 === void 0 || _this$_parent17.triggerDragOver(evt);
|
|
27273
27088
|
return false;
|
|
@@ -27276,7 +27091,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27276
27091
|
}
|
|
27277
27092
|
triggerDragEnter(evt) {
|
|
27278
27093
|
var _this$onDragEnter$$em;
|
|
27279
|
-
if (!((_this$onDragEnter$$em = this.onDragEnter$.emitEvent(evt)) === null || _this$onDragEnter$$em === void 0 ? void 0 : _this$onDragEnter$$em.stopPropagation) && this._parent.classType ===
|
|
27094
|
+
if (!((_this$onDragEnter$$em = this.onDragEnter$.emitEvent(evt)) === null || _this$onDragEnter$$em === void 0 ? void 0 : _this$onDragEnter$$em.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27280
27095
|
var _this$_parent18;
|
|
27281
27096
|
(_this$_parent18 = this._parent) === null || _this$_parent18 === void 0 || _this$_parent18.triggerDragEnter(evt);
|
|
27282
27097
|
return false;
|
|
@@ -27285,7 +27100,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27285
27100
|
}
|
|
27286
27101
|
triggerDrop(evt) {
|
|
27287
27102
|
var _this$onDrop$$emitEve;
|
|
27288
|
-
if (!((_this$onDrop$$emitEve = this.onDrop$.emitEvent(evt)) === null || _this$onDrop$$emitEve === void 0 ? void 0 : _this$onDrop$$emitEve.stopPropagation) && this._parent.classType ===
|
|
27103
|
+
if (!((_this$onDrop$$emitEve = this.onDrop$.emitEvent(evt)) === null || _this$onDrop$$emitEve === void 0 ? void 0 : _this$onDrop$$emitEve.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27289
27104
|
var _this$_parent19;
|
|
27290
27105
|
(_this$_parent19 = this._parent) === null || _this$_parent19 === void 0 || _this$_parent19.triggerDrop(evt);
|
|
27291
27106
|
return false;
|
|
@@ -27298,10 +27113,11 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27298
27113
|
*
|
|
27299
27114
|
*/
|
|
27300
27115
|
_transformHandler() {
|
|
27301
|
-
|
|
27116
|
+
const composeResult = Transform.create().composeMatrix({
|
|
27302
27117
|
scaleX: this.scaleX,
|
|
27303
27118
|
scaleY: this.scaleY
|
|
27304
27119
|
});
|
|
27120
|
+
this.transform = composeResult;
|
|
27305
27121
|
this.getViewports().forEach((vp) => {
|
|
27306
27122
|
vp.resetCanvasSizeAndUpdateScroll();
|
|
27307
27123
|
});
|
|
@@ -28396,7 +28212,7 @@ var Viewport = class {
|
|
|
28396
28212
|
});
|
|
28397
28213
|
if (isLimitedStore && !isLimitedStore.isLimitedX && !isLimitedStore.isLimitedY) {
|
|
28398
28214
|
evt.preventDefault();
|
|
28399
|
-
if (this._scene.getParent().classType ===
|
|
28215
|
+
if (this._scene.getParent().classType === "SceneViewer") state.stopPropagation();
|
|
28400
28216
|
}
|
|
28401
28217
|
if (this._isWheelPreventDefaultX && this._isWheelPreventDefaultY) evt.preventDefault();
|
|
28402
28218
|
this._scene.makeDirty(true);
|
|
@@ -28754,8 +28570,8 @@ var Viewport = class {
|
|
|
28754
28570
|
_drawScrollbar(ctx) {
|
|
28755
28571
|
if (!this._scrollBar) return;
|
|
28756
28572
|
const parent = this._scene.getParent();
|
|
28757
|
-
if (parent.classType ===
|
|
28758
|
-
else if (parent.classType ===
|
|
28573
|
+
if (parent.classType === "SceneViewer") this._scrollBar.render(ctx);
|
|
28574
|
+
else if (parent.classType === "Engine") this._scrollBar.render(ctx);
|
|
28759
28575
|
}
|
|
28760
28576
|
setViewportSize(props) {
|
|
28761
28577
|
if (_univerjs_core.Tools.isDefine(props === null || props === void 0 ? void 0 : props.top)) this.top = props.top;
|