@leafer/miniapp 1.6.1 → 1.6.2
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/miniapp.cjs +0 -1
- package/dist/miniapp.esm.js +0 -1
- package/dist/miniapp.module.js +117 -65
- package/dist/miniapp.module.min.js +1 -1
- package/dist/miniapp.module.min.js.map +1 -1
- package/package.json +18 -18
- package/dist/miniapp.cjs.map +0 -1
- package/dist/miniapp.esm.js.map +0 -1
- package/dist/miniapp.module.js.map +0 -1
package/dist/miniapp.cjs
CHANGED
package/dist/miniapp.esm.js
CHANGED
package/dist/miniapp.module.js
CHANGED
|
@@ -2589,7 +2589,11 @@ const BezierHelper = {
|
|
|
2589
2589
|
const point = {};
|
|
2590
2590
|
getPointAndSet(t, fromX, fromY, x1, y1, x2, y2, toX, toY, point);
|
|
2591
2591
|
return point;
|
|
2592
|
-
}
|
|
2592
|
+
},
|
|
2593
|
+
getDerivative(t, fromV, v1, v2, toV) {
|
|
2594
|
+
const o = 1 - t;
|
|
2595
|
+
return 3 * o * o * (v1 - fromV) + 6 * o * t * (v2 - v1) + 3 * t * t * (toV - v2);
|
|
2596
|
+
},
|
|
2593
2597
|
};
|
|
2594
2598
|
const { getPointAndSet, toTwoPointBounds: toTwoPointBounds$1, ellipse: ellipse$6 } = BezierHelper;
|
|
2595
2599
|
|
|
@@ -3770,8 +3774,11 @@ class LeaferImage {
|
|
|
3770
3774
|
load(onSuccess, onError) {
|
|
3771
3775
|
if (!this.loading) {
|
|
3772
3776
|
this.loading = true;
|
|
3777
|
+
let { loadImage, loadImageWithProgress } = Platform.origin, onProgress = this.config.showProgress && loadImageWithProgress && this.onProgress.bind(this);
|
|
3778
|
+
if (onProgress)
|
|
3779
|
+
loadImage = loadImageWithProgress;
|
|
3773
3780
|
Resource.tasker.add(() => __awaiter(this, void 0, void 0, function* () {
|
|
3774
|
-
return yield
|
|
3781
|
+
return yield loadImage(this.url, onProgress).then(img => this.setView(img)).catch((e) => {
|
|
3775
3782
|
this.error = e;
|
|
3776
3783
|
this.onComplete(false);
|
|
3777
3784
|
});
|
|
@@ -3796,6 +3803,9 @@ class LeaferImage {
|
|
|
3796
3803
|
this.view = img;
|
|
3797
3804
|
this.onComplete(true);
|
|
3798
3805
|
}
|
|
3806
|
+
onProgress(progress) {
|
|
3807
|
+
this.progress = progress;
|
|
3808
|
+
}
|
|
3799
3809
|
onComplete(isSuccess) {
|
|
3800
3810
|
let odd;
|
|
3801
3811
|
this.waitComplete.forEach((item, index) => {
|
|
@@ -4261,13 +4271,20 @@ const LeafHelper = {
|
|
|
4261
4271
|
if (leaf.isBranch) {
|
|
4262
4272
|
const { children } = leaf;
|
|
4263
4273
|
for (let i = 0, len = children.length; i < len; i++) {
|
|
4264
|
-
updateAllWorldOpacity
|
|
4274
|
+
updateAllWorldOpacity(children[i]);
|
|
4265
4275
|
}
|
|
4266
4276
|
}
|
|
4267
4277
|
},
|
|
4268
|
-
|
|
4269
|
-
|
|
4278
|
+
updateChange(leaf) {
|
|
4279
|
+
const layout = leaf.__layout;
|
|
4280
|
+
if (layout.stateStyleChanged)
|
|
4281
|
+
leaf.updateState();
|
|
4282
|
+
if (layout.opacityChanged)
|
|
4283
|
+
updateAllWorldOpacity(leaf);
|
|
4270
4284
|
leaf.__updateChange();
|
|
4285
|
+
},
|
|
4286
|
+
updateAllChange(leaf) {
|
|
4287
|
+
updateChange$1(leaf);
|
|
4271
4288
|
if (leaf.isBranch) {
|
|
4272
4289
|
const { children } = leaf;
|
|
4273
4290
|
for (let i = 0, len = children.length; i < len; i++) {
|
|
@@ -4403,7 +4420,7 @@ const LeafHelper = {
|
|
|
4403
4420
|
}
|
|
4404
4421
|
};
|
|
4405
4422
|
const L$4 = LeafHelper;
|
|
4406
|
-
const { updateAllMatrix: updateAllMatrix$4, updateMatrix: updateMatrix$4, updateAllWorldOpacity:
|
|
4423
|
+
const { updateAllMatrix: updateAllMatrix$4, updateMatrix: updateMatrix$4, updateAllWorldOpacity, updateAllChange: updateAllChange$1, updateChange: updateChange$1 } = L$4;
|
|
4407
4424
|
function getTempLocal(t, world) {
|
|
4408
4425
|
t.__layout.update();
|
|
4409
4426
|
return t.parent ? PointHelper.tempToInnerOf(world, t.parent.__world) : world;
|
|
@@ -6125,7 +6142,7 @@ class LeafLevelList {
|
|
|
6125
6142
|
}
|
|
6126
6143
|
}
|
|
6127
6144
|
|
|
6128
|
-
const version = "1.6.
|
|
6145
|
+
const version = "1.6.2";
|
|
6129
6146
|
|
|
6130
6147
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6131
6148
|
get allowBackgroundColor() { return false; }
|
|
@@ -6449,7 +6466,7 @@ class Watcher {
|
|
|
6449
6466
|
}
|
|
6450
6467
|
}
|
|
6451
6468
|
|
|
6452
|
-
const { updateAllMatrix: updateAllMatrix$2, updateBounds: updateOneBounds,
|
|
6469
|
+
const { updateAllMatrix: updateAllMatrix$2, updateBounds: updateOneBounds, updateChange: updateOneChange } = LeafHelper;
|
|
6453
6470
|
const { pushAllChildBranch, pushAllParent } = BranchHelper;
|
|
6454
6471
|
function updateMatrix$2(updateList, levelList) {
|
|
6455
6472
|
let layout;
|
|
@@ -6492,15 +6509,7 @@ function updateBounds$1(boundsList) {
|
|
|
6492
6509
|
});
|
|
6493
6510
|
}
|
|
6494
6511
|
function updateChange(updateList) {
|
|
6495
|
-
|
|
6496
|
-
updateList.list.forEach(leaf => {
|
|
6497
|
-
layout = leaf.__layout;
|
|
6498
|
-
if (layout.opacityChanged)
|
|
6499
|
-
updateAllWorldOpacity(leaf);
|
|
6500
|
-
if (layout.stateStyleChanged)
|
|
6501
|
-
setTimeout(() => layout.stateStyleChanged && leaf.updateState());
|
|
6502
|
-
leaf.__updateChange();
|
|
6503
|
-
});
|
|
6512
|
+
updateList.list.forEach(updateOneChange);
|
|
6504
6513
|
}
|
|
6505
6514
|
|
|
6506
6515
|
const { worldBounds: worldBounds$1 } = LeafBoundsHelper;
|
|
@@ -7345,13 +7354,11 @@ class TextData extends UIData {
|
|
|
7345
7354
|
setFontWeight(value) {
|
|
7346
7355
|
if (typeof value === 'string') {
|
|
7347
7356
|
this.__setInput('fontWeight', value);
|
|
7348
|
-
|
|
7349
|
-
}
|
|
7350
|
-
else {
|
|
7351
|
-
if (this.__input)
|
|
7352
|
-
this.__removeInput('fontWeight');
|
|
7353
|
-
this._fontWeight = value;
|
|
7357
|
+
value = fontWeightMap[value] || 400;
|
|
7354
7358
|
}
|
|
7359
|
+
else if (this.__input)
|
|
7360
|
+
this.__removeInput('fontWeight');
|
|
7361
|
+
this._fontWeight = value;
|
|
7355
7362
|
}
|
|
7356
7363
|
setBoxStyle(value) {
|
|
7357
7364
|
let t = this.__leaf, box = t.__box;
|
|
@@ -7678,6 +7685,9 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
7678
7685
|
else
|
|
7679
7686
|
drawer.rect(x, y, width, height);
|
|
7680
7687
|
}
|
|
7688
|
+
drawImagePlaceholder(canvas, _image) {
|
|
7689
|
+
Paint.fill(this.__.placeholderColor, this, canvas);
|
|
7690
|
+
}
|
|
7681
7691
|
animate(_keyframe, _options, _type, _isTemp) {
|
|
7682
7692
|
return Plugin.need('animate');
|
|
7683
7693
|
}
|
|
@@ -7914,6 +7924,9 @@ __decorate([
|
|
|
7914
7924
|
__decorate([
|
|
7915
7925
|
effectType()
|
|
7916
7926
|
], UI.prototype, "filter", void 0);
|
|
7927
|
+
__decorate([
|
|
7928
|
+
surfaceType()
|
|
7929
|
+
], UI.prototype, "placeholderColor", void 0);
|
|
7917
7930
|
__decorate([
|
|
7918
7931
|
dataType({})
|
|
7919
7932
|
], UI.prototype, "data", void 0);
|
|
@@ -8744,10 +8757,11 @@ let Image = class Image extends Rect {
|
|
|
8744
8757
|
get ready() { return this.image ? this.image.ready : false; }
|
|
8745
8758
|
constructor(data) {
|
|
8746
8759
|
super(data);
|
|
8747
|
-
this.
|
|
8748
|
-
|
|
8749
|
-
|
|
8750
|
-
|
|
8760
|
+
this.on_(ImageEvent.LOADED, this.__onLoaded, this);
|
|
8761
|
+
}
|
|
8762
|
+
__onLoaded(e) {
|
|
8763
|
+
if (e.attrName === 'fill' && e.attrValue.url === this.url)
|
|
8764
|
+
this.image = e.image;
|
|
8751
8765
|
}
|
|
8752
8766
|
destroy() {
|
|
8753
8767
|
this.image = null;
|
|
@@ -8861,7 +8875,7 @@ let Text = class Text extends UI {
|
|
|
8861
8875
|
data.__baseLine = data.__lineHeight - (data.__lineHeight - fontSize * 0.7) / 2;
|
|
8862
8876
|
data.__font = `${italic ? 'italic ' : ''}${textCase === 'small-caps' ? 'small-caps ' : ''}${fontWeight !== 'normal' ? fontWeight + ' ' : ''}${fontSize}px ${fontFamily}`;
|
|
8863
8877
|
data.__clipText = textOverflow !== 'show' && !data.__autoSize;
|
|
8864
|
-
data.__textDrawData = TextConvert.getDrawData(data.text, this.__);
|
|
8878
|
+
data.__textDrawData = TextConvert.getDrawData((data.__isPlacehold = data.placeholder && data.text === '') ? data.placeholder : data.text, this.__);
|
|
8865
8879
|
}
|
|
8866
8880
|
__updateBoxBounds() {
|
|
8867
8881
|
const data = this.__;
|
|
@@ -8959,6 +8973,9 @@ __decorate([
|
|
|
8959
8973
|
__decorate([
|
|
8960
8974
|
boundsType('')
|
|
8961
8975
|
], Text.prototype, "text", void 0);
|
|
8976
|
+
__decorate([
|
|
8977
|
+
boundsType('')
|
|
8978
|
+
], Text.prototype, "placeholder", void 0);
|
|
8962
8979
|
__decorate([
|
|
8963
8980
|
boundsType('caption')
|
|
8964
8981
|
], Text.prototype, "fontFamily", void 0);
|
|
@@ -10489,8 +10506,10 @@ class Interaction extends InteractionBase {
|
|
|
10489
10506
|
}
|
|
10490
10507
|
|
|
10491
10508
|
function fillText(ui, canvas) {
|
|
10492
|
-
|
|
10493
|
-
|
|
10509
|
+
const data = ui.__, { rows, decorationY } = data.__textDrawData;
|
|
10510
|
+
if (data.__isPlacehold && data.placeholderColor)
|
|
10511
|
+
canvas.fillStyle = data.placeholderColor;
|
|
10512
|
+
let row;
|
|
10494
10513
|
for (let i = 0, len = rows.length; i < len; i++) {
|
|
10495
10514
|
row = rows[i];
|
|
10496
10515
|
if (row.text)
|
|
@@ -10499,7 +10518,7 @@ function fillText(ui, canvas) {
|
|
|
10499
10518
|
row.data.forEach(charData => { canvas.fillText(charData.char, charData.x, row.y); });
|
|
10500
10519
|
}
|
|
10501
10520
|
if (decorationY) {
|
|
10502
|
-
const { decorationColor, decorationHeight } = data;
|
|
10521
|
+
const { decorationColor, decorationHeight } = data.__textDrawData;
|
|
10503
10522
|
if (decorationColor)
|
|
10504
10523
|
canvas.fillStyle = decorationColor;
|
|
10505
10524
|
rows.forEach(row => decorationY.forEach(value => canvas.fillRect(row.x, row.y + value, row.width, decorationHeight)));
|
|
@@ -10508,38 +10527,44 @@ function fillText(ui, canvas) {
|
|
|
10508
10527
|
|
|
10509
10528
|
function fill(fill, ui, canvas) {
|
|
10510
10529
|
canvas.fillStyle = fill;
|
|
10511
|
-
|
|
10530
|
+
fillPathOrText(ui, canvas);
|
|
10512
10531
|
}
|
|
10513
10532
|
function fills(fills, ui, canvas) {
|
|
10514
10533
|
let item;
|
|
10515
|
-
const { windingRule, __font } = ui.__;
|
|
10516
10534
|
for (let i = 0, len = fills.length; i < len; i++) {
|
|
10517
10535
|
item = fills[i];
|
|
10518
|
-
if (item.image
|
|
10519
|
-
|
|
10520
|
-
|
|
10521
|
-
|
|
10522
|
-
|
|
10523
|
-
|
|
10524
|
-
|
|
10525
|
-
if (item.blendMode)
|
|
10526
|
-
canvas.blendMode = item.blendMode;
|
|
10527
|
-
__font ? fillText(ui, canvas) : (windingRule ? canvas.fill(windingRule) : canvas.fill());
|
|
10528
|
-
canvas.restore();
|
|
10536
|
+
if (item.image) {
|
|
10537
|
+
if (PaintImage.checkImage(ui, canvas, item, !ui.__.__font))
|
|
10538
|
+
continue;
|
|
10539
|
+
if (!item.style) {
|
|
10540
|
+
if (!i && item.image.isPlacehold)
|
|
10541
|
+
ui.drawImagePlaceholder(canvas, item.image);
|
|
10542
|
+
continue;
|
|
10529
10543
|
}
|
|
10530
|
-
|
|
10531
|
-
|
|
10532
|
-
|
|
10533
|
-
|
|
10534
|
-
|
|
10535
|
-
|
|
10536
|
-
|
|
10537
|
-
|
|
10538
|
-
|
|
10544
|
+
}
|
|
10545
|
+
canvas.fillStyle = item.style;
|
|
10546
|
+
if (item.transform) {
|
|
10547
|
+
canvas.save();
|
|
10548
|
+
canvas.transform(item.transform);
|
|
10549
|
+
if (item.blendMode)
|
|
10550
|
+
canvas.blendMode = item.blendMode;
|
|
10551
|
+
fillPathOrText(ui, canvas);
|
|
10552
|
+
canvas.restore();
|
|
10553
|
+
}
|
|
10554
|
+
else {
|
|
10555
|
+
if (item.blendMode) {
|
|
10556
|
+
canvas.saveBlendMode(item.blendMode);
|
|
10557
|
+
fillPathOrText(ui, canvas);
|
|
10558
|
+
canvas.restoreBlendMode();
|
|
10539
10559
|
}
|
|
10560
|
+
else
|
|
10561
|
+
fillPathOrText(ui, canvas);
|
|
10540
10562
|
}
|
|
10541
10563
|
}
|
|
10542
10564
|
}
|
|
10565
|
+
function fillPathOrText(ui, canvas) {
|
|
10566
|
+
ui.__.__font ? fillText(ui, canvas) : (ui.__.windingRule ? canvas.fill(ui.__.windingRule) : canvas.fill());
|
|
10567
|
+
}
|
|
10543
10568
|
|
|
10544
10569
|
function strokeText(stroke, ui, canvas) {
|
|
10545
10570
|
const { strokeAlign } = ui.__;
|
|
@@ -10779,6 +10804,7 @@ const PaintModule = {
|
|
|
10779
10804
|
compute,
|
|
10780
10805
|
fill,
|
|
10781
10806
|
fills,
|
|
10807
|
+
fillPathOrText,
|
|
10782
10808
|
fillText,
|
|
10783
10809
|
stroke,
|
|
10784
10810
|
strokes,
|
|
@@ -10971,6 +10997,13 @@ function image(ui, attrName, paint, boxBounds, firstUse) {
|
|
|
10971
10997
|
onLoadError(ui, event, error);
|
|
10972
10998
|
leafPaint.loadId = null;
|
|
10973
10999
|
});
|
|
11000
|
+
if (ui.placeholderColor)
|
|
11001
|
+
setTimeout(() => {
|
|
11002
|
+
if (!(image.ready || image.isPlacehold)) {
|
|
11003
|
+
image.isPlacehold = true;
|
|
11004
|
+
ui.forceUpdate('surface');
|
|
11005
|
+
}
|
|
11006
|
+
}, 100);
|
|
10974
11007
|
}
|
|
10975
11008
|
return leafPaint;
|
|
10976
11009
|
}
|
|
@@ -12531,8 +12564,10 @@ const EditDataHelper = {
|
|
|
12531
12564
|
align = 'top-right';
|
|
12532
12565
|
}
|
|
12533
12566
|
if (lockRatio) {
|
|
12534
|
-
|
|
12535
|
-
|
|
12567
|
+
if (lockRatio === 'corner' && direction % 2) {
|
|
12568
|
+
lockRatio = false;
|
|
12569
|
+
}
|
|
12570
|
+
else {
|
|
12536
12571
|
let scale;
|
|
12537
12572
|
switch (direction) {
|
|
12538
12573
|
case top$1:
|
|
@@ -16692,6 +16727,7 @@ ui$3.__runAnimation = function (type, complete) {
|
|
|
16692
16727
|
const gaussNodes = [0.1488743389, 0.4333953941, 0.6794095682, 0.8650633666, 0.9739065285];
|
|
16693
16728
|
const gaussWeights = [0.2955242247, 0.2692667193, 0.2190863625, 0.1494513491, 0.0666713443];
|
|
16694
16729
|
const { sqrt } = Math;
|
|
16730
|
+
const { getDerivative } = BezierHelper;
|
|
16695
16731
|
const HighBezierHelper = {
|
|
16696
16732
|
getDistance(fromX, fromY, x1, y1, x2, y2, toX, toY, t = 1) {
|
|
16697
16733
|
let distance = 0, t1, t2, d1X, d1Y, d2X, d2Y, half = t / 2;
|
|
@@ -16706,10 +16742,6 @@ const HighBezierHelper = {
|
|
|
16706
16742
|
}
|
|
16707
16743
|
return distance * half;
|
|
16708
16744
|
},
|
|
16709
|
-
getDerivative(t, fromV, v1, v2, toV) {
|
|
16710
|
-
const o = 1 - t;
|
|
16711
|
-
return 3 * o * o * (v1 - fromV) + 6 * o * t * (v2 - v1) + 3 * t * t * (toV - v2);
|
|
16712
|
-
},
|
|
16713
16745
|
getRotation(t, fromX, fromY, x1, y1, x2, y2, toX, toY) {
|
|
16714
16746
|
const dx = getDerivative(t, fromX, x1, x2, toX);
|
|
16715
16747
|
const dy = getDerivative(t, fromY, y1, y2, toY);
|
|
@@ -16738,7 +16770,7 @@ const HighBezierHelper = {
|
|
|
16738
16770
|
data.push(PathCommandMap.C, ax, ay, bx, by, cx, cy);
|
|
16739
16771
|
}
|
|
16740
16772
|
};
|
|
16741
|
-
const {
|
|
16773
|
+
const { getDistance } = HighBezierHelper;
|
|
16742
16774
|
|
|
16743
16775
|
const { M, L, C, Z } = PathCommandMap;
|
|
16744
16776
|
const tempPoint = {}, tempFrom = {};
|
|
@@ -17036,7 +17068,10 @@ function stateType(defaultValue, styleName) {
|
|
|
17036
17068
|
return decorateLeafAttr(defaultValue, (key) => attr({
|
|
17037
17069
|
set(value) {
|
|
17038
17070
|
this.__setAttr(key, value);
|
|
17039
|
-
|
|
17071
|
+
if (this.leaferIsReady)
|
|
17072
|
+
styleName ? State.setStyleName(this, styleName, value) : State.set(this, value);
|
|
17073
|
+
else
|
|
17074
|
+
this.__layout.stateStyleChanged = true;
|
|
17040
17075
|
}
|
|
17041
17076
|
}));
|
|
17042
17077
|
}
|
|
@@ -17133,6 +17168,9 @@ function getStyle(leaf) {
|
|
|
17133
17168
|
const selectedStyle = style.selectedStyle || leaf.selectedStyle;
|
|
17134
17169
|
if (selectedStyle && State.isSelected(leaf, button))
|
|
17135
17170
|
exist = assign(style, selectedStyle);
|
|
17171
|
+
const placeholderStyle = style.placeholderStyle || leaf.placeholderStyle;
|
|
17172
|
+
if (placeholderStyle && State.isPlacehold(leaf, button))
|
|
17173
|
+
exist = assign(style, placeholderStyle);
|
|
17136
17174
|
if (State.isDisabled(leaf, button)) {
|
|
17137
17175
|
const disabledStyle = style.disabledStyle || leaf.disabledStyle;
|
|
17138
17176
|
if (disabledStyle)
|
|
@@ -17312,12 +17350,14 @@ State.animateExcludes = {
|
|
|
17312
17350
|
transitionOut: 1,
|
|
17313
17351
|
states: 1,
|
|
17314
17352
|
state: 1,
|
|
17353
|
+
placeholder: 1,
|
|
17315
17354
|
normalStyle: 1,
|
|
17316
17355
|
hoverStyle: 1,
|
|
17317
17356
|
pressStyle: 1,
|
|
17318
17357
|
focusStyle: 1,
|
|
17319
17358
|
selectedStyle: 1,
|
|
17320
|
-
disabledStyle: 1
|
|
17359
|
+
disabledStyle: 1,
|
|
17360
|
+
placeholderStyle: 1
|
|
17321
17361
|
};
|
|
17322
17362
|
State.isState = function (state, leaf, button) { return checkState(state, leaf, button); };
|
|
17323
17363
|
State.isSelected = function (leaf, button) { return checkFixedState('selected', leaf, button); };
|
|
@@ -17325,6 +17365,7 @@ State.isDisabled = function (leaf, button) { return checkFixedState('disabled',
|
|
|
17325
17365
|
State.isFocus = function (leaf, button) { return checkPointerState('isFocus', leaf, button); };
|
|
17326
17366
|
State.isHover = function (leaf, button) { return checkPointerState('isHover', leaf, button); };
|
|
17327
17367
|
State.isPress = function (leaf, button) { return checkPointerState('isPress', leaf, button); };
|
|
17368
|
+
State.isPlacehold = function (leaf, _button) { return leaf.__.__isPlacehold; };
|
|
17328
17369
|
State.isDrag = function (leaf, button) { return checkPointerState('isDrag', leaf, button); };
|
|
17329
17370
|
State.setStyleName = function (leaf, stateType, value) { value ? setState(leaf, stateType, leaf[stateType]) : unsetState(leaf, stateType, leaf[stateType]); };
|
|
17330
17371
|
State.set = function (leaf, stateName) { const style = leaf.states[stateName]; style ? setState(leaf, stateName, style) : unsetState(leaf, stateName, style); };
|
|
@@ -17342,6 +17383,7 @@ UI.addAttr('pressStyle', undefined, stateStyleType);
|
|
|
17342
17383
|
UI.addAttr('focusStyle', undefined, stateStyleType);
|
|
17343
17384
|
UI.addAttr('selectedStyle', undefined, stateStyleType);
|
|
17344
17385
|
UI.addAttr('disabledStyle', undefined, stateStyleType);
|
|
17386
|
+
UI.addAttr('placeholderStyle', undefined, stateStyleType);
|
|
17345
17387
|
UI.addAttr('button', false, dataType);
|
|
17346
17388
|
ui$1.focus = function (value = true) {
|
|
17347
17389
|
this.waitLeafer(() => {
|
|
@@ -17360,6 +17402,15 @@ ui$1.focus = function (value = true) {
|
|
|
17360
17402
|
ui$1.updateState = function () {
|
|
17361
17403
|
State.updateStyle(this, undefined, 'in');
|
|
17362
17404
|
};
|
|
17405
|
+
const text = Text.prototype, textKey = 'text';
|
|
17406
|
+
defineKey(text, textKey, Object.assign(Object.assign({}, getDescriptor(text, textKey)), { set(value) {
|
|
17407
|
+
const t = this, oldValue = t.text;
|
|
17408
|
+
if (t.__setAttr(textKey, value)) {
|
|
17409
|
+
doBoundsType(t);
|
|
17410
|
+
if (t.placeholderStyle && t.placeholder && (oldValue === '' || value === ''))
|
|
17411
|
+
t.__layout.stateStyleChanged = true;
|
|
17412
|
+
}
|
|
17413
|
+
} }));
|
|
17363
17414
|
|
|
17364
17415
|
class RobotData extends UIData {
|
|
17365
17416
|
get __drawAfterFill() { return true; }
|
|
@@ -17703,7 +17754,7 @@ const ExportModule = {
|
|
|
17703
17754
|
else {
|
|
17704
17755
|
let renderBounds, trimBounds, scaleX = 1, scaleY = 1;
|
|
17705
17756
|
const { worldTransform, isLeafer, leafer, isFrame } = leaf;
|
|
17706
|
-
const { slice, trim, padding, onCanvas } = options;
|
|
17757
|
+
const { slice, clip, trim, padding, onCanvas } = options;
|
|
17707
17758
|
const smooth = options.smooth === undefined ? (leafer ? leafer.config.smooth : true) : options.smooth;
|
|
17708
17759
|
const contextSettings = options.contextSettings || (leafer ? leafer.config.contextSettings : undefined);
|
|
17709
17760
|
const screenshot = options.screenshot || leaf.isApp;
|
|
@@ -17747,7 +17798,9 @@ const ExportModule = {
|
|
|
17747
17798
|
scaleData.scaleY *= pixelRatio;
|
|
17748
17799
|
pixelRatio = leaf.app.pixelRatio;
|
|
17749
17800
|
}
|
|
17750
|
-
|
|
17801
|
+
let { x, y, width, height } = new Bounds(renderBounds).scale(scaleData.scaleX, scaleData.scaleY);
|
|
17802
|
+
if (clip)
|
|
17803
|
+
x += clip.x, y += clip.y, width = clip.width, height = clip.height;
|
|
17751
17804
|
const renderOptions = { matrix: matrix.scale(1 / scaleData.scaleX, 1 / scaleData.scaleY).invert().translate(-x, -y).withScale(1 / scaleX * scaleData.scaleX, 1 / scaleY * scaleData.scaleY) };
|
|
17752
17805
|
let canvas = Creator.canvas({ width: Math.floor(width), height: Math.floor(height), pixelRatio, smooth, contextSettings });
|
|
17753
17806
|
let sliceLeaf;
|
|
@@ -17900,4 +17953,3 @@ Object.assign(Filter, {
|
|
|
17900
17953
|
});
|
|
17901
17954
|
|
|
17902
17955
|
export { AlignHelper, Animate, AnimateEasing, AnimateEvent, AnimateList, Answer, App, AroundHelper, Arrow, ArrowData, AutoBounds, BezierHelper, Bounds, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragEvent, Dragger, DropEvent, EditBox, EditDataHelper, EditPoint, EditSelect, EditSelectHelper, EditTool, EditToolCreator, Editor, EditorEvent, EditorGroupEvent, EditorHelper, EditorMoveEvent, EditorRotateEvent, EditorScaleEvent, EditorSkewEvent, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, Finder, Flow, Frame, FrameData, Group, GroupData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, InnerEditor, InnerEditorEvent, Interaction, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferImage, LeaferTypeCreator, Line, LineData, LineEditTool, MathHelper, Matrix, MatrixHelper, MoveEvent, MultiTouchHelper, MyDragEvent, MyImage, MyPointerEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathArrowModule, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathMatrixHelper, PathNumberCommandLengthMap, PathNumberCommandMap, PathScaler, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, Robot, RobotData, RotateEvent, Run, ScrollBar, SelectArea, Selector, Star, StarData, State, StringNumberMap, Stroker, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, Transformer, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, WheelEventHelper, ZoomEvent, addViewport, addViewportConfig, affectRenderBoundsType, affectStrokeBoundsType, arrowType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, doBoundsType, doStrokeType, effectType, emptyData, eraserType, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isEmptyData, isNull, layoutProcessor, maskType, motionPathType, naturalBoundsType, opacityType, pathInputType, pathType, pen, positionType, registerEditTool, registerInnerEditor, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleResize, scaleResizeFontSize, scaleResizeGroup, scaleResizePath, scaleResizePoints, scaleType, sortType, stateStyleType, stateType, strokeType, surfaceType, tempBounds$1 as tempBounds, tempMatrix, tempPoint$4 as tempPoint, useCanvas, useModule, version, visibleType, zoomLayerType };
|
|
17903
|
-
//# sourceMappingURL=miniapp.module.js.map
|