@univerjs/engine-render 0.21.0 → 0.21.1-insiders.20260509-bf98cad
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -18
- package/lib/cjs/index.js +721 -906
- package/lib/es/index.js +721 -906
- package/lib/types/components/sheets/sheet.render-skeleton.d.ts +1 -0
- package/lib/types/render-manager/render-manager.service.d.ts +4 -4
- package/lib/types/render-manager/render-unit.d.ts +4 -2
- package/lib/umd/index.js +2 -3
- package/package.json +14 -10
- package/LICENSE +0 -176
package/lib/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);
|
|
@@ -17341,6 +17176,8 @@ let SpreadsheetSkeleton = class SpreadsheetSkeleton extends _univerjs_core.Sheet
|
|
|
17341
17176
|
this._resetCache();
|
|
17342
17177
|
this.makeDirty(true);
|
|
17343
17178
|
}));
|
|
17179
|
+
}
|
|
17180
|
+
registerGetCellHeight() {
|
|
17344
17181
|
this.disposeWithMe(this.worksheet.__registerGetCellHeight((row, col) => {
|
|
17345
17182
|
var _this$calculateAutoHe;
|
|
17346
17183
|
return (_this$calculateAutoHe = this.calculateAutoHeightForCell(row, col)) !== null && _this$calculateAutoHe !== void 0 ? _this$calculateAutoHe : 0;
|
|
@@ -17622,7 +17459,7 @@ let SpreadsheetSkeleton = class SpreadsheetSkeleton extends _univerjs_core.Sheet
|
|
|
17622
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;
|
|
17623
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;
|
|
17624
17461
|
if ((style === null || style === void 0 ? void 0 : style.tb) === _univerjs_core.WrapStrategy.WRAP) {
|
|
17625
|
-
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);
|
|
17626
17463
|
skeleton.calculate();
|
|
17627
17464
|
return skeleton.getTotalHeight() + paddingTop + paddingBottom;
|
|
17628
17465
|
} else {
|
|
@@ -17668,14 +17505,14 @@ let SpreadsheetSkeleton = class SpreadsheetSkeleton extends _univerjs_core.Sheet
|
|
|
17668
17505
|
_calculateColWidth(colIndex) {
|
|
17669
17506
|
const worksheet = this.worksheet;
|
|
17670
17507
|
let colWidth = 0;
|
|
17671
|
-
const visibleRangeViewMain = this.visibleRangeByViewportKey(
|
|
17508
|
+
const visibleRangeViewMain = this.visibleRangeByViewportKey("viewMain");
|
|
17672
17509
|
if (!visibleRangeViewMain) return colWidth;
|
|
17673
17510
|
const { startRow: startRowOfViewMain, endRow: endRowOfViewMain } = visibleRangeViewMain;
|
|
17674
17511
|
const rowCount = this.worksheet.getRowCount();
|
|
17675
17512
|
const otherRowIndex = /* @__PURE__ */ new Set();
|
|
17676
17513
|
otherRowIndex.add(0);
|
|
17677
17514
|
otherRowIndex.add(rowCount - 1);
|
|
17678
|
-
const visibleRangeViewMainTop = this.visibleRangeByViewportKey(
|
|
17515
|
+
const visibleRangeViewMainTop = this.visibleRangeByViewportKey("viewMainTop");
|
|
17679
17516
|
if (visibleRangeViewMainTop) {
|
|
17680
17517
|
const { startRow: startRowOfViewMainTop, endRow: endRowOfViewMainTop } = visibleRangeViewMainTop;
|
|
17681
17518
|
for (let i = startRowOfViewMainTop; i <= endRowOfViewMainTop; i++) otherRowIndex.add(i);
|
|
@@ -18104,22 +17941,22 @@ let SpreadsheetSkeleton = class SpreadsheetSkeleton extends _univerjs_core.Sheet
|
|
|
18104
17941
|
if (style && style.bd) {
|
|
18105
17942
|
const mergeRange = options === null || options === void 0 ? void 0 : options.mergeRange;
|
|
18106
17943
|
if (mergeRange) {
|
|
18107
|
-
this._setMergeBorderProps(
|
|
18108
|
-
this._setMergeBorderProps(
|
|
18109
|
-
this._setMergeBorderProps(
|
|
18110
|
-
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);
|
|
18111
17948
|
} else if (!this.intersectMergeRange(row, col)) {
|
|
18112
|
-
this._setBorderProps(row, col,
|
|
18113
|
-
this._setBorderProps(row, col,
|
|
18114
|
-
this._setBorderProps(row, col,
|
|
18115
|
-
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);
|
|
18116
17953
|
}
|
|
18117
|
-
this._setBorderProps(row, col,
|
|
18118
|
-
this._setBorderProps(row, col,
|
|
18119
|
-
this._setBorderProps(row, col,
|
|
18120
|
-
this._setBorderProps(row, col,
|
|
18121
|
-
this._setBorderProps(row, col,
|
|
18122
|
-
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);
|
|
18123
17960
|
}
|
|
18124
17961
|
}
|
|
18125
17962
|
_setBgStylesCache(row, col, style, options) {
|
|
@@ -18240,29 +18077,29 @@ let SpreadsheetSkeleton = class SpreadsheetSkeleton extends _univerjs_core.Sheet
|
|
|
18240
18077
|
let forEnd = mergeRange.endRow;
|
|
18241
18078
|
let row = mergeRange.startRow;
|
|
18242
18079
|
let column = mergeRange.startColumn;
|
|
18243
|
-
if (type ===
|
|
18080
|
+
if (type === "t") {
|
|
18244
18081
|
row = mergeRange.startRow;
|
|
18245
18082
|
forStart = mergeRange.startColumn;
|
|
18246
18083
|
forEnd = mergeRange.endColumn;
|
|
18247
|
-
} else if (type ===
|
|
18084
|
+
} else if (type === "b") {
|
|
18248
18085
|
row = mergeRange.endRow;
|
|
18249
18086
|
forStart = mergeRange.startColumn;
|
|
18250
18087
|
forEnd = mergeRange.endColumn;
|
|
18251
|
-
} else if (type ===
|
|
18088
|
+
} else if (type === "l") {
|
|
18252
18089
|
column = mergeRange.startColumn;
|
|
18253
18090
|
forStart = mergeRange.startRow;
|
|
18254
18091
|
forEnd = mergeRange.endRow;
|
|
18255
|
-
} else if (type ===
|
|
18092
|
+
} else if (type === "r") {
|
|
18256
18093
|
column = mergeRange.endColumn;
|
|
18257
18094
|
forStart = mergeRange.startRow;
|
|
18258
18095
|
forEnd = mergeRange.endRow;
|
|
18259
18096
|
}
|
|
18260
18097
|
for (let i = forStart; i <= forEnd; i++) {
|
|
18261
18098
|
var _cell$themeStyle, _style$bd$type, _style$bd;
|
|
18262
|
-
if (type ===
|
|
18263
|
-
else if (type ===
|
|
18264
|
-
else if (type ===
|
|
18265
|
-
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;
|
|
18266
18103
|
const cell = this.worksheet.getCell(row, column);
|
|
18267
18104
|
if (!cell) break;
|
|
18268
18105
|
const themeStyleBackground = (_cell$themeStyle = cell.themeStyle) === null || _cell$themeStyle === void 0 ? void 0 : _cell$themeStyle.bd;
|
|
@@ -18302,12 +18139,12 @@ let SpreadsheetSkeleton = class SpreadsheetSkeleton extends _univerjs_core.Sheet
|
|
|
18302
18139
|
* When the top border of a cell and the bottom border of the cell above it (r-1) overlap,
|
|
18303
18140
|
* if the top border of cell r is white, then the rendering is ignored.
|
|
18304
18141
|
*/
|
|
18305
|
-
if (type ===
|
|
18142
|
+
if (type === "t") {
|
|
18306
18143
|
var _borderCache$getValue;
|
|
18307
|
-
if (((_borderCache$getValue = borderCache.getValue(r - 1, c)) === null || _borderCache$getValue === void 0 ? void 0 : _borderCache$getValue[
|
|
18308
|
-
} 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") {
|
|
18309
18146
|
var _borderCache$getValue2;
|
|
18310
|
-
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;
|
|
18311
18148
|
}
|
|
18312
18149
|
borderCache.getValue(r, c)[type] = {
|
|
18313
18150
|
type,
|
|
@@ -18706,7 +18543,7 @@ var Font = class extends SheetExtension {
|
|
|
18706
18543
|
const paddingBottom = (_padding$b = padding.b) !== null && _padding$b !== void 0 ? _padding$b : DEFAULT_PADDING_DATA.b;
|
|
18707
18544
|
const { vertexAngle = 0, wrapStrategy, cellData } = fontCache;
|
|
18708
18545
|
if ((cellData === null || cellData === void 0 ? void 0 : cellData.v) === void 0 || (cellData === null || cellData === void 0 ? void 0 : cellData.v) === null) return;
|
|
18709
|
-
const text = (0, _univerjs_core.
|
|
18546
|
+
const text = (0, _univerjs_core.getDisplayValueFromCell)(cellData);
|
|
18710
18547
|
const { startX, startY, endX, endY } = renderFontCtx;
|
|
18711
18548
|
const cellWidth = endX - startX - paddingLeft - paddingRight;
|
|
18712
18549
|
const cellHeight = endY - startY - paddingTop - paddingBottom;
|
|
@@ -19154,7 +18991,7 @@ var DocComponent = class extends RenderComponent {
|
|
|
19154
18991
|
this._skeleton = _skeleton;
|
|
19155
18992
|
_defineProperty(this, "pageMarginLeft", 0);
|
|
19156
18993
|
_defineProperty(this, "pageMarginTop", 0);
|
|
19157
|
-
_defineProperty(this, "pageLayoutType",
|
|
18994
|
+
_defineProperty(this, "pageLayoutType", 0);
|
|
19158
18995
|
this._setConfig(config);
|
|
19159
18996
|
}
|
|
19160
18997
|
getSkeleton() {
|
|
@@ -19169,7 +19006,7 @@ var DocComponent = class extends RenderComponent {
|
|
|
19169
19006
|
if ((config === null || config === void 0 ? void 0 : config.pageMarginTop) != null) this.pageMarginTop = config === null || config === void 0 ? void 0 : config.pageMarginTop;
|
|
19170
19007
|
else this.pageMarginTop = 14;
|
|
19171
19008
|
if ((config === null || config === void 0 ? void 0 : config.pageLayoutType) != null) this.pageLayoutType = config === null || config === void 0 ? void 0 : config.pageLayoutType;
|
|
19172
|
-
else this.pageLayoutType =
|
|
19009
|
+
else this.pageLayoutType = 0;
|
|
19173
19010
|
}
|
|
19174
19011
|
render(mainCtx, bounds) {
|
|
19175
19012
|
if (!this.visible) {
|
|
@@ -19189,7 +19026,7 @@ var DocComponent = class extends RenderComponent {
|
|
|
19189
19026
|
scaleY: 1
|
|
19190
19027
|
};
|
|
19191
19028
|
let { scaleX = 1, scaleY = 1 } = this.parent;
|
|
19192
|
-
if (this.parent.classType ===
|
|
19029
|
+
if (this.parent.classType === "Scene") {
|
|
19193
19030
|
scaleX = this.parent.ancestorScaleX || 1;
|
|
19194
19031
|
scaleY = this.parent.ancestorScaleY || 1;
|
|
19195
19032
|
}
|
|
@@ -19213,15 +19050,10 @@ var DocComponent = class extends RenderComponent {
|
|
|
19213
19050
|
|
|
19214
19051
|
//#endregion
|
|
19215
19052
|
//#region src/components/docs/doc-extension.ts
|
|
19216
|
-
let DOCS_EXTENSION_TYPE = /* @__PURE__ */ function(DOCS_EXTENSION_TYPE) {
|
|
19217
|
-
DOCS_EXTENSION_TYPE[DOCS_EXTENSION_TYPE["SPAN"] = 0] = "SPAN";
|
|
19218
|
-
DOCS_EXTENSION_TYPE[DOCS_EXTENSION_TYPE["LINE"] = 1] = "LINE";
|
|
19219
|
-
return DOCS_EXTENSION_TYPE;
|
|
19220
|
-
}({});
|
|
19221
19053
|
var docExtension = class extends ComponentExtension {
|
|
19222
19054
|
constructor(..._args) {
|
|
19223
19055
|
super(..._args);
|
|
19224
|
-
_defineProperty(this, "type",
|
|
19056
|
+
_defineProperty(this, "type", 0);
|
|
19225
19057
|
_defineProperty(this, "translateX", 0);
|
|
19226
19058
|
_defineProperty(this, "translateY", 0);
|
|
19227
19059
|
}
|
|
@@ -19316,10 +19148,10 @@ var Border$1 = class extends docExtension {
|
|
|
19316
19148
|
_createBorderCache(borderData) {
|
|
19317
19149
|
const { t, b, l, r } = borderData;
|
|
19318
19150
|
const borderCache = /* @__PURE__ */ new Map();
|
|
19319
|
-
t && borderCache.set(
|
|
19320
|
-
b && borderCache.set(
|
|
19321
|
-
l && borderCache.set(
|
|
19322
|
-
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);
|
|
19323
19155
|
return borderCache;
|
|
19324
19156
|
}
|
|
19325
19157
|
};
|
|
@@ -19371,12 +19203,12 @@ var Circle = class Circle extends Shape {
|
|
|
19371
19203
|
constructor(key, props) {
|
|
19372
19204
|
super(key, props);
|
|
19373
19205
|
_defineProperty(this, "_radius", void 0);
|
|
19374
|
-
_defineProperty(this, "objectType",
|
|
19206
|
+
_defineProperty(this, "objectType", 5);
|
|
19375
19207
|
this._radius = (props === null || props === void 0 ? void 0 : props.radius) || 10;
|
|
19376
19208
|
this._setFixBoundingBox();
|
|
19377
19209
|
this.onTransformChange$.subscribeEvent((changeState) => {
|
|
19378
19210
|
const { type, value, preValue } = changeState;
|
|
19379
|
-
if (type ===
|
|
19211
|
+
if (type === 1 || type === 5) {
|
|
19380
19212
|
const value = Math.min(this.width, this.height);
|
|
19381
19213
|
this._radius = value / 2;
|
|
19382
19214
|
this.width = value;
|
|
@@ -19445,7 +19277,7 @@ const RECT_OBJECT_ARRAY = ["radius"];
|
|
|
19445
19277
|
var Rect = class Rect extends Shape {
|
|
19446
19278
|
constructor(key, props) {
|
|
19447
19279
|
super(key, props);
|
|
19448
|
-
_defineProperty(this, "objectType",
|
|
19280
|
+
_defineProperty(this, "objectType", 4);
|
|
19449
19281
|
_defineProperty(this, "_radius", 0);
|
|
19450
19282
|
_defineProperty(this, "_opacity", 1);
|
|
19451
19283
|
_defineProperty(this, "_visualHeight", void 0);
|
|
@@ -19633,7 +19465,7 @@ var Image$1 = class extends Shape {
|
|
|
19633
19465
|
_defineProperty(this, "_renderByCropper", false);
|
|
19634
19466
|
_defineProperty(this, "_transformCalculateSrcRect", true);
|
|
19635
19467
|
_defineProperty(this, "_clipService", null);
|
|
19636
|
-
_defineProperty(this, "objectType",
|
|
19468
|
+
_defineProperty(this, "objectType", 3);
|
|
19637
19469
|
_defineProperty(this, "isDrawingObject", true);
|
|
19638
19470
|
this._props = { ...config };
|
|
19639
19471
|
if (config.image) {
|
|
@@ -19681,7 +19513,7 @@ var Image$1 = class extends Shape {
|
|
|
19681
19513
|
return this._clipService;
|
|
19682
19514
|
}
|
|
19683
19515
|
get classType() {
|
|
19684
|
-
return
|
|
19516
|
+
return "Image";
|
|
19685
19517
|
}
|
|
19686
19518
|
transformByStateCloseCropper(option) {
|
|
19687
19519
|
this._transformCalculateSrcRect = false;
|
|
@@ -19899,7 +19731,7 @@ var Image$1 = class extends Shape {
|
|
|
19899
19731
|
centerY
|
|
19900
19732
|
]);
|
|
19901
19733
|
const parent = this.getParent();
|
|
19902
|
-
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);
|
|
19903
19735
|
const halfWidth = realWidth / 2;
|
|
19904
19736
|
const halfHeight = realHeight / 2;
|
|
19905
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;
|
|
@@ -19928,7 +19760,7 @@ var Path = class Path extends Shape {
|
|
|
19928
19760
|
this._setFixBoundingBox();
|
|
19929
19761
|
this.onTransformChange$.subscribeEvent((changeState) => {
|
|
19930
19762
|
const { type, preValue } = changeState;
|
|
19931
|
-
if (type ===
|
|
19763
|
+
if (type === 1 || type === 5) {
|
|
19932
19764
|
this._reCalculateCache = true;
|
|
19933
19765
|
const { left, top, width, height } = this._getSelfRect();
|
|
19934
19766
|
const { width: preWidth, height: preHeight } = preValue;
|
|
@@ -20596,7 +20428,7 @@ var RegularPolygon = class RegularPolygon extends Shape {
|
|
|
20596
20428
|
this._setFixBoundingBox();
|
|
20597
20429
|
this.onTransformChange$.subscribeEvent((changeState) => {
|
|
20598
20430
|
const { type, value, preValue } = changeState;
|
|
20599
|
-
if (type ===
|
|
20431
|
+
if (type === 1 || type === 5) this.resizePolygon(preValue);
|
|
20600
20432
|
});
|
|
20601
20433
|
}
|
|
20602
20434
|
get pointsGroup() {
|
|
@@ -20763,7 +20595,7 @@ var RichText = class extends BaseObject {
|
|
|
20763
20595
|
_defineProperty(this, "_bg", void 0);
|
|
20764
20596
|
_defineProperty(this, "_bd", void 0);
|
|
20765
20597
|
_defineProperty(this, "_cl", void 0);
|
|
20766
|
-
_defineProperty(this, "objectType",
|
|
20598
|
+
_defineProperty(this, "objectType", 1);
|
|
20767
20599
|
if (props === null || props === void 0 ? void 0 : props.richText) this._documentData = props.richText;
|
|
20768
20600
|
else if (props) {
|
|
20769
20601
|
this._fs = props.fs;
|
|
@@ -20788,7 +20620,7 @@ var RichText = class extends BaseObject {
|
|
|
20788
20620
|
this._initialProps(props);
|
|
20789
20621
|
this.onTransformChange$.subscribeEvent((changeState) => {
|
|
20790
20622
|
const { type } = changeState;
|
|
20791
|
-
if (type ===
|
|
20623
|
+
if (type === 1 || type === 5) {
|
|
20792
20624
|
docModel.updateDocumentDataPageSize(this.width);
|
|
20793
20625
|
this._documentSkeleton.makeDirty(true);
|
|
20794
20626
|
this._documentSkeleton.calculate();
|
|
@@ -21481,7 +21313,7 @@ var FontAndBaseLine = class extends docExtension {
|
|
|
21481
21313
|
ctx.restore();
|
|
21482
21314
|
} else {
|
|
21483
21315
|
const CHECKED_GLYPH = "☑";
|
|
21484
|
-
if ((content === "☐" || content === CHECKED_GLYPH) && glyph.glyphType ===
|
|
21316
|
+
if ((content === "☐" || content === CHECKED_GLYPH) && glyph.glyphType === 2) {
|
|
21485
21317
|
var _glyph$ts$fs, _glyph$ts;
|
|
21486
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);
|
|
21487
21319
|
ctx.save();
|
|
@@ -21740,7 +21572,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
21740
21572
|
const extensions = this.getExtensionsByOrder();
|
|
21741
21573
|
for (const extension of extensions) extension.clearCache();
|
|
21742
21574
|
const backgroundExtension = extensions.find((e) => e.uKey === "DefaultDocsBackgroundExtension");
|
|
21743
|
-
const glyphExtensionsExcludeBackground = extensions.filter((e) => e.type ===
|
|
21575
|
+
const glyphExtensionsExcludeBackground = extensions.filter((e) => e.type === 0 && e.uKey !== "DefaultDocsBackgroundExtension");
|
|
21744
21576
|
let pageTop = 0;
|
|
21745
21577
|
let pageLeft = 0;
|
|
21746
21578
|
for (let i = 0, len = pages.length; i < len; i++) {
|
|
@@ -21798,8 +21630,8 @@ var Documents = class Documents extends DocComponent {
|
|
|
21798
21630
|
const maxLineAsc = asc;
|
|
21799
21631
|
const maxLineAscSin = maxLineAsc * Math.sin(centerAngle);
|
|
21800
21632
|
const maxLineAscCos = maxLineAsc * Math.cos(centerAngle);
|
|
21801
|
-
if (type ===
|
|
21802
|
-
for (const extension of extensions) if (extension.type ===
|
|
21633
|
+
if (type === 1) {
|
|
21634
|
+
for (const extension of extensions) if (extension.type === 1) {
|
|
21803
21635
|
extension.extensionOffset = {
|
|
21804
21636
|
alignOffset,
|
|
21805
21637
|
renderConfig
|
|
@@ -21909,7 +21741,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
21909
21741
|
ctx.save();
|
|
21910
21742
|
ctx.setLineWidthByPrecision(1);
|
|
21911
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";
|
|
21912
|
-
drawLineByBorderType(ctx,
|
|
21744
|
+
drawLineByBorderType(ctx, "b", 0, {
|
|
21913
21745
|
startX: x,
|
|
21914
21746
|
startY: y,
|
|
21915
21747
|
endX: x + pageWidth - marginLeft - marginRight,
|
|
@@ -21945,8 +21777,8 @@ var Documents = class Documents extends DocComponent {
|
|
|
21945
21777
|
const maxLineAsc = asc;
|
|
21946
21778
|
const maxLineAscSin = maxLineAsc * Math.sin(centerAngle);
|
|
21947
21779
|
const maxLineAscCos = maxLineAsc * Math.cos(centerAngle);
|
|
21948
|
-
if (type ===
|
|
21949
|
-
for (const extension of extensions) if (extension.type ===
|
|
21780
|
+
if (type === 1) {
|
|
21781
|
+
for (const extension of extensions) if (extension.type === 1) {
|
|
21950
21782
|
extension.extensionOffset = {
|
|
21951
21783
|
alignOffset,
|
|
21952
21784
|
renderConfig
|
|
@@ -22026,7 +21858,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
22026
21858
|
ctx.setLineWidthByPrecision(1);
|
|
22027
21859
|
ctx.save();
|
|
22028
21860
|
ctx.strokeStyle = (_borderLeft$color$rgb = borderLeft.color.rgb) !== null && _borderLeft$color$rgb !== void 0 ? _borderLeft$color$rgb : DEFAULT_BORDER_COLOR.color.rgb;
|
|
22029
|
-
drawLineByBorderType(ctx,
|
|
21861
|
+
drawLineByBorderType(ctx, "l", 0, {
|
|
22030
21862
|
startX: x,
|
|
22031
21863
|
startY: y,
|
|
22032
21864
|
endX: x + pageWidth,
|
|
@@ -22035,7 +21867,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
22035
21867
|
ctx.restore();
|
|
22036
21868
|
ctx.save();
|
|
22037
21869
|
ctx.strokeStyle = (_borderTop$color$rgb = borderTop.color.rgb) !== null && _borderTop$color$rgb !== void 0 ? _borderTop$color$rgb : DEFAULT_BORDER_COLOR.color.rgb;
|
|
22038
|
-
drawLineByBorderType(ctx,
|
|
21870
|
+
drawLineByBorderType(ctx, "t", 0, {
|
|
22039
21871
|
startX: x,
|
|
22040
21872
|
startY: y,
|
|
22041
21873
|
endX: x + pageWidth,
|
|
@@ -22044,7 +21876,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
22044
21876
|
ctx.restore();
|
|
22045
21877
|
ctx.save();
|
|
22046
21878
|
ctx.strokeStyle = (_borderRight$color$rg = borderRight.color.rgb) !== null && _borderRight$color$rg !== void 0 ? _borderRight$color$rg : DEFAULT_BORDER_COLOR.color.rgb;
|
|
22047
|
-
drawLineByBorderType(ctx,
|
|
21879
|
+
drawLineByBorderType(ctx, "r", 0, {
|
|
22048
21880
|
startX: x,
|
|
22049
21881
|
startY: y,
|
|
22050
21882
|
endX: x + pageWidth,
|
|
@@ -22053,7 +21885,7 @@ var Documents = class Documents extends DocComponent {
|
|
|
22053
21885
|
ctx.restore();
|
|
22054
21886
|
ctx.save();
|
|
22055
21887
|
ctx.strokeStyle = (_borderBottom$color$r = borderBottom.color.rgb) !== null && _borderBottom$color$r !== void 0 ? _borderBottom$color$r : DEFAULT_BORDER_COLOR.color.rgb;
|
|
22056
|
-
drawLineByBorderType(ctx,
|
|
21888
|
+
drawLineByBorderType(ctx, "b", 0, {
|
|
22057
21889
|
startX: x,
|
|
22058
21890
|
startY: y,
|
|
22059
21891
|
endX: x + pageWidth,
|
|
@@ -22082,8 +21914,8 @@ var Documents = class Documents extends DocComponent {
|
|
|
22082
21914
|
const maxLineAsc = asc;
|
|
22083
21915
|
const maxLineAscSin = maxLineAsc * Math.sin(centerAngle);
|
|
22084
21916
|
const maxLineAscCos = maxLineAsc * Math.cos(centerAngle);
|
|
22085
|
-
if (type ===
|
|
22086
|
-
for (const extension of extensions) if (extension.type ===
|
|
21917
|
+
if (type === 1) {
|
|
21918
|
+
for (const extension of extensions) if (extension.type === 1) {
|
|
22087
21919
|
extension.extensionOffset = {
|
|
22088
21920
|
alignOffset,
|
|
22089
21921
|
renderConfig
|
|
@@ -22506,14 +22338,14 @@ var Spreadsheet = class extends SheetComponent {
|
|
|
22506
22338
|
_getAncestorSize() {
|
|
22507
22339
|
const parent = this._getAncestorParent();
|
|
22508
22340
|
if (!parent) return;
|
|
22509
|
-
if (parent.classType ===
|
|
22341
|
+
if (parent.classType === "Engine") {
|
|
22510
22342
|
const mainCanvas = parent.getCanvas();
|
|
22511
22343
|
return {
|
|
22512
22344
|
width: mainCanvas.getWidth(),
|
|
22513
22345
|
height: mainCanvas.getHeight()
|
|
22514
22346
|
};
|
|
22515
22347
|
}
|
|
22516
|
-
if (parent.classType ===
|
|
22348
|
+
if (parent.classType === "SceneViewer") return {
|
|
22517
22349
|
width: parent.width,
|
|
22518
22350
|
height: parent.height
|
|
22519
22351
|
};
|
|
@@ -22521,7 +22353,7 @@ var Spreadsheet = class extends SheetComponent {
|
|
|
22521
22353
|
_getAncestorParent() {
|
|
22522
22354
|
let parent = this.parent;
|
|
22523
22355
|
while (parent) {
|
|
22524
|
-
if (parent.classType ===
|
|
22356
|
+
if (parent.classType === "Engine" || parent.classType === "SceneViewer") return parent;
|
|
22525
22357
|
parent = (parent === null || parent === void 0 ? void 0 : parent.getParent) && (parent === null || parent === void 0 ? void 0 : parent.getParent());
|
|
22526
22358
|
}
|
|
22527
22359
|
}
|
|
@@ -22778,9 +22610,9 @@ let IWatermarkTypeEnum = /* @__PURE__ */ function(IWatermarkTypeEnum) {
|
|
|
22778
22610
|
function renderWatermark(ctx, config, image, userInfo) {
|
|
22779
22611
|
const type = config.type;
|
|
22780
22612
|
const watermarkConfig = config.config;
|
|
22781
|
-
if (type ===
|
|
22782
|
-
else if (type ===
|
|
22783
|
-
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);
|
|
22784
22616
|
}
|
|
22785
22617
|
function renderUserInfoWatermark(ctx, config, userInfo) {
|
|
22786
22618
|
const { x, y, repeat, spacingX, spacingY, rotate, opacity, name, fontSize, color, bold, italic, direction } = config;
|
|
@@ -22936,7 +22768,7 @@ var Layer = class extends _univerjs_core.Disposable {
|
|
|
22936
22768
|
* @returns {Layer} this
|
|
22937
22769
|
*/
|
|
22938
22770
|
addObject(o) {
|
|
22939
|
-
if (o.classType ===
|
|
22771
|
+
if (o.classType === "Group") {
|
|
22940
22772
|
const objects = o.getObjects();
|
|
22941
22773
|
for (const object of objects) {
|
|
22942
22774
|
if (this.scene.getObject(object.oKey)) continue;
|
|
@@ -22998,7 +22830,7 @@ var Layer = class extends _univerjs_core.Disposable {
|
|
|
22998
22830
|
* parent is SceneViewer, make it dirty
|
|
22999
22831
|
*/
|
|
23000
22832
|
const parent = this.scene.getParent();
|
|
23001
|
-
if (parent.classType ===
|
|
22833
|
+
if (parent.classType === "SceneViewer") parent.makeDirty(true);
|
|
23002
22834
|
return this;
|
|
23003
22835
|
}
|
|
23004
22836
|
makeDirtyWithDebounce(state = true) {
|
|
@@ -23105,7 +22937,7 @@ var WatermarkLayer = class extends Layer {
|
|
|
23105
22937
|
updateConfig(config, user) {
|
|
23106
22938
|
var _this$_config;
|
|
23107
22939
|
this._config = config;
|
|
23108
|
-
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) {
|
|
23109
22941
|
this._image = new Image();
|
|
23110
22942
|
this._image.src = this._config.config.image.url;
|
|
23111
22943
|
}
|
|
@@ -23143,7 +22975,7 @@ var SceneViewer = class extends BaseObject {
|
|
|
23143
22975
|
this._initialProps(props);
|
|
23144
22976
|
}
|
|
23145
22977
|
get classType() {
|
|
23146
|
-
return
|
|
22978
|
+
return "SceneViewer";
|
|
23147
22979
|
}
|
|
23148
22980
|
render(mainCtx, bounds) {
|
|
23149
22981
|
var _this$_activeSubScene;
|
|
@@ -23270,7 +23102,7 @@ var Slide = class extends SceneViewer {
|
|
|
23270
23102
|
addNavigation() {
|
|
23271
23103
|
const scene = this.getActiveSubScene();
|
|
23272
23104
|
if (scene == null || this._navigationEnabled === false) return;
|
|
23273
|
-
const leftArrow = new Path(
|
|
23105
|
+
const leftArrow = new Path("__slideNavigationLeft__", {
|
|
23274
23106
|
data: arrowPath,
|
|
23275
23107
|
width: 60,
|
|
23276
23108
|
height: 60,
|
|
@@ -23279,7 +23111,7 @@ var Slide = class extends SceneViewer {
|
|
|
23279
23111
|
fill: this._getArrowColor(),
|
|
23280
23112
|
flipX: true
|
|
23281
23113
|
});
|
|
23282
|
-
const rightArrow = new Path(
|
|
23114
|
+
const rightArrow = new Path("__slideNavigationRight__", {
|
|
23283
23115
|
data: arrowPath,
|
|
23284
23116
|
width: 60,
|
|
23285
23117
|
height: 60,
|
|
@@ -23288,11 +23120,11 @@ var Slide = class extends SceneViewer {
|
|
|
23288
23120
|
fill: this._getArrowColor()
|
|
23289
23121
|
});
|
|
23290
23122
|
const hoverIn = (o, evt) => {
|
|
23291
|
-
o.setCursor(
|
|
23123
|
+
o.setCursor("pointer");
|
|
23292
23124
|
o.setProps({ fill: this._getArrowColor(true) });
|
|
23293
23125
|
};
|
|
23294
23126
|
const hoverOut = (o, evt) => {
|
|
23295
|
-
o.setCursor(
|
|
23127
|
+
o.setCursor("default");
|
|
23296
23128
|
o.setProps({ fill: this._getArrowColor() });
|
|
23297
23129
|
};
|
|
23298
23130
|
attachObjectHover(leftArrow, hoverIn, hoverOut);
|
|
@@ -23304,8 +23136,8 @@ var Slide = class extends SceneViewer {
|
|
|
23304
23136
|
var _scene$getObject, _scene$getObject2;
|
|
23305
23137
|
const scene = this.getActiveSubScene();
|
|
23306
23138
|
if (scene == null || this._navigationEnabled === false) return;
|
|
23307
|
-
(_scene$getObject = scene.getObject(
|
|
23308
|
-
(_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();
|
|
23309
23141
|
}
|
|
23310
23142
|
enableNav() {
|
|
23311
23143
|
this._navigationEnabled = true;
|
|
@@ -23317,15 +23149,15 @@ var Slide = class extends SceneViewer {
|
|
|
23317
23149
|
var _scene$getObject3, _scene$getObject4;
|
|
23318
23150
|
const scene = this.getActiveSubScene();
|
|
23319
23151
|
if (scene == null || this._navigationEnabled === false) return;
|
|
23320
|
-
(_scene$getObject3 = scene.getObject(
|
|
23321
|
-
(_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();
|
|
23322
23154
|
}
|
|
23323
23155
|
showNav() {
|
|
23324
23156
|
var _scene$getObject5, _scene$getObject6;
|
|
23325
23157
|
const scene = this.getActiveSubScene();
|
|
23326
23158
|
if (scene == null || this._navigationEnabled === false) return;
|
|
23327
|
-
(_scene$getObject5 = scene.getObject(
|
|
23328
|
-
(_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();
|
|
23329
23161
|
}
|
|
23330
23162
|
renderToThumb(mainCtx, pageId, scaleX = 1, scaleY = 1) {
|
|
23331
23163
|
const scene = this.getSubScene(pageId);
|
|
@@ -23539,7 +23371,7 @@ var Group = class extends BaseObject {
|
|
|
23539
23371
|
this.addObjects(...objects);
|
|
23540
23372
|
}
|
|
23541
23373
|
get classType() {
|
|
23542
|
-
return
|
|
23374
|
+
return "Group";
|
|
23543
23375
|
}
|
|
23544
23376
|
set cursor(val) {
|
|
23545
23377
|
this.setCursor(val);
|
|
@@ -23659,7 +23491,7 @@ var Group = class extends BaseObject {
|
|
|
23659
23491
|
}
|
|
23660
23492
|
_transformObject(object, groupWidth, groupHeight) {
|
|
23661
23493
|
const transform = transformObjectOutOfGroup(object.getState(), this.getState(), groupWidth, groupHeight);
|
|
23662
|
-
if (object.classType ===
|
|
23494
|
+
if (object.classType === "Group") object.transformByState({
|
|
23663
23495
|
left: transform.left,
|
|
23664
23496
|
top: transform.top
|
|
23665
23497
|
});
|
|
@@ -23743,7 +23575,7 @@ var DrawingGroupObject = class extends Group {
|
|
|
23743
23575
|
centerY
|
|
23744
23576
|
]);
|
|
23745
23577
|
const parent = this.getParent();
|
|
23746
|
-
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);
|
|
23747
23579
|
return renderTransform;
|
|
23748
23580
|
}
|
|
23749
23581
|
render(ctx, bounds) {
|
|
@@ -23774,7 +23606,7 @@ var DrawingGroupObject = class extends Group {
|
|
|
23774
23606
|
centerY
|
|
23775
23607
|
]);
|
|
23776
23608
|
const parent = this.getParent();
|
|
23777
|
-
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);
|
|
23778
23610
|
const halfWidth = realWidth / 2;
|
|
23779
23611
|
const halfHeight = realHeight / 2;
|
|
23780
23612
|
if (oCoord.x < -halfWidth || oCoord.x > halfWidth || oCoord.y < -halfHeight || oCoord.y > halfHeight) return false;
|
|
@@ -24018,7 +23850,7 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24018
23850
|
return this.getCanvas().getHeight();
|
|
24019
23851
|
}
|
|
24020
23852
|
get classType() {
|
|
24021
|
-
return
|
|
23853
|
+
return "Engine";
|
|
24022
23854
|
}
|
|
24023
23855
|
get activeScene() {
|
|
24024
23856
|
return this._activeScene;
|
|
@@ -24088,7 +23920,7 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24088
23920
|
const options = Object.assign({}, {
|
|
24089
23921
|
elementHeight: 1,
|
|
24090
23922
|
elementWidth: 1,
|
|
24091
|
-
renderMode:
|
|
23923
|
+
renderMode: 0,
|
|
24092
23924
|
dpr: 1
|
|
24093
23925
|
}, _options);
|
|
24094
23926
|
this._canvas = new Canvas({
|
|
@@ -24102,7 +23934,7 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24102
23934
|
this._handleKeyboardAction();
|
|
24103
23935
|
this._handlePointerAction();
|
|
24104
23936
|
this._handleDragAction();
|
|
24105
|
-
if (options.renderMode !==
|
|
23937
|
+
if (options.renderMode !== 1) this._matchMediaHandler();
|
|
24106
23938
|
}
|
|
24107
23939
|
getScenes() {
|
|
24108
23940
|
return this._scenes;
|
|
@@ -24235,7 +24067,7 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24235
24067
|
const preHeight = this.height;
|
|
24236
24068
|
this.getCanvas().setSize(width, height);
|
|
24237
24069
|
this.onTransformChange$.emitEvent({
|
|
24238
|
-
type:
|
|
24070
|
+
type: 1,
|
|
24239
24071
|
value: {
|
|
24240
24072
|
width,
|
|
24241
24073
|
height
|
|
@@ -24381,13 +24213,13 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24381
24213
|
_handleKeyboardAction() {
|
|
24382
24214
|
const keyboardDownEvent = (evt) => {
|
|
24383
24215
|
const deviceEvent = evt;
|
|
24384
|
-
deviceEvent.deviceType =
|
|
24216
|
+
deviceEvent.deviceType = 1;
|
|
24385
24217
|
deviceEvent.inputIndex = evt.keyCode;
|
|
24386
24218
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24387
24219
|
};
|
|
24388
24220
|
const keyboardUpEvent = (evt) => {
|
|
24389
24221
|
const deviceEvent = evt;
|
|
24390
|
-
deviceEvent.deviceType =
|
|
24222
|
+
deviceEvent.deviceType = 1;
|
|
24391
24223
|
deviceEvent.inputIndex = evt.keyCode;
|
|
24392
24224
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24393
24225
|
};
|
|
@@ -24412,13 +24244,13 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24412
24244
|
this._pointerMoveEvent = (e) => {
|
|
24413
24245
|
const evt = e;
|
|
24414
24246
|
const deviceType = this._getPointerType(evt);
|
|
24415
|
-
this._pointerPosRecord[
|
|
24416
|
-
this._pointerPosRecord[
|
|
24417
|
-
this._pointerPosRecord[
|
|
24418
|
-
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;
|
|
24419
24251
|
const deviceEvent = evt;
|
|
24420
24252
|
deviceEvent.deviceType = deviceType;
|
|
24421
|
-
deviceEvent.inputIndex =
|
|
24253
|
+
deviceEvent.inputIndex = 0;
|
|
24422
24254
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24423
24255
|
if (!this._usingSafari) {
|
|
24424
24256
|
deviceEvent.inputIndex = evt.button + 2;
|
|
@@ -24428,23 +24260,23 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24428
24260
|
this._pointerDownEvent = (nativeEvent) => {
|
|
24429
24261
|
const evt = nativeEvent;
|
|
24430
24262
|
const deviceType = this._getPointerType(evt);
|
|
24431
|
-
const previousHorizontal = this._pointerPosRecord[
|
|
24432
|
-
const previousVertical = this._pointerPosRecord[
|
|
24433
|
-
if (deviceType ===
|
|
24263
|
+
const previousHorizontal = this._pointerPosRecord[0];
|
|
24264
|
+
const previousVertical = this._pointerPosRecord[1];
|
|
24265
|
+
if (deviceType === 2) {
|
|
24434
24266
|
if (this._mouseId === -1) if (evt.pointerId === void 0) this._mouseId = this._isUsingFirefox ? 0 : 1;
|
|
24435
24267
|
else this._mouseId = evt.pointerId;
|
|
24436
24268
|
if (!document.pointerLockElement) this._remainCapture = this._mouseId;
|
|
24437
24269
|
} else if (evt.pointerId && !document.pointerLockElement) this._remainCapture = evt.pointerId;
|
|
24438
|
-
this._pointerPosRecord[
|
|
24439
|
-
this._pointerPosRecord[
|
|
24270
|
+
this._pointerPosRecord[0] = evt.clientX;
|
|
24271
|
+
this._pointerPosRecord[1] = evt.clientY;
|
|
24440
24272
|
const deviceEvent = evt;
|
|
24441
24273
|
deviceEvent.deviceType = deviceType;
|
|
24442
24274
|
if (previousHorizontal !== evt.clientX) {
|
|
24443
|
-
deviceEvent.inputIndex =
|
|
24275
|
+
deviceEvent.inputIndex = 0;
|
|
24444
24276
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24445
24277
|
}
|
|
24446
24278
|
if (previousVertical !== evt.clientY) {
|
|
24447
|
-
deviceEvent.inputIndex =
|
|
24279
|
+
deviceEvent.inputIndex = 1;
|
|
24448
24280
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24449
24281
|
}
|
|
24450
24282
|
deviceEvent.inputIndex = evt.button + 2;
|
|
@@ -24453,23 +24285,23 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24453
24285
|
this._pointerUpEvent = (_evt) => {
|
|
24454
24286
|
const evt = _evt;
|
|
24455
24287
|
const deviceType = this._getPointerType(evt);
|
|
24456
|
-
const previousHorizontal = this._pointerPosRecord[
|
|
24457
|
-
const previousVertical = this._pointerPosRecord[
|
|
24458
|
-
this._pointerPosRecord[
|
|
24459
|
-
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;
|
|
24460
24292
|
const deviceEvent = evt;
|
|
24461
24293
|
deviceEvent.deviceType = deviceType;
|
|
24462
24294
|
if (previousHorizontal !== evt.clientX) {
|
|
24463
|
-
deviceEvent.inputIndex =
|
|
24295
|
+
deviceEvent.inputIndex = 0;
|
|
24464
24296
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24465
24297
|
}
|
|
24466
24298
|
if (previousVertical !== evt.clientY) {
|
|
24467
|
-
deviceEvent.inputIndex =
|
|
24299
|
+
deviceEvent.inputIndex = 1;
|
|
24468
24300
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24469
24301
|
}
|
|
24470
24302
|
deviceEvent.inputIndex = evt.button + 2;
|
|
24471
24303
|
const canvasEle = this.getCanvasElement();
|
|
24472
|
-
if (deviceType ===
|
|
24304
|
+
if (deviceType === 2 && this._mouseId >= 0 && canvasEle.hasPointerCapture(this._mouseId)) {
|
|
24473
24305
|
this._remainCapture = this._mouseId;
|
|
24474
24306
|
canvasEle.releasePointerCapture(this._mouseId);
|
|
24475
24307
|
} else if (deviceEvent.pointerId && canvasEle.hasPointerCapture(deviceEvent.pointerId)) {
|
|
@@ -24477,7 +24309,7 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24477
24309
|
canvasEle.releasePointerCapture(deviceEvent.pointerId);
|
|
24478
24310
|
}
|
|
24479
24311
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24480
|
-
if (deviceType !==
|
|
24312
|
+
if (deviceType !== 2) this._pointerPosRecord = {};
|
|
24481
24313
|
};
|
|
24482
24314
|
this._pointerEnterEvent = (evt) => {
|
|
24483
24315
|
const deviceType = this._getPointerType(evt);
|
|
@@ -24508,15 +24340,15 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24508
24340
|
this._pointerPosRecord = {};
|
|
24509
24341
|
};
|
|
24510
24342
|
this._pointerWheelEvent = (evt) => {
|
|
24511
|
-
const deviceType =
|
|
24512
|
-
this._pointerPosRecord[
|
|
24513
|
-
this._pointerPosRecord[
|
|
24514
|
-
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;
|
|
24515
24347
|
const deviceEvent = evt;
|
|
24516
24348
|
deviceEvent.deviceType = deviceType;
|
|
24517
|
-
if (this._pointerPosRecord[
|
|
24518
|
-
if (this._pointerPosRecord[
|
|
24519
|
-
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];
|
|
24520
24352
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24521
24353
|
};
|
|
24522
24354
|
const canvasEle = this.getCanvasElement();
|
|
@@ -24550,32 +24382,32 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24550
24382
|
this._dragOverEvent = (evt) => {
|
|
24551
24383
|
evt.preventDefault();
|
|
24552
24384
|
const deviceType = this._getPointerType(evt);
|
|
24553
|
-
const previousHorizontal = this._pointerPosRecord[
|
|
24554
|
-
const previousVertical = this._pointerPosRecord[
|
|
24555
|
-
this._pointerPosRecord[
|
|
24556
|
-
this._pointerPosRecord[
|
|
24557
|
-
this._pointerPosRecord[
|
|
24558
|
-
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;
|
|
24559
24391
|
const deviceEvent = evt;
|
|
24560
24392
|
deviceEvent.deviceType = deviceType;
|
|
24561
24393
|
if (previousHorizontal !== evt.clientX) {
|
|
24562
|
-
deviceEvent.inputIndex =
|
|
24563
|
-
deviceEvent.currentState = this._pointerPosRecord[
|
|
24394
|
+
deviceEvent.inputIndex = 0;
|
|
24395
|
+
deviceEvent.currentState = this._pointerPosRecord[0];
|
|
24564
24396
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24565
24397
|
}
|
|
24566
24398
|
if (previousVertical !== evt.clientY) {
|
|
24567
|
-
deviceEvent.inputIndex =
|
|
24568
|
-
deviceEvent.currentState = this._pointerPosRecord[
|
|
24399
|
+
deviceEvent.inputIndex = 1;
|
|
24400
|
+
deviceEvent.currentState = this._pointerPosRecord[1];
|
|
24569
24401
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24570
24402
|
}
|
|
24571
|
-
if (this._pointerPosRecord[
|
|
24572
|
-
deviceEvent.inputIndex =
|
|
24573
|
-
deviceEvent.currentState = this._pointerPosRecord[
|
|
24403
|
+
if (this._pointerPosRecord[10] !== 0) {
|
|
24404
|
+
deviceEvent.inputIndex = 10;
|
|
24405
|
+
deviceEvent.currentState = this._pointerPosRecord[10];
|
|
24574
24406
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24575
24407
|
}
|
|
24576
|
-
if (this._pointerPosRecord[
|
|
24577
|
-
deviceEvent.inputIndex =
|
|
24578
|
-
deviceEvent.currentState = this._pointerPosRecord[
|
|
24408
|
+
if (this._pointerPosRecord[11] !== 0) {
|
|
24409
|
+
deviceEvent.inputIndex = 11;
|
|
24410
|
+
deviceEvent.currentState = this._pointerPosRecord[11];
|
|
24579
24411
|
this.onInputChanged$.emitEvent(deviceEvent);
|
|
24580
24412
|
}
|
|
24581
24413
|
if (!this._usingSafari) {
|
|
@@ -24614,8 +24446,8 @@ let Engine = class Engine extends _univerjs_core.Disposable {
|
|
|
24614
24446
|
return passiveSupported;
|
|
24615
24447
|
}
|
|
24616
24448
|
_getPointerType(evt) {
|
|
24617
|
-
let deviceType =
|
|
24618
|
-
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;
|
|
24619
24451
|
return deviceType;
|
|
24620
24452
|
}
|
|
24621
24453
|
_matchMediaHandler() {
|
|
@@ -24636,7 +24468,7 @@ Engine = __decorate([__decorateParam(2, ICanvasColorService)], Engine);
|
|
|
24636
24468
|
//#endregion
|
|
24637
24469
|
//#region package.json
|
|
24638
24470
|
var name = "@univerjs/engine-render";
|
|
24639
|
-
var version = "0.21.
|
|
24471
|
+
var version = "0.21.1-insiders.20260509-bf98cad";
|
|
24640
24472
|
|
|
24641
24473
|
//#endregion
|
|
24642
24474
|
//#region src/config/config.ts
|
|
@@ -24831,7 +24663,7 @@ var InputManager = class InputManager extends _univerjs_core.Disposable {
|
|
|
24831
24663
|
if (!engine) return;
|
|
24832
24664
|
this._onInput$ = engine.onInputChanged$.subscribeEvent((eventData) => {
|
|
24833
24665
|
const evt = eventData;
|
|
24834
|
-
if (eventData.deviceType ===
|
|
24666
|
+
if (eventData.deviceType === 1) switch (eventData.type) {
|
|
24835
24667
|
case "keydown":
|
|
24836
24668
|
this._onKeyDown(evt);
|
|
24837
24669
|
break;
|
|
@@ -24839,7 +24671,7 @@ var InputManager = class InputManager extends _univerjs_core.Disposable {
|
|
|
24839
24671
|
this._onKeyUp(evt);
|
|
24840
24672
|
break;
|
|
24841
24673
|
}
|
|
24842
|
-
if (eventData.deviceType ===
|
|
24674
|
+
if (eventData.deviceType === 2 || eventData.deviceType === 3) switch (eventData.type) {
|
|
24843
24675
|
case "wheel":
|
|
24844
24676
|
case "DOMMouseScroll":
|
|
24845
24677
|
case "mousewheel":
|
|
@@ -24861,10 +24693,10 @@ var InputManager = class InputManager extends _univerjs_core.Disposable {
|
|
|
24861
24693
|
if (enableMove) this._onPointerMove(evt);
|
|
24862
24694
|
break;
|
|
24863
24695
|
case "pointerup":
|
|
24864
|
-
if (enableUp && eventData.inputIndex >=
|
|
24696
|
+
if (enableUp && eventData.inputIndex >= 2 && eventData.inputIndex <= 4) this._onPointerUp(evt);
|
|
24865
24697
|
break;
|
|
24866
24698
|
case "pointerdown":
|
|
24867
|
-
if (enableDown && eventData.inputIndex >=
|
|
24699
|
+
if (enableDown && eventData.inputIndex >= 2 && eventData.inputIndex <= 4) this._onPointerDown(evt);
|
|
24868
24700
|
break;
|
|
24869
24701
|
}
|
|
24870
24702
|
if (eventData.dataTransfer) switch (eventData.type) {
|
|
@@ -24872,7 +24704,7 @@ var InputManager = class InputManager extends _univerjs_core.Disposable {
|
|
|
24872
24704
|
if (enableEnter) this._onDragEnter(evt);
|
|
24873
24705
|
break;
|
|
24874
24706
|
case "dragover": {
|
|
24875
|
-
const validIndex = eventData.inputIndex ===
|
|
24707
|
+
const validIndex = eventData.inputIndex === 0 || eventData.inputIndex === 1 || eventData.inputIndex === 10 || eventData.inputIndex === 11;
|
|
24876
24708
|
if (enableMove && validIndex) this._onDragOver(evt);
|
|
24877
24709
|
break;
|
|
24878
24710
|
}
|
|
@@ -24919,9 +24751,9 @@ var InputManager = class InputManager extends _univerjs_core.Disposable {
|
|
|
24919
24751
|
return !this._isObjectInSceneViewer(currentObject);
|
|
24920
24752
|
}
|
|
24921
24753
|
_isObjectInSceneViewer(obj) {
|
|
24922
|
-
if (obj && obj.classType ===
|
|
24754
|
+
if (obj && obj.classType === "BaseObject") {
|
|
24923
24755
|
const scene = obj.getScene();
|
|
24924
|
-
if (scene) return scene.getParent().classType ===
|
|
24756
|
+
if (scene) return scene.getParent().classType === "SceneViewer";
|
|
24925
24757
|
}
|
|
24926
24758
|
return false;
|
|
24927
24759
|
}
|
|
@@ -24988,7 +24820,7 @@ const THRESHOLD_TO_AUTO_MOVE = {
|
|
|
24988
24820
|
r: 60
|
|
24989
24821
|
};
|
|
24990
24822
|
var ScrollTimer = class ScrollTimer {
|
|
24991
|
-
constructor(_scene, _scrollTimerType =
|
|
24823
|
+
constructor(_scene, _scrollTimerType = 3, _thresholdAutoMove = THRESHOLD_TO_AUTO_MOVE) {
|
|
24992
24824
|
this._scene = _scene;
|
|
24993
24825
|
this._scrollTimerType = _scrollTimerType;
|
|
24994
24826
|
this._thresholdAutoMove = _thresholdAutoMove;
|
|
@@ -25002,7 +24834,7 @@ var ScrollTimer = class ScrollTimer {
|
|
|
25002
24834
|
_defineProperty(this, "_scrollY", 0);
|
|
25003
24835
|
_defineProperty(this, "_scrollFunction", void 0);
|
|
25004
24836
|
}
|
|
25005
|
-
static create(scene, scrollTimerType =
|
|
24837
|
+
static create(scene, scrollTimerType = 3, padding) {
|
|
25006
24838
|
return new ScrollTimer(scene, scrollTimerType, padding);
|
|
25007
24839
|
}
|
|
25008
24840
|
get offsetX() {
|
|
@@ -25041,7 +24873,7 @@ var ScrollTimer = class ScrollTimer {
|
|
|
25041
24873
|
let x = 0;
|
|
25042
24874
|
let y = 0;
|
|
25043
24875
|
let shouldScroll = false;
|
|
25044
|
-
if (this._scrollTimerType &
|
|
24876
|
+
if (this._scrollTimerType & 1) {
|
|
25045
24877
|
if (this._moveX < leftBounding + l) {
|
|
25046
24878
|
x = this._moveX - leftBounding - l;
|
|
25047
24879
|
shouldScroll = true;
|
|
@@ -25051,7 +24883,7 @@ var ScrollTimer = class ScrollTimer {
|
|
|
25051
24883
|
shouldScroll = true;
|
|
25052
24884
|
}
|
|
25053
24885
|
}
|
|
25054
|
-
if (this._scrollTimerType &
|
|
24886
|
+
if (this._scrollTimerType & 2) {
|
|
25055
24887
|
if (this._moveY < topBounding + t) {
|
|
25056
24888
|
y = this._moveY - topBounding - t;
|
|
25057
24889
|
shouldScroll = true;
|
|
@@ -25094,42 +24926,21 @@ var ScrollTimer = class ScrollTimer {
|
|
|
25094
24926
|
|
|
25095
24927
|
//#endregion
|
|
25096
24928
|
//#region src/scene.transformer.ts
|
|
25097
|
-
var TransformerManagerType = /* @__PURE__ */ function(TransformerManagerType) {
|
|
25098
|
-
TransformerManagerType["RESIZE_LT"] = "__SpreadsheetTransformerResizeLT__";
|
|
25099
|
-
TransformerManagerType["RESIZE_CT"] = "__SpreadsheetTransformerResizeCT__";
|
|
25100
|
-
TransformerManagerType["RESIZE_RT"] = "__SpreadsheetTransformerResizeRT__";
|
|
25101
|
-
TransformerManagerType["RESIZE_LM"] = "__SpreadsheetTransformerResizeLM__";
|
|
25102
|
-
TransformerManagerType["RESIZE_RM"] = "__SpreadsheetTransformerResizeRM__";
|
|
25103
|
-
TransformerManagerType["RESIZE_LB"] = "__SpreadsheetTransformerResizeLB__";
|
|
25104
|
-
TransformerManagerType["RESIZE_CB"] = "__SpreadsheetTransformerResizeCB__";
|
|
25105
|
-
TransformerManagerType["RESIZE_RB"] = "__SpreadsheetTransformerResizeRB__";
|
|
25106
|
-
TransformerManagerType["OUTLINE"] = "__SpreadsheetTransformerOutline__";
|
|
25107
|
-
TransformerManagerType["ROTATE_LINE"] = "__SpreadsheetTransformerRotateLine__";
|
|
25108
|
-
TransformerManagerType["ROTATE"] = "__SpreadsheetTransformerRotate__";
|
|
25109
|
-
TransformerManagerType["GROUP"] = "__SpreadsheetTransformer__";
|
|
25110
|
-
return TransformerManagerType;
|
|
25111
|
-
}(TransformerManagerType || {});
|
|
25112
24929
|
const TransformerManagerTypeArray = [
|
|
25113
|
-
|
|
25114
|
-
|
|
25115
|
-
|
|
25116
|
-
|
|
25117
|
-
|
|
25118
|
-
|
|
25119
|
-
|
|
25120
|
-
|
|
24930
|
+
"__SpreadsheetTransformerResizeLT__",
|
|
24931
|
+
"__SpreadsheetTransformerResizeCT__",
|
|
24932
|
+
"__SpreadsheetTransformerResizeRT__",
|
|
24933
|
+
"__SpreadsheetTransformerResizeLM__",
|
|
24934
|
+
"__SpreadsheetTransformerResizeRM__",
|
|
24935
|
+
"__SpreadsheetTransformerResizeLB__",
|
|
24936
|
+
"__SpreadsheetTransformerResizeCB__",
|
|
24937
|
+
"__SpreadsheetTransformerResizeRB__"
|
|
25121
24938
|
];
|
|
25122
|
-
var MoveObserverType = /* @__PURE__ */ function(MoveObserverType) {
|
|
25123
|
-
MoveObserverType[MoveObserverType["MOVE_START"] = 0] = "MOVE_START";
|
|
25124
|
-
MoveObserverType[MoveObserverType["MOVING"] = 1] = "MOVING";
|
|
25125
|
-
MoveObserverType[MoveObserverType["MOVE_END"] = 2] = "MOVE_END";
|
|
25126
|
-
return MoveObserverType;
|
|
25127
|
-
}(MoveObserverType || {});
|
|
25128
24939
|
const DEFAULT_TRANSFORMER_LAYER_INDEX = 2;
|
|
25129
24940
|
const MINI_WIDTH_LIMIT = 20;
|
|
25130
24941
|
const MINI_HEIGHT_LIMIT = 20;
|
|
25131
24942
|
const DEFAULT_CONTROL_PLUS_INDEX = 5e3;
|
|
25132
|
-
const SINGLE_ACTIVE_OBJECT_TYPE_MAP = new Set([
|
|
24943
|
+
const SINGLE_ACTIVE_OBJECT_TYPE_MAP = new Set([6]);
|
|
25133
24944
|
/**
|
|
25134
24945
|
* Transformer constructor. Transformer is a special type of group that allow you transform
|
|
25135
24946
|
* primitives and shapes. Transforming tool is not changing `width` and `height` properties of nodes
|
|
@@ -25222,7 +25033,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25222
25033
|
changeNotification() {
|
|
25223
25034
|
this._changing$.next({
|
|
25224
25035
|
objects: this._selectedObjectMap,
|
|
25225
|
-
type:
|
|
25036
|
+
type: 0
|
|
25226
25037
|
});
|
|
25227
25038
|
return this;
|
|
25228
25039
|
}
|
|
@@ -25367,14 +25178,14 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25367
25178
|
this._changeStart$.next({
|
|
25368
25179
|
target: applyObject,
|
|
25369
25180
|
objects: this._selectedObjectMap,
|
|
25370
|
-
type:
|
|
25181
|
+
type: 0
|
|
25371
25182
|
});
|
|
25372
25183
|
} else {
|
|
25373
25184
|
this._copperSelectedObject = applyObject;
|
|
25374
25185
|
this._changeStart$.next({
|
|
25375
25186
|
target: applyObject,
|
|
25376
25187
|
objects: new Map([[applyObject.oKey, applyObject]]),
|
|
25377
|
-
type:
|
|
25188
|
+
type: 0
|
|
25378
25189
|
});
|
|
25379
25190
|
}
|
|
25380
25191
|
this._moveBufferSkip = false;
|
|
@@ -25395,14 +25206,14 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25395
25206
|
const { offsetX, offsetY } = event;
|
|
25396
25207
|
if (!isCropper) this._changeEnd$.next({
|
|
25397
25208
|
objects: this._selectedObjectMap,
|
|
25398
|
-
type:
|
|
25209
|
+
type: 2,
|
|
25399
25210
|
offsetX,
|
|
25400
25211
|
offsetY,
|
|
25401
25212
|
event
|
|
25402
25213
|
});
|
|
25403
25214
|
else this._changeEnd$.next({
|
|
25404
25215
|
objects: new Map([[applyObject.oKey, applyObject]]),
|
|
25405
|
-
type:
|
|
25216
|
+
type: 2,
|
|
25406
25217
|
offsetX,
|
|
25407
25218
|
offsetY,
|
|
25408
25219
|
event
|
|
@@ -25486,7 +25297,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25486
25297
|
objects: this._selectedObjectMap,
|
|
25487
25298
|
moveX: moveLeft,
|
|
25488
25299
|
moveY: moveTop,
|
|
25489
|
-
type:
|
|
25300
|
+
type: 1,
|
|
25490
25301
|
offsetX: moveOffsetX,
|
|
25491
25302
|
offsetY: moveOffsetY
|
|
25492
25303
|
});
|
|
@@ -25500,7 +25311,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25500
25311
|
objects: new Map([[cropper.oKey, cropper]]),
|
|
25501
25312
|
moveX: moveLeft,
|
|
25502
25313
|
moveY: moveTop,
|
|
25503
|
-
type:
|
|
25314
|
+
type: 1,
|
|
25504
25315
|
offsetX: moveOffsetX,
|
|
25505
25316
|
offsetY: moveOffsetY
|
|
25506
25317
|
});
|
|
@@ -25525,7 +25336,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25525
25336
|
});
|
|
25526
25337
|
this._changing$.next({
|
|
25527
25338
|
objects: this._selectedObjectMap,
|
|
25528
|
-
type:
|
|
25339
|
+
type: 1,
|
|
25529
25340
|
offsetX: moveOffsetX,
|
|
25530
25341
|
offsetY: moveOffsetY
|
|
25531
25342
|
});
|
|
@@ -25533,12 +25344,12 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25533
25344
|
this._moveFunc(applyObject, type, x, y, keepRatio, isCropper, isGroup);
|
|
25534
25345
|
this._changing$.next({
|
|
25535
25346
|
objects: new Map([[applyObject.oKey, applyObject]]),
|
|
25536
|
-
type:
|
|
25347
|
+
type: 1,
|
|
25537
25348
|
offsetX: moveOffsetX,
|
|
25538
25349
|
offsetY: moveOffsetY
|
|
25539
25350
|
});
|
|
25540
25351
|
}
|
|
25541
|
-
if (!(keepRatio && type !==
|
|
25352
|
+
if (!(keepRatio && type !== "__SpreadsheetTransformerResizeCT__" && type !== "__SpreadsheetTransformerResizeCB__" && type !== "__SpreadsheetTransformerResizeLM__" && type !== "__SpreadsheetTransformerResizeRM__" && !isGroup)) {
|
|
25542
25353
|
this._startOffsetX = x;
|
|
25543
25354
|
this._startOffsetY = y;
|
|
25544
25355
|
}
|
|
@@ -25548,17 +25359,17 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25548
25359
|
const originState = this._startStateMap.get(moveObject.oKey) || {};
|
|
25549
25360
|
let state = {};
|
|
25550
25361
|
const { moveLeft, moveTop } = this._getMovePoint(x, y, moveObject);
|
|
25551
|
-
if (keepRatio && type !==
|
|
25552
|
-
case
|
|
25362
|
+
if (keepRatio && type !== "__SpreadsheetTransformerResizeCT__" && type !== "__SpreadsheetTransformerResizeCB__" && type !== "__SpreadsheetTransformerResizeLM__" && type !== "__SpreadsheetTransformerResizeRM__" && !isGroup) switch (type) {
|
|
25363
|
+
case "__SpreadsheetTransformerResizeLT__":
|
|
25553
25364
|
state = this._resizeLeftTop(moveObject, moveLeft, moveTop, originState);
|
|
25554
25365
|
break;
|
|
25555
|
-
case
|
|
25366
|
+
case "__SpreadsheetTransformerResizeRT__":
|
|
25556
25367
|
state = this._resizeRightTop(moveObject, moveLeft, moveTop, originState);
|
|
25557
25368
|
break;
|
|
25558
|
-
case
|
|
25369
|
+
case "__SpreadsheetTransformerResizeLB__":
|
|
25559
25370
|
state = this._resizeLeftBottom(moveObject, moveLeft, moveTop, originState);
|
|
25560
25371
|
break;
|
|
25561
|
-
case
|
|
25372
|
+
case "__SpreadsheetTransformerResizeRB__":
|
|
25562
25373
|
state = this._resizeRightBottom(moveObject, moveLeft, moveTop, originState);
|
|
25563
25374
|
break;
|
|
25564
25375
|
}
|
|
@@ -25610,37 +25421,37 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25610
25421
|
height
|
|
25611
25422
|
};
|
|
25612
25423
|
switch (type) {
|
|
25613
|
-
case
|
|
25424
|
+
case "__SpreadsheetTransformerResizeLT__":
|
|
25614
25425
|
state.width = width - moveLeft < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : width - moveLeft;
|
|
25615
25426
|
state.height = height - moveTop < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : height - moveTop;
|
|
25616
25427
|
state.left = left + width - state.width;
|
|
25617
25428
|
state.top = top + height - state.height;
|
|
25618
25429
|
break;
|
|
25619
|
-
case
|
|
25430
|
+
case "__SpreadsheetTransformerResizeCT__":
|
|
25620
25431
|
state.height = height - moveTop < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : height - moveTop;
|
|
25621
25432
|
state.top = top + height - state.height;
|
|
25622
25433
|
break;
|
|
25623
|
-
case
|
|
25434
|
+
case "__SpreadsheetTransformerResizeRT__":
|
|
25624
25435
|
state.width = width + moveLeft < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : width + moveLeft;
|
|
25625
25436
|
state.height = height - moveTop < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : height - moveTop;
|
|
25626
25437
|
state.top = top + height - state.height;
|
|
25627
25438
|
break;
|
|
25628
|
-
case
|
|
25439
|
+
case "__SpreadsheetTransformerResizeLM__":
|
|
25629
25440
|
state.width = width - moveLeft < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : width - moveLeft;
|
|
25630
25441
|
state.left = left + width - state.width;
|
|
25631
25442
|
break;
|
|
25632
|
-
case
|
|
25443
|
+
case "__SpreadsheetTransformerResizeRM__":
|
|
25633
25444
|
state.width = moveLeft + width < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : moveLeft + width;
|
|
25634
25445
|
break;
|
|
25635
|
-
case
|
|
25446
|
+
case "__SpreadsheetTransformerResizeLB__":
|
|
25636
25447
|
state.width = width - moveLeft < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : width - moveLeft;
|
|
25637
25448
|
state.height = height + moveTop < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : height + moveTop;
|
|
25638
25449
|
state.left = state.width <= MINI_WIDTH_LIMIT ? left : left + moveLeft;
|
|
25639
25450
|
break;
|
|
25640
|
-
case
|
|
25451
|
+
case "__SpreadsheetTransformerResizeCB__":
|
|
25641
25452
|
state.height = moveTop + height < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : moveTop + height;
|
|
25642
25453
|
break;
|
|
25643
|
-
case
|
|
25454
|
+
case "__SpreadsheetTransformerResizeRB__":
|
|
25644
25455
|
state.width = moveLeft + width < MINI_WIDTH_LIMIT ? MINI_WIDTH_LIMIT : moveLeft + width;
|
|
25645
25456
|
state.height = moveTop + height < MINI_HEIGHT_LIMIT ? MINI_HEIGHT_LIMIT : moveTop + height;
|
|
25646
25457
|
break;
|
|
@@ -25745,7 +25556,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25745
25556
|
moveTop: moveTopFix
|
|
25746
25557
|
};
|
|
25747
25558
|
}
|
|
25748
|
-
_attachEventToAnchor(anchor, type =
|
|
25559
|
+
_attachEventToAnchor(anchor, type = "__SpreadsheetTransformerResizeLT__", applyObject) {
|
|
25749
25560
|
this.disposeWithMe((0, _univerjs_core.toDisposable)(anchor.onPointerDown$.subscribeEvent((evt, state) => {
|
|
25750
25561
|
const { offsetX: evtOffsetX, offsetY: evtOffsetY } = evt;
|
|
25751
25562
|
this._startOffsetX = evtOffsetX;
|
|
@@ -25766,7 +25577,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25766
25577
|
this._clearControlMap();
|
|
25767
25578
|
this._changeStart$.next({
|
|
25768
25579
|
objects: this._selectedObjectMap,
|
|
25769
|
-
type:
|
|
25580
|
+
type: 0
|
|
25770
25581
|
});
|
|
25771
25582
|
this._selectedObjectMap.forEach((moveObject) => {
|
|
25772
25583
|
const { width, height, left, top } = moveObject.getState();
|
|
@@ -25780,7 +25591,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25780
25591
|
} else {
|
|
25781
25592
|
this._changeStart$.next({
|
|
25782
25593
|
objects: new Map([[applyObject.oKey, applyObject]]),
|
|
25783
|
-
type:
|
|
25594
|
+
type: 0
|
|
25784
25595
|
});
|
|
25785
25596
|
const { width, height, left, top } = applyObject.getState();
|
|
25786
25597
|
this._startStateMap.set(applyObject.oKey, {
|
|
@@ -25812,7 +25623,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25812
25623
|
this._recoverySizeBoundary(Array.from(this._selectedObjectMap.values()), ancestorLeft, ancestorTop, topSceneWidth, topSceneHeight);
|
|
25813
25624
|
this._changeEnd$.next({
|
|
25814
25625
|
objects: this._selectedObjectMap,
|
|
25815
|
-
type:
|
|
25626
|
+
type: 2,
|
|
25816
25627
|
offsetX,
|
|
25817
25628
|
offsetY,
|
|
25818
25629
|
event
|
|
@@ -25821,7 +25632,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25821
25632
|
this._recoverySizeBoundary([applyObject], ancestorLeft, ancestorTop, topSceneWidth, topSceneHeight);
|
|
25822
25633
|
this._changeEnd$.next({
|
|
25823
25634
|
objects: new Map([[applyObject.oKey, applyObject]]),
|
|
25824
|
-
type:
|
|
25635
|
+
type: 2,
|
|
25825
25636
|
offsetX,
|
|
25826
25637
|
offsetY,
|
|
25827
25638
|
event
|
|
@@ -25859,14 +25670,14 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25859
25670
|
const viewportActualXY = topScene.getScrollXYInfoByViewport(Vector2.create(evtOffsetX, evtOffsetY));
|
|
25860
25671
|
this._viewportScrollX = viewportActualXY.x;
|
|
25861
25672
|
this._viewportScrollY = viewportActualXY.y;
|
|
25862
|
-
const cursor = this._getRotateAnchorCursor(
|
|
25673
|
+
const cursor = this._getRotateAnchorCursor("__SpreadsheetTransformerRotateLine__");
|
|
25863
25674
|
const { ancestorLeft, ancestorTop, width, height, angle: agentOrigin } = applyObject;
|
|
25864
25675
|
const centerX = width / 2 + ancestorLeft;
|
|
25865
25676
|
const centerY = height / 2 + ancestorTop;
|
|
25866
25677
|
this._clearControlMap();
|
|
25867
25678
|
this._changeStart$.next({
|
|
25868
25679
|
objects: this._selectedObjectMap,
|
|
25869
|
-
type:
|
|
25680
|
+
type: 0
|
|
25870
25681
|
});
|
|
25871
25682
|
this._moveBufferSkip = false;
|
|
25872
25683
|
const topScenePointerMoveSub = topScene.onPointerMove$.subscribeEvent((moveEvt) => {
|
|
@@ -25883,7 +25694,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25883
25694
|
const { offsetX, offsetY } = event;
|
|
25884
25695
|
this._changeEnd$.next({
|
|
25885
25696
|
objects: this._selectedObjectMap,
|
|
25886
|
-
type:
|
|
25697
|
+
type: 2,
|
|
25887
25698
|
offsetX,
|
|
25888
25699
|
offsetY,
|
|
25889
25700
|
event
|
|
@@ -25905,7 +25716,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25905
25716
|
this._changing$.next({
|
|
25906
25717
|
objects: this._selectedObjectMap,
|
|
25907
25718
|
angle,
|
|
25908
|
-
type:
|
|
25719
|
+
type: 1,
|
|
25909
25720
|
offsetX: moveOffsetX,
|
|
25910
25721
|
offsetY: moveOffsetY
|
|
25911
25722
|
});
|
|
@@ -25919,35 +25730,35 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25919
25730
|
};
|
|
25920
25731
|
}
|
|
25921
25732
|
_getRotateAnchorCursor(type) {
|
|
25922
|
-
let cursor =
|
|
25733
|
+
let cursor = "nw-resize";
|
|
25923
25734
|
switch (type) {
|
|
25924
|
-
case
|
|
25925
|
-
cursor =
|
|
25735
|
+
case "__SpreadsheetTransformerRotate__":
|
|
25736
|
+
cursor = "move";
|
|
25926
25737
|
break;
|
|
25927
|
-
case
|
|
25928
|
-
cursor =
|
|
25738
|
+
case "__SpreadsheetTransformerRotateLine__":
|
|
25739
|
+
cursor = "move";
|
|
25929
25740
|
break;
|
|
25930
|
-
case
|
|
25931
|
-
case
|
|
25932
|
-
cursor =
|
|
25741
|
+
case "__SpreadsheetTransformerResizeLT__": break;
|
|
25742
|
+
case "__SpreadsheetTransformerResizeCT__":
|
|
25743
|
+
cursor = "n-resize";
|
|
25933
25744
|
break;
|
|
25934
|
-
case
|
|
25935
|
-
cursor =
|
|
25745
|
+
case "__SpreadsheetTransformerResizeRT__":
|
|
25746
|
+
cursor = "ne-resize";
|
|
25936
25747
|
break;
|
|
25937
|
-
case
|
|
25938
|
-
cursor =
|
|
25748
|
+
case "__SpreadsheetTransformerResizeLM__":
|
|
25749
|
+
cursor = "w-resize";
|
|
25939
25750
|
break;
|
|
25940
|
-
case
|
|
25941
|
-
cursor =
|
|
25751
|
+
case "__SpreadsheetTransformerResizeRM__":
|
|
25752
|
+
cursor = "e-resize";
|
|
25942
25753
|
break;
|
|
25943
|
-
case
|
|
25944
|
-
cursor =
|
|
25754
|
+
case "__SpreadsheetTransformerResizeLB__":
|
|
25755
|
+
cursor = "sw-resize";
|
|
25945
25756
|
break;
|
|
25946
|
-
case
|
|
25947
|
-
cursor =
|
|
25757
|
+
case "__SpreadsheetTransformerResizeCB__":
|
|
25758
|
+
cursor = "s-resize";
|
|
25948
25759
|
break;
|
|
25949
|
-
case
|
|
25950
|
-
cursor =
|
|
25760
|
+
case "__SpreadsheetTransformerResizeRB__":
|
|
25761
|
+
cursor = "se-resize";
|
|
25951
25762
|
break;
|
|
25952
25763
|
}
|
|
25953
25764
|
return cursor;
|
|
@@ -25959,35 +25770,35 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
25959
25770
|
const longEdge = anchorSize;
|
|
25960
25771
|
const shortEdge = anchorSize / 4;
|
|
25961
25772
|
switch (type) {
|
|
25962
|
-
case
|
|
25773
|
+
case "__SpreadsheetTransformerResizeLT__":
|
|
25963
25774
|
left += -borderSpacing - borderStrokeWidth;
|
|
25964
25775
|
top += -borderSpacing - borderStrokeWidth;
|
|
25965
25776
|
break;
|
|
25966
|
-
case
|
|
25777
|
+
case "__SpreadsheetTransformerResizeCT__":
|
|
25967
25778
|
left += width / 2 - longEdge / 2;
|
|
25968
25779
|
top += -borderSpacing - borderStrokeWidth;
|
|
25969
25780
|
break;
|
|
25970
|
-
case
|
|
25781
|
+
case "__SpreadsheetTransformerResizeRT__":
|
|
25971
25782
|
left += width + borderSpacing - borderStrokeWidth - longEdge;
|
|
25972
25783
|
top += -borderSpacing - borderStrokeWidth;
|
|
25973
25784
|
break;
|
|
25974
|
-
case
|
|
25785
|
+
case "__SpreadsheetTransformerResizeLM__":
|
|
25975
25786
|
left += borderSpacing - borderStrokeWidth;
|
|
25976
25787
|
top += height / 2 - longEdge / 2;
|
|
25977
25788
|
break;
|
|
25978
|
-
case
|
|
25789
|
+
case "__SpreadsheetTransformerResizeRM__":
|
|
25979
25790
|
left += width + borderSpacing - borderStrokeWidth - shortEdge;
|
|
25980
25791
|
top += height / 2 - longEdge / 2;
|
|
25981
25792
|
break;
|
|
25982
|
-
case
|
|
25793
|
+
case "__SpreadsheetTransformerResizeLB__":
|
|
25983
25794
|
left += -this.borderSpacing - borderStrokeWidth;
|
|
25984
25795
|
top += height + borderSpacing - borderStrokeWidth - longEdge;
|
|
25985
25796
|
break;
|
|
25986
|
-
case
|
|
25797
|
+
case "__SpreadsheetTransformerResizeCB__":
|
|
25987
25798
|
left += width / 2 - longEdge / 2;
|
|
25988
25799
|
top += height + borderSpacing - borderStrokeWidth - shortEdge;
|
|
25989
25800
|
break;
|
|
25990
|
-
case
|
|
25801
|
+
case "__SpreadsheetTransformerResizeRB__":
|
|
25991
25802
|
left += width + borderSpacing - borderStrokeWidth - longEdge;
|
|
25992
25803
|
top += height + borderSpacing - borderStrokeWidth - longEdge;
|
|
25993
25804
|
break;
|
|
@@ -26002,43 +25813,43 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
26002
25813
|
let left = -anchorSize / 2;
|
|
26003
25814
|
let top = -anchorSize / 2;
|
|
26004
25815
|
switch (type) {
|
|
26005
|
-
case
|
|
25816
|
+
case "__SpreadsheetTransformerRotate__":
|
|
26006
25817
|
left = width / 2 - rotateSize / 2;
|
|
26007
25818
|
top = -rotateAnchorOffset - borderSpacing - borderStrokeWidth * 2 - rotateSize;
|
|
26008
25819
|
break;
|
|
26009
|
-
case
|
|
25820
|
+
case "__SpreadsheetTransformerRotateLine__":
|
|
26010
25821
|
left = width / 2;
|
|
26011
25822
|
top = -rotateAnchorOffset - borderSpacing - borderStrokeWidth;
|
|
26012
25823
|
break;
|
|
26013
|
-
case
|
|
25824
|
+
case "__SpreadsheetTransformerResizeLT__":
|
|
26014
25825
|
left += -borderSpacing - borderStrokeWidth;
|
|
26015
25826
|
top += -borderSpacing - borderStrokeWidth;
|
|
26016
25827
|
break;
|
|
26017
|
-
case
|
|
25828
|
+
case "__SpreadsheetTransformerResizeCT__":
|
|
26018
25829
|
left += width / 2;
|
|
26019
25830
|
top += -borderSpacing - borderStrokeWidth;
|
|
26020
25831
|
break;
|
|
26021
|
-
case
|
|
25832
|
+
case "__SpreadsheetTransformerResizeRT__":
|
|
26022
25833
|
left += width + borderSpacing - borderStrokeWidth;
|
|
26023
25834
|
top += -borderSpacing - borderStrokeWidth;
|
|
26024
25835
|
break;
|
|
26025
|
-
case
|
|
25836
|
+
case "__SpreadsheetTransformerResizeLM__":
|
|
26026
25837
|
left += borderSpacing - borderStrokeWidth;
|
|
26027
25838
|
top += height / 2;
|
|
26028
25839
|
break;
|
|
26029
|
-
case
|
|
25840
|
+
case "__SpreadsheetTransformerResizeRM__":
|
|
26030
25841
|
left += width + borderSpacing - borderStrokeWidth;
|
|
26031
25842
|
top += height / 2;
|
|
26032
25843
|
break;
|
|
26033
|
-
case
|
|
25844
|
+
case "__SpreadsheetTransformerResizeLB__":
|
|
26034
25845
|
left += -this.borderSpacing - borderStrokeWidth;
|
|
26035
25846
|
top += height + borderSpacing - borderStrokeWidth;
|
|
26036
25847
|
break;
|
|
26037
|
-
case
|
|
25848
|
+
case "__SpreadsheetTransformerResizeCB__":
|
|
26038
25849
|
left += width / 2;
|
|
26039
25850
|
top += height + borderSpacing - borderStrokeWidth;
|
|
26040
25851
|
break;
|
|
26041
|
-
case
|
|
25852
|
+
case "__SpreadsheetTransformerResizeRB__":
|
|
26042
25853
|
left += width + borderSpacing - borderStrokeWidth;
|
|
26043
25854
|
top += height + borderSpacing - borderStrokeWidth;
|
|
26044
25855
|
break;
|
|
@@ -26064,7 +25875,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
26064
25875
|
left,
|
|
26065
25876
|
top
|
|
26066
25877
|
});
|
|
26067
|
-
this._attachHover(anchor, cursor,
|
|
25878
|
+
this._attachHover(anchor, cursor, "default");
|
|
26068
25879
|
return anchor;
|
|
26069
25880
|
}
|
|
26070
25881
|
_createCopperResizeAnchor(type, applyObject, zIndex) {
|
|
@@ -26086,36 +25897,36 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
26086
25897
|
};
|
|
26087
25898
|
const longEdge = anchorSize;
|
|
26088
25899
|
const shortEdge = anchorSize / 4;
|
|
26089
|
-
if (cursor ===
|
|
25900
|
+
if (cursor === "e-resize") {
|
|
26090
25901
|
config.width = shortEdge;
|
|
26091
25902
|
config.height = longEdge;
|
|
26092
25903
|
anchor = new Rect(oKey, config);
|
|
26093
|
-
} else if (cursor ===
|
|
25904
|
+
} else if (cursor === "w-resize") {
|
|
26094
25905
|
config.width = shortEdge;
|
|
26095
25906
|
config.height = longEdge;
|
|
26096
25907
|
anchor = new Rect(oKey, config);
|
|
26097
|
-
} else if (cursor ===
|
|
25908
|
+
} else if (cursor === "n-resize") {
|
|
26098
25909
|
config.width = longEdge;
|
|
26099
25910
|
config.height = shortEdge;
|
|
26100
25911
|
anchor = new Rect(oKey, config);
|
|
26101
|
-
} else if (cursor ===
|
|
25912
|
+
} else if (cursor === "s-resize") {
|
|
26102
25913
|
config.width = longEdge;
|
|
26103
25914
|
config.height = shortEdge;
|
|
26104
25915
|
anchor = new Rect(oKey, config);
|
|
26105
|
-
} else if (cursor ===
|
|
25916
|
+
} else if (cursor === "ne-resize") {
|
|
26106
25917
|
config.pointsGroup = this._getNorthEastPoints(longEdge, shortEdge);
|
|
26107
25918
|
anchor = new RegularPolygon(oKey, config);
|
|
26108
|
-
} else if (cursor ===
|
|
25919
|
+
} else if (cursor === "nw-resize") {
|
|
26109
25920
|
config.pointsGroup = this._getNorthWestPoints(longEdge, shortEdge);
|
|
26110
25921
|
anchor = new RegularPolygon(oKey, config);
|
|
26111
|
-
} else if (cursor ===
|
|
25922
|
+
} else if (cursor === "se-resize") {
|
|
26112
25923
|
config.pointsGroup = this._getSouthEastPoints(longEdge, shortEdge);
|
|
26113
25924
|
anchor = new RegularPolygon(oKey, config);
|
|
26114
|
-
} else if (cursor ===
|
|
25925
|
+
} else if (cursor === "sw-resize") {
|
|
26115
25926
|
config.pointsGroup = this._getSouthWestPoints(longEdge, shortEdge);
|
|
26116
25927
|
anchor = new RegularPolygon(oKey, config);
|
|
26117
25928
|
}
|
|
26118
|
-
this._attachHover(anchor, cursor,
|
|
25929
|
+
this._attachHover(anchor, cursor, "default");
|
|
26119
25930
|
return anchor;
|
|
26120
25931
|
}
|
|
26121
25932
|
_getNorthEastPoints(longEdge, shortEdge) {
|
|
@@ -26242,17 +26053,17 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
26242
26053
|
]];
|
|
26243
26054
|
}
|
|
26244
26055
|
_checkTransformerType(oKey) {
|
|
26245
|
-
if (oKey.indexOf(
|
|
26246
|
-
if (oKey.indexOf(
|
|
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(
|
|
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__";
|
|
26256
26067
|
}
|
|
26257
26068
|
_updateControlIterator(func) {
|
|
26258
26069
|
this._transformerControlMap.forEach((control, oKey) => {
|
|
@@ -26317,7 +26128,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
26317
26128
|
const layerIndex = applyObject.getLayerIndex() || DEFAULT_TRANSFORMER_LAYER_INDEX;
|
|
26318
26129
|
const groupElements = [];
|
|
26319
26130
|
if (borderEnabled && !isCropper) {
|
|
26320
|
-
const outline = new Rect(
|
|
26131
|
+
const outline = new Rect(`__SpreadsheetTransformerOutline___${zIndex}`, {
|
|
26321
26132
|
zIndex: zIndex - 1,
|
|
26322
26133
|
evented: false,
|
|
26323
26134
|
strokeWidth: borderStrokeWidth,
|
|
@@ -26327,9 +26138,9 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
26327
26138
|
groupElements.push(outline);
|
|
26328
26139
|
}
|
|
26329
26140
|
if (resizeEnabled && !isCropper) {
|
|
26330
|
-
const { left: lineLeft, top: lineTop } = this._getRotateAnchorPosition(
|
|
26141
|
+
const { left: lineLeft, top: lineTop } = this._getRotateAnchorPosition("__SpreadsheetTransformerRotateLine__", height, width, applyObject);
|
|
26331
26142
|
if (rotateEnabled) {
|
|
26332
|
-
const rotateLine = new Rect(
|
|
26143
|
+
const rotateLine = new Rect(`__SpreadsheetTransformerRotateLine___${zIndex}`, {
|
|
26333
26144
|
zIndex: zIndex - 1,
|
|
26334
26145
|
evented: false,
|
|
26335
26146
|
left: lineLeft,
|
|
@@ -26339,9 +26150,9 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
26339
26150
|
strokeWidth: borderStrokeWidth,
|
|
26340
26151
|
stroke: borderStroke
|
|
26341
26152
|
});
|
|
26342
|
-
const { left: rotateLeft, top: rotateTop } = this._getRotateAnchorPosition(
|
|
26343
|
-
const cursor = this._getRotateAnchorCursor(
|
|
26344
|
-
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}`, {
|
|
26345
26156
|
zIndex: zIndex - 1,
|
|
26346
26157
|
left: rotateLeft,
|
|
26347
26158
|
top: rotateTop,
|
|
@@ -26352,7 +26163,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
26352
26163
|
stroke: borderStroke
|
|
26353
26164
|
});
|
|
26354
26165
|
this._attachEventToRotate(rotate, applyObject);
|
|
26355
|
-
this._attachHover(rotate, cursor,
|
|
26166
|
+
this._attachHover(rotate, cursor, "default");
|
|
26356
26167
|
groupElements.push(rotateLine, rotate);
|
|
26357
26168
|
}
|
|
26358
26169
|
}
|
|
@@ -26365,7 +26176,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
26365
26176
|
this._attachEventToAnchor(anchor, type, applyObject);
|
|
26366
26177
|
groupElements.push(anchor);
|
|
26367
26178
|
}
|
|
26368
|
-
const transformerControl = new Group(
|
|
26179
|
+
const transformerControl = new Group(`__SpreadsheetTransformer___${oKey}`, ...groupElements);
|
|
26369
26180
|
transformerControl.zIndex = zIndex;
|
|
26370
26181
|
transformerControl.evented = false;
|
|
26371
26182
|
transformerControl.openSelfSizeMode();
|
|
@@ -26393,7 +26204,7 @@ var Transformer = class extends _univerjs_core.Disposable {
|
|
|
26393
26204
|
this._changeStart$.next({
|
|
26394
26205
|
target: applyObject,
|
|
26395
26206
|
objects: this._selectedObjectMap,
|
|
26396
|
-
type:
|
|
26207
|
+
type: 0
|
|
26397
26208
|
});
|
|
26398
26209
|
}
|
|
26399
26210
|
_updateActiveObjectList(applyObject, evt) {
|
|
@@ -26443,8 +26254,8 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26443
26254
|
_defineProperty(this, "_evented", true);
|
|
26444
26255
|
_defineProperty(this, "_layers", []);
|
|
26445
26256
|
_defineProperty(this, "_viewports", []);
|
|
26446
|
-
_defineProperty(this, "_cursor",
|
|
26447
|
-
_defineProperty(this, "_defaultCursor",
|
|
26257
|
+
_defineProperty(this, "_cursor", "default");
|
|
26258
|
+
_defineProperty(this, "_defaultCursor", "default");
|
|
26448
26259
|
_defineProperty(this, "_addObject$", new rxjs.BehaviorSubject(this));
|
|
26449
26260
|
_defineProperty(this, "addObject$", this._addObject$.asObservable());
|
|
26450
26261
|
_defineProperty(this, "onTransformChange$", new _univerjs_core.EventSubject());
|
|
@@ -26490,18 +26301,18 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26490
26301
|
_defineProperty(this, "_capturedObject", null);
|
|
26491
26302
|
this._sceneKey = sceneKey;
|
|
26492
26303
|
if (state) this.transformByState(state);
|
|
26493
|
-
if (this._parent.classType ===
|
|
26304
|
+
if (this._parent.classType === "Engine") {
|
|
26494
26305
|
const parent = this._parent;
|
|
26495
26306
|
parent.addScene(this);
|
|
26496
26307
|
if (!parent.hasActiveScene()) parent.setActiveScene(sceneKey);
|
|
26497
26308
|
this._inputManager = new InputManager(this);
|
|
26498
|
-
} else if (this._parent.classType ===
|
|
26309
|
+
} else if (this._parent.classType === "SceneViewer") this._parent.addSubScene(this);
|
|
26499
26310
|
this.disposeWithMe((0, _univerjs_core.toDisposable)((_this$_parent = this._parent) === null || _this$_parent === void 0 ? void 0 : _this$_parent.onTransformChange$.subscribeEvent((_change) => {
|
|
26500
26311
|
this._transformHandler();
|
|
26501
26312
|
})));
|
|
26502
26313
|
}
|
|
26503
26314
|
get classType() {
|
|
26504
|
-
return
|
|
26315
|
+
return "Scene";
|
|
26505
26316
|
}
|
|
26506
26317
|
get transform() {
|
|
26507
26318
|
return this._transform;
|
|
@@ -26545,7 +26356,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26545
26356
|
get ancestorScaleX() {
|
|
26546
26357
|
const p = this.getParent();
|
|
26547
26358
|
let pScale = 1;
|
|
26548
|
-
if (p.classType ===
|
|
26359
|
+
if (p.classType === "SceneViewer") pScale = p.ancestorScaleX;
|
|
26549
26360
|
return this.scaleX * pScale;
|
|
26550
26361
|
}
|
|
26551
26362
|
/**
|
|
@@ -26554,7 +26365,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26554
26365
|
get ancestorScaleY() {
|
|
26555
26366
|
const p = this.getParent();
|
|
26556
26367
|
let pScale = 1;
|
|
26557
|
-
if (p.classType ===
|
|
26368
|
+
if (p.classType === "SceneViewer") pScale = p.ancestorScaleY;
|
|
26558
26369
|
return this.scaleY * pScale;
|
|
26559
26370
|
}
|
|
26560
26371
|
getAncestorScale() {
|
|
@@ -26566,13 +26377,13 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26566
26377
|
get ancestorLeft() {
|
|
26567
26378
|
const p = this.getParent();
|
|
26568
26379
|
let pOffsetX = 0;
|
|
26569
|
-
if (p.classType ===
|
|
26380
|
+
if (p.classType === "SceneViewer") pOffsetX = p.ancestorLeft;
|
|
26570
26381
|
return pOffsetX;
|
|
26571
26382
|
}
|
|
26572
26383
|
get ancestorTop() {
|
|
26573
26384
|
const p = this.getParent();
|
|
26574
26385
|
let pOffsetY = 0;
|
|
26575
|
-
if (p.classType ===
|
|
26386
|
+
if (p.classType === "SceneViewer") pOffsetY = p.ancestorTop;
|
|
26576
26387
|
return pOffsetY;
|
|
26577
26388
|
}
|
|
26578
26389
|
set cursor(val) {
|
|
@@ -26580,7 +26391,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26580
26391
|
}
|
|
26581
26392
|
attachControl(options) {
|
|
26582
26393
|
var _this$_inputManager;
|
|
26583
|
-
if (!(this._parent.classType ===
|
|
26394
|
+
if (!(this._parent.classType === "Engine")) return;
|
|
26584
26395
|
(_this$_inputManager = this._inputManager) === null || _this$_inputManager === void 0 || _this$_inputManager.attachControl(options);
|
|
26585
26396
|
return this;
|
|
26586
26397
|
}
|
|
@@ -26593,7 +26404,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26593
26404
|
this._layers.forEach((layer) => {
|
|
26594
26405
|
layer.makeDirty(state);
|
|
26595
26406
|
});
|
|
26596
|
-
if (this._parent.classType ===
|
|
26407
|
+
if (this._parent.classType === "SceneViewer") {
|
|
26597
26408
|
var _this$_parent2;
|
|
26598
26409
|
(_this$_parent2 = this._parent) === null || _this$_parent2 === void 0 || _this$_parent2.makeDirty(state);
|
|
26599
26410
|
}
|
|
@@ -26647,7 +26458,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26647
26458
|
if (height !== void 0) this.height = height;
|
|
26648
26459
|
this._transformHandler();
|
|
26649
26460
|
this.onTransformChange$.emitEvent({
|
|
26650
|
-
type:
|
|
26461
|
+
type: 1,
|
|
26651
26462
|
value: {
|
|
26652
26463
|
width: this.width,
|
|
26653
26464
|
height: this.height
|
|
@@ -26680,7 +26491,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26680
26491
|
this.setScaleValueOnly(scaleX || 1, scaleY || 1);
|
|
26681
26492
|
this._transformHandler();
|
|
26682
26493
|
this.onTransformChange$.emitEvent({
|
|
26683
|
-
type:
|
|
26494
|
+
type: 2,
|
|
26684
26495
|
value: {
|
|
26685
26496
|
scaleX: this.scaleX,
|
|
26686
26497
|
scaleY: this.scaleY
|
|
@@ -26704,7 +26515,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26704
26515
|
this.scaleY = precisionTo(this.scaleY, 1);
|
|
26705
26516
|
this._transformHandler();
|
|
26706
26517
|
this.onTransformChange$.emitEvent({
|
|
26707
|
-
type:
|
|
26518
|
+
type: 2,
|
|
26708
26519
|
value: {
|
|
26709
26520
|
scaleX: this.scaleX,
|
|
26710
26521
|
scaleY: this.scaleY
|
|
@@ -26732,7 +26543,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26732
26543
|
});
|
|
26733
26544
|
this._transformHandler();
|
|
26734
26545
|
this.onTransformChange$.emitEvent({
|
|
26735
|
-
type:
|
|
26546
|
+
type: 5,
|
|
26736
26547
|
value: state,
|
|
26737
26548
|
preValue: preKeys
|
|
26738
26549
|
});
|
|
@@ -26741,10 +26552,10 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
26741
26552
|
return this._parent;
|
|
26742
26553
|
}
|
|
26743
26554
|
getEngine() {
|
|
26744
|
-
if (this._parent.classType ===
|
|
26555
|
+
if (this._parent.classType === "Engine") return this._parent;
|
|
26745
26556
|
let parent = this._parent;
|
|
26746
26557
|
while (parent) {
|
|
26747
|
-
if (parent.classType ===
|
|
26558
|
+
if (parent.classType === "Engine") return parent;
|
|
26748
26559
|
parent = parent === null || parent === void 0 ? void 0 : parent.getParent();
|
|
26749
26560
|
}
|
|
26750
26561
|
return null;
|
|
@@ -27031,18 +26842,18 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27031
26842
|
let parent = this.getParent();
|
|
27032
26843
|
const parentList = [];
|
|
27033
26844
|
while (parent) {
|
|
27034
|
-
if (parent.classType ===
|
|
26845
|
+
if (parent.classType === "Scene" || parent.classType === "SceneViewer") parentList.push(parent);
|
|
27035
26846
|
parent = (parent === null || parent === void 0 ? void 0 : parent.getParent) && (parent === null || parent === void 0 ? void 0 : parent.getParent());
|
|
27036
26847
|
}
|
|
27037
26848
|
parentList.reverse();
|
|
27038
|
-
for (const parent of parentList) if (parent.classType ===
|
|
26849
|
+
for (const parent of parentList) if (parent.classType === "Scene") {
|
|
27039
26850
|
const viewPort = parent.getActiveViewportByCoord(coord);
|
|
27040
26851
|
if (viewPort) {
|
|
27041
26852
|
const actualX = viewPort.viewportScrollX || 0;
|
|
27042
26853
|
const actualY = viewPort.viewportScrollY || 0;
|
|
27043
26854
|
coord = coord.addByPoint(actualX, actualY);
|
|
27044
26855
|
}
|
|
27045
|
-
} else if (parent.classType ===
|
|
26856
|
+
} else if (parent.classType === "SceneViewer") coord = parent.transform.clone().invert().applyPoint(coord);
|
|
27046
26857
|
return coord;
|
|
27047
26858
|
}
|
|
27048
26859
|
clearLayer() {
|
|
@@ -27120,16 +26931,16 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27120
26931
|
for (let i = 0; i < objectLength; i++) {
|
|
27121
26932
|
var _testObject$parent;
|
|
27122
26933
|
const testObject = objectOrder[i];
|
|
27123
|
-
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;
|
|
27124
26935
|
const svCoord = vecFromSheetContent;
|
|
27125
26936
|
if (testObject.isHit(svCoord)) {
|
|
27126
|
-
if (testObject.classType ===
|
|
26937
|
+
if (testObject.classType === "SceneViewer") {
|
|
27127
26938
|
const pickedObject = testObject.pick(svCoord);
|
|
27128
26939
|
if (pickedObject) isPickedObject = pickedObject;
|
|
27129
26940
|
else isPickedObject = testObject.getActiveSubScene();
|
|
27130
26941
|
} else isPickedObject = testObject;
|
|
27131
26942
|
break;
|
|
27132
|
-
} else if (testObject.classType ===
|
|
26943
|
+
} else if (testObject.classType === "SceneViewer" && testObject.allowSelectedClipElement()) {
|
|
27133
26944
|
const pickedObject = testObject.pick(svCoord);
|
|
27134
26945
|
if (pickedObject) {
|
|
27135
26946
|
isPickedObject = pickedObject;
|
|
@@ -27137,12 +26948,12 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27137
26948
|
}
|
|
27138
26949
|
}
|
|
27139
26950
|
}
|
|
27140
|
-
if (!isPickedObject && this._parent.classType ===
|
|
26951
|
+
if (!isPickedObject && this._parent.classType === "Engine") return this;
|
|
27141
26952
|
return isPickedObject;
|
|
27142
26953
|
}
|
|
27143
26954
|
triggerPointerUp(evt) {
|
|
27144
26955
|
var _this$onPointerUp$$em;
|
|
27145
|
-
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") {
|
|
27146
26957
|
var _this$_parent3;
|
|
27147
26958
|
(_this$_parent3 = this._parent) === null || _this$_parent3 === void 0 || _this$_parent3.triggerPointerUp(evt);
|
|
27148
26959
|
return false;
|
|
@@ -27151,7 +26962,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27151
26962
|
}
|
|
27152
26963
|
triggerMouseWheel(evt) {
|
|
27153
26964
|
var _this$onMouseWheel$$e;
|
|
27154
|
-
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") {
|
|
27155
26966
|
var _this$_parent4;
|
|
27156
26967
|
(_this$_parent4 = this._parent) === null || _this$_parent4 === void 0 || _this$_parent4.triggerMouseWheel(evt);
|
|
27157
26968
|
return false;
|
|
@@ -27160,7 +26971,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27160
26971
|
}
|
|
27161
26972
|
triggerSingleClick(evt) {
|
|
27162
26973
|
var _this$onSingleClick$$;
|
|
27163
|
-
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") {
|
|
27164
26975
|
var _this$_parent5;
|
|
27165
26976
|
(_this$_parent5 = this._parent) === null || _this$_parent5 === void 0 || _this$_parent5.triggerSingleClick(evt);
|
|
27166
26977
|
return false;
|
|
@@ -27169,7 +26980,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27169
26980
|
}
|
|
27170
26981
|
triggerClick(evt) {
|
|
27171
26982
|
var _this$onClick$$emitEv;
|
|
27172
|
-
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") {
|
|
27173
26984
|
var _this$_parent6;
|
|
27174
26985
|
(_this$_parent6 = this._parent) === null || _this$_parent6 === void 0 || _this$_parent6.triggerClick(evt);
|
|
27175
26986
|
return false;
|
|
@@ -27178,7 +26989,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27178
26989
|
}
|
|
27179
26990
|
triggerDblclick(evt) {
|
|
27180
26991
|
var _this$onDblclick$$emi;
|
|
27181
|
-
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") {
|
|
27182
26993
|
var _this$_parent7;
|
|
27183
26994
|
(_this$_parent7 = this._parent) === null || _this$_parent7 === void 0 || _this$_parent7.triggerDblclick(evt);
|
|
27184
26995
|
return false;
|
|
@@ -27187,7 +26998,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27187
26998
|
}
|
|
27188
26999
|
triggerTripleClick(evt) {
|
|
27189
27000
|
var _this$onTripleClick$$;
|
|
27190
|
-
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") {
|
|
27191
27002
|
var _this$_parent8;
|
|
27192
27003
|
(_this$_parent8 = this._parent) === null || _this$_parent8 === void 0 || _this$_parent8.triggerTripleClick(evt);
|
|
27193
27004
|
return false;
|
|
@@ -27196,7 +27007,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27196
27007
|
}
|
|
27197
27008
|
triggerPointerMove(evt) {
|
|
27198
27009
|
var _this$onPointerMove$$;
|
|
27199
|
-
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") {
|
|
27200
27011
|
var _this$_parent9;
|
|
27201
27012
|
(_this$_parent9 = this._parent) === null || _this$_parent9 === void 0 || _this$_parent9.triggerPointerMove(evt);
|
|
27202
27013
|
return false;
|
|
@@ -27205,7 +27016,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27205
27016
|
}
|
|
27206
27017
|
triggerPointerDown(evt) {
|
|
27207
27018
|
var _this$onPointerDown$$;
|
|
27208
|
-
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") {
|
|
27209
27020
|
var _this$_parent10;
|
|
27210
27021
|
(_this$_parent10 = this._parent) === null || _this$_parent10 === void 0 || _this$_parent10.triggerPointerDown(evt);
|
|
27211
27022
|
return false;
|
|
@@ -27213,7 +27024,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27213
27024
|
return true;
|
|
27214
27025
|
}
|
|
27215
27026
|
triggerPointerOut(evt) {
|
|
27216
|
-
if (this._parent.classType ===
|
|
27027
|
+
if (this._parent.classType === "SceneViewer") {
|
|
27217
27028
|
var _this$_parent11;
|
|
27218
27029
|
(_this$_parent11 = this._parent) === null || _this$_parent11 === void 0 || _this$_parent11.triggerPointerOut(evt);
|
|
27219
27030
|
return false;
|
|
@@ -27222,7 +27033,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27222
27033
|
}
|
|
27223
27034
|
triggerPointerLeave(evt) {
|
|
27224
27035
|
var _this$onPointerLeave$;
|
|
27225
|
-
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") {
|
|
27226
27037
|
var _this$_parent12;
|
|
27227
27038
|
(_this$_parent12 = this._parent) === null || _this$_parent12 === void 0 || _this$_parent12.triggerPointerLeave(evt);
|
|
27228
27039
|
return false;
|
|
@@ -27230,7 +27041,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27230
27041
|
return true;
|
|
27231
27042
|
}
|
|
27232
27043
|
triggerPointerOver(evt) {
|
|
27233
|
-
if (this._parent.classType ===
|
|
27044
|
+
if (this._parent.classType === "SceneViewer") {
|
|
27234
27045
|
var _this$_parent13;
|
|
27235
27046
|
(_this$_parent13 = this._parent) === null || _this$_parent13 === void 0 || _this$_parent13.triggerPointerOver(evt);
|
|
27236
27047
|
return false;
|
|
@@ -27238,7 +27049,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27238
27049
|
return true;
|
|
27239
27050
|
}
|
|
27240
27051
|
triggerPointerCancel(evt) {
|
|
27241
|
-
if (this._parent.classType ===
|
|
27052
|
+
if (this._parent.classType === "SceneViewer") {
|
|
27242
27053
|
var _this$_parent14;
|
|
27243
27054
|
(_this$_parent14 = this._parent) === null || _this$_parent14 === void 0 || _this$_parent14.triggerPointerCancel(evt);
|
|
27244
27055
|
return false;
|
|
@@ -27247,7 +27058,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27247
27058
|
}
|
|
27248
27059
|
triggerPointerEnter(evt) {
|
|
27249
27060
|
var _this$onPointerEnter$;
|
|
27250
|
-
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") {
|
|
27251
27062
|
var _this$_parent15;
|
|
27252
27063
|
(_this$_parent15 = this._parent) === null || _this$_parent15 === void 0 || _this$_parent15.triggerPointerEnter(evt);
|
|
27253
27064
|
return false;
|
|
@@ -27256,7 +27067,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27256
27067
|
}
|
|
27257
27068
|
triggerDragLeave(evt) {
|
|
27258
27069
|
var _this$onDragLeave$$em;
|
|
27259
|
-
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") {
|
|
27260
27071
|
var _this$_parent16;
|
|
27261
27072
|
(_this$_parent16 = this._parent) === null || _this$_parent16 === void 0 || _this$_parent16.triggerDragLeave(evt);
|
|
27262
27073
|
return false;
|
|
@@ -27265,7 +27076,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27265
27076
|
}
|
|
27266
27077
|
triggerDragOver(evt) {
|
|
27267
27078
|
var _this$onDragOver$$emi;
|
|
27268
|
-
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") {
|
|
27269
27080
|
var _this$_parent17;
|
|
27270
27081
|
(_this$_parent17 = this._parent) === null || _this$_parent17 === void 0 || _this$_parent17.triggerDragOver(evt);
|
|
27271
27082
|
return false;
|
|
@@ -27274,7 +27085,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27274
27085
|
}
|
|
27275
27086
|
triggerDragEnter(evt) {
|
|
27276
27087
|
var _this$onDragEnter$$em;
|
|
27277
|
-
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") {
|
|
27278
27089
|
var _this$_parent18;
|
|
27279
27090
|
(_this$_parent18 = this._parent) === null || _this$_parent18 === void 0 || _this$_parent18.triggerDragEnter(evt);
|
|
27280
27091
|
return false;
|
|
@@ -27283,7 +27094,7 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27283
27094
|
}
|
|
27284
27095
|
triggerDrop(evt) {
|
|
27285
27096
|
var _this$onDrop$$emitEve;
|
|
27286
|
-
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") {
|
|
27287
27098
|
var _this$_parent19;
|
|
27288
27099
|
(_this$_parent19 = this._parent) === null || _this$_parent19 === void 0 || _this$_parent19.triggerDrop(evt);
|
|
27289
27100
|
return false;
|
|
@@ -27296,10 +27107,11 @@ var Scene = class extends _univerjs_core.Disposable {
|
|
|
27296
27107
|
*
|
|
27297
27108
|
*/
|
|
27298
27109
|
_transformHandler() {
|
|
27299
|
-
|
|
27110
|
+
const composeResult = Transform.create().composeMatrix({
|
|
27300
27111
|
scaleX: this.scaleX,
|
|
27301
27112
|
scaleY: this.scaleY
|
|
27302
27113
|
});
|
|
27114
|
+
this.transform = composeResult;
|
|
27303
27115
|
this.getViewports().forEach((vp) => {
|
|
27304
27116
|
vp.resetCanvasSizeAndUpdateScroll();
|
|
27305
27117
|
});
|
|
@@ -27364,6 +27176,7 @@ let RenderUnit = class RenderUnit extends _univerjs_core.Disposable {
|
|
|
27364
27176
|
return this._renderContext.components;
|
|
27365
27177
|
}
|
|
27366
27178
|
constructor(init, parentInjector) {
|
|
27179
|
+
var _init$createUnitOptio;
|
|
27367
27180
|
super();
|
|
27368
27181
|
_defineProperty(this, "isRenderUnit", true);
|
|
27369
27182
|
_defineProperty(this, "_activated$", new rxjs.BehaviorSubject(true));
|
|
@@ -27384,6 +27197,7 @@ let RenderUnit = class RenderUnit extends _univerjs_core.Disposable {
|
|
|
27384
27197
|
activate: () => this._activated$.next(true),
|
|
27385
27198
|
deactivate: () => this._activated$.next(false)
|
|
27386
27199
|
};
|
|
27200
|
+
if (((_init$createUnitOptio = init.createUnitOptions) === null || _init$createUnitOptio === void 0 ? void 0 : _init$createUnitOptio.makeCurrent) === false) this.deactivate();
|
|
27387
27201
|
}
|
|
27388
27202
|
dispose() {
|
|
27389
27203
|
this._injector.dispose();
|
|
@@ -27515,8 +27329,8 @@ let RenderManagerService = class RenderManagerService extends _univerjs_core.Dis
|
|
|
27515
27329
|
* @param unitId
|
|
27516
27330
|
* @returns renderUnit:IRender
|
|
27517
27331
|
*/
|
|
27518
|
-
createRender(unitId) {
|
|
27519
|
-
const renderer = this._createRender(unitId, this._injector.createInstance(Engine, unitId, void 0));
|
|
27332
|
+
createRender(unitId, createUnitOptions) {
|
|
27333
|
+
const renderer = this._createRender(unitId, this._injector.createInstance(Engine, unitId, void 0), true, createUnitOptions);
|
|
27520
27334
|
this._renderCreated$.next(renderer);
|
|
27521
27335
|
return renderer;
|
|
27522
27336
|
}
|
|
@@ -27540,7 +27354,7 @@ let RenderManagerService = class RenderManagerService extends _univerjs_core.Dis
|
|
|
27540
27354
|
* @param isMainScene
|
|
27541
27355
|
* @returns renderUnit:IRender
|
|
27542
27356
|
*/
|
|
27543
|
-
_createRender(unitId, engine, isMainScene = true) {
|
|
27357
|
+
_createRender(unitId, engine, isMainScene = true, createUnitOptions) {
|
|
27544
27358
|
const existItem = this.getRenderById(unitId);
|
|
27545
27359
|
let shouldDestroyEngine = true;
|
|
27546
27360
|
if (existItem != null) {
|
|
@@ -27561,7 +27375,8 @@ let RenderManagerService = class RenderManagerService extends _univerjs_core.Dis
|
|
|
27561
27375
|
unit,
|
|
27562
27376
|
engine,
|
|
27563
27377
|
scene,
|
|
27564
|
-
isMainScene
|
|
27378
|
+
isMainScene,
|
|
27379
|
+
createUnitOptions
|
|
27565
27380
|
});
|
|
27566
27381
|
this._addRenderUnit(unitId, renderUnit);
|
|
27567
27382
|
this._tryAddRenderDependencies(renderUnit, ctorOfDeps);
|
|
@@ -28391,7 +28206,7 @@ var Viewport = class {
|
|
|
28391
28206
|
});
|
|
28392
28207
|
if (isLimitedStore && !isLimitedStore.isLimitedX && !isLimitedStore.isLimitedY) {
|
|
28393
28208
|
evt.preventDefault();
|
|
28394
|
-
if (this._scene.getParent().classType ===
|
|
28209
|
+
if (this._scene.getParent().classType === "SceneViewer") state.stopPropagation();
|
|
28395
28210
|
}
|
|
28396
28211
|
if (this._isWheelPreventDefaultX && this._isWheelPreventDefaultY) evt.preventDefault();
|
|
28397
28212
|
this._scene.makeDirty(true);
|
|
@@ -28749,8 +28564,8 @@ var Viewport = class {
|
|
|
28749
28564
|
_drawScrollbar(ctx) {
|
|
28750
28565
|
if (!this._scrollBar) return;
|
|
28751
28566
|
const parent = this._scene.getParent();
|
|
28752
|
-
if (parent.classType ===
|
|
28753
|
-
else if (parent.classType ===
|
|
28567
|
+
if (parent.classType === "SceneViewer") this._scrollBar.render(ctx);
|
|
28568
|
+
else if (parent.classType === "Engine") this._scrollBar.render(ctx);
|
|
28754
28569
|
}
|
|
28755
28570
|
setViewportSize(props) {
|
|
28756
28571
|
if (_univerjs_core.Tools.isDefine(props === null || props === void 0 ? void 0 : props.top)) this.top = props.top;
|