@leafer-game/worker 1.3.1 → 1.3.3
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/dist/worker.js +396 -264
- package/dist/worker.min.js +1 -1
- package/dist/worker.module.js +397 -265
- package/dist/worker.module.min.js +1 -1
- package/package.json +10 -10
package/dist/worker.module.js
CHANGED
|
@@ -1533,10 +1533,10 @@ const DataHelper = {
|
|
|
1533
1533
|
Object.keys(merge).forEach(key => {
|
|
1534
1534
|
var _a, _b;
|
|
1535
1535
|
value = merge[key];
|
|
1536
|
-
if ((value === null || value ===
|
|
1536
|
+
if ((value === null || value === undefined ? undefined : value.constructor) === Object && ((_a = t[key]) === null || _a === undefined ? undefined : _a.constructor) === Object)
|
|
1537
1537
|
return assign$1(t[key], merge[key], exclude && exclude[key]);
|
|
1538
1538
|
if (exclude && (key in exclude)) {
|
|
1539
|
-
if (((_b = exclude[key]) === null || _b ===
|
|
1539
|
+
if (((_b = exclude[key]) === null || _b === undefined ? undefined : _b.constructor) === Object)
|
|
1540
1540
|
assign$1(t[key] = {}, merge[key], exclude[key]);
|
|
1541
1541
|
return;
|
|
1542
1542
|
}
|
|
@@ -1705,7 +1705,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
1705
1705
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
1706
1706
|
PERFORMANCE OF THIS SOFTWARE.
|
|
1707
1707
|
***************************************************************************** */
|
|
1708
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
1708
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
1709
1709
|
|
|
1710
1710
|
|
|
1711
1711
|
function __decorate(decorators, target, key, desc) {
|
|
@@ -1773,7 +1773,7 @@ let Canvas$1 = class Canvas {
|
|
|
1773
1773
|
}
|
|
1774
1774
|
setTransform(_a, _b, _c, _d, _e, _f) { }
|
|
1775
1775
|
resetTransform() { }
|
|
1776
|
-
getTransform() { return
|
|
1776
|
+
getTransform() { return undefined; }
|
|
1777
1777
|
save() { }
|
|
1778
1778
|
restore() { }
|
|
1779
1779
|
transform(a, b, c, d, e, f) {
|
|
@@ -1830,12 +1830,12 @@ let Canvas$1 = class Canvas {
|
|
|
1830
1830
|
ellipse(_x, _y, _radiusX, _radiusY, _rotation, _startAngle, _endAngle, _anticlockwise) { }
|
|
1831
1831
|
rect(_x, _y, _width, _height) { }
|
|
1832
1832
|
roundRect(_x, _y, _width, _height, _radius) { }
|
|
1833
|
-
createConicGradient(_startAngle, _x, _y) { return
|
|
1834
|
-
createLinearGradient(_x0, _y0, _x1, _y1) { return
|
|
1835
|
-
createPattern(_image, _repetition) { return
|
|
1836
|
-
createRadialGradient(_x0, _y0, _r0, _x1, _y1, _r1) { return
|
|
1833
|
+
createConicGradient(_startAngle, _x, _y) { return undefined; }
|
|
1834
|
+
createLinearGradient(_x0, _y0, _x1, _y1) { return undefined; }
|
|
1835
|
+
createPattern(_image, _repetition) { return undefined; }
|
|
1836
|
+
createRadialGradient(_x0, _y0, _r0, _x1, _y1, _r1) { return undefined; }
|
|
1837
1837
|
fillText(_text, _x, _y, _maxWidth) { }
|
|
1838
|
-
measureText(_text) { return
|
|
1838
|
+
measureText(_text) { return undefined; }
|
|
1839
1839
|
strokeText(_text, _x, _y, _maxWidth) { }
|
|
1840
1840
|
destroy() {
|
|
1841
1841
|
this.context = null;
|
|
@@ -1843,79 +1843,79 @@ let Canvas$1 = class Canvas {
|
|
|
1843
1843
|
};
|
|
1844
1844
|
__decorate([
|
|
1845
1845
|
contextAttr('imageSmoothingEnabled')
|
|
1846
|
-
], Canvas$1.prototype, "smooth",
|
|
1846
|
+
], Canvas$1.prototype, "smooth", undefined);
|
|
1847
1847
|
__decorate([
|
|
1848
1848
|
contextAttr('imageSmoothingQuality')
|
|
1849
|
-
], Canvas$1.prototype, "smoothLevel",
|
|
1849
|
+
], Canvas$1.prototype, "smoothLevel", undefined);
|
|
1850
1850
|
__decorate([
|
|
1851
1851
|
contextAttr('globalAlpha')
|
|
1852
|
-
], Canvas$1.prototype, "opacity",
|
|
1852
|
+
], Canvas$1.prototype, "opacity", undefined);
|
|
1853
1853
|
__decorate([
|
|
1854
1854
|
contextAttr()
|
|
1855
|
-
], Canvas$1.prototype, "fillStyle",
|
|
1855
|
+
], Canvas$1.prototype, "fillStyle", undefined);
|
|
1856
1856
|
__decorate([
|
|
1857
1857
|
contextAttr()
|
|
1858
|
-
], Canvas$1.prototype, "strokeStyle",
|
|
1858
|
+
], Canvas$1.prototype, "strokeStyle", undefined);
|
|
1859
1859
|
__decorate([
|
|
1860
1860
|
contextAttr('lineWidth')
|
|
1861
|
-
], Canvas$1.prototype, "strokeWidth",
|
|
1861
|
+
], Canvas$1.prototype, "strokeWidth", undefined);
|
|
1862
1862
|
__decorate([
|
|
1863
1863
|
contextAttr('lineCap')
|
|
1864
|
-
], Canvas$1.prototype, "strokeCap",
|
|
1864
|
+
], Canvas$1.prototype, "strokeCap", undefined);
|
|
1865
1865
|
__decorate([
|
|
1866
1866
|
contextAttr('lineJoin')
|
|
1867
|
-
], Canvas$1.prototype, "strokeJoin",
|
|
1867
|
+
], Canvas$1.prototype, "strokeJoin", undefined);
|
|
1868
1868
|
__decorate([
|
|
1869
1869
|
contextAttr('lineDashOffset')
|
|
1870
|
-
], Canvas$1.prototype, "dashOffset",
|
|
1870
|
+
], Canvas$1.prototype, "dashOffset", undefined);
|
|
1871
1871
|
__decorate([
|
|
1872
1872
|
contextAttr()
|
|
1873
|
-
], Canvas$1.prototype, "miterLimit",
|
|
1873
|
+
], Canvas$1.prototype, "miterLimit", undefined);
|
|
1874
1874
|
__decorate([
|
|
1875
1875
|
contextAttr()
|
|
1876
|
-
], Canvas$1.prototype, "shadowBlur",
|
|
1876
|
+
], Canvas$1.prototype, "shadowBlur", undefined);
|
|
1877
1877
|
__decorate([
|
|
1878
1878
|
contextAttr()
|
|
1879
|
-
], Canvas$1.prototype, "shadowColor",
|
|
1879
|
+
], Canvas$1.prototype, "shadowColor", undefined);
|
|
1880
1880
|
__decorate([
|
|
1881
1881
|
contextAttr()
|
|
1882
|
-
], Canvas$1.prototype, "shadowOffsetX",
|
|
1882
|
+
], Canvas$1.prototype, "shadowOffsetX", undefined);
|
|
1883
1883
|
__decorate([
|
|
1884
1884
|
contextAttr()
|
|
1885
|
-
], Canvas$1.prototype, "shadowOffsetY",
|
|
1885
|
+
], Canvas$1.prototype, "shadowOffsetY", undefined);
|
|
1886
1886
|
__decorate([
|
|
1887
1887
|
contextAttr()
|
|
1888
|
-
], Canvas$1.prototype, "filter",
|
|
1888
|
+
], Canvas$1.prototype, "filter", undefined);
|
|
1889
1889
|
__decorate([
|
|
1890
1890
|
contextAttr()
|
|
1891
|
-
], Canvas$1.prototype, "font",
|
|
1891
|
+
], Canvas$1.prototype, "font", undefined);
|
|
1892
1892
|
__decorate([
|
|
1893
1893
|
contextAttr()
|
|
1894
|
-
], Canvas$1.prototype, "fontKerning",
|
|
1894
|
+
], Canvas$1.prototype, "fontKerning", undefined);
|
|
1895
1895
|
__decorate([
|
|
1896
1896
|
contextAttr()
|
|
1897
|
-
], Canvas$1.prototype, "fontStretch",
|
|
1897
|
+
], Canvas$1.prototype, "fontStretch", undefined);
|
|
1898
1898
|
__decorate([
|
|
1899
1899
|
contextAttr()
|
|
1900
|
-
], Canvas$1.prototype, "fontVariantCaps",
|
|
1900
|
+
], Canvas$1.prototype, "fontVariantCaps", undefined);
|
|
1901
1901
|
__decorate([
|
|
1902
1902
|
contextAttr()
|
|
1903
|
-
], Canvas$1.prototype, "textAlign",
|
|
1903
|
+
], Canvas$1.prototype, "textAlign", undefined);
|
|
1904
1904
|
__decorate([
|
|
1905
1905
|
contextAttr()
|
|
1906
|
-
], Canvas$1.prototype, "textBaseline",
|
|
1906
|
+
], Canvas$1.prototype, "textBaseline", undefined);
|
|
1907
1907
|
__decorate([
|
|
1908
1908
|
contextAttr()
|
|
1909
|
-
], Canvas$1.prototype, "textRendering",
|
|
1909
|
+
], Canvas$1.prototype, "textRendering", undefined);
|
|
1910
1910
|
__decorate([
|
|
1911
1911
|
contextAttr()
|
|
1912
|
-
], Canvas$1.prototype, "wordSpacing",
|
|
1912
|
+
], Canvas$1.prototype, "wordSpacing", undefined);
|
|
1913
1913
|
__decorate([
|
|
1914
1914
|
contextAttr()
|
|
1915
|
-
], Canvas$1.prototype, "letterSpacing",
|
|
1915
|
+
], Canvas$1.prototype, "letterSpacing", undefined);
|
|
1916
1916
|
__decorate([
|
|
1917
1917
|
contextAttr()
|
|
1918
|
-
], Canvas$1.prototype, "direction",
|
|
1918
|
+
], Canvas$1.prototype, "direction", undefined);
|
|
1919
1919
|
__decorate([
|
|
1920
1920
|
contextMethod()
|
|
1921
1921
|
], Canvas$1.prototype, "setTransform", null);
|
|
@@ -3384,7 +3384,7 @@ class TaskItem {
|
|
|
3384
3384
|
this.task = task;
|
|
3385
3385
|
}
|
|
3386
3386
|
run() {
|
|
3387
|
-
return __awaiter(this,
|
|
3387
|
+
return __awaiter(this, undefined, undefined, function* () {
|
|
3388
3388
|
try {
|
|
3389
3389
|
if (this.task && !this.isComplete && this.parent.running)
|
|
3390
3390
|
yield this.task();
|
|
@@ -3696,7 +3696,7 @@ class LeaferImage {
|
|
|
3696
3696
|
load(onSuccess, onError) {
|
|
3697
3697
|
if (!this.loading) {
|
|
3698
3698
|
this.loading = true;
|
|
3699
|
-
ImageManager.tasker.add(() => __awaiter(this,
|
|
3699
|
+
ImageManager.tasker.add(() => __awaiter(this, undefined, undefined, function* () {
|
|
3700
3700
|
return yield Platform.origin.loadImage(this.url).then((img) => {
|
|
3701
3701
|
this.ready = true;
|
|
3702
3702
|
this.width = img.naturalWidth || img.width;
|
|
@@ -5175,8 +5175,7 @@ const LeafBounds = {
|
|
|
5175
5175
|
__updateAutoLayout() {
|
|
5176
5176
|
this.__layout.matrixChanged = true;
|
|
5177
5177
|
if (this.isBranch) {
|
|
5178
|
-
|
|
5179
|
-
this.leafer.layouter.addExtra(this);
|
|
5178
|
+
this.__extraUpdate();
|
|
5180
5179
|
if (this.__.flow) {
|
|
5181
5180
|
if (this.__layout.boxChanged)
|
|
5182
5181
|
this.__updateFlowLayout();
|
|
@@ -5329,7 +5328,7 @@ let Leaf = class Leaf {
|
|
|
5329
5328
|
get __worldFlipped() { return this.__world.scaleX < 0 || this.__world.scaleY < 0; }
|
|
5330
5329
|
get __onlyHitMask() { return this.__hasMask && !this.__.hitChildren; }
|
|
5331
5330
|
get __ignoreHitWorld() { return (this.__hasMask || this.__hasEraser) && this.__.hitChildren; }
|
|
5332
|
-
get __inLazyBounds() {
|
|
5331
|
+
get __inLazyBounds() { return this.leaferIsCreated && this.leafer.lazyBounds.hit(this.__world); }
|
|
5333
5332
|
get pathInputed() { return this.__.__pathInputed; }
|
|
5334
5333
|
set event(map) { this.on(map); }
|
|
5335
5334
|
constructor(data) {
|
|
@@ -5440,6 +5439,10 @@ let Leaf = class Leaf {
|
|
|
5440
5439
|
forceRender(_bounds, _sync) {
|
|
5441
5440
|
this.forceUpdate('surface');
|
|
5442
5441
|
}
|
|
5442
|
+
__extraUpdate() {
|
|
5443
|
+
if (this.leaferIsReady)
|
|
5444
|
+
this.leafer.layouter.addExtra(this);
|
|
5445
|
+
}
|
|
5443
5446
|
__updateWorldMatrix() { }
|
|
5444
5447
|
__updateLocalMatrix() { }
|
|
5445
5448
|
__updateWorldBounds() { }
|
|
@@ -6007,7 +6010,7 @@ class LeafLevelList {
|
|
|
6007
6010
|
}
|
|
6008
6011
|
}
|
|
6009
6012
|
|
|
6010
|
-
const version = "1.3.
|
|
6013
|
+
const version = "1.3.3";
|
|
6011
6014
|
|
|
6012
6015
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6013
6016
|
get allowBackgroundColor() { return true; }
|
|
@@ -6352,7 +6355,7 @@ class Layouter {
|
|
|
6352
6355
|
}
|
|
6353
6356
|
partLayout() {
|
|
6354
6357
|
var _a;
|
|
6355
|
-
if (!((_a = this.__updatedList) === null || _a ===
|
|
6358
|
+
if (!((_a = this.__updatedList) === null || _a === undefined ? undefined : _a.length))
|
|
6356
6359
|
return;
|
|
6357
6360
|
const t = Run.start('PartLayout');
|
|
6358
6361
|
const { target, __updatedList: updateList } = this;
|
|
@@ -6539,7 +6542,7 @@ class Renderer {
|
|
|
6539
6542
|
partRender() {
|
|
6540
6543
|
const { canvas, updateBlocks: list } = this;
|
|
6541
6544
|
if (!list)
|
|
6542
|
-
return
|
|
6545
|
+
return;
|
|
6543
6546
|
this.mergeBlocks();
|
|
6544
6547
|
list.forEach(block => { if (canvas.bounds.hit(block) && !block.isEmpty())
|
|
6545
6548
|
this.clipRender(block); });
|
|
@@ -6923,6 +6926,7 @@ class UIData extends LeafData {
|
|
|
6923
6926
|
return t.fill && this.__hasStroke;
|
|
6924
6927
|
}
|
|
6925
6928
|
get __clipAfterFill() { const t = this; return (t.cornerRadius || t.innerShadow || t.__pathInputed); }
|
|
6929
|
+
get __hasSurface() { const t = this; return (t.fill || t.stroke); }
|
|
6926
6930
|
get __autoWidth() { return !this._width; }
|
|
6927
6931
|
get __autoHeight() { return !this._height; }
|
|
6928
6932
|
get __autoSide() { return !this._width || !this._height; }
|
|
@@ -7395,7 +7399,7 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
7395
7399
|
animate(_keyframe, _options, _type, _isTemp) {
|
|
7396
7400
|
return Plugin.need('animate');
|
|
7397
7401
|
}
|
|
7398
|
-
killAnimate(_type,
|
|
7402
|
+
killAnimate(_type, _nextStyle) { }
|
|
7399
7403
|
export(_filename, _options) {
|
|
7400
7404
|
return Plugin.need('export');
|
|
7401
7405
|
}
|
|
@@ -7426,199 +7430,199 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
7426
7430
|
};
|
|
7427
7431
|
__decorate([
|
|
7428
7432
|
dataProcessor(UIData)
|
|
7429
|
-
], UI.prototype, "__",
|
|
7433
|
+
], UI.prototype, "__", undefined);
|
|
7430
7434
|
__decorate([
|
|
7431
7435
|
zoomLayerType()
|
|
7432
|
-
], UI.prototype, "zoomLayer",
|
|
7436
|
+
], UI.prototype, "zoomLayer", undefined);
|
|
7433
7437
|
__decorate([
|
|
7434
7438
|
dataType('')
|
|
7435
|
-
], UI.prototype, "id",
|
|
7439
|
+
], UI.prototype, "id", undefined);
|
|
7436
7440
|
__decorate([
|
|
7437
7441
|
dataType('')
|
|
7438
|
-
], UI.prototype, "name",
|
|
7442
|
+
], UI.prototype, "name", undefined);
|
|
7439
7443
|
__decorate([
|
|
7440
7444
|
dataType('')
|
|
7441
|
-
], UI.prototype, "className",
|
|
7445
|
+
], UI.prototype, "className", undefined);
|
|
7442
7446
|
__decorate([
|
|
7443
7447
|
surfaceType('pass-through')
|
|
7444
|
-
], UI.prototype, "blendMode",
|
|
7448
|
+
], UI.prototype, "blendMode", undefined);
|
|
7445
7449
|
__decorate([
|
|
7446
7450
|
opacityType(1)
|
|
7447
|
-
], UI.prototype, "opacity",
|
|
7451
|
+
], UI.prototype, "opacity", undefined);
|
|
7448
7452
|
__decorate([
|
|
7449
7453
|
visibleType(true)
|
|
7450
|
-
], UI.prototype, "visible",
|
|
7454
|
+
], UI.prototype, "visible", undefined);
|
|
7451
7455
|
__decorate([
|
|
7452
7456
|
surfaceType(false)
|
|
7453
|
-
], UI.prototype, "locked",
|
|
7457
|
+
], UI.prototype, "locked", undefined);
|
|
7454
7458
|
__decorate([
|
|
7455
7459
|
sortType(0)
|
|
7456
|
-
], UI.prototype, "zIndex",
|
|
7460
|
+
], UI.prototype, "zIndex", undefined);
|
|
7457
7461
|
__decorate([
|
|
7458
7462
|
maskType(false)
|
|
7459
|
-
], UI.prototype, "mask",
|
|
7463
|
+
], UI.prototype, "mask", undefined);
|
|
7460
7464
|
__decorate([
|
|
7461
7465
|
eraserType(false)
|
|
7462
|
-
], UI.prototype, "eraser",
|
|
7466
|
+
], UI.prototype, "eraser", undefined);
|
|
7463
7467
|
__decorate([
|
|
7464
7468
|
positionType(0, true)
|
|
7465
|
-
], UI.prototype, "x",
|
|
7469
|
+
], UI.prototype, "x", undefined);
|
|
7466
7470
|
__decorate([
|
|
7467
7471
|
positionType(0, true)
|
|
7468
|
-
], UI.prototype, "y",
|
|
7472
|
+
], UI.prototype, "y", undefined);
|
|
7469
7473
|
__decorate([
|
|
7470
7474
|
boundsType(100, true)
|
|
7471
|
-
], UI.prototype, "width",
|
|
7475
|
+
], UI.prototype, "width", undefined);
|
|
7472
7476
|
__decorate([
|
|
7473
7477
|
boundsType(100, true)
|
|
7474
|
-
], UI.prototype, "height",
|
|
7478
|
+
], UI.prototype, "height", undefined);
|
|
7475
7479
|
__decorate([
|
|
7476
7480
|
scaleType(1, true)
|
|
7477
|
-
], UI.prototype, "scaleX",
|
|
7481
|
+
], UI.prototype, "scaleX", undefined);
|
|
7478
7482
|
__decorate([
|
|
7479
7483
|
scaleType(1, true)
|
|
7480
|
-
], UI.prototype, "scaleY",
|
|
7484
|
+
], UI.prototype, "scaleY", undefined);
|
|
7481
7485
|
__decorate([
|
|
7482
7486
|
rotationType(0, true)
|
|
7483
|
-
], UI.prototype, "rotation",
|
|
7487
|
+
], UI.prototype, "rotation", undefined);
|
|
7484
7488
|
__decorate([
|
|
7485
7489
|
rotationType(0, true)
|
|
7486
|
-
], UI.prototype, "skewX",
|
|
7490
|
+
], UI.prototype, "skewX", undefined);
|
|
7487
7491
|
__decorate([
|
|
7488
7492
|
rotationType(0, true)
|
|
7489
|
-
], UI.prototype, "skewY",
|
|
7493
|
+
], UI.prototype, "skewY", undefined);
|
|
7490
7494
|
__decorate([
|
|
7491
7495
|
positionType(0, true)
|
|
7492
|
-
], UI.prototype, "offsetX",
|
|
7496
|
+
], UI.prototype, "offsetX", undefined);
|
|
7493
7497
|
__decorate([
|
|
7494
7498
|
positionType(0, true)
|
|
7495
|
-
], UI.prototype, "offsetY",
|
|
7499
|
+
], UI.prototype, "offsetY", undefined);
|
|
7496
7500
|
__decorate([
|
|
7497
7501
|
positionType(0, true)
|
|
7498
|
-
], UI.prototype, "scrollX",
|
|
7502
|
+
], UI.prototype, "scrollX", undefined);
|
|
7499
7503
|
__decorate([
|
|
7500
7504
|
positionType(0, true)
|
|
7501
|
-
], UI.prototype, "scrollY",
|
|
7505
|
+
], UI.prototype, "scrollY", undefined);
|
|
7502
7506
|
__decorate([
|
|
7503
7507
|
autoLayoutType()
|
|
7504
|
-
], UI.prototype, "origin",
|
|
7508
|
+
], UI.prototype, "origin", undefined);
|
|
7505
7509
|
__decorate([
|
|
7506
7510
|
autoLayoutType()
|
|
7507
|
-
], UI.prototype, "around",
|
|
7511
|
+
], UI.prototype, "around", undefined);
|
|
7508
7512
|
__decorate([
|
|
7509
7513
|
dataType(false)
|
|
7510
|
-
], UI.prototype, "lazy",
|
|
7514
|
+
], UI.prototype, "lazy", undefined);
|
|
7511
7515
|
__decorate([
|
|
7512
7516
|
naturalBoundsType(1)
|
|
7513
|
-
], UI.prototype, "pixelRatio",
|
|
7517
|
+
], UI.prototype, "pixelRatio", undefined);
|
|
7514
7518
|
__decorate([
|
|
7515
7519
|
pathInputType()
|
|
7516
|
-
], UI.prototype, "path",
|
|
7520
|
+
], UI.prototype, "path", undefined);
|
|
7517
7521
|
__decorate([
|
|
7518
7522
|
pathType()
|
|
7519
|
-
], UI.prototype, "windingRule",
|
|
7523
|
+
], UI.prototype, "windingRule", undefined);
|
|
7520
7524
|
__decorate([
|
|
7521
7525
|
pathType(true)
|
|
7522
|
-
], UI.prototype, "closed",
|
|
7526
|
+
], UI.prototype, "closed", undefined);
|
|
7523
7527
|
__decorate([
|
|
7524
7528
|
boundsType(0)
|
|
7525
|
-
], UI.prototype, "padding",
|
|
7529
|
+
], UI.prototype, "padding", undefined);
|
|
7526
7530
|
__decorate([
|
|
7527
7531
|
boundsType(false)
|
|
7528
|
-
], UI.prototype, "lockRatio",
|
|
7532
|
+
], UI.prototype, "lockRatio", undefined);
|
|
7529
7533
|
__decorate([
|
|
7530
7534
|
boundsType()
|
|
7531
|
-
], UI.prototype, "widthRange",
|
|
7535
|
+
], UI.prototype, "widthRange", undefined);
|
|
7532
7536
|
__decorate([
|
|
7533
7537
|
boundsType()
|
|
7534
|
-
], UI.prototype, "heightRange",
|
|
7538
|
+
], UI.prototype, "heightRange", undefined);
|
|
7535
7539
|
__decorate([
|
|
7536
7540
|
dataType(false)
|
|
7537
|
-
], UI.prototype, "draggable",
|
|
7541
|
+
], UI.prototype, "draggable", undefined);
|
|
7538
7542
|
__decorate([
|
|
7539
7543
|
dataType()
|
|
7540
|
-
], UI.prototype, "dragBounds",
|
|
7544
|
+
], UI.prototype, "dragBounds", undefined);
|
|
7541
7545
|
__decorate([
|
|
7542
7546
|
dataType(false)
|
|
7543
|
-
], UI.prototype, "editable",
|
|
7547
|
+
], UI.prototype, "editable", undefined);
|
|
7544
7548
|
__decorate([
|
|
7545
7549
|
hitType(true)
|
|
7546
|
-
], UI.prototype, "hittable",
|
|
7550
|
+
], UI.prototype, "hittable", undefined);
|
|
7547
7551
|
__decorate([
|
|
7548
7552
|
hitType('path')
|
|
7549
|
-
], UI.prototype, "hitFill",
|
|
7553
|
+
], UI.prototype, "hitFill", undefined);
|
|
7550
7554
|
__decorate([
|
|
7551
7555
|
strokeType('path')
|
|
7552
|
-
], UI.prototype, "hitStroke",
|
|
7556
|
+
], UI.prototype, "hitStroke", undefined);
|
|
7553
7557
|
__decorate([
|
|
7554
7558
|
hitType(false)
|
|
7555
|
-
], UI.prototype, "hitBox",
|
|
7559
|
+
], UI.prototype, "hitBox", undefined);
|
|
7556
7560
|
__decorate([
|
|
7557
7561
|
hitType(true)
|
|
7558
|
-
], UI.prototype, "hitChildren",
|
|
7562
|
+
], UI.prototype, "hitChildren", undefined);
|
|
7559
7563
|
__decorate([
|
|
7560
7564
|
hitType(true)
|
|
7561
|
-
], UI.prototype, "hitSelf",
|
|
7565
|
+
], UI.prototype, "hitSelf", undefined);
|
|
7562
7566
|
__decorate([
|
|
7563
7567
|
hitType()
|
|
7564
|
-
], UI.prototype, "hitRadius",
|
|
7568
|
+
], UI.prototype, "hitRadius", undefined);
|
|
7565
7569
|
__decorate([
|
|
7566
7570
|
cursorType('')
|
|
7567
|
-
], UI.prototype, "cursor",
|
|
7571
|
+
], UI.prototype, "cursor", undefined);
|
|
7568
7572
|
__decorate([
|
|
7569
7573
|
surfaceType()
|
|
7570
|
-
], UI.prototype, "fill",
|
|
7574
|
+
], UI.prototype, "fill", undefined);
|
|
7571
7575
|
__decorate([
|
|
7572
7576
|
strokeType()
|
|
7573
|
-
], UI.prototype, "stroke",
|
|
7577
|
+
], UI.prototype, "stroke", undefined);
|
|
7574
7578
|
__decorate([
|
|
7575
7579
|
strokeType('inside')
|
|
7576
|
-
], UI.prototype, "strokeAlign",
|
|
7580
|
+
], UI.prototype, "strokeAlign", undefined);
|
|
7577
7581
|
__decorate([
|
|
7578
7582
|
strokeType(1)
|
|
7579
|
-
], UI.prototype, "strokeWidth",
|
|
7583
|
+
], UI.prototype, "strokeWidth", undefined);
|
|
7580
7584
|
__decorate([
|
|
7581
7585
|
strokeType(false)
|
|
7582
|
-
], UI.prototype, "strokeWidthFixed",
|
|
7586
|
+
], UI.prototype, "strokeWidthFixed", undefined);
|
|
7583
7587
|
__decorate([
|
|
7584
7588
|
strokeType('none')
|
|
7585
|
-
], UI.prototype, "strokeCap",
|
|
7589
|
+
], UI.prototype, "strokeCap", undefined);
|
|
7586
7590
|
__decorate([
|
|
7587
7591
|
strokeType('miter')
|
|
7588
|
-
], UI.prototype, "strokeJoin",
|
|
7592
|
+
], UI.prototype, "strokeJoin", undefined);
|
|
7589
7593
|
__decorate([
|
|
7590
7594
|
strokeType()
|
|
7591
|
-
], UI.prototype, "dashPattern",
|
|
7595
|
+
], UI.prototype, "dashPattern", undefined);
|
|
7592
7596
|
__decorate([
|
|
7593
7597
|
strokeType()
|
|
7594
|
-
], UI.prototype, "dashOffset",
|
|
7598
|
+
], UI.prototype, "dashOffset", undefined);
|
|
7595
7599
|
__decorate([
|
|
7596
7600
|
strokeType(10)
|
|
7597
|
-
], UI.prototype, "miterLimit",
|
|
7601
|
+
], UI.prototype, "miterLimit", undefined);
|
|
7598
7602
|
__decorate([
|
|
7599
7603
|
pathType(0)
|
|
7600
|
-
], UI.prototype, "cornerRadius",
|
|
7604
|
+
], UI.prototype, "cornerRadius", undefined);
|
|
7601
7605
|
__decorate([
|
|
7602
7606
|
pathType()
|
|
7603
|
-
], UI.prototype, "cornerSmoothing",
|
|
7607
|
+
], UI.prototype, "cornerSmoothing", undefined);
|
|
7604
7608
|
__decorate([
|
|
7605
7609
|
effectType()
|
|
7606
|
-
], UI.prototype, "shadow",
|
|
7610
|
+
], UI.prototype, "shadow", undefined);
|
|
7607
7611
|
__decorate([
|
|
7608
7612
|
effectType()
|
|
7609
|
-
], UI.prototype, "innerShadow",
|
|
7613
|
+
], UI.prototype, "innerShadow", undefined);
|
|
7610
7614
|
__decorate([
|
|
7611
7615
|
effectType()
|
|
7612
|
-
], UI.prototype, "blur",
|
|
7616
|
+
], UI.prototype, "blur", undefined);
|
|
7613
7617
|
__decorate([
|
|
7614
7618
|
effectType()
|
|
7615
|
-
], UI.prototype, "backgroundBlur",
|
|
7619
|
+
], UI.prototype, "backgroundBlur", undefined);
|
|
7616
7620
|
__decorate([
|
|
7617
7621
|
effectType()
|
|
7618
|
-
], UI.prototype, "grayscale",
|
|
7622
|
+
], UI.prototype, "grayscale", undefined);
|
|
7619
7623
|
__decorate([
|
|
7620
7624
|
dataType({})
|
|
7621
|
-
], UI.prototype, "data",
|
|
7625
|
+
], UI.prototype, "data", undefined);
|
|
7622
7626
|
__decorate([
|
|
7623
7627
|
rewrite(Leaf.prototype.reset)
|
|
7624
7628
|
], UI.prototype, "reset", null);
|
|
@@ -7679,7 +7683,7 @@ let Group = class Group extends UI {
|
|
|
7679
7683
|
};
|
|
7680
7684
|
__decorate([
|
|
7681
7685
|
dataProcessor(GroupData)
|
|
7682
|
-
], Group.prototype, "__",
|
|
7686
|
+
], Group.prototype, "__", undefined);
|
|
7683
7687
|
Group = __decorate([
|
|
7684
7688
|
useModule(Branch),
|
|
7685
7689
|
registerUI()
|
|
@@ -7850,8 +7854,6 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
7850
7854
|
__setAttr(attrName, newValue) {
|
|
7851
7855
|
if (this.canvas) {
|
|
7852
7856
|
if (canvasSizeAttrs.includes(attrName)) {
|
|
7853
|
-
if (!newValue)
|
|
7854
|
-
debug$1.warn(attrName + ' is 0');
|
|
7855
7857
|
this.__changeCanvasSize(attrName, newValue);
|
|
7856
7858
|
}
|
|
7857
7859
|
else if (attrName === 'fill') {
|
|
@@ -7891,8 +7893,6 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
7891
7893
|
this.created = true;
|
|
7892
7894
|
}
|
|
7893
7895
|
__onReady() {
|
|
7894
|
-
if (this.ready)
|
|
7895
|
-
return;
|
|
7896
7896
|
this.ready = true;
|
|
7897
7897
|
this.emitLeafer(LeaferEvent.BEFORE_READY);
|
|
7898
7898
|
this.emitLeafer(LeaferEvent.READY);
|
|
@@ -7906,6 +7906,20 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
7906
7906
|
this.emitLeafer(LeaferEvent.VIEW_READY);
|
|
7907
7907
|
WaitHelper.run(this.__viewReadyWait);
|
|
7908
7908
|
}
|
|
7909
|
+
__onLayoutEnd() {
|
|
7910
|
+
const { grow, growWidth, growHeight } = this.config;
|
|
7911
|
+
if (grow) {
|
|
7912
|
+
let { width, height, pixelRatio } = this;
|
|
7913
|
+
const bounds = grow === 'box' ? this.worldBoxBounds : this.__world;
|
|
7914
|
+
if (growWidth !== false)
|
|
7915
|
+
width = Math.max(1, bounds.x + bounds.width);
|
|
7916
|
+
if (growHeight !== false)
|
|
7917
|
+
height = Math.max(1, bounds.y + bounds.height);
|
|
7918
|
+
this.__doResize({ width, height, pixelRatio });
|
|
7919
|
+
}
|
|
7920
|
+
if (!this.ready)
|
|
7921
|
+
this.__onReady();
|
|
7922
|
+
}
|
|
7909
7923
|
__onNextRender() {
|
|
7910
7924
|
if (this.viewReady) {
|
|
7911
7925
|
WaitHelper.run(this.__nextRenderWait);
|
|
@@ -7999,10 +8013,9 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
7999
8013
|
const runId = Run.start('FirstCreate ' + this.innerName);
|
|
8000
8014
|
this.once(LeaferEvent.START, () => Run.end(runId));
|
|
8001
8015
|
this.once(LayoutEvent.START, () => this.updateLazyBounds());
|
|
8002
|
-
this.once(LayoutEvent.END, () => this.__onReady());
|
|
8003
8016
|
this.once(RenderEvent.START, () => this.__onCreated());
|
|
8004
8017
|
this.once(RenderEvent.END, () => this.__onViewReady());
|
|
8005
|
-
this.__eventIds.push(this.on_(WatchEvent.DATA, this.__onWatchData, this), this.on_(RenderEvent.NEXT, this.__onNextRender, this));
|
|
8018
|
+
this.__eventIds.push(this.on_(WatchEvent.DATA, this.__onWatchData, this), this.on_(LayoutEvent.END, this.__onLayoutEnd, this), this.on_(RenderEvent.NEXT, this.__onNextRender, this));
|
|
8006
8019
|
}
|
|
8007
8020
|
__removeListenEvents() {
|
|
8008
8021
|
this.off_(this.__eventIds);
|
|
@@ -8043,10 +8056,10 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
8043
8056
|
Leafer.list = new LeafList();
|
|
8044
8057
|
__decorate([
|
|
8045
8058
|
dataProcessor(LeaferData)
|
|
8046
|
-
], Leafer.prototype, "__",
|
|
8059
|
+
], Leafer.prototype, "__", undefined);
|
|
8047
8060
|
__decorate([
|
|
8048
8061
|
boundsType()
|
|
8049
|
-
], Leafer.prototype, "pixelRatio",
|
|
8062
|
+
], Leafer.prototype, "pixelRatio", undefined);
|
|
8050
8063
|
Leafer = Leafer_1 = __decorate([
|
|
8051
8064
|
registerUI()
|
|
8052
8065
|
], Leafer);
|
|
@@ -8059,7 +8072,7 @@ let Rect = class Rect extends UI {
|
|
|
8059
8072
|
};
|
|
8060
8073
|
__decorate([
|
|
8061
8074
|
dataProcessor(RectData)
|
|
8062
|
-
], Rect.prototype, "__",
|
|
8075
|
+
], Rect.prototype, "__", undefined);
|
|
8063
8076
|
Rect = __decorate([
|
|
8064
8077
|
useModule(RectRender),
|
|
8065
8078
|
rewriteAble(),
|
|
@@ -8084,6 +8097,8 @@ let Box = class Box extends Group {
|
|
|
8084
8097
|
const data = this.__;
|
|
8085
8098
|
if (this.children.length) {
|
|
8086
8099
|
if (data.__autoSide) {
|
|
8100
|
+
if (data.__hasSurface)
|
|
8101
|
+
this.__extraUpdate();
|
|
8087
8102
|
super.__updateBoxBounds();
|
|
8088
8103
|
const { boxBounds } = this.__layout;
|
|
8089
8104
|
if (!data.__autoSize) {
|
|
@@ -8148,13 +8163,13 @@ let Box = class Box extends Group {
|
|
|
8148
8163
|
};
|
|
8149
8164
|
__decorate([
|
|
8150
8165
|
dataProcessor(BoxData)
|
|
8151
|
-
], Box.prototype, "__",
|
|
8166
|
+
], Box.prototype, "__", undefined);
|
|
8152
8167
|
__decorate([
|
|
8153
8168
|
dataType(false)
|
|
8154
|
-
], Box.prototype, "resizeChildren",
|
|
8169
|
+
], Box.prototype, "resizeChildren", undefined);
|
|
8155
8170
|
__decorate([
|
|
8156
8171
|
affectRenderBoundsType('show')
|
|
8157
|
-
], Box.prototype, "overflow",
|
|
8172
|
+
], Box.prototype, "overflow", undefined);
|
|
8158
8173
|
__decorate([
|
|
8159
8174
|
rewrite(rect$1.__updateStrokeSpread)
|
|
8160
8175
|
], Box.prototype, "__updateStrokeSpread", null);
|
|
@@ -8193,13 +8208,13 @@ let Frame = class Frame extends Box {
|
|
|
8193
8208
|
};
|
|
8194
8209
|
__decorate([
|
|
8195
8210
|
dataProcessor(FrameData)
|
|
8196
|
-
], Frame.prototype, "__",
|
|
8211
|
+
], Frame.prototype, "__", undefined);
|
|
8197
8212
|
__decorate([
|
|
8198
8213
|
surfaceType('#FFFFFF')
|
|
8199
|
-
], Frame.prototype, "fill",
|
|
8214
|
+
], Frame.prototype, "fill", undefined);
|
|
8200
8215
|
__decorate([
|
|
8201
8216
|
affectRenderBoundsType('hide')
|
|
8202
|
-
], Frame.prototype, "overflow",
|
|
8217
|
+
], Frame.prototype, "overflow", undefined);
|
|
8203
8218
|
Frame = __decorate([
|
|
8204
8219
|
registerUI()
|
|
8205
8220
|
], Frame);
|
|
@@ -8246,16 +8261,16 @@ let Ellipse = class Ellipse extends UI {
|
|
|
8246
8261
|
};
|
|
8247
8262
|
__decorate([
|
|
8248
8263
|
dataProcessor(EllipseData)
|
|
8249
|
-
], Ellipse.prototype, "__",
|
|
8264
|
+
], Ellipse.prototype, "__", undefined);
|
|
8250
8265
|
__decorate([
|
|
8251
8266
|
pathType(0)
|
|
8252
|
-
], Ellipse.prototype, "innerRadius",
|
|
8267
|
+
], Ellipse.prototype, "innerRadius", undefined);
|
|
8253
8268
|
__decorate([
|
|
8254
8269
|
pathType(0)
|
|
8255
|
-
], Ellipse.prototype, "startAngle",
|
|
8270
|
+
], Ellipse.prototype, "startAngle", undefined);
|
|
8256
8271
|
__decorate([
|
|
8257
8272
|
pathType(0)
|
|
8258
|
-
], Ellipse.prototype, "endAngle",
|
|
8273
|
+
], Ellipse.prototype, "endAngle", undefined);
|
|
8259
8274
|
Ellipse = __decorate([
|
|
8260
8275
|
registerUI()
|
|
8261
8276
|
], Ellipse);
|
|
@@ -8314,22 +8329,22 @@ let Line = class Line extends UI {
|
|
|
8314
8329
|
};
|
|
8315
8330
|
__decorate([
|
|
8316
8331
|
dataProcessor(LineData)
|
|
8317
|
-
], Line.prototype, "__",
|
|
8332
|
+
], Line.prototype, "__", undefined);
|
|
8318
8333
|
__decorate([
|
|
8319
8334
|
affectStrokeBoundsType('center')
|
|
8320
|
-
], Line.prototype, "strokeAlign",
|
|
8335
|
+
], Line.prototype, "strokeAlign", undefined);
|
|
8321
8336
|
__decorate([
|
|
8322
8337
|
boundsType(0)
|
|
8323
|
-
], Line.prototype, "height",
|
|
8338
|
+
], Line.prototype, "height", undefined);
|
|
8324
8339
|
__decorate([
|
|
8325
8340
|
pathType()
|
|
8326
|
-
], Line.prototype, "points",
|
|
8341
|
+
], Line.prototype, "points", undefined);
|
|
8327
8342
|
__decorate([
|
|
8328
8343
|
pathType(0)
|
|
8329
|
-
], Line.prototype, "curve",
|
|
8344
|
+
], Line.prototype, "curve", undefined);
|
|
8330
8345
|
__decorate([
|
|
8331
8346
|
pathType(false)
|
|
8332
|
-
], Line.prototype, "closed",
|
|
8347
|
+
], Line.prototype, "closed", undefined);
|
|
8333
8348
|
Line = __decorate([
|
|
8334
8349
|
registerUI()
|
|
8335
8350
|
], Line);
|
|
@@ -8362,16 +8377,16 @@ let Polygon = class Polygon extends UI {
|
|
|
8362
8377
|
};
|
|
8363
8378
|
__decorate([
|
|
8364
8379
|
dataProcessor(PolygonData)
|
|
8365
|
-
], Polygon.prototype, "__",
|
|
8380
|
+
], Polygon.prototype, "__", undefined);
|
|
8366
8381
|
__decorate([
|
|
8367
8382
|
pathType(3)
|
|
8368
|
-
], Polygon.prototype, "sides",
|
|
8383
|
+
], Polygon.prototype, "sides", undefined);
|
|
8369
8384
|
__decorate([
|
|
8370
8385
|
pathType()
|
|
8371
|
-
], Polygon.prototype, "points",
|
|
8386
|
+
], Polygon.prototype, "points", undefined);
|
|
8372
8387
|
__decorate([
|
|
8373
8388
|
pathType(0)
|
|
8374
|
-
], Polygon.prototype, "curve",
|
|
8389
|
+
], Polygon.prototype, "curve", undefined);
|
|
8375
8390
|
__decorate([
|
|
8376
8391
|
rewrite(line.__updateRenderPath)
|
|
8377
8392
|
], Polygon.prototype, "__updateRenderPath", null);
|
|
@@ -8403,13 +8418,13 @@ let Star = class Star extends UI {
|
|
|
8403
8418
|
};
|
|
8404
8419
|
__decorate([
|
|
8405
8420
|
dataProcessor(StarData)
|
|
8406
|
-
], Star.prototype, "__",
|
|
8421
|
+
], Star.prototype, "__", undefined);
|
|
8407
8422
|
__decorate([
|
|
8408
8423
|
pathType(5)
|
|
8409
|
-
], Star.prototype, "corners",
|
|
8424
|
+
], Star.prototype, "corners", undefined);
|
|
8410
8425
|
__decorate([
|
|
8411
8426
|
pathType(0.382)
|
|
8412
|
-
], Star.prototype, "innerRadius",
|
|
8427
|
+
], Star.prototype, "innerRadius", undefined);
|
|
8413
8428
|
Star = __decorate([
|
|
8414
8429
|
registerUI()
|
|
8415
8430
|
], Star);
|
|
@@ -8431,10 +8446,10 @@ let Image = class Image extends Rect {
|
|
|
8431
8446
|
};
|
|
8432
8447
|
__decorate([
|
|
8433
8448
|
dataProcessor(ImageData)
|
|
8434
|
-
], Image.prototype, "__",
|
|
8449
|
+
], Image.prototype, "__", undefined);
|
|
8435
8450
|
__decorate([
|
|
8436
8451
|
boundsType('')
|
|
8437
|
-
], Image.prototype, "url",
|
|
8452
|
+
], Image.prototype, "url", undefined);
|
|
8438
8453
|
Image = __decorate([
|
|
8439
8454
|
registerUI()
|
|
8440
8455
|
], Image);
|
|
@@ -8497,25 +8512,25 @@ let Canvas = class Canvas extends Rect {
|
|
|
8497
8512
|
};
|
|
8498
8513
|
__decorate([
|
|
8499
8514
|
dataProcessor(CanvasData)
|
|
8500
|
-
], Canvas.prototype, "__",
|
|
8515
|
+
], Canvas.prototype, "__", undefined);
|
|
8501
8516
|
__decorate([
|
|
8502
8517
|
resizeType(100)
|
|
8503
|
-
], Canvas.prototype, "width",
|
|
8518
|
+
], Canvas.prototype, "width", undefined);
|
|
8504
8519
|
__decorate([
|
|
8505
8520
|
resizeType(100)
|
|
8506
|
-
], Canvas.prototype, "height",
|
|
8521
|
+
], Canvas.prototype, "height", undefined);
|
|
8507
8522
|
__decorate([
|
|
8508
8523
|
resizeType(1)
|
|
8509
|
-
], Canvas.prototype, "pixelRatio",
|
|
8524
|
+
], Canvas.prototype, "pixelRatio", undefined);
|
|
8510
8525
|
__decorate([
|
|
8511
8526
|
resizeType(true)
|
|
8512
|
-
], Canvas.prototype, "smooth",
|
|
8527
|
+
], Canvas.prototype, "smooth", undefined);
|
|
8513
8528
|
__decorate([
|
|
8514
8529
|
dataType(false)
|
|
8515
|
-
], Canvas.prototype, "safeResize",
|
|
8530
|
+
], Canvas.prototype, "safeResize", undefined);
|
|
8516
8531
|
__decorate([
|
|
8517
8532
|
resizeType()
|
|
8518
|
-
], Canvas.prototype, "contextSettings",
|
|
8533
|
+
], Canvas.prototype, "contextSettings", undefined);
|
|
8519
8534
|
Canvas = __decorate([
|
|
8520
8535
|
registerUI()
|
|
8521
8536
|
], Canvas);
|
|
@@ -8606,76 +8621,76 @@ let Text = class Text extends UI {
|
|
|
8606
8621
|
};
|
|
8607
8622
|
__decorate([
|
|
8608
8623
|
dataProcessor(TextData)
|
|
8609
|
-
], Text.prototype, "__",
|
|
8624
|
+
], Text.prototype, "__", undefined);
|
|
8610
8625
|
__decorate([
|
|
8611
8626
|
boundsType(0)
|
|
8612
|
-
], Text.prototype, "width",
|
|
8627
|
+
], Text.prototype, "width", undefined);
|
|
8613
8628
|
__decorate([
|
|
8614
8629
|
boundsType(0)
|
|
8615
|
-
], Text.prototype, "height",
|
|
8630
|
+
], Text.prototype, "height", undefined);
|
|
8616
8631
|
__decorate([
|
|
8617
8632
|
dataType(false)
|
|
8618
|
-
], Text.prototype, "resizeFontSize",
|
|
8633
|
+
], Text.prototype, "resizeFontSize", undefined);
|
|
8619
8634
|
__decorate([
|
|
8620
8635
|
surfaceType('#000000')
|
|
8621
|
-
], Text.prototype, "fill",
|
|
8636
|
+
], Text.prototype, "fill", undefined);
|
|
8622
8637
|
__decorate([
|
|
8623
8638
|
affectStrokeBoundsType('outside')
|
|
8624
|
-
], Text.prototype, "strokeAlign",
|
|
8639
|
+
], Text.prototype, "strokeAlign", undefined);
|
|
8625
8640
|
__decorate([
|
|
8626
8641
|
hitType('all')
|
|
8627
|
-
], Text.prototype, "hitFill",
|
|
8642
|
+
], Text.prototype, "hitFill", undefined);
|
|
8628
8643
|
__decorate([
|
|
8629
8644
|
boundsType('')
|
|
8630
|
-
], Text.prototype, "text",
|
|
8645
|
+
], Text.prototype, "text", undefined);
|
|
8631
8646
|
__decorate([
|
|
8632
|
-
boundsType('
|
|
8633
|
-
], Text.prototype, "fontFamily",
|
|
8647
|
+
boundsType('caption')
|
|
8648
|
+
], Text.prototype, "fontFamily", undefined);
|
|
8634
8649
|
__decorate([
|
|
8635
8650
|
boundsType(12)
|
|
8636
|
-
], Text.prototype, "fontSize",
|
|
8651
|
+
], Text.prototype, "fontSize", undefined);
|
|
8637
8652
|
__decorate([
|
|
8638
8653
|
boundsType('normal')
|
|
8639
|
-
], Text.prototype, "fontWeight",
|
|
8654
|
+
], Text.prototype, "fontWeight", undefined);
|
|
8640
8655
|
__decorate([
|
|
8641
8656
|
boundsType(false)
|
|
8642
|
-
], Text.prototype, "italic",
|
|
8657
|
+
], Text.prototype, "italic", undefined);
|
|
8643
8658
|
__decorate([
|
|
8644
8659
|
boundsType('none')
|
|
8645
|
-
], Text.prototype, "textCase",
|
|
8660
|
+
], Text.prototype, "textCase", undefined);
|
|
8646
8661
|
__decorate([
|
|
8647
8662
|
boundsType('none')
|
|
8648
|
-
], Text.prototype, "textDecoration",
|
|
8663
|
+
], Text.prototype, "textDecoration", undefined);
|
|
8649
8664
|
__decorate([
|
|
8650
8665
|
boundsType(0)
|
|
8651
|
-
], Text.prototype, "letterSpacing",
|
|
8666
|
+
], Text.prototype, "letterSpacing", undefined);
|
|
8652
8667
|
__decorate([
|
|
8653
8668
|
boundsType({ type: 'percent', value: 1.5 })
|
|
8654
|
-
], Text.prototype, "lineHeight",
|
|
8669
|
+
], Text.prototype, "lineHeight", undefined);
|
|
8655
8670
|
__decorate([
|
|
8656
8671
|
boundsType(0)
|
|
8657
|
-
], Text.prototype, "paraIndent",
|
|
8672
|
+
], Text.prototype, "paraIndent", undefined);
|
|
8658
8673
|
__decorate([
|
|
8659
8674
|
boundsType(0)
|
|
8660
|
-
], Text.prototype, "paraSpacing",
|
|
8675
|
+
], Text.prototype, "paraSpacing", undefined);
|
|
8661
8676
|
__decorate([
|
|
8662
8677
|
boundsType('x')
|
|
8663
|
-
], Text.prototype, "writingMode",
|
|
8678
|
+
], Text.prototype, "writingMode", undefined);
|
|
8664
8679
|
__decorate([
|
|
8665
8680
|
boundsType('left')
|
|
8666
|
-
], Text.prototype, "textAlign",
|
|
8681
|
+
], Text.prototype, "textAlign", undefined);
|
|
8667
8682
|
__decorate([
|
|
8668
8683
|
boundsType('top')
|
|
8669
|
-
], Text.prototype, "verticalAlign",
|
|
8684
|
+
], Text.prototype, "verticalAlign", undefined);
|
|
8670
8685
|
__decorate([
|
|
8671
8686
|
boundsType(true)
|
|
8672
|
-
], Text.prototype, "autoSizeAlign",
|
|
8687
|
+
], Text.prototype, "autoSizeAlign", undefined);
|
|
8673
8688
|
__decorate([
|
|
8674
8689
|
boundsType('normal')
|
|
8675
|
-
], Text.prototype, "textWrap",
|
|
8690
|
+
], Text.prototype, "textWrap", undefined);
|
|
8676
8691
|
__decorate([
|
|
8677
8692
|
boundsType('show')
|
|
8678
|
-
], Text.prototype, "textOverflow",
|
|
8693
|
+
], Text.prototype, "textOverflow", undefined);
|
|
8679
8694
|
Text = __decorate([
|
|
8680
8695
|
registerUI()
|
|
8681
8696
|
], Text);
|
|
@@ -8688,10 +8703,10 @@ let Path = class Path extends UI {
|
|
|
8688
8703
|
};
|
|
8689
8704
|
__decorate([
|
|
8690
8705
|
dataProcessor(PathData)
|
|
8691
|
-
], Path.prototype, "__",
|
|
8706
|
+
], Path.prototype, "__", undefined);
|
|
8692
8707
|
__decorate([
|
|
8693
8708
|
affectStrokeBoundsType('center')
|
|
8694
|
-
], Path.prototype, "strokeAlign",
|
|
8709
|
+
], Path.prototype, "strokeAlign", undefined);
|
|
8695
8710
|
Path = __decorate([
|
|
8696
8711
|
registerUI()
|
|
8697
8712
|
], Path);
|
|
@@ -8730,10 +8745,10 @@ let Pen = class Pen extends Group {
|
|
|
8730
8745
|
};
|
|
8731
8746
|
__decorate([
|
|
8732
8747
|
dataProcessor(PenData)
|
|
8733
|
-
], Pen.prototype, "__",
|
|
8748
|
+
], Pen.prototype, "__", undefined);
|
|
8734
8749
|
__decorate([
|
|
8735
8750
|
penPathType()
|
|
8736
|
-
], Pen.prototype, "path",
|
|
8751
|
+
], Pen.prototype, "path", undefined);
|
|
8737
8752
|
Pen = __decorate([
|
|
8738
8753
|
useModule(PathCreator, ['set', 'path', 'paint']),
|
|
8739
8754
|
registerUI()
|
|
@@ -9918,9 +9933,9 @@ leaf.__hitWorld = function (point) {
|
|
|
9918
9933
|
}
|
|
9919
9934
|
return this.__hit(inner);
|
|
9920
9935
|
};
|
|
9921
|
-
leaf.__hitFill = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a ===
|
|
9922
|
-
leaf.__hitStroke = function (inner, strokeWidth) { var _a; return (_a = this.__hitCanvas) === null || _a ===
|
|
9923
|
-
leaf.__hitPixel = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a ===
|
|
9936
|
+
leaf.__hitFill = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a === undefined ? undefined : _a.hitFill(inner, this.__.windingRule); };
|
|
9937
|
+
leaf.__hitStroke = function (inner, strokeWidth) { var _a; return (_a = this.__hitCanvas) === null || _a === undefined ? undefined : _a.hitStroke(inner, strokeWidth); };
|
|
9938
|
+
leaf.__hitPixel = function (inner) { var _a; return (_a = this.__hitCanvas) === null || _a === undefined ? undefined : _a.hitPixel(inner, this.__layout.renderBounds, this.__hitCanvas.hitScale); };
|
|
9924
9939
|
leaf.__drawHitPath = function (canvas) { if (canvas)
|
|
9925
9940
|
this.__drawRenderPath(canvas); };
|
|
9926
9941
|
|
|
@@ -10655,7 +10670,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
|
|
|
10655
10670
|
}
|
|
10656
10671
|
else {
|
|
10657
10672
|
if (!paint.patternTask) {
|
|
10658
|
-
paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this,
|
|
10673
|
+
paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, undefined, undefined, function* () {
|
|
10659
10674
|
paint.patternTask = null;
|
|
10660
10675
|
if (canvas.bounds.hit(ui.__nowWorld))
|
|
10661
10676
|
createPattern(ui, paint, pixelRatio);
|
|
@@ -10811,7 +10826,7 @@ function shadow$1(ui, current, shape) {
|
|
|
10811
10826
|
const end = shadow.length - 1;
|
|
10812
10827
|
toOffsetOutBounds$1(bounds, offsetOutBounds$1);
|
|
10813
10828
|
shadow.forEach((item, index) => {
|
|
10814
|
-
other.setWorldShadow((offsetOutBounds$1.offsetX + item.x * scaleX), (offsetOutBounds$1.offsetY + item.y * scaleY), item.blur * scaleX, item.color);
|
|
10829
|
+
other.setWorldShadow((offsetOutBounds$1.offsetX + item.x * scaleX), (offsetOutBounds$1.offsetY + item.y * scaleY), item.blur * scaleX, ColorConvert.string(item.color));
|
|
10815
10830
|
spreadScale = item.spread ? 1 + item.spread * 2 / (__layout.boxBounds.width + (__layout.strokeBoxSpread || 0) * 2) : 0;
|
|
10816
10831
|
drawWorldShadow(other, offsetOutBounds$1, spreadScale, shape);
|
|
10817
10832
|
copyBounds = bounds;
|
|
@@ -10887,7 +10902,7 @@ function innerShadow(ui, current, shape) {
|
|
|
10887
10902
|
other.copyWorld(shape.canvas, shapeBounds, bounds, 'source-out');
|
|
10888
10903
|
copyBounds = bounds;
|
|
10889
10904
|
}
|
|
10890
|
-
other.fillWorld(copyBounds, item.color, 'source-in');
|
|
10905
|
+
other.fillWorld(copyBounds, ColorConvert.string(item.color), 'source-in');
|
|
10891
10906
|
if (ui.__worldFlipped) {
|
|
10892
10907
|
current.copyWorldByReset(other, copyBounds, nowWorld, item.blendMode);
|
|
10893
10908
|
}
|
|
@@ -11249,7 +11264,7 @@ function layoutChar(drawData, style, width, _height) {
|
|
|
11249
11264
|
rows.forEach(row => {
|
|
11250
11265
|
if (row.words) {
|
|
11251
11266
|
indentWidth = paraIndent && row.paraStart ? paraIndent : 0;
|
|
11252
|
-
addWordWidth = (width && textAlign === 'justify' && row.words.length > 1) ? (width - row.width - indentWidth) / (row.words.length - 1) : 0;
|
|
11267
|
+
addWordWidth = (width && (textAlign === 'justify' || textAlign === 'both') && row.words.length > 1) ? (width - row.width - indentWidth) / (row.words.length - 1) : 0;
|
|
11253
11268
|
mode = (letterSpacing || row.isOverflow) ? CharMode : (addWordWidth > 0.01 ? WordMode : TextMode);
|
|
11254
11269
|
if (row.isOverflow && !letterSpacing)
|
|
11255
11270
|
row.textMode = true;
|
|
@@ -11271,7 +11286,7 @@ function layoutChar(drawData, style, width, _height) {
|
|
|
11271
11286
|
else {
|
|
11272
11287
|
charX = toChar(word.data, charX, row.data, row.isOverflow);
|
|
11273
11288
|
}
|
|
11274
|
-
if (!row.paraEnd
|
|
11289
|
+
if (addWordWidth && (!row.paraEnd || textAlign === 'both')) {
|
|
11275
11290
|
charX += addWordWidth;
|
|
11276
11291
|
row.width += addWordWidth;
|
|
11277
11292
|
}
|
|
@@ -11660,25 +11675,25 @@ let Robot = class Robot extends UI {
|
|
|
11660
11675
|
};
|
|
11661
11676
|
__decorate([
|
|
11662
11677
|
dataProcessor(RobotData)
|
|
11663
|
-
], Robot.prototype, "__",
|
|
11678
|
+
], Robot.prototype, "__", undefined);
|
|
11664
11679
|
__decorate([
|
|
11665
11680
|
boundsType()
|
|
11666
|
-
], Robot.prototype, "robot",
|
|
11681
|
+
], Robot.prototype, "robot", undefined);
|
|
11667
11682
|
__decorate([
|
|
11668
11683
|
dataType()
|
|
11669
|
-
], Robot.prototype, "actions",
|
|
11684
|
+
], Robot.prototype, "actions", undefined);
|
|
11670
11685
|
__decorate([
|
|
11671
11686
|
dataType('')
|
|
11672
|
-
], Robot.prototype, "action",
|
|
11687
|
+
], Robot.prototype, "action", undefined);
|
|
11673
11688
|
__decorate([
|
|
11674
11689
|
surfaceType(0)
|
|
11675
|
-
], Robot.prototype, "now",
|
|
11690
|
+
], Robot.prototype, "now", undefined);
|
|
11676
11691
|
__decorate([
|
|
11677
11692
|
dataType(12)
|
|
11678
|
-
], Robot.prototype, "FPS",
|
|
11693
|
+
], Robot.prototype, "FPS", undefined);
|
|
11679
11694
|
__decorate([
|
|
11680
11695
|
dataType(true)
|
|
11681
|
-
], Robot.prototype, "loop",
|
|
11696
|
+
], Robot.prototype, "loop", undefined);
|
|
11682
11697
|
Robot = __decorate([
|
|
11683
11698
|
registerUI()
|
|
11684
11699
|
], Robot);
|
|
@@ -11746,7 +11761,9 @@ function updateStyle(leaf, style, type) {
|
|
|
11746
11761
|
type = null;
|
|
11747
11762
|
let transition = type ? getTransition(type, style, leaf) : false;
|
|
11748
11763
|
const fromStyle = transition ? getFromStyle(leaf, style) : undefined;
|
|
11749
|
-
|
|
11764
|
+
const nextStyle = State.canAnimate && getStyle(leaf);
|
|
11765
|
+
if (nextStyle)
|
|
11766
|
+
leaf.killAnimate('transition');
|
|
11750
11767
|
if (normalStyle)
|
|
11751
11768
|
leaf.set(normalStyle, 'temp');
|
|
11752
11769
|
const statesStyle = getStyle(leaf);
|
|
@@ -11776,7 +11793,8 @@ function updateStyle(leaf, style, type) {
|
|
|
11776
11793
|
}
|
|
11777
11794
|
function getStyle(leaf) {
|
|
11778
11795
|
let exist;
|
|
11779
|
-
const style = {},
|
|
11796
|
+
const style = {}, button = findParentButton(leaf);
|
|
11797
|
+
const state = button ? (leaf.state || button.state) : leaf.state;
|
|
11780
11798
|
const stateStyle = state && leaf.states[state];
|
|
11781
11799
|
if (stateStyle && State.isState(state, leaf, button))
|
|
11782
11800
|
exist = assign(style, stateStyle);
|
|
@@ -11847,7 +11865,7 @@ function setState(leaf, stateName, stateStyle) {
|
|
|
11847
11865
|
if (leaf.button)
|
|
11848
11866
|
setChildrenState(leaf.children, null, stateName);
|
|
11849
11867
|
}
|
|
11850
|
-
function setChildrenState(children, stateType,
|
|
11868
|
+
function setChildrenState(children, stateType, stateName) {
|
|
11851
11869
|
if (!children)
|
|
11852
11870
|
return;
|
|
11853
11871
|
let leaf, update;
|
|
@@ -11871,10 +11889,10 @@ function setChildrenState(children, stateType, state) {
|
|
|
11871
11889
|
if (update)
|
|
11872
11890
|
setPointerState(leaf, stateType);
|
|
11873
11891
|
}
|
|
11874
|
-
else if (
|
|
11875
|
-
setState(leaf,
|
|
11892
|
+
else if (stateName !== undefined)
|
|
11893
|
+
setState(leaf, stateName);
|
|
11876
11894
|
if (leaf.isBranch)
|
|
11877
|
-
setChildrenState(leaf.children, stateType,
|
|
11895
|
+
setChildrenState(leaf.children, stateType, stateName);
|
|
11878
11896
|
}
|
|
11879
11897
|
}
|
|
11880
11898
|
|
|
@@ -11890,7 +11908,7 @@ function unsetState(leaf, stateName, stateStyle) {
|
|
|
11890
11908
|
if (leaf.button)
|
|
11891
11909
|
unsetChildrenState(leaf.children, null, stateName);
|
|
11892
11910
|
}
|
|
11893
|
-
function unsetChildrenState(children, stateType,
|
|
11911
|
+
function unsetChildrenState(children, stateType, stateName) {
|
|
11894
11912
|
if (!children)
|
|
11895
11913
|
return;
|
|
11896
11914
|
let leaf;
|
|
@@ -11898,10 +11916,10 @@ function unsetChildrenState(children, stateType, state) {
|
|
|
11898
11916
|
leaf = children[i];
|
|
11899
11917
|
if (stateType)
|
|
11900
11918
|
unsetPointerState(leaf, stateType);
|
|
11901
|
-
else if (
|
|
11902
|
-
unsetState(leaf,
|
|
11919
|
+
else if (stateName !== undefined)
|
|
11920
|
+
unsetState(leaf, stateName);
|
|
11903
11921
|
if (leaf.isBranch)
|
|
11904
|
-
unsetChildrenState(leaf.children, stateType,
|
|
11922
|
+
unsetChildrenState(leaf.children, stateType, stateName);
|
|
11905
11923
|
}
|
|
11906
11924
|
}
|
|
11907
11925
|
|
|
@@ -12119,8 +12137,11 @@ function animationType(defaultValue) {
|
|
|
12119
12137
|
return decorateLeafAttr(defaultValue, (key) => attr({
|
|
12120
12138
|
set(value) {
|
|
12121
12139
|
this.__setAttr(key, value);
|
|
12122
|
-
if (this.leafer)
|
|
12123
|
-
|
|
12140
|
+
if (this.leafer) {
|
|
12141
|
+
this.killAnimate('animation');
|
|
12142
|
+
if (value)
|
|
12143
|
+
this.animate(value, undefined, 'animation');
|
|
12144
|
+
}
|
|
12124
12145
|
}
|
|
12125
12146
|
}));
|
|
12126
12147
|
}
|
|
@@ -12157,22 +12178,29 @@ let Animate = class Animate extends Eventer {
|
|
|
12157
12178
|
get completed() { return this.time >= this.duration && !this.started; }
|
|
12158
12179
|
get frame() { return this.frames[this.nowIndex]; }
|
|
12159
12180
|
get frameTotalTime() { return this.frame.totalTime || this.frame.duration || 0; }
|
|
12181
|
+
get nowReverse() { return (this.mainReverse ? 1 : 0) + (this.frameReverse ? 1 : 0) === 1; }
|
|
12160
12182
|
get realEnding() {
|
|
12161
12183
|
let count;
|
|
12162
|
-
const { ending, reverse, loop } = this;
|
|
12184
|
+
const { ending, reverse, swing, loop } = this;
|
|
12163
12185
|
if (ending === 'from')
|
|
12164
12186
|
count = 0;
|
|
12165
12187
|
else if (ending === 'to')
|
|
12166
12188
|
count = 1;
|
|
12167
12189
|
else {
|
|
12168
12190
|
count = reverse ? 0 : 1;
|
|
12169
|
-
if (loop && typeof loop === 'number')
|
|
12191
|
+
if (swing && loop && typeof loop === 'number')
|
|
12170
12192
|
count += loop - 1;
|
|
12171
12193
|
}
|
|
12172
12194
|
return count % 2 ? 'to' : 'from';
|
|
12173
12195
|
}
|
|
12174
12196
|
constructor(target, keyframe, options, isTemp) {
|
|
12175
12197
|
super();
|
|
12198
|
+
if (keyframe) {
|
|
12199
|
+
if (keyframe.keyframes)
|
|
12200
|
+
options = keyframe, keyframe = keyframe.keyframes;
|
|
12201
|
+
else if (keyframe.style)
|
|
12202
|
+
options = keyframe, keyframe = keyframe.style;
|
|
12203
|
+
}
|
|
12176
12204
|
this.init(target, keyframe, options, isTemp);
|
|
12177
12205
|
}
|
|
12178
12206
|
init(target, keyframe, options, isTemp) {
|
|
@@ -12188,16 +12216,14 @@ let Animate = class Animate extends Eventer {
|
|
|
12188
12216
|
break;
|
|
12189
12217
|
case 'object': this.config = options, options.event && (this.event = options.event);
|
|
12190
12218
|
}
|
|
12191
|
-
|
|
12192
|
-
return;
|
|
12193
|
-
this.keyframes = keyframe instanceof Array ? keyframe : [keyframe];
|
|
12219
|
+
this.keyframes = keyframe instanceof Array ? keyframe : (keyframe ? [keyframe] : []);
|
|
12194
12220
|
const { easing, attrs } = this;
|
|
12195
12221
|
this.easingFn = AnimateEasing.get(easing);
|
|
12196
12222
|
if (attrs || this.attrsMap)
|
|
12197
12223
|
this.attrsMap = attrs ? attrs.reduce((map, value) => { map[value] = true; return map; }, {}) : undefined;
|
|
12198
12224
|
this.frames = [];
|
|
12199
12225
|
this.create();
|
|
12200
|
-
if (this.autoplay)
|
|
12226
|
+
if (this.autoplay && this.frames.length)
|
|
12201
12227
|
this.timer = setTimeout(() => {
|
|
12202
12228
|
this.timer = 0;
|
|
12203
12229
|
this.play();
|
|
@@ -12246,7 +12272,7 @@ let Animate = class Animate extends Eventer {
|
|
|
12246
12272
|
}
|
|
12247
12273
|
create() {
|
|
12248
12274
|
const { target, frames, keyframes, config } = this, { length } = keyframes, joinBefore = length > 1 ? this.join : true;
|
|
12249
|
-
let
|
|
12275
|
+
let totalTime = 0, totalAutoTime = 0, before, keyframe, item, style, times;
|
|
12250
12276
|
if (length > 1)
|
|
12251
12277
|
this.fromStyle = {}, this.toStyle = {};
|
|
12252
12278
|
for (let i = 0; i < length; i++) {
|
|
@@ -12255,27 +12281,32 @@ let Animate = class Animate extends Eventer {
|
|
|
12255
12281
|
if (!before)
|
|
12256
12282
|
before = joinBefore ? target : style;
|
|
12257
12283
|
item = { style, beforeStyle: {} };
|
|
12284
|
+
times = 1;
|
|
12258
12285
|
if (keyframe.style) {
|
|
12259
|
-
const { duration, autoDuration, delay, autoDelay, easing } = keyframe;
|
|
12286
|
+
const { duration, autoDuration, delay, autoDelay, easing, swing, loop } = keyframe;
|
|
12287
|
+
if (swing)
|
|
12288
|
+
item.swing = typeof swing === 'number' ? swing : 2, times = item.swing * 2 - 1;
|
|
12289
|
+
if (loop)
|
|
12290
|
+
item.loop = times = typeof loop === 'number' ? loop : 2;
|
|
12260
12291
|
if (duration) {
|
|
12261
|
-
item.duration = duration,
|
|
12292
|
+
item.duration = duration, totalTime += duration * times;
|
|
12262
12293
|
if (delay)
|
|
12263
12294
|
item.totalTime = duration + delay;
|
|
12264
12295
|
}
|
|
12265
12296
|
else {
|
|
12266
12297
|
if (autoDuration)
|
|
12267
|
-
item.autoDuration = autoDuration,
|
|
12298
|
+
item.autoDuration = autoDuration, totalAutoTime += autoDuration * times;
|
|
12268
12299
|
}
|
|
12269
12300
|
if (delay)
|
|
12270
|
-
item.delay = delay,
|
|
12301
|
+
item.delay = delay, totalTime += delay * times;
|
|
12271
12302
|
else if (autoDelay)
|
|
12272
|
-
item.autoDelay = autoDelay,
|
|
12303
|
+
item.autoDelay = autoDelay, totalAutoTime += autoDelay * times;
|
|
12273
12304
|
if (easing)
|
|
12274
12305
|
item.easingFn = AnimateEasing.get(easing);
|
|
12275
12306
|
}
|
|
12276
12307
|
if (!item.autoDuration && item.duration === undefined) {
|
|
12277
12308
|
if (length > 1)
|
|
12278
|
-
(i > 0 || joinBefore) ?
|
|
12309
|
+
(i > 0 || joinBefore) ? totalAutoTime += times : item.duration = 0;
|
|
12279
12310
|
else
|
|
12280
12311
|
item.duration = this.duration;
|
|
12281
12312
|
}
|
|
@@ -12291,14 +12322,14 @@ let Animate = class Animate extends Eventer {
|
|
|
12291
12322
|
before = style;
|
|
12292
12323
|
frames.push(item);
|
|
12293
12324
|
}
|
|
12294
|
-
if (
|
|
12295
|
-
if (this.duration <=
|
|
12296
|
-
this.changeDuration(
|
|
12297
|
-
this.allocateTime((this.duration -
|
|
12325
|
+
if (totalAutoTime) {
|
|
12326
|
+
if (this.duration <= totalTime || !(config && config.duration))
|
|
12327
|
+
this.changeDuration(totalTime + frameDuration * totalAutoTime);
|
|
12328
|
+
this.allocateTime((this.duration - totalTime) / totalAutoTime);
|
|
12298
12329
|
}
|
|
12299
12330
|
else {
|
|
12300
|
-
if (
|
|
12301
|
-
this.changeDuration(
|
|
12331
|
+
if (totalTime)
|
|
12332
|
+
this.changeDuration(totalTime);
|
|
12302
12333
|
}
|
|
12303
12334
|
this.emit(AnimateEvent.CREATED, this);
|
|
12304
12335
|
}
|
|
@@ -12325,7 +12356,7 @@ let Animate = class Animate extends Eventer {
|
|
|
12325
12356
|
if (frame.autoDelay)
|
|
12326
12357
|
frame.delay = frame.autoDelay * partTime;
|
|
12327
12358
|
if (frame.delay)
|
|
12328
|
-
frame.totalTime = frame.duration
|
|
12359
|
+
frame.totalTime = frame.duration + frame.delay;
|
|
12329
12360
|
}
|
|
12330
12361
|
}
|
|
12331
12362
|
}
|
|
@@ -12343,7 +12374,7 @@ let Animate = class Animate extends Eventer {
|
|
|
12343
12374
|
if (realTime < duration) {
|
|
12344
12375
|
while (realTime - this.playedTotalTime > this.frameTotalTime) {
|
|
12345
12376
|
this.transition(1);
|
|
12346
|
-
this.
|
|
12377
|
+
this.mainReverse ? this.reverseNextFrame() : this.nextFrame();
|
|
12347
12378
|
}
|
|
12348
12379
|
const itemDelay = this.nowReverse ? 0 : (this.frame.delay || 0);
|
|
12349
12380
|
const itemPlayedTime = realTime - this.playedTotalTime - itemDelay;
|
|
@@ -12367,9 +12398,9 @@ let Animate = class Animate extends Eventer {
|
|
|
12367
12398
|
const { loop, loopDelay, swing } = this;
|
|
12368
12399
|
if (loop !== false || swing) {
|
|
12369
12400
|
this.looped ? this.looped++ : this.looped = 1;
|
|
12370
|
-
if (
|
|
12401
|
+
if (this.needLoop(this.looped, loop, swing)) {
|
|
12371
12402
|
if (swing)
|
|
12372
|
-
this.
|
|
12403
|
+
this.mainReverse = !this.mainReverse;
|
|
12373
12404
|
if (loopDelay)
|
|
12374
12405
|
this.timer = setTimeout(() => { this.timer = 0, this.begin(); }, loopDelay / this.speed * 1000);
|
|
12375
12406
|
else
|
|
@@ -12384,8 +12415,8 @@ let Animate = class Animate extends Eventer {
|
|
|
12384
12415
|
start(seek) {
|
|
12385
12416
|
this.requestAnimateTime = 1;
|
|
12386
12417
|
const { reverse } = this;
|
|
12387
|
-
if (reverse || this.
|
|
12388
|
-
this.
|
|
12418
|
+
if (reverse || this.mainReverse)
|
|
12419
|
+
this.mainReverse = reverse;
|
|
12389
12420
|
if (this.looped)
|
|
12390
12421
|
this.looped = 0;
|
|
12391
12422
|
if (seek)
|
|
@@ -12403,12 +12434,12 @@ let Animate = class Animate extends Eventer {
|
|
|
12403
12434
|
}
|
|
12404
12435
|
begin(seek) {
|
|
12405
12436
|
this.playedTotalTime = this.time = 0;
|
|
12406
|
-
this.
|
|
12437
|
+
this.mainReverse ? this.setTo() : this.setFrom();
|
|
12407
12438
|
if (!seek)
|
|
12408
12439
|
this.requestAnimate();
|
|
12409
12440
|
}
|
|
12410
12441
|
end() {
|
|
12411
|
-
this.
|
|
12442
|
+
this.mainReverse ? this.setFrom() : this.setTo();
|
|
12412
12443
|
}
|
|
12413
12444
|
complete() {
|
|
12414
12445
|
this.requestAnimateTime = 0;
|
|
@@ -12431,15 +12462,19 @@ let Animate = class Animate extends Eventer {
|
|
|
12431
12462
|
this.setStyle(this.toStyle);
|
|
12432
12463
|
}
|
|
12433
12464
|
nextFrame() {
|
|
12465
|
+
if (this.needLoopFrame())
|
|
12466
|
+
return this.increaseTime();
|
|
12434
12467
|
if (this.nowIndex + 1 >= this.frames.length)
|
|
12435
12468
|
return;
|
|
12436
|
-
this.
|
|
12469
|
+
this.increaseTime();
|
|
12437
12470
|
this.nowIndex++;
|
|
12438
12471
|
}
|
|
12439
12472
|
reverseNextFrame() {
|
|
12473
|
+
if (this.needLoopFrame())
|
|
12474
|
+
return this.increaseTime();
|
|
12440
12475
|
if (this.nowIndex - 1 < 0)
|
|
12441
12476
|
return;
|
|
12442
|
-
this.
|
|
12477
|
+
this.increaseTime();
|
|
12443
12478
|
this.nowIndex--;
|
|
12444
12479
|
}
|
|
12445
12480
|
transition(t) {
|
|
@@ -12475,6 +12510,27 @@ let Animate = class Animate extends Eventer {
|
|
|
12475
12510
|
target.__ ? target.set(style, this.isTemp ? 'temp' : false) : Object.assign(target, style);
|
|
12476
12511
|
}
|
|
12477
12512
|
}
|
|
12513
|
+
increaseTime() {
|
|
12514
|
+
this.playedTotalTime += this.frameTotalTime;
|
|
12515
|
+
}
|
|
12516
|
+
needLoop(looped, loop, swing) {
|
|
12517
|
+
return !(this.needStopLoop(looped, loop) || this.needStopLoop(looped, swing, true));
|
|
12518
|
+
}
|
|
12519
|
+
needStopLoop(looped, times, swing) {
|
|
12520
|
+
return typeof times === 'number' && (!times || looped >= (swing ? times * 2 - 1 : times));
|
|
12521
|
+
}
|
|
12522
|
+
needLoopFrame() {
|
|
12523
|
+
const { loop, swing } = this.frame;
|
|
12524
|
+
if (loop || swing) {
|
|
12525
|
+
this.frameLooped ? this.frameLooped++ : this.frameLooped = 1;
|
|
12526
|
+
if (swing)
|
|
12527
|
+
this.frameReverse = !this.frameReverse;
|
|
12528
|
+
if (this.needLoop(this.frameLooped, loop, swing))
|
|
12529
|
+
return true;
|
|
12530
|
+
this.frameLooped = this.frameReverse = undefined;
|
|
12531
|
+
}
|
|
12532
|
+
return false;
|
|
12533
|
+
}
|
|
12478
12534
|
clearTimer(fn) {
|
|
12479
12535
|
if (this.timer) {
|
|
12480
12536
|
clearTimeout(this.timer), this.timer = 0;
|
|
@@ -12496,44 +12552,102 @@ let Animate = class Animate extends Eventer {
|
|
|
12496
12552
|
};
|
|
12497
12553
|
__decorate([
|
|
12498
12554
|
animateAttr('ease')
|
|
12499
|
-
], Animate.prototype, "easing",
|
|
12555
|
+
], Animate.prototype, "easing", undefined);
|
|
12500
12556
|
__decorate([
|
|
12501
12557
|
animateAttr(0)
|
|
12502
|
-
], Animate.prototype, "delay",
|
|
12558
|
+
], Animate.prototype, "delay", undefined);
|
|
12503
12559
|
__decorate([
|
|
12504
12560
|
animateAttr(frameDuration)
|
|
12505
|
-
], Animate.prototype, "duration",
|
|
12561
|
+
], Animate.prototype, "duration", undefined);
|
|
12506
12562
|
__decorate([
|
|
12507
12563
|
animateAttr('auto')
|
|
12508
|
-
], Animate.prototype, "ending",
|
|
12564
|
+
], Animate.prototype, "ending", undefined);
|
|
12509
12565
|
__decorate([
|
|
12510
12566
|
animateAttr(false)
|
|
12511
|
-
], Animate.prototype, "reverse",
|
|
12567
|
+
], Animate.prototype, "reverse", undefined);
|
|
12512
12568
|
__decorate([
|
|
12513
12569
|
animateAttr(false)
|
|
12514
|
-
], Animate.prototype, "swing",
|
|
12570
|
+
], Animate.prototype, "swing", undefined);
|
|
12515
12571
|
__decorate([
|
|
12516
12572
|
animateAttr(false)
|
|
12517
|
-
], Animate.prototype, "loop",
|
|
12573
|
+
], Animate.prototype, "loop", undefined);
|
|
12518
12574
|
__decorate([
|
|
12519
12575
|
animateAttr(0)
|
|
12520
|
-
], Animate.prototype, "loopDelay",
|
|
12576
|
+
], Animate.prototype, "loopDelay", undefined);
|
|
12521
12577
|
__decorate([
|
|
12522
12578
|
animateAttr(1)
|
|
12523
|
-
], Animate.prototype, "speed",
|
|
12579
|
+
], Animate.prototype, "speed", undefined);
|
|
12524
12580
|
__decorate([
|
|
12525
12581
|
animateAttr(true)
|
|
12526
|
-
], Animate.prototype, "autoplay",
|
|
12582
|
+
], Animate.prototype, "autoplay", undefined);
|
|
12527
12583
|
__decorate([
|
|
12528
12584
|
animateAttr()
|
|
12529
|
-
], Animate.prototype, "join",
|
|
12585
|
+
], Animate.prototype, "join", undefined);
|
|
12530
12586
|
__decorate([
|
|
12531
12587
|
animateAttr()
|
|
12532
|
-
], Animate.prototype, "attrs",
|
|
12588
|
+
], Animate.prototype, "attrs", undefined);
|
|
12533
12589
|
Animate = __decorate([
|
|
12534
12590
|
useModule(LeafEventer)
|
|
12535
12591
|
], Animate);
|
|
12536
12592
|
|
|
12593
|
+
let AnimateList = class AnimateList extends Animate {
|
|
12594
|
+
get completed() { return this.list.every(item => item.completed); }
|
|
12595
|
+
get endingStyle() { return this._endingStyle; }
|
|
12596
|
+
constructor(target, animation, isTemp) {
|
|
12597
|
+
super(target, null);
|
|
12598
|
+
this.list = [];
|
|
12599
|
+
this.updateList(animation, isTemp);
|
|
12600
|
+
}
|
|
12601
|
+
updateList(animation, isTemp) {
|
|
12602
|
+
this.fromStyle = {};
|
|
12603
|
+
this.toStyle = {};
|
|
12604
|
+
this._endingStyle = {};
|
|
12605
|
+
if (!animation)
|
|
12606
|
+
animation = this.list.filter(item => {
|
|
12607
|
+
const { completed } = item;
|
|
12608
|
+
if (completed)
|
|
12609
|
+
item.destroy();
|
|
12610
|
+
return !completed;
|
|
12611
|
+
});
|
|
12612
|
+
this.list = animation.map(item => {
|
|
12613
|
+
const animate = item.target ? item : new Animate(this.target, item, isTemp);
|
|
12614
|
+
Object.assign(this.fromStyle, animate.fromStyle);
|
|
12615
|
+
Object.assign(this.toStyle, animate.toStyle);
|
|
12616
|
+
Object.assign(this._endingStyle, animate.endingStyle);
|
|
12617
|
+
return animate;
|
|
12618
|
+
});
|
|
12619
|
+
}
|
|
12620
|
+
play() {
|
|
12621
|
+
this.each(item => item.play());
|
|
12622
|
+
}
|
|
12623
|
+
pause() {
|
|
12624
|
+
this.each(item => item.pause());
|
|
12625
|
+
}
|
|
12626
|
+
stop() {
|
|
12627
|
+
this.each(item => item.stop());
|
|
12628
|
+
}
|
|
12629
|
+
seek(time) {
|
|
12630
|
+
this.each(item => item.seek(time));
|
|
12631
|
+
}
|
|
12632
|
+
kill(complete, killStyle) {
|
|
12633
|
+
this.each(item => item.kill(complete, killStyle));
|
|
12634
|
+
this.destroy();
|
|
12635
|
+
}
|
|
12636
|
+
each(func) {
|
|
12637
|
+
this.list.forEach(func);
|
|
12638
|
+
}
|
|
12639
|
+
destroy(complete) {
|
|
12640
|
+
const { list } = this;
|
|
12641
|
+
if (list.length) {
|
|
12642
|
+
this.each(item => item.destroy(complete));
|
|
12643
|
+
list.length = 0;
|
|
12644
|
+
}
|
|
12645
|
+
}
|
|
12646
|
+
};
|
|
12647
|
+
AnimateList = __decorate([
|
|
12648
|
+
useModule(LeafEventer)
|
|
12649
|
+
], AnimateList);
|
|
12650
|
+
|
|
12537
12651
|
const colorNames = {
|
|
12538
12652
|
transparent: 'FFF0',
|
|
12539
12653
|
aliceblue: 'F0F8FF',
|
|
@@ -12870,7 +12984,8 @@ function getDecimalLen(num) {
|
|
|
12870
12984
|
return decimal ? decimal.length : 0;
|
|
12871
12985
|
}
|
|
12872
12986
|
function value(from, to, t) {
|
|
12873
|
-
|
|
12987
|
+
const fromIsNumber = typeof from === 'number', toIsNumber = typeof to === 'number';
|
|
12988
|
+
return (fromIsNumber && toIsNumber) ? from + (to - from) * t : ((toIsNumber || fromIsNumber) ? number(from, to, t) : from);
|
|
12874
12989
|
}
|
|
12875
12990
|
function number(from, to, t, roundValue) {
|
|
12876
12991
|
from || (from = 0), to || (to = 0);
|
|
@@ -12914,23 +13029,40 @@ dataType()(ui$2, 'transitionOut');
|
|
|
12914
13029
|
ui$2.animate = function (keyframe, options, kill, isTemp) {
|
|
12915
13030
|
if (keyframe === undefined)
|
|
12916
13031
|
return this.__animate;
|
|
12917
|
-
|
|
12918
|
-
|
|
12919
|
-
|
|
12920
|
-
|
|
12921
|
-
|
|
12922
|
-
|
|
12923
|
-
|
|
12924
|
-
|
|
12925
|
-
|
|
13032
|
+
const isAnimationList = keyframe instanceof Array && !options && kill;
|
|
13033
|
+
let nextAnimate = isAnimationList ? new AnimateList(this, keyframe, isTemp) : new Animate(this, keyframe, options, isTemp);
|
|
13034
|
+
this.killAnimate(kill, nextAnimate.toStyle);
|
|
13035
|
+
const animate = this.__animate;
|
|
13036
|
+
if (animate) {
|
|
13037
|
+
if (nextAnimate instanceof AnimateList)
|
|
13038
|
+
nextAnimate.list.unshift(animate);
|
|
13039
|
+
else
|
|
13040
|
+
nextAnimate = new AnimateList(this, [animate, nextAnimate]);
|
|
13041
|
+
}
|
|
13042
|
+
return this.__animate = nextAnimate;
|
|
12926
13043
|
};
|
|
12927
|
-
ui$2.killAnimate = function (_type,
|
|
13044
|
+
ui$2.killAnimate = function (_type, nextStyle) {
|
|
12928
13045
|
const animate = this.__animate;
|
|
12929
|
-
if (animate)
|
|
12930
|
-
|
|
13046
|
+
if (animate) {
|
|
13047
|
+
let kill = false;
|
|
13048
|
+
if (nextStyle && !animate.completed) {
|
|
13049
|
+
if (animate instanceof AnimateList)
|
|
13050
|
+
animate.updateList();
|
|
13051
|
+
const { toStyle } = animate;
|
|
13052
|
+
for (let key in nextStyle)
|
|
13053
|
+
if (key in toStyle) {
|
|
13054
|
+
kill = true;
|
|
13055
|
+
break;
|
|
13056
|
+
}
|
|
13057
|
+
}
|
|
13058
|
+
else
|
|
13059
|
+
kill = true;
|
|
13060
|
+
if (kill)
|
|
13061
|
+
animate.kill(true, nextStyle), this.__animate = null;
|
|
13062
|
+
}
|
|
12931
13063
|
};
|
|
12932
13064
|
ui$2.__runAnimation = function (type, complete) {
|
|
12933
|
-
this.animate(type === 'in' ? this.animation : this.animationOut);
|
|
13065
|
+
this.animate(type === 'in' ? this.animation : this.animationOut, undefined, 'animation');
|
|
12934
13066
|
if (complete)
|
|
12935
13067
|
this.__animate.on(AnimateEvent.COMPLETED, complete);
|
|
12936
13068
|
};
|
|
@@ -13224,12 +13356,12 @@ ui$1.__updateMotionPath = function () {
|
|
|
13224
13356
|
data.__pathForMotion = undefined;
|
|
13225
13357
|
if (this.motionPath) {
|
|
13226
13358
|
let child;
|
|
13227
|
-
const { children } = this.parent
|
|
13359
|
+
const { children } = this.parent;
|
|
13228
13360
|
for (let i = 0; i < children.length; i++) {
|
|
13229
13361
|
child = children[i];
|
|
13230
13362
|
if (!isNull(child.motion) && !child.__layout.matrixChanged) {
|
|
13231
|
-
if (
|
|
13232
|
-
|
|
13363
|
+
if (child !== this)
|
|
13364
|
+
child.__extraUpdate();
|
|
13233
13365
|
updateMotion(child);
|
|
13234
13366
|
}
|
|
13235
13367
|
}
|
|
@@ -13424,4 +13556,4 @@ Creator.finder = function (target) {
|
|
|
13424
13556
|
return new Finder(target);
|
|
13425
13557
|
};
|
|
13426
13558
|
|
|
13427
|
-
export { AlignHelper, Animate, AnimateEasing, AnimateEvent, Answer, App, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragEvent, Dragger, DropEvent, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Finder, Frame, FrameData, Group, GroupData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferImage, Line, LineData, MathHelper, Matrix, MatrixHelper, MoveEvent, MyDragEvent, MyImage, MyPointerEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Robot, RobotData, RotateEvent, Run, Selector, Star, StarData, State, StringNumberMap, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, ZoomEvent, affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, doBoundsType, doStrokeType, effectType, emptyData, eraserType, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isNull, layoutProcessor, maskType, motionPathType, naturalBoundsType, opacityType, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, sortType, stateStyleType, stateType, strokeType, surfaceType, tempBounds$1 as tempBounds, tempMatrix, tempPoint$4 as tempPoint, useCanvas, useModule, version, visibleType, zoomLayerType };
|
|
13559
|
+
export { AlignHelper, Animate, AnimateEasing, AnimateEvent, AnimateList, Answer, App, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragEvent, Dragger, DropEvent, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Finder, Frame, FrameData, Group, GroupData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferImage, Line, LineData, MathHelper, Matrix, MatrixHelper, MoveEvent, MyDragEvent, MyImage, MyPointerEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Robot, RobotData, RotateEvent, Run, Selector, Star, StarData, State, StringNumberMap, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, ZoomEvent, affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, doBoundsType, doStrokeType, effectType, emptyData, eraserType, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isNull, layoutProcessor, maskType, motionPathType, naturalBoundsType, opacityType, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, sortType, stateStyleType, stateType, strokeType, surfaceType, tempBounds$1 as tempBounds, tempMatrix, tempPoint$4 as tempPoint, useCanvas, useModule, version, visibleType, zoomLayerType };
|