@univerjs/engine-render 0.21.1 → 0.22.0
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 +712 -902
- package/lib/es/index.js +712 -902
- package/lib/umd/index.js +2 -3
- package/package.json +14 -10
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,
|
|
@@ -18708,7 +18543,7 @@ var Font = class extends SheetExtension {
|
|
|
18708
18543
|
const paddingBottom = (_padding$b = padding.b) !== null && _padding$b !== void 0 ? _padding$b : DEFAULT_PADDING_DATA.b;
|
|
18709
18544
|
const { vertexAngle = 0, wrapStrategy, cellData } = fontCache;
|
|
18710
18545
|
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.
|
|
18546
|
+
const text = (0, _univerjs_core.getDisplayValueFromCell)(cellData);
|
|
18712
18547
|
const { startX, startY, endX, endY } = renderFontCtx;
|
|
18713
18548
|
const cellWidth = endX - startX - paddingLeft - paddingRight;
|
|
18714
18549
|
const cellHeight = endY - startY - paddingTop - paddingBottom;
|
|
@@ -19156,7 +18991,7 @@ var DocComponent = class extends RenderComponent {
|
|
|
19156
18991
|
this._skeleton = _skeleton;
|
|
19157
18992
|
_defineProperty(this, "pageMarginLeft", 0);
|
|
19158
18993
|
_defineProperty(this, "pageMarginTop", 0);
|
|
19159
|
-
_defineProperty(this, "pageLayoutType",
|
|
18994
|
+
_defineProperty(this, "pageLayoutType", 0);
|
|
19160
18995
|
this._setConfig(config);
|
|
19161
18996
|
}
|
|
19162
18997
|
getSkeleton() {
|
|
@@ -19171,7 +19006,7 @@ var DocComponent = class extends RenderComponent {
|
|
|
19171
19006
|
if ((config === null || config === void 0 ? void 0 : config.pageMarginTop) != null) this.pageMarginTop = config === null || config === void 0 ? void 0 : config.pageMarginTop;
|
|
19172
19007
|
else this.pageMarginTop = 14;
|
|
19173
19008
|
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 =
|
|
19009
|
+
else this.pageLayoutType = 0;
|
|
19175
19010
|
}
|
|
19176
19011
|
render(mainCtx, bounds) {
|
|
19177
19012
|
if (!this.visible) {
|
|
@@ -19191,7 +19026,7 @@ var DocComponent = class extends RenderComponent {
|
|
|
19191
19026
|
scaleY: 1
|
|
19192
19027
|
};
|
|
19193
19028
|
let { scaleX = 1, scaleY = 1 } = this.parent;
|
|
19194
|
-
if (this.parent.classType ===
|
|
19029
|
+
if (this.parent.classType === "Scene") {
|
|
19195
19030
|
scaleX = this.parent.ancestorScaleX || 1;
|
|
19196
19031
|
scaleY = this.parent.ancestorScaleY || 1;
|
|
19197
19032
|
}
|
|
@@ -19215,15 +19050,10 @@ var DocComponent = class extends RenderComponent {
|
|
|
19215
19050
|
|
|
19216
19051
|
//#endregion
|
|
19217
19052
|
//#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
19053
|
var docExtension = class extends ComponentExtension {
|
|
19224
19054
|
constructor(..._args) {
|
|
19225
19055
|
super(..._args);
|
|
19226
|
-
_defineProperty(this, "type",
|
|
19056
|
+
_defineProperty(this, "type", 0);
|
|
19227
19057
|
_defineProperty(this, "translateX", 0);
|
|
19228
19058
|
_defineProperty(this, "translateY", 0);
|
|
19229
19059
|
}
|
|
@@ -19318,10 +19148,10 @@ var Border$1 = class extends docExtension {
|
|
|
19318
19148
|
_createBorderCache(borderData) {
|
|
19319
19149
|
const { t, b, l, r } = borderData;
|
|
19320
19150
|
const borderCache = /* @__PURE__ */ new Map();
|
|
19321
|
-
t && borderCache.set(
|
|
19322
|
-
b && borderCache.set(
|
|
19323
|
-
l && borderCache.set(
|
|
19324
|
-
r && borderCache.set(
|
|
19151
|
+
t && borderCache.set("t", t);
|
|
19152
|
+
b && borderCache.set("b", b);
|
|
19153
|
+
l && borderCache.set("l", l);
|
|
19154
|
+
r && borderCache.set("r", r);
|
|
19325
19155
|
return borderCache;
|
|
19326
19156
|
}
|
|
19327
19157
|
};
|
|
@@ -19373,12 +19203,12 @@ var Circle = class Circle extends Shape {
|
|
|
19373
19203
|
constructor(key, props) {
|
|
19374
19204
|
super(key, props);
|
|
19375
19205
|
_defineProperty(this, "_radius", void 0);
|
|
19376
|
-
_defineProperty(this, "objectType",
|
|
19206
|
+
_defineProperty(this, "objectType", 5);
|
|
19377
19207
|
this._radius = (props === null || props === void 0 ? void 0 : props.radius) || 10;
|
|
19378
19208
|
this._setFixBoundingBox();
|
|
19379
19209
|
this.onTransformChange$.subscribeEvent((changeState) => {
|
|
19380
19210
|
const { type, value, preValue } = changeState;
|
|
19381
|
-
if (type ===
|
|
19211
|
+
if (type === 1 || type === 5) {
|
|
19382
19212
|
const value = Math.min(this.width, this.height);
|
|
19383
19213
|
this._radius = value / 2;
|
|
19384
19214
|
this.width = value;
|
|
@@ -19447,7 +19277,7 @@ const RECT_OBJECT_ARRAY = ["radius"];
|
|
|
19447
19277
|
var Rect = class Rect extends Shape {
|
|
19448
19278
|
constructor(key, props) {
|
|
19449
19279
|
super(key, props);
|
|
19450
|
-
_defineProperty(this, "objectType",
|
|
19280
|
+
_defineProperty(this, "objectType", 4);
|
|
19451
19281
|
_defineProperty(this, "_radius", 0);
|
|
19452
19282
|
_defineProperty(this, "_opacity", 1);
|
|
19453
19283
|
_defineProperty(this, "_visualHeight", void 0);
|
|
@@ -19635,7 +19465,7 @@ var Image$1 = class extends Shape {
|
|
|
19635
19465
|
_defineProperty(this, "_renderByCropper", false);
|
|
19636
19466
|
_defineProperty(this, "_transformCalculateSrcRect", true);
|
|
19637
19467
|
_defineProperty(this, "_clipService", null);
|
|
19638
|
-
_defineProperty(this, "objectType",
|
|
19468
|
+
_defineProperty(this, "objectType", 3);
|
|
19639
19469
|
_defineProperty(this, "isDrawingObject", true);
|
|
19640
19470
|
this._props = { ...config };
|
|
19641
19471
|
if (config.image) {
|
|
@@ -19683,7 +19513,7 @@ var Image$1 = class extends Shape {
|
|
|
19683
19513
|
return this._clipService;
|
|
19684
19514
|
}
|
|
19685
19515
|
get classType() {
|
|
19686
|
-
return
|
|
19516
|
+
return "Image";
|
|
19687
19517
|
}
|
|
19688
19518
|
transformByStateCloseCropper(option) {
|
|
19689
19519
|
this._transformCalculateSrcRect = false;
|
|
@@ -19901,7 +19731,7 @@ var Image$1 = class extends Shape {
|
|
|
19901
19731
|
centerY
|
|
19902
19732
|
]);
|
|
19903
19733
|
const parent = this.getParent();
|
|
19904
|
-
const oCoord = (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) ===
|
|
19734
|
+
const oCoord = (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) === "Group" ? parent.ancestorTransform.multiply(renderTransform) : renderTransform).invert().applyPoint(coord);
|
|
19905
19735
|
const halfWidth = realWidth / 2;
|
|
19906
19736
|
const halfHeight = realHeight / 2;
|
|
19907
19737
|
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 +19760,7 @@ var Path = class Path extends Shape {
|
|
|
19930
19760
|
this._setFixBoundingBox();
|
|
19931
19761
|
this.onTransformChange$.subscribeEvent((changeState) => {
|
|
19932
19762
|
const { type, preValue } = changeState;
|
|
19933
|
-
if (type ===
|
|
19763
|
+
if (type === 1 || type === 5) {
|
|
19934
19764
|
this._reCalculateCache = true;
|
|
19935
19765
|
const { left, top, width, height } = this._getSelfRect();
|
|
19936
19766
|
const { width: preWidth, height: preHeight } = preValue;
|
|
@@ -20598,7 +20428,7 @@ var RegularPolygon = class RegularPolygon extends Shape {
|
|
|
20598
20428
|
this._setFixBoundingBox();
|
|
20599
20429
|
this.onTransformChange$.subscribeEvent((changeState) => {
|
|
20600
20430
|
const { type, value, preValue } = changeState;
|
|
20601
|
-
if (type ===
|
|
20431
|
+
if (type === 1 || type === 5) this.resizePolygon(preValue);
|
|
20602
20432
|
});
|
|
20603
20433
|
}
|
|
20604
20434
|
get pointsGroup() {
|
|
@@ -20765,7 +20595,7 @@ var RichText = class extends BaseObject {
|
|
|
20765
20595
|
_defineProperty(this, "_bg", void 0);
|
|
20766
20596
|
_defineProperty(this, "_bd", void 0);
|
|
20767
20597
|
_defineProperty(this, "_cl", void 0);
|
|
20768
|
-
_defineProperty(this, "objectType",
|
|
20598
|
+
_defineProperty(this, "objectType", 1);
|
|
20769
20599
|
if (props === null || props === void 0 ? void 0 : props.richText) this._documentData = props.richText;
|
|
20770
20600
|
else if (props) {
|
|
20771
20601
|
this._fs = props.fs;
|
|
@@ -20790,7 +20620,7 @@ var RichText = class extends BaseObject {
|
|
|
20790
20620
|
this._initialProps(props);
|
|
20791
20621
|
this.onTransformChange$.subscribeEvent((changeState) => {
|
|
20792
20622
|
const { type } = changeState;
|
|
20793
|
-
if (type ===
|
|
20623
|
+
if (type === 1 || type === 5) {
|
|
20794
20624
|
docModel.updateDocumentDataPageSize(this.width);
|
|
20795
20625
|
this._documentSkeleton.makeDirty(true);
|
|
20796
20626
|
this._documentSkeleton.calculate();
|
|
@@ -21483,7 +21313,7 @@ var FontAndBaseLine = class extends docExtension {
|
|
|
21483
21313
|
ctx.restore();
|
|
21484
21314
|
} else {
|
|
21485
21315
|
const CHECKED_GLYPH = "☑";
|
|
21486
|
-
if ((content === "☐" || content === CHECKED_GLYPH) && glyph.glyphType ===
|
|
21316
|
+
if ((content === "☐" || content === CHECKED_GLYPH) && glyph.glyphType === 2) {
|
|
21487
21317
|
var _glyph$ts$fs, _glyph$ts;
|
|
21488
21318
|
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
21319
|
ctx.save();
|
|
@@ -21742,7 +21572,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
21742
21572
|
const extensions = this.getExtensionsByOrder();
|
|
21743
21573
|
for (const extension of extensions) extension.clearCache();
|
|
21744
21574
|
const backgroundExtension = extensions.find((e) => e.uKey === "DefaultDocsBackgroundExtension");
|
|
21745
|
-
const glyphExtensionsExcludeBackground = extensions.filter((e) => e.type ===
|
|
21575
|
+
const glyphExtensionsExcludeBackground = extensions.filter((e) => e.type === 0 && e.uKey !== "DefaultDocsBackgroundExtension");
|
|
21746
21576
|
let pageTop = 0;
|
|
21747
21577
|
let pageLeft = 0;
|
|
21748
21578
|
for (let i = 0, len = pages.length; i < len; i++) {
|
|
@@ -21800,8 +21630,8 @@ var Documents = class Documents extends DocComponent {
|
|
|
21800
21630
|
const maxLineAsc = asc;
|
|
21801
21631
|
const maxLineAscSin = maxLineAsc * Math.sin(centerAngle);
|
|
21802
21632
|
const maxLineAscCos = maxLineAsc * Math.cos(centerAngle);
|
|
21803
|
-
if (type ===
|
|
21804
|
-
for (const extension of extensions) if (extension.type ===
|
|
21633
|
+
if (type === 1) {
|
|
21634
|
+
for (const extension of extensions) if (extension.type === 1) {
|
|
21805
21635
|
extension.extensionOffset = {
|
|
21806
21636
|
alignOffset,
|
|
21807
21637
|
renderConfig
|
|
@@ -21911,7 +21741,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
21911
21741
|
ctx.save();
|
|
21912
21742
|
ctx.setLineWidthByPrecision(1);
|
|
21913
21743
|
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,
|
|
21744
|
+
drawLineByBorderType(ctx, "b", 0, {
|
|
21915
21745
|
startX: x,
|
|
21916
21746
|
startY: y,
|
|
21917
21747
|
endX: x + pageWidth - marginLeft - marginRight,
|
|
@@ -21947,8 +21777,8 @@ var Documents = class Documents extends DocComponent {
|
|
|
21947
21777
|
const maxLineAsc = asc;
|
|
21948
21778
|
const maxLineAscSin = maxLineAsc * Math.sin(centerAngle);
|
|
21949
21779
|
const maxLineAscCos = maxLineAsc * Math.cos(centerAngle);
|
|
21950
|
-
if (type ===
|
|
21951
|
-
for (const extension of extensions) if (extension.type ===
|
|
21780
|
+
if (type === 1) {
|
|
21781
|
+
for (const extension of extensions) if (extension.type === 1) {
|
|
21952
21782
|
extension.extensionOffset = {
|
|
21953
21783
|
alignOffset,
|
|
21954
21784
|
renderConfig
|
|
@@ -22028,7 +21858,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
22028
21858
|
ctx.setLineWidthByPrecision(1);
|
|
22029
21859
|
ctx.save();
|
|
22030
21860
|
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,
|
|
21861
|
+
drawLineByBorderType(ctx, "l", 0, {
|
|
22032
21862
|
startX: x,
|
|
22033
21863
|
startY: y,
|
|
22034
21864
|
endX: x + pageWidth,
|
|
@@ -22037,7 +21867,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
22037
21867
|
ctx.restore();
|
|
22038
21868
|
ctx.save();
|
|
22039
21869
|
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,
|
|
21870
|
+
drawLineByBorderType(ctx, "t", 0, {
|
|
22041
21871
|
startX: x,
|
|
22042
21872
|
startY: y,
|
|
22043
21873
|
endX: x + pageWidth,
|
|
@@ -22046,7 +21876,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
22046
21876
|
ctx.restore();
|
|
22047
21877
|
ctx.save();
|
|
22048
21878
|
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,
|
|
21879
|
+
drawLineByBorderType(ctx, "r", 0, {
|
|
22050
21880
|
startX: x,
|
|
22051
21881
|
startY: y,
|
|
22052
21882
|
endX: x + pageWidth,
|
|
@@ -22055,7 +21885,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
22055
21885
|
ctx.restore();
|
|
22056
21886
|
ctx.save();
|
|
22057
21887
|
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,
|
|
21888
|
+
drawLineByBorderType(ctx, "b", 0, {
|
|
22059
21889
|
startX: x,
|
|
22060
21890
|
startY: y,
|
|
22061
21891
|
endX: x + pageWidth,
|
|
@@ -22084,8 +21914,8 @@ var Documents = class Documents extends DocComponent {
|
|
|
22084
21914
|
const maxLineAsc = asc;
|
|
22085
21915
|
const maxLineAscSin = maxLineAsc * Math.sin(centerAngle);
|
|
22086
21916
|
const maxLineAscCos = maxLineAsc * Math.cos(centerAngle);
|
|
22087
|
-
if (type ===
|
|
22088
|
-
for (const extension of extensions) if (extension.type ===
|
|
21917
|
+
if (type === 1) {
|
|
21918
|
+
for (const extension of extensions) if (extension.type === 1) {
|
|
22089
21919
|
extension.extensionOffset = {
|
|
22090
21920
|
alignOffset,
|
|
22091
21921
|
renderConfig
|
|
@@ -22508,14 +22338,14 @@ var Spreadsheet = class extends SheetComponent {
|
|
|
22508
22338
|
_getAncestorSize() {
|
|
22509
22339
|
const parent = this._getAncestorParent();
|
|
22510
22340
|
if (!parent) return;
|
|
22511
|
-
if (parent.classType ===
|
|
22341
|
+
if (parent.classType === "Engine") {
|
|
22512
22342
|
const mainCanvas = parent.getCanvas();
|
|
22513
22343
|
return {
|
|
22514
22344
|
width: mainCanvas.getWidth(),
|
|
22515
22345
|
height: mainCanvas.getHeight()
|
|
22516
22346
|
};
|
|
22517
22347
|
}
|
|
22518
|
-
if (parent.classType ===
|
|
22348
|
+
if (parent.classType === "SceneViewer") return {
|
|
22519
22349
|
width: parent.width,
|
|
22520
22350
|
height: parent.height
|
|
22521
22351
|
};
|
|
@@ -22523,7 +22353,7 @@ var Spreadsheet = class extends SheetComponent {
|
|
|
22523
22353
|
_getAncestorParent() {
|
|
22524
22354
|
let parent = this.parent;
|
|
22525
22355
|
while (parent) {
|
|
22526
|
-
if (parent.classType ===
|
|
22356
|
+
if (parent.classType === "Engine" || parent.classType === "SceneViewer") return parent;
|
|
22527
22357
|
parent = (parent === null || parent === void 0 ? void 0 : parent.getParent) && (parent === null || parent === void 0 ? void 0 : parent.getParent());
|
|
22528
22358
|
}
|
|
22529
22359
|
}
|
|
@@ -22780,9 +22610,9 @@ let IWatermarkTypeEnum = /* @__PURE__ */ function(IWatermarkTypeEnum) {
|
|
|
22780
22610
|
function renderWatermark(ctx, config, image, userInfo) {
|
|
22781
22611
|
const type = config.type;
|
|
22782
22612
|
const watermarkConfig = config.config;
|
|
22783
|
-
if (type ===
|
|
22784
|
-
else if (type ===
|
|
22785
|
-
else if (type ===
|
|
22613
|
+
if (type === "userInfo" && watermarkConfig.userInfo) renderUserInfoWatermark(ctx, watermarkConfig.userInfo, userInfo);
|
|
22614
|
+
else if (type === "image" && watermarkConfig.image) renderImageWatermark(ctx, watermarkConfig.image, image);
|
|
22615
|
+
else if (type === "text" && watermarkConfig.text) renderTextWatermark(ctx, watermarkConfig.text);
|
|
22786
22616
|
}
|
|
22787
22617
|
function renderUserInfoWatermark(ctx, config, userInfo) {
|
|
22788
22618
|
const { x, y, repeat, spacingX, spacingY, rotate, opacity, name, fontSize, color, bold, italic, direction } = config;
|
|
@@ -22938,7 +22768,7 @@ var Layer = class extends _univerjs_core.Disposable {
|
|
|
22938
22768
|
* @returns {Layer} this
|
|
22939
22769
|
*/
|
|
22940
22770
|
addObject(o) {
|
|
22941
|
-
if (o.classType ===
|
|
22771
|
+
if (o.classType === "Group") {
|
|
22942
22772
|
const objects = o.getObjects();
|
|
22943
22773
|
for (const object of objects) {
|
|
22944
22774
|
if (this.scene.getObject(object.oKey)) continue;
|
|
@@ -23000,7 +22830,7 @@ var Layer = class extends _univerjs_core.Disposable {
|
|
|
23000
22830
|
* parent is SceneViewer, make it dirty
|
|
23001
22831
|
*/
|
|
23002
22832
|
const parent = this.scene.getParent();
|
|
23003
|
-
if (parent.classType ===
|
|
22833
|
+
if (parent.classType === "SceneViewer") parent.makeDirty(true);
|
|
23004
22834
|
return this;
|
|
23005
22835
|
}
|
|
23006
22836
|
makeDirtyWithDebounce(state = true) {
|
|
@@ -23107,7 +22937,7 @@ var WatermarkLayer = class extends Layer {
|
|
|
23107
22937
|
updateConfig(config, user) {
|
|
23108
22938
|
var _this$_config;
|
|
23109
22939
|
this._config = config;
|
|
23110
|
-
if (((_this$_config = this._config) === null || _this$_config === void 0 ? void 0 : _this$_config.type) ===
|
|
22940
|
+
if (((_this$_config = this._config) === null || _this$_config === void 0 ? void 0 : _this$_config.type) === "image" && this._config.config.image) {
|
|
23111
22941
|
this._image = new Image();
|
|
23112
22942
|
this._image.src = this._config.config.image.url;
|
|
23113
22943
|
}
|
|
@@ -23145,7 +22975,7 @@ var SceneViewer = class extends BaseObject {
|
|
|
23145
22975
|
this._initialProps(props);
|
|
23146
22976
|
}
|
|
23147
22977
|
get classType() {
|
|
23148
|
-
return
|
|
22978
|
+
return "SceneViewer";
|
|
23149
22979
|
}
|
|
23150
22980
|
render(mainCtx, bounds) {
|
|
23151
22981
|
var _this$_activeSubScene;
|
|
@@ -23272,7 +23102,7 @@ var Slide = class extends SceneViewer {
|
|
|
23272
23102
|
addNavigation() {
|
|
23273
23103
|
const scene = this.getActiveSubScene();
|
|
23274
23104
|
if (scene == null || this._navigationEnabled === false) return;
|
|
23275
|
-
const leftArrow = new Path(
|
|
23105
|
+
const leftArrow = new Path("__slideNavigationLeft__", {
|
|
23276
23106
|
data: arrowPath,
|
|
23277
23107
|
width: 60,
|
|
23278
23108
|
height: 60,
|
|
@@ -23281,7 +23111,7 @@ var Slide = class extends SceneViewer {
|
|
|
23281
23111
|
fill: this._getArrowColor(),
|
|
23282
23112
|
flipX: true
|
|
23283
23113
|
});
|
|
23284
|
-
const rightArrow = new Path(
|
|
23114
|
+
const rightArrow = new Path("__slideNavigationRight__", {
|
|
23285
23115
|
data: arrowPath,
|
|
23286
23116
|
width: 60,
|
|
23287
23117
|
height: 60,
|
|
@@ -23290,11 +23120,11 @@ var Slide = class extends SceneViewer {
|
|
|
23290
23120
|
fill: this._getArrowColor()
|
|
23291
23121
|
});
|
|
23292
23122
|
const hoverIn = (o, evt) => {
|
|
23293
|
-
o.setCursor(
|
|
23123
|
+
o.setCursor("pointer");
|
|
23294
23124
|
o.setProps({ fill: this._getArrowColor(true) });
|
|
23295
23125
|
};
|
|
23296
23126
|
const hoverOut = (o, evt) => {
|
|
23297
|
-
o.setCursor(
|
|
23127
|
+
o.setCursor("default");
|
|
23298
23128
|
o.setProps({ fill: this._getArrowColor() });
|
|
23299
23129
|
};
|
|
23300
23130
|
attachObjectHover(leftArrow, hoverIn, hoverOut);
|
|
@@ -23306,8 +23136,8 @@ var Slide = class extends SceneViewer {
|
|
|
23306
23136
|
var _scene$getObject, _scene$getObject2;
|
|
23307
23137
|
const scene = this.getActiveSubScene();
|
|
23308
23138
|
if (scene == null || this._navigationEnabled === false) return;
|
|
23309
|
-
(_scene$getObject = scene.getObject(
|
|
23310
|
-
(_scene$getObject2 = scene.getObject(
|
|
23139
|
+
(_scene$getObject = scene.getObject("__slideNavigationLeft__")) === null || _scene$getObject === void 0 || _scene$getObject.dispose();
|
|
23140
|
+
(_scene$getObject2 = scene.getObject("__slideNavigationRight__")) === null || _scene$getObject2 === void 0 || _scene$getObject2.dispose();
|
|
23311
23141
|
}
|
|
23312
23142
|
enableNav() {
|
|
23313
23143
|
this._navigationEnabled = true;
|
|
@@ -23319,15 +23149,15 @@ var Slide = class extends SceneViewer {
|
|
|
23319
23149
|
var _scene$getObject3, _scene$getObject4;
|
|
23320
23150
|
const scene = this.getActiveSubScene();
|
|
23321
23151
|
if (scene == null || this._navigationEnabled === false) return;
|
|
23322
|
-
(_scene$getObject3 = scene.getObject(
|
|
23323
|
-
(_scene$getObject4 = scene.getObject(
|
|
23152
|
+
(_scene$getObject3 = scene.getObject("__slideNavigationLeft__")) === null || _scene$getObject3 === void 0 || _scene$getObject3.hide();
|
|
23153
|
+
(_scene$getObject4 = scene.getObject("__slideNavigationRight__")) === null || _scene$getObject4 === void 0 || _scene$getObject4.hide();
|
|
23324
23154
|
}
|
|
23325
23155
|
showNav() {
|
|
23326
23156
|
var _scene$getObject5, _scene$getObject6;
|
|
23327
23157
|
const scene = this.getActiveSubScene();
|
|
23328
23158
|
if (scene == null || this._navigationEnabled === false) return;
|
|
23329
|
-
(_scene$getObject5 = scene.getObject(
|
|
23330
|
-
(_scene$getObject6 = scene.getObject(
|
|
23159
|
+
(_scene$getObject5 = scene.getObject("__slideNavigationLeft__")) === null || _scene$getObject5 === void 0 || _scene$getObject5.show();
|
|
23160
|
+
(_scene$getObject6 = scene.getObject("__slideNavigationRight__")) === null || _scene$getObject6 === void 0 || _scene$getObject6.show();
|
|
23331
23161
|
}
|
|
23332
23162
|
renderToThumb(mainCtx, pageId, scaleX = 1, scaleY = 1) {
|
|
23333
23163
|
const scene = this.getSubScene(pageId);
|
|
@@ -23541,7 +23371,7 @@ var Group = class extends BaseObject {
|
|
|
23541
23371
|
this.addObjects(...objects);
|
|
23542
23372
|
}
|
|
23543
23373
|
get classType() {
|
|
23544
|
-
return
|
|
23374
|
+
return "Group";
|
|
23545
23375
|
}
|
|
23546
23376
|
set cursor(val) {
|
|
23547
23377
|
this.setCursor(val);
|
|
@@ -23661,7 +23491,7 @@ var Group = class extends BaseObject {
|
|
|
23661
23491
|
}
|
|
23662
23492
|
_transformObject(object, groupWidth, groupHeight) {
|
|
23663
23493
|
const transform = transformObjectOutOfGroup(object.getState(), this.getState(), groupWidth, groupHeight);
|
|
23664
|
-
if (object.classType ===
|
|
23494
|
+
if (object.classType === "Group") object.transformByState({
|
|
23665
23495
|
left: transform.left,
|
|
23666
23496
|
top: transform.top
|
|
23667
23497
|
});
|
|
@@ -23745,7 +23575,7 @@ var DrawingGroupObject = class extends Group {
|
|
|
23745
23575
|
centerY
|
|
23746
23576
|
]);
|
|
23747
23577
|
const parent = this.getParent();
|
|
23748
|
-
if (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) ===
|
|
23578
|
+
if (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) === "Group") return parent.ancestorTransform.multiply(renderTransform);
|
|
23749
23579
|
return renderTransform;
|
|
23750
23580
|
}
|
|
23751
23581
|
render(ctx, bounds) {
|
|
@@ -23776,7 +23606,7 @@ var DrawingGroupObject = class extends Group {
|
|
|
23776
23606
|
centerY
|
|
23777
23607
|
]);
|
|
23778
23608
|
const parent = this.getParent();
|
|
23779
|
-
const oCoord = (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) ===
|
|
23609
|
+
const oCoord = (this.isInGroup && (parent === null || parent === void 0 ? void 0 : parent.classType) === "Group" ? parent.ancestorTransform.multiply(renderTransform) : renderTransform).invert().applyPoint(coord);
|
|
23780
23610
|
const halfWidth = realWidth / 2;
|
|
23781
23611
|
const halfHeight = realHeight / 2;
|
|
23782
23612
|
if (oCoord.x < -halfWidth || oCoord.x > halfWidth || oCoord.y < -halfHeight || oCoord.y > halfHeight) return false;
|
|
@@ -24020,7 +23850,7 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24020
23850
|
return this.getCanvas().getHeight();
|
|
24021
23851
|
}
|
|
24022
23852
|
get classType() {
|
|
24023
|
-
return
|
|
23853
|
+
return "Engine";
|
|
24024
23854
|
}
|
|
24025
23855
|
get activeScene() {
|
|
24026
23856
|
return this._activeScene;
|
|
@@ -24090,7 +23920,7 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24090
23920
|
const options = Object.assign({}, {
|
|
24091
23921
|
elementHeight: 1,
|
|
24092
23922
|
elementWidth: 1,
|
|
24093
|
-
renderMode:
|
|
23923
|
+
renderMode: 0,
|
|
24094
23924
|
dpr: 1
|
|
24095
23925
|
}, _options);
|
|
24096
23926
|
this._canvas = new Canvas({
|
|
@@ -24104,7 +23934,7 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24104
23934
|
this._handleKeyboardAction();
|
|
24105
23935
|
this._handlePointerAction();
|
|
24106
23936
|
this._handleDragAction();
|
|
24107
|
-
if (options.renderMode !==
|
|
23937
|
+
if (options.renderMode !== 1) this._matchMediaHandler();
|
|
24108
23938
|
}
|
|
24109
23939
|
getScenes() {
|
|
24110
23940
|
return this._scenes;
|
|
@@ -24237,7 +24067,7 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24237
24067
|
const preHeight = this.height;
|
|
24238
24068
|
this.getCanvas().setSize(width, height);
|
|
24239
24069
|
this.onTransformChange$.emitEvent({
|
|
24240
|
-
type:
|
|
24070
|
+
type: 1,
|
|
24241
24071
|
value: {
|
|
24242
24072
|
width,
|
|
24243
24073
|
height
|
|
@@ -24383,13 +24213,13 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24383
24213
|
_handleKeyboardAction() {
|
|
24384
24214
|
const keyboardDownEvent = (evt) => {
|
|
24385
24215
|
const deviceEvent = evt;
|
|
24386
|
-
deviceEvent.deviceType =
|
|
24216
|
+
deviceEvent.deviceType = 1;
|
|
24387
24217
|
deviceEvent.inputIndex = evt.keyCode;
|
|
24388
24218
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24389
24219
|
};
|
|
24390
24220
|
const keyboardUpEvent = (evt) => {
|
|
24391
24221
|
const deviceEvent = evt;
|
|
24392
|
-
deviceEvent.deviceType =
|
|
24222
|
+
deviceEvent.deviceType = 1;
|
|
24393
24223
|
deviceEvent.inputIndex = evt.keyCode;
|
|
24394
24224
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24395
24225
|
};
|
|
@@ -24414,13 +24244,13 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24414
24244
|
this._pointerMoveEvent = (e) => {
|
|
24415
24245
|
const evt = e;
|
|
24416
24246
|
const deviceType = this._getPointerType(evt);
|
|
24417
|
-
this._pointerPosRecord[
|
|
24418
|
-
this._pointerPosRecord[
|
|
24419
|
-
this._pointerPosRecord[
|
|
24420
|
-
this._pointerPosRecord[
|
|
24247
|
+
this._pointerPosRecord[0] = evt.clientX;
|
|
24248
|
+
this._pointerPosRecord[1] = evt.clientY;
|
|
24249
|
+
this._pointerPosRecord[10] = evt.movementX;
|
|
24250
|
+
this._pointerPosRecord[11] = evt.movementY;
|
|
24421
24251
|
const deviceEvent = evt;
|
|
24422
24252
|
deviceEvent.deviceType = deviceType;
|
|
24423
|
-
deviceEvent.inputIndex =
|
|
24253
|
+
deviceEvent.inputIndex = 0;
|
|
24424
24254
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24425
24255
|
if (!this._usingSafari) {
|
|
24426
24256
|
deviceEvent.inputIndex = evt.button + 2;
|
|
@@ -24430,23 +24260,23 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24430
24260
|
this._pointerDownEvent = (nativeEvent) => {
|
|
24431
24261
|
const evt = nativeEvent;
|
|
24432
24262
|
const deviceType = this._getPointerType(evt);
|
|
24433
|
-
const previousHorizontal = this._pointerPosRecord[
|
|
24434
|
-
const previousVertical = this._pointerPosRecord[
|
|
24435
|
-
if (deviceType ===
|
|
24263
|
+
const previousHorizontal = this._pointerPosRecord[0];
|
|
24264
|
+
const previousVertical = this._pointerPosRecord[1];
|
|
24265
|
+
if (deviceType === 2) {
|
|
24436
24266
|
if (this._mouseId === -1) if (evt.pointerId === void 0) this._mouseId = this._isUsingFirefox ? 0 : 1;
|
|
24437
24267
|
else this._mouseId = evt.pointerId;
|
|
24438
24268
|
if (!document.pointerLockElement) this._remainCapture = this._mouseId;
|
|
24439
24269
|
} else if (evt.pointerId && !document.pointerLockElement) this._remainCapture = evt.pointerId;
|
|
24440
|
-
this._pointerPosRecord[
|
|
24441
|
-
this._pointerPosRecord[
|
|
24270
|
+
this._pointerPosRecord[0] = evt.clientX;
|
|
24271
|
+
this._pointerPosRecord[1] = evt.clientY;
|
|
24442
24272
|
const deviceEvent = evt;
|
|
24443
24273
|
deviceEvent.deviceType = deviceType;
|
|
24444
24274
|
if (previousHorizontal !== evt.clientX) {
|
|
24445
|
-
deviceEvent.inputIndex =
|
|
24275
|
+
deviceEvent.inputIndex = 0;
|
|
24446
24276
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24447
24277
|
}
|
|
24448
24278
|
if (previousVertical !== evt.clientY) {
|
|
24449
|
-
deviceEvent.inputIndex =
|
|
24279
|
+
deviceEvent.inputIndex = 1;
|
|
24450
24280
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24451
24281
|
}
|
|
24452
24282
|
deviceEvent.inputIndex = evt.button + 2;
|
|
@@ -24455,23 +24285,23 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24455
24285
|
this._pointerUpEvent = (_evt) => {
|
|
24456
24286
|
const evt = _evt;
|
|
24457
24287
|
const deviceType = this._getPointerType(evt);
|
|
24458
|
-
const previousHorizontal = this._pointerPosRecord[
|
|
24459
|
-
const previousVertical = this._pointerPosRecord[
|
|
24460
|
-
this._pointerPosRecord[
|
|
24461
|
-
this._pointerPosRecord[
|
|
24288
|
+
const previousHorizontal = this._pointerPosRecord[0];
|
|
24289
|
+
const previousVertical = this._pointerPosRecord[1];
|
|
24290
|
+
this._pointerPosRecord[0] = evt.clientX;
|
|
24291
|
+
this._pointerPosRecord[1] = evt.clientY;
|
|
24462
24292
|
const deviceEvent = evt;
|
|
24463
24293
|
deviceEvent.deviceType = deviceType;
|
|
24464
24294
|
if (previousHorizontal !== evt.clientX) {
|
|
24465
|
-
deviceEvent.inputIndex =
|
|
24295
|
+
deviceEvent.inputIndex = 0;
|
|
24466
24296
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24467
24297
|
}
|
|
24468
24298
|
if (previousVertical !== evt.clientY) {
|
|
24469
|
-
deviceEvent.inputIndex =
|
|
24299
|
+
deviceEvent.inputIndex = 1;
|
|
24470
24300
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24471
24301
|
}
|
|
24472
24302
|
deviceEvent.inputIndex = evt.button + 2;
|
|
24473
24303
|
const canvasEle = this.getCanvasElement();
|
|
24474
|
-
if (deviceType ===
|
|
24304
|
+
if (deviceType === 2 && this._mouseId >= 0 && canvasEle.hasPointerCapture(this._mouseId)) {
|
|
24475
24305
|
this._remainCapture = this._mouseId;
|
|
24476
24306
|
canvasEle.releasePointerCapture(this._mouseId);
|
|
24477
24307
|
} else if (deviceEvent.pointerId && canvasEle.hasPointerCapture(deviceEvent.pointerId)) {
|
|
@@ -24479,7 +24309,7 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24479
24309
|
canvasEle.releasePointerCapture(deviceEvent.pointerId);
|
|
24480
24310
|
}
|
|
24481
24311
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24482
|
-
if (deviceType !==
|
|
24312
|
+
if (deviceType !== 2) this._pointerPosRecord = {};
|
|
24483
24313
|
};
|
|
24484
24314
|
this._pointerEnterEvent = (evt) => {
|
|
24485
24315
|
const deviceType = this._getPointerType(evt);
|
|
@@ -24510,15 +24340,15 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24510
24340
|
this._pointerPosRecord = {};
|
|
24511
24341
|
};
|
|
24512
24342
|
this._pointerWheelEvent = (evt) => {
|
|
24513
|
-
const deviceType =
|
|
24514
|
-
this._pointerPosRecord[
|
|
24515
|
-
this._pointerPosRecord[
|
|
24516
|
-
this._pointerPosRecord[
|
|
24343
|
+
const deviceType = 2;
|
|
24344
|
+
this._pointerPosRecord[7] = evt.deltaX || 0;
|
|
24345
|
+
this._pointerPosRecord[8] = evt.deltaY || evt.wheelDelta || 0;
|
|
24346
|
+
this._pointerPosRecord[9] = evt.deltaZ || 0;
|
|
24517
24347
|
const deviceEvent = evt;
|
|
24518
24348
|
deviceEvent.deviceType = deviceType;
|
|
24519
|
-
if (this._pointerPosRecord[
|
|
24520
|
-
if (this._pointerPosRecord[
|
|
24521
|
-
if (this._pointerPosRecord[
|
|
24349
|
+
if (this._pointerPosRecord[7] !== 0) deviceEvent.currentState = this._pointerPosRecord[7];
|
|
24350
|
+
if (this._pointerPosRecord[8] !== 0) deviceEvent.currentState = this._pointerPosRecord[8];
|
|
24351
|
+
if (this._pointerPosRecord[9] !== 0) deviceEvent.currentState = this._pointerPosRecord[9];
|
|
24522
24352
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24523
24353
|
};
|
|
24524
24354
|
const canvasEle = this.getCanvasElement();
|
|
@@ -24552,32 +24382,32 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24552
24382
|
this._dragOverEvent = (evt) => {
|
|
24553
24383
|
evt.preventDefault();
|
|
24554
24384
|
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[
|
|
24385
|
+
const previousHorizontal = this._pointerPosRecord[0];
|
|
24386
|
+
const previousVertical = this._pointerPosRecord[1];
|
|
24387
|
+
this._pointerPosRecord[0] = evt.clientX;
|
|
24388
|
+
this._pointerPosRecord[1] = evt.clientY;
|
|
24389
|
+
this._pointerPosRecord[10] = evt.movementX;
|
|
24390
|
+
this._pointerPosRecord[11] = evt.movementY;
|
|
24561
24391
|
const deviceEvent = evt;
|
|
24562
24392
|
deviceEvent.deviceType = deviceType;
|
|
24563
24393
|
if (previousHorizontal !== evt.clientX) {
|
|
24564
|
-
deviceEvent.inputIndex =
|
|
24565
|
-
deviceEvent.currentState = this._pointerPosRecord[
|
|
24394
|
+
deviceEvent.inputIndex = 0;
|
|
24395
|
+
deviceEvent.currentState = this._pointerPosRecord[0];
|
|
24566
24396
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24567
24397
|
}
|
|
24568
24398
|
if (previousVertical !== evt.clientY) {
|
|
24569
|
-
deviceEvent.inputIndex =
|
|
24570
|
-
deviceEvent.currentState = this._pointerPosRecord[
|
|
24399
|
+
deviceEvent.inputIndex = 1;
|
|
24400
|
+
deviceEvent.currentState = this._pointerPosRecord[1];
|
|
24571
24401
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24572
24402
|
}
|
|
24573
|
-
if (this._pointerPosRecord[
|
|
24574
|
-
deviceEvent.inputIndex =
|
|
24575
|
-
deviceEvent.currentState = this._pointerPosRecord[
|
|
24403
|
+
if (this._pointerPosRecord[10] !== 0) {
|
|
24404
|
+
deviceEvent.inputIndex = 10;
|
|
24405
|
+
deviceEvent.currentState = this._pointerPosRecord[10];
|
|
24576
24406
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24577
24407
|
}
|
|
24578
|
-
if (this._pointerPosRecord[
|
|
24579
|
-
deviceEvent.inputIndex =
|
|
24580
|
-
deviceEvent.currentState = this._pointerPosRecord[
|
|
24408
|
+
if (this._pointerPosRecord[11] !== 0) {
|
|
24409
|
+
deviceEvent.inputIndex = 11;
|
|
24410
|
+
deviceEvent.currentState = this._pointerPosRecord[11];
|
|
24581
24411
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24582
24412
|
}
|
|
24583
24413
|
if (!this._usingSafari) {
|
|
@@ -24616,8 +24446,8 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24616
24446
|
return passiveSupported;
|
|
24617
24447
|
}
|
|
24618
24448
|
_getPointerType(evt) {
|
|
24619
|
-
let deviceType =
|
|
24620
|
-
if (evt.pointerType === "touch" || evt.pointerType === "pen" || evt.touches) deviceType =
|
|
24449
|
+
let deviceType = 2;
|
|
24450
|
+
if (evt.pointerType === "touch" || evt.pointerType === "pen" || evt.touches) deviceType = 3;
|
|
24621
24451
|
return deviceType;
|
|
24622
24452
|
}
|
|
24623
24453
|
_matchMediaHandler() {
|
|
@@ -24638,7 +24468,7 @@ Engine = __decorate([__decorateParam(2, ICanvasColorService)], Engine);
|
|
|
24638
24468
|
//#endregion
|
|
24639
24469
|
//#region package.json
|
|
24640
24470
|
var name = "@univerjs/engine-render";
|
|
24641
|
-
var version = "0.
|
|
24471
|
+
var version = "0.22.0";
|
|
24642
24472
|
|
|
24643
24473
|
//#endregion
|
|
24644
24474
|
//#region src/config/config.ts
|
|
@@ -24833,7 +24663,7 @@ var InputManager = class InputManager extends _univerjs_core.Disposable {
|
|
|
24833
24663
|
if (!engine) return;
|
|
24834
24664
|
this._onInput$ = engine.onInputChanged$.subscribeEvent((eventData) => {
|
|
24835
24665
|
const evt = eventData;
|
|
24836
|
-
if (eventData.deviceType ===
|
|
24666
|
+
if (eventData.deviceType === 1) switch (eventData.type) {
|
|
24837
24667
|
case "keydown":
|
|
24838
24668
|
this._onKeyDown(evt);
|
|
24839
24669
|
break;
|
|
@@ -24841,7 +24671,7 @@ var InputManager = class InputManager extends _univerjs_core.Disposable {
|
|
|
24841
24671
|
this._onKeyUp(evt);
|
|
24842
24672
|
break;
|
|
24843
24673
|
}
|
|
24844
|
-
if (eventData.deviceType ===
|
|
24674
|
+
if (eventData.deviceType === 2 || eventData.deviceType === 3) switch (eventData.type) {
|
|
24845
24675
|
case "wheel":
|
|
24846
24676
|
case "DOMMouseScroll":
|
|
24847
24677
|
case "mousewheel":
|
|
@@ -24863,10 +24693,10 @@ var InputManager = class InputManager extends _univerjs_core.Disposable {
|
|
|
24863
24693
|
if (enableMove) this._onPointerMove(evt);
|
|
24864
24694
|
break;
|
|
24865
24695
|
case "pointerup":
|
|
24866
|
-
if (enableUp && eventData.inputIndex >=
|
|
24696
|
+
if (enableUp && eventData.inputIndex >= 2 && eventData.inputIndex <= 4) this._onPointerUp(evt);
|
|
24867
24697
|
break;
|
|
24868
24698
|
case "pointerdown":
|
|
24869
|
-
if (enableDown && eventData.inputIndex >=
|
|
24699
|
+
if (enableDown && eventData.inputIndex >= 2 && eventData.inputIndex <= 4) this._onPointerDown(evt);
|
|
24870
24700
|
break;
|
|
24871
24701
|
}
|
|
24872
24702
|
if (eventData.dataTransfer) switch (eventData.type) {
|
|
@@ -24874,7 +24704,7 @@ var InputManager = class InputManager extends _univerjs_core.Disposable {
|
|
|
24874
24704
|
if (enableEnter) this._onDragEnter(evt);
|
|
24875
24705
|
break;
|
|
24876
24706
|
case "dragover": {
|
|
24877
|
-
const validIndex = eventData.inputIndex ===
|
|
24707
|
+
const validIndex = eventData.inputIndex === 0 || eventData.inputIndex === 1 || eventData.inputIndex === 10 || eventData.inputIndex === 11;
|
|
24878
24708
|
if (enableMove && validIndex) this._onDragOver(evt);
|
|
24879
24709
|
break;
|
|
24880
24710
|
}
|
|
@@ -24921,9 +24751,9 @@ var InputManager = class InputManager extends _univerjs_core.Disposable {
|
|
|
24921
24751
|
return !this._isObjectInSceneViewer(currentObject);
|
|
24922
24752
|
}
|
|
24923
24753
|
_isObjectInSceneViewer(obj) {
|
|
24924
|
-
if (obj && obj.classType ===
|
|
24754
|
+
if (obj && obj.classType === "BaseObject") {
|
|
24925
24755
|
const scene = obj.getScene();
|
|
24926
|
-
if (scene) return scene.getParent().classType ===
|
|
24756
|
+
if (scene) return scene.getParent().classType === "SceneViewer";
|
|
24927
24757
|
}
|
|
24928
24758
|
return false;
|
|
24929
24759
|
}
|
|
@@ -24990,7 +24820,7 @@ const THRESHOLD_TO_AUTO_MOVE = {
|
|
|
24990
24820
|
r: 60
|
|
24991
24821
|
};
|
|
24992
24822
|
var ScrollTimer = class ScrollTimer {
|
|
24993
|
-
constructor(_scene, _scrollTimerType =
|
|
24823
|
+
constructor(_scene, _scrollTimerType = 3, _thresholdAutoMove = THRESHOLD_TO_AUTO_MOVE) {
|
|
24994
24824
|
this._scene = _scene;
|
|
24995
24825
|
this._scrollTimerType = _scrollTimerType;
|
|
24996
24826
|
this._thresholdAutoMove = _thresholdAutoMove;
|
|
@@ -25004,7 +24834,7 @@ var ScrollTimer = class ScrollTimer {
|
|
|
25004
24834
|
_defineProperty(this, "_scrollY", 0);
|
|
25005
24835
|
_defineProperty(this, "_scrollFunction", void 0);
|
|
25006
24836
|
}
|
|
25007
|
-
static create(scene, scrollTimerType =
|
|
24837
|
+
static create(scene, scrollTimerType = 3, padding) {
|
|
25008
24838
|
return new ScrollTimer(scene, scrollTimerType, padding);
|
|
25009
24839
|
}
|
|
25010
24840
|
get offsetX() {
|
|
@@ -25043,7 +24873,7 @@ var ScrollTimer = class ScrollTimer {
|
|
|
25043
24873
|
let x = 0;
|
|
25044
24874
|
let y = 0;
|
|
25045
24875
|
let shouldScroll = false;
|
|
25046
|
-
if (this._scrollTimerType &
|
|
24876
|
+
if (this._scrollTimerType & 1) {
|
|
25047
24877
|
if (this._moveX < leftBounding + l) {
|
|
25048
24878
|
x = this._moveX - leftBounding - l;
|
|
25049
24879
|
shouldScroll = true;
|
|
@@ -25053,7 +24883,7 @@ var ScrollTimer = class ScrollTimer {
|
|
|
25053
24883
|
shouldScroll = true;
|
|
25054
24884
|
}
|
|
25055
24885
|
}
|
|
25056
|
-
if (this._scrollTimerType &
|
|
24886
|
+
if (this._scrollTimerType & 2) {
|
|
25057
24887
|
if (this._moveY < topBounding + t) {
|
|
25058
24888
|
y = this._moveY - topBounding - t;
|
|
25059
24889
|
shouldScroll = true;
|
|
@@ -25096,42 +24926,21 @@ var ScrollTimer = class ScrollTimer {
|
|
|
25096
24926
|
|
|
25097
24927
|
//#endregion
|
|
25098
24928
|
//#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
24929
|
const TransformerManagerTypeArray = [
|
|
25115
|
-
|
|
25116
|
-
|
|
25117
|
-
|
|
25118
|
-
|
|
25119
|
-
|
|
25120
|
-
|
|
25121
|
-
|
|
25122
|
-
|
|
24930
|
+
"__SpreadsheetTransformerResizeLT__",
|
|
24931
|
+
"__SpreadsheetTransformerResizeCT__",
|
|
24932
|
+
"__SpreadsheetTransformerResizeRT__",
|
|
24933
|
+
"__SpreadsheetTransformerResizeLM__",
|
|
24934
|
+
"__SpreadsheetTransformerResizeRM__",
|
|
24935
|
+
"__SpreadsheetTransformerResizeLB__",
|
|
24936
|
+
"__SpreadsheetTransformerResizeCB__",
|
|
24937
|
+
"__SpreadsheetTransformerResizeRB__"
|
|
25123
24938
|
];
|
|
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
24939
|
const DEFAULT_TRANSFORMER_LAYER_INDEX = 2;
|
|
25131
24940
|
const MINI_WIDTH_LIMIT = 20;
|
|
25132
24941
|
const MINI_HEIGHT_LIMIT = 20;
|
|
25133
24942
|
const DEFAULT_CONTROL_PLUS_INDEX = 5e3;
|
|
25134
|
-
const SINGLE_ACTIVE_OBJECT_TYPE_MAP = new Set([
|
|
24943
|
+
const SINGLE_ACTIVE_OBJECT_TYPE_MAP = new Set([6]);
|
|
25135
24944
|
/**
|
|
25136
24945
|
* Transformer constructor. Transformer is a special type of group that allow you transform
|
|
25137
24946
|
* primitives and shapes. Transforming tool is not changing `width` and `height` properties of nodes
|
|
@@ -25224,7 +25033,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25224
25033
|
changeNotification() {
|
|
25225
25034
|
this._changing$.next({
|
|
25226
25035
|
objects: this._selectedObjectMap,
|
|
25227
|
-
type:
|
|
25036
|
+
type: 0
|
|
25228
25037
|
});
|
|
25229
25038
|
return this;
|
|
25230
25039
|
}
|
|
@@ -25369,14 +25178,14 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25369
25178
|
this._changeStart$.next({
|
|
25370
25179
|
target: applyObject,
|
|
25371
25180
|
objects: this._selectedObjectMap,
|
|
25372
|
-
type:
|
|
25181
|
+
type: 0
|
|
25373
25182
|
});
|
|
25374
25183
|
} else {
|
|
25375
25184
|
this._copperSelectedObject = applyObject;
|
|
25376
25185
|
this._changeStart$.next({
|
|
25377
25186
|
target: applyObject,
|
|
25378
25187
|
objects: new Map([[applyObject.oKey, applyObject]]),
|
|
25379
|
-
type:
|
|
25188
|
+
type: 0
|
|
25380
25189
|
});
|
|
25381
25190
|
}
|
|
25382
25191
|
this._moveBufferSkip = false;
|
|
@@ -25397,14 +25206,14 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25397
25206
|
const { offsetX, offsetY } = event;
|
|
25398
25207
|
if (!isCropper) this._changeEnd$.next({
|
|
25399
25208
|
objects: this._selectedObjectMap,
|
|
25400
|
-
type:
|
|
25209
|
+
type: 2,
|
|
25401
25210
|
offsetX,
|
|
25402
25211
|
offsetY,
|
|
25403
25212
|
event
|
|
25404
25213
|
});
|
|
25405
25214
|
else this._changeEnd$.next({
|
|
25406
25215
|
objects: new Map([[applyObject.oKey, applyObject]]),
|
|
25407
|
-
type:
|
|
25216
|
+
type: 2,
|
|
25408
25217
|
offsetX,
|
|
25409
25218
|
offsetY,
|
|
25410
25219
|
event
|
|
@@ -25488,7 +25297,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25488
25297
|
objects: this._selectedObjectMap,
|
|
25489
25298
|
moveX: moveLeft,
|
|
25490
25299
|
moveY: moveTop,
|
|
25491
|
-
type:
|
|
25300
|
+
type: 1,
|
|
25492
25301
|
offsetX: moveOffsetX,
|
|
25493
25302
|
offsetY: moveOffsetY
|
|
25494
25303
|
});
|
|
@@ -25502,7 +25311,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25502
25311
|
objects: new Map([[cropper.oKey, cropper]]),
|
|
25503
25312
|
moveX: moveLeft,
|
|
25504
25313
|
moveY: moveTop,
|
|
25505
|
-
type:
|
|
25314
|
+
type: 1,
|
|
25506
25315
|
offsetX: moveOffsetX,
|
|
25507
25316
|
offsetY: moveOffsetY
|
|
25508
25317
|
});
|
|
@@ -25527,7 +25336,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25527
25336
|
});
|
|
25528
25337
|
this._changing$.next({
|
|
25529
25338
|
objects: this._selectedObjectMap,
|
|
25530
|
-
type:
|
|
25339
|
+
type: 1,
|
|
25531
25340
|
offsetX: moveOffsetX,
|
|
25532
25341
|
offsetY: moveOffsetY
|
|
25533
25342
|
});
|
|
@@ -25535,12 +25344,12 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25535
25344
|
this._moveFunc(applyObject, type, x, y, keepRatio, isCropper, isGroup);
|
|
25536
25345
|
this._changing$.next({
|
|
25537
25346
|
objects: new Map([[applyObject.oKey, applyObject]]),
|
|
25538
|
-
type:
|
|
25347
|
+
type: 1,
|
|
25539
25348
|
offsetX: moveOffsetX,
|
|
25540
25349
|
offsetY: moveOffsetY
|
|
25541
25350
|
});
|
|
25542
25351
|
}
|
|
25543
|
-
if (!(keepRatio && type !==
|
|
25352
|
+
if (!(keepRatio && type !== "__SpreadsheetTransformerResizeCT__" && type !== "__SpreadsheetTransformerResizeCB__" && type !== "__SpreadsheetTransformerResizeLM__" && type !== "__SpreadsheetTransformerResizeRM__" && !isGroup)) {
|
|
25544
25353
|
this._startOffsetX = x;
|
|
25545
25354
|
this._startOffsetY = y;
|
|
25546
25355
|
}
|
|
@@ -25550,17 +25359,17 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25550
25359
|
const originState = this._startStateMap.get(moveObject.oKey) || {};
|
|
25551
25360
|
let state = {};
|
|
25552
25361
|
const { moveLeft, moveTop } = this._getMovePoint(x, y, moveObject);
|
|
25553
|
-
if (keepRatio && type !==
|
|
25554
|
-
case
|
|
25362
|
+
if (keepRatio && type !== "__SpreadsheetTransformerResizeCT__" && type !== "__SpreadsheetTransformerResizeCB__" && type !== "__SpreadsheetTransformerResizeLM__" && type !== "__SpreadsheetTransformerResizeRM__" && !isGroup) switch (type) {
|
|
25363
|
+
case "__SpreadsheetTransformerResizeLT__":
|
|
25555
25364
|
state = this._resizeLeftTop(moveObject, moveLeft, moveTop, originState);
|
|
25556
25365
|
break;
|
|
25557
|
-
case
|
|
25366
|
+
case "__SpreadsheetTransformerResizeRT__":
|
|
25558
25367
|
state = this._resizeRightTop(moveObject, moveLeft, moveTop, originState);
|
|
25559
25368
|
break;
|
|
25560
|
-
case
|
|
25369
|
+
case "__SpreadsheetTransformerResizeLB__":
|
|
25561
25370
|
state = this._resizeLeftBottom(moveObject, moveLeft, moveTop, originState);
|
|
25562
25371
|
break;
|
|
25563
|
-
case
|
|
25372
|
+
case "__SpreadsheetTransformerResizeRB__":
|
|
25564
25373
|
state = this._resizeRightBottom(moveObject, moveLeft, moveTop, originState);
|
|
25565
25374
|
break;
|
|
25566
25375
|
}
|
|
@@ -25612,37 +25421,37 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25612
25421
|
height
|
|
25613
25422
|
};
|
|
25614
25423
|
switch (type) {
|
|
25615
|
-
case
|
|
25424
|
+
case "__SpreadsheetTransformerResizeLT__":
|
|
25616
25425
|
state.width = width - moveLeft < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : width - moveLeft;
|
|
25617
25426
|
state.height = height - moveTop < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : height - moveTop;
|
|
25618
25427
|
state.left = left + width - state.width;
|
|
25619
25428
|
state.top = top + height - state.height;
|
|
25620
25429
|
break;
|
|
25621
|
-
case
|
|
25430
|
+
case "__SpreadsheetTransformerResizeCT__":
|
|
25622
25431
|
state.height = height - moveTop < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : height - moveTop;
|
|
25623
25432
|
state.top = top + height - state.height;
|
|
25624
25433
|
break;
|
|
25625
|
-
case
|
|
25434
|
+
case "__SpreadsheetTransformerResizeRT__":
|
|
25626
25435
|
state.width = width + moveLeft < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : width + moveLeft;
|
|
25627
25436
|
state.height = height - moveTop < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : height - moveTop;
|
|
25628
25437
|
state.top = top + height - state.height;
|
|
25629
25438
|
break;
|
|
25630
|
-
case
|
|
25439
|
+
case "__SpreadsheetTransformerResizeLM__":
|
|
25631
25440
|
state.width = width - moveLeft < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : width - moveLeft;
|
|
25632
25441
|
state.left = left + width - state.width;
|
|
25633
25442
|
break;
|
|
25634
|
-
case
|
|
25443
|
+
case "__SpreadsheetTransformerResizeRM__":
|
|
25635
25444
|
state.width = moveLeft + width < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : moveLeft + width;
|
|
25636
25445
|
break;
|
|
25637
|
-
case
|
|
25446
|
+
case "__SpreadsheetTransformerResizeLB__":
|
|
25638
25447
|
state.width = width - moveLeft < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : width - moveLeft;
|
|
25639
25448
|
state.height = height + moveTop < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : height + moveTop;
|
|
25640
25449
|
state.left = state.width <= MINI_WIDTH_LIMIT ? left : left + moveLeft;
|
|
25641
25450
|
break;
|
|
25642
|
-
case
|
|
25451
|
+
case "__SpreadsheetTransformerResizeCB__":
|
|
25643
25452
|
state.height = moveTop + height < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : moveTop + height;
|
|
25644
25453
|
break;
|
|
25645
|
-
case
|
|
25454
|
+
case "__SpreadsheetTransformerResizeRB__":
|
|
25646
25455
|
state.width = moveLeft + width < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : moveLeft + width;
|
|
25647
25456
|
state.height = moveTop + height < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : moveTop + height;
|
|
25648
25457
|
break;
|
|
@@ -25747,7 +25556,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25747
25556
|
moveTop: moveTopFix
|
|
25748
25557
|
};
|
|
25749
25558
|
}
|
|
25750
|
-
_attachEventToAnchor(anchor, type =
|
|
25559
|
+
_attachEventToAnchor(anchor, type = "__SpreadsheetTransformerResizeLT__", applyObject) {
|
|
25751
25560
|
this.disposeWithMe((0, _univerjs_core.toDisposable)(anchor.onPointerDown$.subscribeEvent((evt, state) => {
|
|
25752
25561
|
const { offsetX: evtOffsetX, offsetY: evtOffsetY } = evt;
|
|
25753
25562
|
this._startOffsetX = evtOffsetX;
|
|
@@ -25768,7 +25577,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25768
25577
|
this._clearControlMap();
|
|
25769
25578
|
this._changeStart$.next({
|
|
25770
25579
|
objects: this._selectedObjectMap,
|
|
25771
|
-
type:
|
|
25580
|
+
type: 0
|
|
25772
25581
|
});
|
|
25773
25582
|
this._selectedObjectMap.forEach((moveObject) => {
|
|
25774
25583
|
const { width, height, left, top } = moveObject.getState();
|
|
@@ -25782,7 +25591,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25782
25591
|
} else {
|
|
25783
25592
|
this._changeStart$.next({
|
|
25784
25593
|
objects: new Map([[applyObject.oKey, applyObject]]),
|
|
25785
|
-
type:
|
|
25594
|
+
type: 0
|
|
25786
25595
|
});
|
|
25787
25596
|
const { width, height, left, top } = applyObject.getState();
|
|
25788
25597
|
this._startStateMap.set(applyObject.oKey, {
|
|
@@ -25814,7 +25623,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25814
25623
|
this._recoverySizeBoundary(Array.from(this._selectedObjectMap.values()), ancestorLeft, ancestorTop, topSceneWidth, topSceneHeight);
|
|
25815
25624
|
this._changeEnd$.next({
|
|
25816
25625
|
objects: this._selectedObjectMap,
|
|
25817
|
-
type:
|
|
25626
|
+
type: 2,
|
|
25818
25627
|
offsetX,
|
|
25819
25628
|
offsetY,
|
|
25820
25629
|
event
|
|
@@ -25823,7 +25632,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25823
25632
|
this._recoverySizeBoundary([applyObject], ancestorLeft, ancestorTop, topSceneWidth, topSceneHeight);
|
|
25824
25633
|
this._changeEnd$.next({
|
|
25825
25634
|
objects: new Map([[applyObject.oKey, applyObject]]),
|
|
25826
|
-
type:
|
|
25635
|
+
type: 2,
|
|
25827
25636
|
offsetX,
|
|
25828
25637
|
offsetY,
|
|
25829
25638
|
event
|
|
@@ -25861,14 +25670,14 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25861
25670
|
const viewportActualXY = topScene.getScrollXYInfoByViewport(Vector2.create(evtOffsetX, evtOffsetY));
|
|
25862
25671
|
this._viewportScrollX = viewportActualXY.x;
|
|
25863
25672
|
this._viewportScrollY = viewportActualXY.y;
|
|
25864
|
-
const cursor = this._getRotateAnchorCursor(
|
|
25673
|
+
const cursor = this._getRotateAnchorCursor("__SpreadsheetTransformerRotateLine__");
|
|
25865
25674
|
const { ancestorLeft, ancestorTop, width, height, angle: agentOrigin } = applyObject;
|
|
25866
25675
|
const centerX = width / 2 + ancestorLeft;
|
|
25867
25676
|
const centerY = height / 2 + ancestorTop;
|
|
25868
25677
|
this._clearControlMap();
|
|
25869
25678
|
this._changeStart$.next({
|
|
25870
25679
|
objects: this._selectedObjectMap,
|
|
25871
|
-
type:
|
|
25680
|
+
type: 0
|
|
25872
25681
|
});
|
|
25873
25682
|
this._moveBufferSkip = false;
|
|
25874
25683
|
const topScenePointerMoveSub = topScene.onPointerMove$.subscribeEvent((moveEvt) => {
|
|
@@ -25885,7 +25694,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25885
25694
|
const { offsetX, offsetY } = event;
|
|
25886
25695
|
this._changeEnd$.next({
|
|
25887
25696
|
objects: this._selectedObjectMap,
|
|
25888
|
-
type:
|
|
25697
|
+
type: 2,
|
|
25889
25698
|
offsetX,
|
|
25890
25699
|
offsetY,
|
|
25891
25700
|
event
|
|
@@ -25907,7 +25716,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25907
25716
|
this._changing$.next({
|
|
25908
25717
|
objects: this._selectedObjectMap,
|
|
25909
25718
|
angle,
|
|
25910
|
-
type:
|
|
25719
|
+
type: 1,
|
|
25911
25720
|
offsetX: moveOffsetX,
|
|
25912
25721
|
offsetY: moveOffsetY
|
|
25913
25722
|
});
|
|
@@ -25921,35 +25730,35 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25921
25730
|
};
|
|
25922
25731
|
}
|
|
25923
25732
|
_getRotateAnchorCursor(type) {
|
|
25924
|
-
let cursor =
|
|
25733
|
+
let cursor = "nw-resize";
|
|
25925
25734
|
switch (type) {
|
|
25926
|
-
case
|
|
25927
|
-
cursor =
|
|
25735
|
+
case "__SpreadsheetTransformerRotate__":
|
|
25736
|
+
cursor = "move";
|
|
25928
25737
|
break;
|
|
25929
|
-
case
|
|
25930
|
-
cursor =
|
|
25738
|
+
case "__SpreadsheetTransformerRotateLine__":
|
|
25739
|
+
cursor = "move";
|
|
25931
25740
|
break;
|
|
25932
|
-
case
|
|
25933
|
-
case
|
|
25934
|
-
cursor =
|
|
25741
|
+
case "__SpreadsheetTransformerResizeLT__": break;
|
|
25742
|
+
case "__SpreadsheetTransformerResizeCT__":
|
|
25743
|
+
cursor = "n-resize";
|
|
25935
25744
|
break;
|
|
25936
|
-
case
|
|
25937
|
-
cursor =
|
|
25745
|
+
case "__SpreadsheetTransformerResizeRT__":
|
|
25746
|
+
cursor = "ne-resize";
|
|
25938
25747
|
break;
|
|
25939
|
-
case
|
|
25940
|
-
cursor =
|
|
25748
|
+
case "__SpreadsheetTransformerResizeLM__":
|
|
25749
|
+
cursor = "w-resize";
|
|
25941
25750
|
break;
|
|
25942
|
-
case
|
|
25943
|
-
cursor =
|
|
25751
|
+
case "__SpreadsheetTransformerResizeRM__":
|
|
25752
|
+
cursor = "e-resize";
|
|
25944
25753
|
break;
|
|
25945
|
-
case
|
|
25946
|
-
cursor =
|
|
25754
|
+
case "__SpreadsheetTransformerResizeLB__":
|
|
25755
|
+
cursor = "sw-resize";
|
|
25947
25756
|
break;
|
|
25948
|
-
case
|
|
25949
|
-
cursor =
|
|
25757
|
+
case "__SpreadsheetTransformerResizeCB__":
|
|
25758
|
+
cursor = "s-resize";
|
|
25950
25759
|
break;
|
|
25951
|
-
case
|
|
25952
|
-
cursor =
|
|
25760
|
+
case "__SpreadsheetTransformerResizeRB__":
|
|
25761
|
+
cursor = "se-resize";
|
|
25953
25762
|
break;
|
|
25954
25763
|
}
|
|
25955
25764
|
return cursor;
|
|
@@ -25961,35 +25770,35 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25961
25770
|
const longEdge = anchorSize;
|
|
25962
25771
|
const shortEdge = anchorSize / 4;
|
|
25963
25772
|
switch (type) {
|
|
25964
|
-
case
|
|
25773
|
+
case "__SpreadsheetTransformerResizeLT__":
|
|
25965
25774
|
left += -borderSpacing - borderStrokeWidth;
|
|
25966
25775
|
top += -borderSpacing - borderStrokeWidth;
|
|
25967
25776
|
break;
|
|
25968
|
-
case
|
|
25777
|
+
case "__SpreadsheetTransformerResizeCT__":
|
|
25969
25778
|
left += width / 2 - longEdge / 2;
|
|
25970
25779
|
top += -borderSpacing - borderStrokeWidth;
|
|
25971
25780
|
break;
|
|
25972
|
-
case
|
|
25781
|
+
case "__SpreadsheetTransformerResizeRT__":
|
|
25973
25782
|
left += width + borderSpacing - borderStrokeWidth - longEdge;
|
|
25974
25783
|
top += -borderSpacing - borderStrokeWidth;
|
|
25975
25784
|
break;
|
|
25976
|
-
case
|
|
25785
|
+
case "__SpreadsheetTransformerResizeLM__":
|
|
25977
25786
|
left += borderSpacing - borderStrokeWidth;
|
|
25978
25787
|
top += height / 2 - longEdge / 2;
|
|
25979
25788
|
break;
|
|
25980
|
-
case
|
|
25789
|
+
case "__SpreadsheetTransformerResizeRM__":
|
|
25981
25790
|
left += width + borderSpacing - borderStrokeWidth - shortEdge;
|
|
25982
25791
|
top += height / 2 - longEdge / 2;
|
|
25983
25792
|
break;
|
|
25984
|
-
case
|
|
25793
|
+
case "__SpreadsheetTransformerResizeLB__":
|
|
25985
25794
|
left += -this.borderSpacing - borderStrokeWidth;
|
|
25986
25795
|
top += height + borderSpacing - borderStrokeWidth - longEdge;
|
|
25987
25796
|
break;
|
|
25988
|
-
case
|
|
25797
|
+
case "__SpreadsheetTransformerResizeCB__":
|
|
25989
25798
|
left += width / 2 - longEdge / 2;
|
|
25990
25799
|
top += height + borderSpacing - borderStrokeWidth - shortEdge;
|
|
25991
25800
|
break;
|
|
25992
|
-
case
|
|
25801
|
+
case "__SpreadsheetTransformerResizeRB__":
|
|
25993
25802
|
left += width + borderSpacing - borderStrokeWidth - longEdge;
|
|
25994
25803
|
top += height + borderSpacing - borderStrokeWidth - longEdge;
|
|
25995
25804
|
break;
|
|
@@ -26004,43 +25813,43 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
26004
25813
|
let left = -anchorSize / 2;
|
|
26005
25814
|
let top = -anchorSize / 2;
|
|
26006
25815
|
switch (type) {
|
|
26007
|
-
case
|
|
25816
|
+
case "__SpreadsheetTransformerRotate__":
|
|
26008
25817
|
left = width / 2 - rotateSize / 2;
|
|
26009
25818
|
top = -rotateAnchorOffset - borderSpacing - borderStrokeWidth * 2 - rotateSize;
|
|
26010
25819
|
break;
|
|
26011
|
-
case
|
|
25820
|
+
case "__SpreadsheetTransformerRotateLine__":
|
|
26012
25821
|
left = width / 2;
|
|
26013
25822
|
top = -rotateAnchorOffset - borderSpacing - borderStrokeWidth;
|
|
26014
25823
|
break;
|
|
26015
|
-
case
|
|
25824
|
+
case "__SpreadsheetTransformerResizeLT__":
|
|
26016
25825
|
left += -borderSpacing - borderStrokeWidth;
|
|
26017
25826
|
top += -borderSpacing - borderStrokeWidth;
|
|
26018
25827
|
break;
|
|
26019
|
-
case
|
|
25828
|
+
case "__SpreadsheetTransformerResizeCT__":
|
|
26020
25829
|
left += width / 2;
|
|
26021
25830
|
top += -borderSpacing - borderStrokeWidth;
|
|
26022
25831
|
break;
|
|
26023
|
-
case
|
|
25832
|
+
case "__SpreadsheetTransformerResizeRT__":
|
|
26024
25833
|
left += width + borderSpacing - borderStrokeWidth;
|
|
26025
25834
|
top += -borderSpacing - borderStrokeWidth;
|
|
26026
25835
|
break;
|
|
26027
|
-
case
|
|
25836
|
+
case "__SpreadsheetTransformerResizeLM__":
|
|
26028
25837
|
left += borderSpacing - borderStrokeWidth;
|
|
26029
25838
|
top += height / 2;
|
|
26030
25839
|
break;
|
|
26031
|
-
case
|
|
25840
|
+
case "__SpreadsheetTransformerResizeRM__":
|
|
26032
25841
|
left += width + borderSpacing - borderStrokeWidth;
|
|
26033
25842
|
top += height / 2;
|
|
26034
25843
|
break;
|
|
26035
|
-
case
|
|
25844
|
+
case "__SpreadsheetTransformerResizeLB__":
|
|
26036
25845
|
left += -this.borderSpacing - borderStrokeWidth;
|
|
26037
25846
|
top += height + borderSpacing - borderStrokeWidth;
|
|
26038
25847
|
break;
|
|
26039
|
-
case
|
|
25848
|
+
case "__SpreadsheetTransformerResizeCB__":
|
|
26040
25849
|
left += width / 2;
|
|
26041
25850
|
top += height + borderSpacing - borderStrokeWidth;
|
|
26042
25851
|
break;
|
|
26043
|
-
case
|
|
25852
|
+
case "__SpreadsheetTransformerResizeRB__":
|
|
26044
25853
|
left += width + borderSpacing - borderStrokeWidth;
|
|
26045
25854
|
top += height + borderSpacing - borderStrokeWidth;
|
|
26046
25855
|
break;
|
|
@@ -26066,7 +25875,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
26066
25875
|
left,
|
|
26067
25876
|
top
|
|
26068
25877
|
});
|
|
26069
|
-
this._attachHover(anchor, cursor,
|
|
25878
|
+
this._attachHover(anchor, cursor, "default");
|
|
26070
25879
|
return anchor;
|
|
26071
25880
|
}
|
|
26072
25881
|
_createCopperResizeAnchor(type, applyObject, zIndex) {
|
|
@@ -26088,36 +25897,36 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
26088
25897
|
};
|
|
26089
25898
|
const longEdge = anchorSize;
|
|
26090
25899
|
const shortEdge = anchorSize / 4;
|
|
26091
|
-
if (cursor ===
|
|
25900
|
+
if (cursor === "e-resize") {
|
|
26092
25901
|
config.width = shortEdge;
|
|
26093
25902
|
config.height = longEdge;
|
|
26094
25903
|
anchor = new Rect(oKey, config);
|
|
26095
|
-
} else if (cursor ===
|
|
25904
|
+
} else if (cursor === "w-resize") {
|
|
26096
25905
|
config.width = shortEdge;
|
|
26097
25906
|
config.height = longEdge;
|
|
26098
25907
|
anchor = new Rect(oKey, config);
|
|
26099
|
-
} else if (cursor ===
|
|
25908
|
+
} else if (cursor === "n-resize") {
|
|
26100
25909
|
config.width = longEdge;
|
|
26101
25910
|
config.height = shortEdge;
|
|
26102
25911
|
anchor = new Rect(oKey, config);
|
|
26103
|
-
} else if (cursor ===
|
|
25912
|
+
} else if (cursor === "s-resize") {
|
|
26104
25913
|
config.width = longEdge;
|
|
26105
25914
|
config.height = shortEdge;
|
|
26106
25915
|
anchor = new Rect(oKey, config);
|
|
26107
|
-
} else if (cursor ===
|
|
25916
|
+
} else if (cursor === "ne-resize") {
|
|
26108
25917
|
config.pointsGroup = this._getNorthEastPoints(longEdge, shortEdge);
|
|
26109
25918
|
anchor = new RegularPolygon(oKey, config);
|
|
26110
|
-
} else if (cursor ===
|
|
25919
|
+
} else if (cursor === "nw-resize") {
|
|
26111
25920
|
config.pointsGroup = this._getNorthWestPoints(longEdge, shortEdge);
|
|
26112
25921
|
anchor = new RegularPolygon(oKey, config);
|
|
26113
|
-
} else if (cursor ===
|
|
25922
|
+
} else if (cursor === "se-resize") {
|
|
26114
25923
|
config.pointsGroup = this._getSouthEastPoints(longEdge, shortEdge);
|
|
26115
25924
|
anchor = new RegularPolygon(oKey, config);
|
|
26116
|
-
} else if (cursor ===
|
|
25925
|
+
} else if (cursor === "sw-resize") {
|
|
26117
25926
|
config.pointsGroup = this._getSouthWestPoints(longEdge, shortEdge);
|
|
26118
25927
|
anchor = new RegularPolygon(oKey, config);
|
|
26119
25928
|
}
|
|
26120
|
-
this._attachHover(anchor, cursor,
|
|
25929
|
+
this._attachHover(anchor, cursor, "default");
|
|
26121
25930
|
return anchor;
|
|
26122
25931
|
}
|
|
26123
25932
|
_getNorthEastPoints(longEdge, shortEdge) {
|
|
@@ -26244,17 +26053,17 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
26244
26053
|
]];
|
|
26245
26054
|
}
|
|
26246
26055
|
_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(
|
|
26056
|
+
if (oKey.indexOf("__SpreadsheetTransformerOutline__") > -1) return "__SpreadsheetTransformerOutline__";
|
|
26057
|
+
if (oKey.indexOf("__SpreadsheetTransformerRotate__") > -1) return "__SpreadsheetTransformerRotate__";
|
|
26058
|
+
if (oKey.indexOf("__SpreadsheetTransformerRotateLine__") > -1) return "__SpreadsheetTransformerRotateLine__";
|
|
26059
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeLT__") > -1) return "__SpreadsheetTransformerResizeLT__";
|
|
26060
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeCT__") > -1) return "__SpreadsheetTransformerResizeCT__";
|
|
26061
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeRT__") > -1) return "__SpreadsheetTransformerResizeRT__";
|
|
26062
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeLM__") > -1) return "__SpreadsheetTransformerResizeLM__";
|
|
26063
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeRM__") > -1) return "__SpreadsheetTransformerResizeRM__";
|
|
26064
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeLB__") > -1) return "__SpreadsheetTransformerResizeLB__";
|
|
26065
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeCB__") > -1) return "__SpreadsheetTransformerResizeCB__";
|
|
26066
|
+
if (oKey.indexOf("__SpreadsheetTransformerResizeRB__") > -1) return "__SpreadsheetTransformerResizeRB__";
|
|
26258
26067
|
}
|
|
26259
26068
|
_updateControlIterator(func) {
|
|
26260
26069
|
this._transformerControlMap.forEach((control, oKey) => {
|
|
@@ -26319,7 +26128,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
26319
26128
|
const layerIndex = applyObject.getLayerIndex() || DEFAULT_TRANSFORMER_LAYER_INDEX;
|
|
26320
26129
|
const groupElements = [];
|
|
26321
26130
|
if (borderEnabled && !isCropper) {
|
|
26322
|
-
const outline = new Rect(
|
|
26131
|
+
const outline = new Rect(`__SpreadsheetTransformerOutline___${zIndex}`, {
|
|
26323
26132
|
zIndex: zIndex - 1,
|
|
26324
26133
|
evented: false,
|
|
26325
26134
|
strokeWidth: borderStrokeWidth,
|
|
@@ -26329,9 +26138,9 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
26329
26138
|
groupElements.push(outline);
|
|
26330
26139
|
}
|
|
26331
26140
|
if (resizeEnabled && !isCropper) {
|
|
26332
|
-
const { left: lineLeft, top: lineTop } = this._getRotateAnchorPosition(
|
|
26141
|
+
const { left: lineLeft, top: lineTop } = this._getRotateAnchorPosition("__SpreadsheetTransformerRotateLine__", height, width, applyObject);
|
|
26333
26142
|
if (rotateEnabled) {
|
|
26334
|
-
const rotateLine = new Rect(
|
|
26143
|
+
const rotateLine = new Rect(`__SpreadsheetTransformerRotateLine___${zIndex}`, {
|
|
26335
26144
|
zIndex: zIndex - 1,
|
|
26336
26145
|
evented: false,
|
|
26337
26146
|
left: lineLeft,
|
|
@@ -26341,9 +26150,9 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
26341
26150
|
strokeWidth: borderStrokeWidth,
|
|
26342
26151
|
stroke: borderStroke
|
|
26343
26152
|
});
|
|
26344
|
-
const { left: rotateLeft, top: rotateTop } = this._getRotateAnchorPosition(
|
|
26345
|
-
const cursor = this._getRotateAnchorCursor(
|
|
26346
|
-
const rotate = new Rect(
|
|
26153
|
+
const { left: rotateLeft, top: rotateTop } = this._getRotateAnchorPosition("__SpreadsheetTransformerRotate__", height, width, applyObject);
|
|
26154
|
+
const cursor = this._getRotateAnchorCursor("__SpreadsheetTransformerRotate__");
|
|
26155
|
+
const rotate = new Rect(`__SpreadsheetTransformerRotate___${zIndex}`, {
|
|
26347
26156
|
zIndex: zIndex - 1,
|
|
26348
26157
|
left: rotateLeft,
|
|
26349
26158
|
top: rotateTop,
|
|
@@ -26354,7 +26163,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
26354
26163
|
stroke: borderStroke
|
|
26355
26164
|
});
|
|
26356
26165
|
this._attachEventToRotate(rotate, applyObject);
|
|
26357
|
-
this._attachHover(rotate, cursor,
|
|
26166
|
+
this._attachHover(rotate, cursor, "default");
|
|
26358
26167
|
groupElements.push(rotateLine, rotate);
|
|
26359
26168
|
}
|
|
26360
26169
|
}
|
|
@@ -26367,7 +26176,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
26367
26176
|
this._attachEventToAnchor(anchor, type, applyObject);
|
|
26368
26177
|
groupElements.push(anchor);
|
|
26369
26178
|
}
|
|
26370
|
-
const transformerControl = new Group(
|
|
26179
|
+
const transformerControl = new Group(`__SpreadsheetTransformer___${oKey}`, ...groupElements);
|
|
26371
26180
|
transformerControl.zIndex = zIndex;
|
|
26372
26181
|
transformerControl.evented = false;
|
|
26373
26182
|
transformerControl.openSelfSizeMode();
|
|
@@ -26395,7 +26204,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
26395
26204
|
this._changeStart$.next({
|
|
26396
26205
|
target: applyObject,
|
|
26397
26206
|
objects: this._selectedObjectMap,
|
|
26398
|
-
type:
|
|
26207
|
+
type: 0
|
|
26399
26208
|
});
|
|
26400
26209
|
}
|
|
26401
26210
|
_updateActiveObjectList(applyObject, evt) {
|
|
@@ -26445,8 +26254,8 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26445
26254
|
_defineProperty(this, "_evented", true);
|
|
26446
26255
|
_defineProperty(this, "_layers", []);
|
|
26447
26256
|
_defineProperty(this, "_viewports", []);
|
|
26448
|
-
_defineProperty(this, "_cursor",
|
|
26449
|
-
_defineProperty(this, "_defaultCursor",
|
|
26257
|
+
_defineProperty(this, "_cursor", "default");
|
|
26258
|
+
_defineProperty(this, "_defaultCursor", "default");
|
|
26450
26259
|
_defineProperty(this, "_addObject$", new rxjs.BehaviorSubject(this));
|
|
26451
26260
|
_defineProperty(this, "addObject$", this._addObject$.asObservable());
|
|
26452
26261
|
_defineProperty(this, "onTransformChange$", new _univerjs_core.EventSubject());
|
|
@@ -26492,18 +26301,18 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26492
26301
|
_defineProperty(this, "_capturedObject", null);
|
|
26493
26302
|
this._sceneKey = sceneKey;
|
|
26494
26303
|
if (state) this.transformByState(state);
|
|
26495
|
-
if (this._parent.classType ===
|
|
26304
|
+
if (this._parent.classType === "Engine") {
|
|
26496
26305
|
const parent = this._parent;
|
|
26497
26306
|
parent.addScene(this);
|
|
26498
26307
|
if (!parent.hasActiveScene()) parent.setActiveScene(sceneKey);
|
|
26499
26308
|
this._inputManager = new InputManager(this);
|
|
26500
|
-
} else if (this._parent.classType ===
|
|
26309
|
+
} else if (this._parent.classType === "SceneViewer") this._parent.addSubScene(this);
|
|
26501
26310
|
this.disposeWithMe((0, _univerjs_core.toDisposable)((_this$_parent = this._parent) === null || _this$_parent === void 0 ? void 0 : _this$_parent.onTransformChange$.subscribeEvent((_change) => {
|
|
26502
26311
|
this._transformHandler();
|
|
26503
26312
|
})));
|
|
26504
26313
|
}
|
|
26505
26314
|
get classType() {
|
|
26506
|
-
return
|
|
26315
|
+
return "Scene";
|
|
26507
26316
|
}
|
|
26508
26317
|
get transform() {
|
|
26509
26318
|
return this._transform;
|
|
@@ -26547,7 +26356,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26547
26356
|
get ancestorScaleX() {
|
|
26548
26357
|
const p = this.getParent();
|
|
26549
26358
|
let pScale = 1;
|
|
26550
|
-
if (p.classType ===
|
|
26359
|
+
if (p.classType === "SceneViewer") pScale = p.ancestorScaleX;
|
|
26551
26360
|
return this.scaleX * pScale;
|
|
26552
26361
|
}
|
|
26553
26362
|
/**
|
|
@@ -26556,7 +26365,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26556
26365
|
get ancestorScaleY() {
|
|
26557
26366
|
const p = this.getParent();
|
|
26558
26367
|
let pScale = 1;
|
|
26559
|
-
if (p.classType ===
|
|
26368
|
+
if (p.classType === "SceneViewer") pScale = p.ancestorScaleY;
|
|
26560
26369
|
return this.scaleY * pScale;
|
|
26561
26370
|
}
|
|
26562
26371
|
getAncestorScale() {
|
|
@@ -26568,13 +26377,13 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26568
26377
|
get ancestorLeft() {
|
|
26569
26378
|
const p = this.getParent();
|
|
26570
26379
|
let pOffsetX = 0;
|
|
26571
|
-
if (p.classType ===
|
|
26380
|
+
if (p.classType === "SceneViewer") pOffsetX = p.ancestorLeft;
|
|
26572
26381
|
return pOffsetX;
|
|
26573
26382
|
}
|
|
26574
26383
|
get ancestorTop() {
|
|
26575
26384
|
const p = this.getParent();
|
|
26576
26385
|
let pOffsetY = 0;
|
|
26577
|
-
if (p.classType ===
|
|
26386
|
+
if (p.classType === "SceneViewer") pOffsetY = p.ancestorTop;
|
|
26578
26387
|
return pOffsetY;
|
|
26579
26388
|
}
|
|
26580
26389
|
set cursor(val) {
|
|
@@ -26582,7 +26391,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26582
26391
|
}
|
|
26583
26392
|
attachControl(options) {
|
|
26584
26393
|
var _this$_inputManager;
|
|
26585
|
-
if (!(this._parent.classType ===
|
|
26394
|
+
if (!(this._parent.classType === "Engine")) return;
|
|
26586
26395
|
(_this$_inputManager = this._inputManager) === null || _this$_inputManager === void 0 || _this$_inputManager.attachControl(options);
|
|
26587
26396
|
return this;
|
|
26588
26397
|
}
|
|
@@ -26595,7 +26404,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26595
26404
|
this._layers.forEach((layer) => {
|
|
26596
26405
|
layer.makeDirty(state);
|
|
26597
26406
|
});
|
|
26598
|
-
if (this._parent.classType ===
|
|
26407
|
+
if (this._parent.classType === "SceneViewer") {
|
|
26599
26408
|
var _this$_parent2;
|
|
26600
26409
|
(_this$_parent2 = this._parent) === null || _this$_parent2 === void 0 || _this$_parent2.makeDirty(state);
|
|
26601
26410
|
}
|
|
@@ -26649,7 +26458,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26649
26458
|
if (height !== void 0) this.height = height;
|
|
26650
26459
|
this._transformHandler();
|
|
26651
26460
|
this.onTransformChange$.emitEvent({
|
|
26652
|
-
type:
|
|
26461
|
+
type: 1,
|
|
26653
26462
|
value: {
|
|
26654
26463
|
width: this.width,
|
|
26655
26464
|
height: this.height
|
|
@@ -26682,7 +26491,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26682
26491
|
this.setScaleValueOnly(scaleX || 1, scaleY || 1);
|
|
26683
26492
|
this._transformHandler();
|
|
26684
26493
|
this.onTransformChange$.emitEvent({
|
|
26685
|
-
type:
|
|
26494
|
+
type: 2,
|
|
26686
26495
|
value: {
|
|
26687
26496
|
scaleX: this.scaleX,
|
|
26688
26497
|
scaleY: this.scaleY
|
|
@@ -26706,7 +26515,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26706
26515
|
this.scaleY = precisionTo(this.scaleY, 1);
|
|
26707
26516
|
this._transformHandler();
|
|
26708
26517
|
this.onTransformChange$.emitEvent({
|
|
26709
|
-
type:
|
|
26518
|
+
type: 2,
|
|
26710
26519
|
value: {
|
|
26711
26520
|
scaleX: this.scaleX,
|
|
26712
26521
|
scaleY: this.scaleY
|
|
@@ -26734,7 +26543,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26734
26543
|
});
|
|
26735
26544
|
this._transformHandler();
|
|
26736
26545
|
this.onTransformChange$.emitEvent({
|
|
26737
|
-
type:
|
|
26546
|
+
type: 5,
|
|
26738
26547
|
value: state,
|
|
26739
26548
|
preValue: preKeys
|
|
26740
26549
|
});
|
|
@@ -26743,10 +26552,10 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26743
26552
|
return this._parent;
|
|
26744
26553
|
}
|
|
26745
26554
|
getEngine() {
|
|
26746
|
-
if (this._parent.classType ===
|
|
26555
|
+
if (this._parent.classType === "Engine") return this._parent;
|
|
26747
26556
|
let parent = this._parent;
|
|
26748
26557
|
while (parent) {
|
|
26749
|
-
if (parent.classType ===
|
|
26558
|
+
if (parent.classType === "Engine") return parent;
|
|
26750
26559
|
parent = parent === null || parent === void 0 ? void 0 : parent.getParent();
|
|
26751
26560
|
}
|
|
26752
26561
|
return null;
|
|
@@ -27033,18 +26842,18 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27033
26842
|
let parent = this.getParent();
|
|
27034
26843
|
const parentList = [];
|
|
27035
26844
|
while (parent) {
|
|
27036
|
-
if (parent.classType ===
|
|
26845
|
+
if (parent.classType === "Scene" || parent.classType === "SceneViewer") parentList.push(parent);
|
|
27037
26846
|
parent = (parent === null || parent === void 0 ? void 0 : parent.getParent) && (parent === null || parent === void 0 ? void 0 : parent.getParent());
|
|
27038
26847
|
}
|
|
27039
26848
|
parentList.reverse();
|
|
27040
|
-
for (const parent of parentList) if (parent.classType ===
|
|
26849
|
+
for (const parent of parentList) if (parent.classType === "Scene") {
|
|
27041
26850
|
const viewPort = parent.getActiveViewportByCoord(coord);
|
|
27042
26851
|
if (viewPort) {
|
|
27043
26852
|
const actualX = viewPort.viewportScrollX || 0;
|
|
27044
26853
|
const actualY = viewPort.viewportScrollY || 0;
|
|
27045
26854
|
coord = coord.addByPoint(actualX, actualY);
|
|
27046
26855
|
}
|
|
27047
|
-
} else if (parent.classType ===
|
|
26856
|
+
} else if (parent.classType === "SceneViewer") coord = parent.transform.clone().invert().applyPoint(coord);
|
|
27048
26857
|
return coord;
|
|
27049
26858
|
}
|
|
27050
26859
|
clearLayer() {
|
|
@@ -27122,16 +26931,16 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27122
26931
|
for (let i = 0; i < objectLength; i++) {
|
|
27123
26932
|
var _testObject$parent;
|
|
27124
26933
|
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) ===
|
|
26934
|
+
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
26935
|
const svCoord = vecFromSheetContent;
|
|
27127
26936
|
if (testObject.isHit(svCoord)) {
|
|
27128
|
-
if (testObject.classType ===
|
|
26937
|
+
if (testObject.classType === "SceneViewer") {
|
|
27129
26938
|
const pickedObject = testObject.pick(svCoord);
|
|
27130
26939
|
if (pickedObject) isPickedObject = pickedObject;
|
|
27131
26940
|
else isPickedObject = testObject.getActiveSubScene();
|
|
27132
26941
|
} else isPickedObject = testObject;
|
|
27133
26942
|
break;
|
|
27134
|
-
} else if (testObject.classType ===
|
|
26943
|
+
} else if (testObject.classType === "SceneViewer" && testObject.allowSelectedClipElement()) {
|
|
27135
26944
|
const pickedObject = testObject.pick(svCoord);
|
|
27136
26945
|
if (pickedObject) {
|
|
27137
26946
|
isPickedObject = pickedObject;
|
|
@@ -27139,12 +26948,12 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27139
26948
|
}
|
|
27140
26949
|
}
|
|
27141
26950
|
}
|
|
27142
|
-
if (!isPickedObject && this._parent.classType ===
|
|
26951
|
+
if (!isPickedObject && this._parent.classType === "Engine") return this;
|
|
27143
26952
|
return isPickedObject;
|
|
27144
26953
|
}
|
|
27145
26954
|
triggerPointerUp(evt) {
|
|
27146
26955
|
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 ===
|
|
26956
|
+
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
26957
|
var _this$_parent3;
|
|
27149
26958
|
(_this$_parent3 = this._parent) === null || _this$_parent3 === void 0 || _this$_parent3.triggerPointerUp(evt);
|
|
27150
26959
|
return false;
|
|
@@ -27153,7 +26962,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27153
26962
|
}
|
|
27154
26963
|
triggerMouseWheel(evt) {
|
|
27155
26964
|
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 ===
|
|
26965
|
+
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
26966
|
var _this$_parent4;
|
|
27158
26967
|
(_this$_parent4 = this._parent) === null || _this$_parent4 === void 0 || _this$_parent4.triggerMouseWheel(evt);
|
|
27159
26968
|
return false;
|
|
@@ -27162,7 +26971,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27162
26971
|
}
|
|
27163
26972
|
triggerSingleClick(evt) {
|
|
27164
26973
|
var _this$onSingleClick$$;
|
|
27165
|
-
if (!((_this$onSingleClick$$ = this.onSingleClick$.emitEvent(evt)) === null || _this$onSingleClick$$ === void 0 ? void 0 : _this$onSingleClick$$.stopPropagation) && this._parent.classType ===
|
|
26974
|
+
if (!((_this$onSingleClick$$ = this.onSingleClick$.emitEvent(evt)) === null || _this$onSingleClick$$ === void 0 ? void 0 : _this$onSingleClick$$.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27166
26975
|
var _this$_parent5;
|
|
27167
26976
|
(_this$_parent5 = this._parent) === null || _this$_parent5 === void 0 || _this$_parent5.triggerSingleClick(evt);
|
|
27168
26977
|
return false;
|
|
@@ -27171,7 +26980,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27171
26980
|
}
|
|
27172
26981
|
triggerClick(evt) {
|
|
27173
26982
|
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 ===
|
|
26983
|
+
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
26984
|
var _this$_parent6;
|
|
27176
26985
|
(_this$_parent6 = this._parent) === null || _this$_parent6 === void 0 || _this$_parent6.triggerClick(evt);
|
|
27177
26986
|
return false;
|
|
@@ -27180,7 +26989,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27180
26989
|
}
|
|
27181
26990
|
triggerDblclick(evt) {
|
|
27182
26991
|
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 ===
|
|
26992
|
+
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
26993
|
var _this$_parent7;
|
|
27185
26994
|
(_this$_parent7 = this._parent) === null || _this$_parent7 === void 0 || _this$_parent7.triggerDblclick(evt);
|
|
27186
26995
|
return false;
|
|
@@ -27189,7 +26998,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27189
26998
|
}
|
|
27190
26999
|
triggerTripleClick(evt) {
|
|
27191
27000
|
var _this$onTripleClick$$;
|
|
27192
|
-
if (!((_this$onTripleClick$$ = this.onTripleClick$.emitEvent(evt)) === null || _this$onTripleClick$$ === void 0 ? void 0 : _this$onTripleClick$$.stopPropagation) && this._parent.classType ===
|
|
27001
|
+
if (!((_this$onTripleClick$$ = this.onTripleClick$.emitEvent(evt)) === null || _this$onTripleClick$$ === void 0 ? void 0 : _this$onTripleClick$$.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27193
27002
|
var _this$_parent8;
|
|
27194
27003
|
(_this$_parent8 = this._parent) === null || _this$_parent8 === void 0 || _this$_parent8.triggerTripleClick(evt);
|
|
27195
27004
|
return false;
|
|
@@ -27198,7 +27007,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27198
27007
|
}
|
|
27199
27008
|
triggerPointerMove(evt) {
|
|
27200
27009
|
var _this$onPointerMove$$;
|
|
27201
|
-
if (!((_this$onPointerMove$$ = this.onPointerMove$.emitEvent(evt)) === null || _this$onPointerMove$$ === void 0 ? void 0 : _this$onPointerMove$$.stopPropagation) && this._parent.classType ===
|
|
27010
|
+
if (!((_this$onPointerMove$$ = this.onPointerMove$.emitEvent(evt)) === null || _this$onPointerMove$$ === void 0 ? void 0 : _this$onPointerMove$$.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27202
27011
|
var _this$_parent9;
|
|
27203
27012
|
(_this$_parent9 = this._parent) === null || _this$_parent9 === void 0 || _this$_parent9.triggerPointerMove(evt);
|
|
27204
27013
|
return false;
|
|
@@ -27207,7 +27016,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27207
27016
|
}
|
|
27208
27017
|
triggerPointerDown(evt) {
|
|
27209
27018
|
var _this$onPointerDown$$;
|
|
27210
|
-
if (!((_this$onPointerDown$$ = this.onPointerDown$.emitEvent(evt)) === null || _this$onPointerDown$$ === void 0 ? void 0 : _this$onPointerDown$$.stopPropagation) && this._parent.classType ===
|
|
27019
|
+
if (!((_this$onPointerDown$$ = this.onPointerDown$.emitEvent(evt)) === null || _this$onPointerDown$$ === void 0 ? void 0 : _this$onPointerDown$$.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27211
27020
|
var _this$_parent10;
|
|
27212
27021
|
(_this$_parent10 = this._parent) === null || _this$_parent10 === void 0 || _this$_parent10.triggerPointerDown(evt);
|
|
27213
27022
|
return false;
|
|
@@ -27215,7 +27024,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27215
27024
|
return true;
|
|
27216
27025
|
}
|
|
27217
27026
|
triggerPointerOut(evt) {
|
|
27218
|
-
if (this._parent.classType ===
|
|
27027
|
+
if (this._parent.classType === "SceneViewer") {
|
|
27219
27028
|
var _this$_parent11;
|
|
27220
27029
|
(_this$_parent11 = this._parent) === null || _this$_parent11 === void 0 || _this$_parent11.triggerPointerOut(evt);
|
|
27221
27030
|
return false;
|
|
@@ -27224,7 +27033,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27224
27033
|
}
|
|
27225
27034
|
triggerPointerLeave(evt) {
|
|
27226
27035
|
var _this$onPointerLeave$;
|
|
27227
|
-
if (!((_this$onPointerLeave$ = this.onPointerLeave$.emitEvent(evt)) === null || _this$onPointerLeave$ === void 0 ? void 0 : _this$onPointerLeave$.stopPropagation) && this._parent.classType ===
|
|
27036
|
+
if (!((_this$onPointerLeave$ = this.onPointerLeave$.emitEvent(evt)) === null || _this$onPointerLeave$ === void 0 ? void 0 : _this$onPointerLeave$.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27228
27037
|
var _this$_parent12;
|
|
27229
27038
|
(_this$_parent12 = this._parent) === null || _this$_parent12 === void 0 || _this$_parent12.triggerPointerLeave(evt);
|
|
27230
27039
|
return false;
|
|
@@ -27232,7 +27041,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27232
27041
|
return true;
|
|
27233
27042
|
}
|
|
27234
27043
|
triggerPointerOver(evt) {
|
|
27235
|
-
if (this._parent.classType ===
|
|
27044
|
+
if (this._parent.classType === "SceneViewer") {
|
|
27236
27045
|
var _this$_parent13;
|
|
27237
27046
|
(_this$_parent13 = this._parent) === null || _this$_parent13 === void 0 || _this$_parent13.triggerPointerOver(evt);
|
|
27238
27047
|
return false;
|
|
@@ -27240,7 +27049,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27240
27049
|
return true;
|
|
27241
27050
|
}
|
|
27242
27051
|
triggerPointerCancel(evt) {
|
|
27243
|
-
if (this._parent.classType ===
|
|
27052
|
+
if (this._parent.classType === "SceneViewer") {
|
|
27244
27053
|
var _this$_parent14;
|
|
27245
27054
|
(_this$_parent14 = this._parent) === null || _this$_parent14 === void 0 || _this$_parent14.triggerPointerCancel(evt);
|
|
27246
27055
|
return false;
|
|
@@ -27249,7 +27058,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27249
27058
|
}
|
|
27250
27059
|
triggerPointerEnter(evt) {
|
|
27251
27060
|
var _this$onPointerEnter$;
|
|
27252
|
-
if (!((_this$onPointerEnter$ = this.onPointerEnter$.emitEvent(evt)) === null || _this$onPointerEnter$ === void 0 ? void 0 : _this$onPointerEnter$.stopPropagation) && this._parent.classType ===
|
|
27061
|
+
if (!((_this$onPointerEnter$ = this.onPointerEnter$.emitEvent(evt)) === null || _this$onPointerEnter$ === void 0 ? void 0 : _this$onPointerEnter$.stopPropagation) && this._parent.classType === "SceneViewer") {
|
|
27253
27062
|
var _this$_parent15;
|
|
27254
27063
|
(_this$_parent15 = this._parent) === null || _this$_parent15 === void 0 || _this$_parent15.triggerPointerEnter(evt);
|
|
27255
27064
|
return false;
|
|
@@ -27258,7 +27067,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27258
27067
|
}
|
|
27259
27068
|
triggerDragLeave(evt) {
|
|
27260
27069
|
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 ===
|
|
27070
|
+
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
27071
|
var _this$_parent16;
|
|
27263
27072
|
(_this$_parent16 = this._parent) === null || _this$_parent16 === void 0 || _this$_parent16.triggerDragLeave(evt);
|
|
27264
27073
|
return false;
|
|
@@ -27267,7 +27076,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27267
27076
|
}
|
|
27268
27077
|
triggerDragOver(evt) {
|
|
27269
27078
|
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 ===
|
|
27079
|
+
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
27080
|
var _this$_parent17;
|
|
27272
27081
|
(_this$_parent17 = this._parent) === null || _this$_parent17 === void 0 || _this$_parent17.triggerDragOver(evt);
|
|
27273
27082
|
return false;
|
|
@@ -27276,7 +27085,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27276
27085
|
}
|
|
27277
27086
|
triggerDragEnter(evt) {
|
|
27278
27087
|
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 ===
|
|
27088
|
+
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
27089
|
var _this$_parent18;
|
|
27281
27090
|
(_this$_parent18 = this._parent) === null || _this$_parent18 === void 0 || _this$_parent18.triggerDragEnter(evt);
|
|
27282
27091
|
return false;
|
|
@@ -27285,7 +27094,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27285
27094
|
}
|
|
27286
27095
|
triggerDrop(evt) {
|
|
27287
27096
|
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 ===
|
|
27097
|
+
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
27098
|
var _this$_parent19;
|
|
27290
27099
|
(_this$_parent19 = this._parent) === null || _this$_parent19 === void 0 || _this$_parent19.triggerDrop(evt);
|
|
27291
27100
|
return false;
|
|
@@ -27298,10 +27107,11 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27298
27107
|
*
|
|
27299
27108
|
*/
|
|
27300
27109
|
_transformHandler() {
|
|
27301
|
-
|
|
27110
|
+
const composeResult = Transform.create().composeMatrix({
|
|
27302
27111
|
scaleX: this.scaleX,
|
|
27303
27112
|
scaleY: this.scaleY
|
|
27304
27113
|
});
|
|
27114
|
+
this.transform = composeResult;
|
|
27305
27115
|
this.getViewports().forEach((vp) => {
|
|
27306
27116
|
vp.resetCanvasSizeAndUpdateScroll();
|
|
27307
27117
|
});
|
|
@@ -28396,7 +28206,7 @@ var Viewport = class {
|
|
|
28396
28206
|
});
|
|
28397
28207
|
if (isLimitedStore && !isLimitedStore.isLimitedX && !isLimitedStore.isLimitedY) {
|
|
28398
28208
|
evt.preventDefault();
|
|
28399
|
-
if (this._scene.getParent().classType ===
|
|
28209
|
+
if (this._scene.getParent().classType === "SceneViewer") state.stopPropagation();
|
|
28400
28210
|
}
|
|
28401
28211
|
if (this._isWheelPreventDefaultX && this._isWheelPreventDefaultY) evt.preventDefault();
|
|
28402
28212
|
this._scene.makeDirty(true);
|
|
@@ -28754,8 +28564,8 @@ var Viewport = class {
|
|
|
28754
28564
|
_drawScrollbar(ctx) {
|
|
28755
28565
|
if (!this._scrollBar) return;
|
|
28756
28566
|
const parent = this._scene.getParent();
|
|
28757
|
-
if (parent.classType ===
|
|
28758
|
-
else if (parent.classType ===
|
|
28567
|
+
if (parent.classType === "SceneViewer") this._scrollBar.render(ctx);
|
|
28568
|
+
else if (parent.classType === "Engine") this._scrollBar.render(ctx);
|
|
28759
28569
|
}
|
|
28760
28570
|
setViewportSize(props) {
|
|
28761
28571
|
if (_univerjs_core.Tools.isDefine(props === null || props === void 0 ? void 0 : props.top)) this.top = props.top;
|