@leafer-ui/miniapp 1.4.2 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/miniapp.cjs +6 -29
- package/dist/miniapp.cjs.map +1 -1
- package/dist/miniapp.esm.js +6 -29
- package/dist/miniapp.esm.js.map +1 -1
- package/dist/miniapp.esm.min.js +1 -1
- package/dist/miniapp.esm.min.js.map +1 -1
- package/dist/miniapp.min.cjs +1 -1
- package/dist/miniapp.min.cjs.map +1 -1
- package/dist/miniapp.module.js +25 -43
- package/dist/miniapp.module.js.map +1 -1
- package/dist/miniapp.module.min.js +1 -1
- package/dist/miniapp.module.min.js.map +1 -1
- package/package.json +11 -11
package/dist/miniapp.module.js
CHANGED
|
@@ -4070,12 +4070,11 @@ function defineDataProcessor(target, key, defaultValue) {
|
|
|
4070
4070
|
if (defaultValue === undefined) {
|
|
4071
4071
|
property.get = function () { return this[computedKey]; };
|
|
4072
4072
|
}
|
|
4073
|
-
else if (typeof defaultValue === '
|
|
4074
|
-
const { clone } = DataHelper;
|
|
4073
|
+
else if (typeof defaultValue === 'function') {
|
|
4075
4074
|
property.get = function () {
|
|
4076
4075
|
let v = this[computedKey];
|
|
4077
4076
|
if (v === undefined)
|
|
4078
|
-
this[computedKey] = v =
|
|
4077
|
+
this[computedKey] = v = defaultValue(this.__leaf);
|
|
4079
4078
|
return v;
|
|
4080
4079
|
};
|
|
4081
4080
|
}
|
|
@@ -5722,10 +5721,10 @@ let Leaf = class Leaf {
|
|
|
5722
5721
|
static changeAttr(attrName, defaultValue, fn) {
|
|
5723
5722
|
fn ? this.addAttr(attrName, defaultValue, fn) : defineDataProcessor(this.prototype, attrName, defaultValue);
|
|
5724
5723
|
}
|
|
5725
|
-
static addAttr(attrName, defaultValue, fn) {
|
|
5724
|
+
static addAttr(attrName, defaultValue, fn, helpValue) {
|
|
5726
5725
|
if (!fn)
|
|
5727
5726
|
fn = boundsType;
|
|
5728
|
-
fn(defaultValue)(this.prototype, attrName);
|
|
5727
|
+
fn(defaultValue, helpValue)(this.prototype, attrName);
|
|
5729
5728
|
}
|
|
5730
5729
|
__emitLifeEvent(type) {
|
|
5731
5730
|
if (this.hasEvent(type))
|
|
@@ -6052,7 +6051,7 @@ class LeafLevelList {
|
|
|
6052
6051
|
}
|
|
6053
6052
|
}
|
|
6054
6053
|
|
|
6055
|
-
const version = "1.
|
|
6054
|
+
const version = "1.5.0";
|
|
6056
6055
|
|
|
6057
6056
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6058
6057
|
get allowBackgroundColor() { return false; }
|
|
@@ -7078,7 +7077,11 @@ const State = {
|
|
|
7078
7077
|
setStyleName() { return Plugin.need('state'); },
|
|
7079
7078
|
set() { return Plugin.need('state'); }
|
|
7080
7079
|
};
|
|
7081
|
-
const Transition = {
|
|
7080
|
+
const Transition = {
|
|
7081
|
+
list: {},
|
|
7082
|
+
register(attrName, fn) { Transition.list[attrName] = fn; },
|
|
7083
|
+
get(attrName) { return Transition.list[attrName]; }
|
|
7084
|
+
};
|
|
7082
7085
|
|
|
7083
7086
|
const { parse, objectToCanvasData } = PathConvert;
|
|
7084
7087
|
const emptyPaint = {};
|
|
@@ -7502,9 +7505,6 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
7502
7505
|
this.__drawPathByBox(pen);
|
|
7503
7506
|
return pen;
|
|
7504
7507
|
}
|
|
7505
|
-
get editConfig() { return undefined; }
|
|
7506
|
-
get editOuter() { return ''; }
|
|
7507
|
-
get editInner() { return ''; }
|
|
7508
7508
|
constructor(data) {
|
|
7509
7509
|
super(data);
|
|
7510
7510
|
}
|
|
@@ -7586,8 +7586,11 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
7586
7586
|
export(_filename, _options) {
|
|
7587
7587
|
return Plugin.need('export');
|
|
7588
7588
|
}
|
|
7589
|
+
syncExport(_filename, _options) {
|
|
7590
|
+
return Plugin.need('export');
|
|
7591
|
+
}
|
|
7589
7592
|
clone(data) {
|
|
7590
|
-
const json = this.toJSON();
|
|
7593
|
+
const json = DataHelper.clone(this.toJSON());
|
|
7591
7594
|
if (data)
|
|
7592
7595
|
Object.assign(json, data);
|
|
7593
7596
|
return UI_1.one(json);
|
|
@@ -7886,7 +7889,7 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
7886
7889
|
get layoutLocked() { return !this.layouter.running; }
|
|
7887
7890
|
get FPS() { return this.renderer ? this.renderer.FPS : 60; }
|
|
7888
7891
|
get cursorPoint() { return (this.interaction && this.interaction.hoverData) || { x: this.width / 2, y: this.height / 2 }; }
|
|
7889
|
-
get clientBounds() { return this.canvas && this.canvas.getClientBounds(); }
|
|
7892
|
+
get clientBounds() { return (this.canvas && this.canvas.getClientBounds(true)) || getBoundsData(); }
|
|
7890
7893
|
constructor(userConfig, data) {
|
|
7891
7894
|
super(data);
|
|
7892
7895
|
this.config = {
|
|
@@ -8188,6 +8191,10 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
8188
8191
|
getPagePointByClient(clientPoint, updateClient) {
|
|
8189
8192
|
return this.getPagePoint(this.getWorldPointByClient(clientPoint, updateClient));
|
|
8190
8193
|
}
|
|
8194
|
+
getClientPointByWorld(worldPoint) {
|
|
8195
|
+
const { x, y } = this.clientBounds;
|
|
8196
|
+
return { x: x + worldPoint.x, y: y + worldPoint.y };
|
|
8197
|
+
}
|
|
8191
8198
|
updateClientBounds() {
|
|
8192
8199
|
this.canvas && this.canvas.updateClientBounds();
|
|
8193
8200
|
}
|
|
@@ -10156,8 +10163,6 @@ ui$1.__updateHitCanvas = function () {
|
|
|
10156
10163
|
h.setStrokeOptions(data);
|
|
10157
10164
|
};
|
|
10158
10165
|
ui$1.__hit = function (inner) {
|
|
10159
|
-
if (Platform.name === 'miniapp')
|
|
10160
|
-
this.__drawHitPath(this.__hitCanvas);
|
|
10161
10166
|
const data = this.__;
|
|
10162
10167
|
if (data.__isHitPixel && this.__hitPixel(inner))
|
|
10163
10168
|
return true;
|
|
@@ -11617,13 +11622,14 @@ function toChar(data, charX, rowData, isOverflow) {
|
|
|
11617
11622
|
}
|
|
11618
11623
|
|
|
11619
11624
|
function layoutText(drawData, style) {
|
|
11620
|
-
const { rows, bounds } = drawData;
|
|
11625
|
+
const { rows, bounds } = drawData, countRows = rows.length;
|
|
11621
11626
|
const { __lineHeight, __baseLine, __letterSpacing, __clipText, textAlign, verticalAlign, paraSpacing, autoSizeAlign } = style;
|
|
11622
|
-
let { x, y, width, height } = bounds, realHeight = __lineHeight *
|
|
11627
|
+
let { x, y, width, height } = bounds, realHeight = __lineHeight * countRows + (paraSpacing ? paraSpacing * (drawData.paraNumber - 1) : 0);
|
|
11623
11628
|
let starY = __baseLine;
|
|
11624
11629
|
if (__clipText && realHeight > height) {
|
|
11625
11630
|
realHeight = Math.max(height, __lineHeight);
|
|
11626
|
-
|
|
11631
|
+
if (countRows > 1)
|
|
11632
|
+
drawData.overflow = countRows;
|
|
11627
11633
|
}
|
|
11628
11634
|
else if (height || autoSizeAlign) {
|
|
11629
11635
|
switch (verticalAlign) {
|
|
@@ -11635,7 +11641,7 @@ function layoutText(drawData, style) {
|
|
|
11635
11641
|
}
|
|
11636
11642
|
starY += y;
|
|
11637
11643
|
let row, rowX, rowWidth, layoutWidth = (width || autoSizeAlign) ? width : drawData.maxWidth;
|
|
11638
|
-
for (let i = 0, len =
|
|
11644
|
+
for (let i = 0, len = countRows; i < len; i++) {
|
|
11639
11645
|
row = rows[i];
|
|
11640
11646
|
row.x = x;
|
|
11641
11647
|
if (row.width < width || (row.width > width && !__clipText)) {
|
|
@@ -11704,7 +11710,7 @@ function clipText(drawData, style, x, width) {
|
|
|
11704
11710
|
if (i === end && charRight < right) {
|
|
11705
11711
|
break;
|
|
11706
11712
|
}
|
|
11707
|
-
else if (charRight < right && char.char !== ' ') {
|
|
11713
|
+
else if ((charRight < right && char.char !== ' ') || !i) {
|
|
11708
11714
|
row.data.splice(i + 1);
|
|
11709
11715
|
row.width -= char.width;
|
|
11710
11716
|
break;
|
|
@@ -11843,29 +11849,5 @@ try {
|
|
|
11843
11849
|
}
|
|
11844
11850
|
catch (_a) { }
|
|
11845
11851
|
|
|
11846
|
-
const systemInfo = wx.getSystemInfoSync();
|
|
11847
|
-
const platform = systemInfo.platform;
|
|
11848
|
-
if (platform === 'ios') {
|
|
11849
|
-
LeaferImage.prototype.getPattern = function (canvas, repeat, transform, paint) {
|
|
11850
|
-
const pattern = Platform.canvas.createPattern(this.view, repeat);
|
|
11851
|
-
const { width, height } = canvas;
|
|
11852
|
-
if (this.width !== width || this.height !== height) {
|
|
11853
|
-
if (!transform)
|
|
11854
|
-
transform = MatrixHelper.get();
|
|
11855
|
-
MatrixHelper.scale(transform, width / this.width, height / this.height);
|
|
11856
|
-
}
|
|
11857
|
-
try {
|
|
11858
|
-
if (transform && pattern.setTransform) {
|
|
11859
|
-
pattern.setTransform(transform);
|
|
11860
|
-
transform = null;
|
|
11861
|
-
}
|
|
11862
|
-
}
|
|
11863
|
-
catch (_a) { }
|
|
11864
|
-
if (paint)
|
|
11865
|
-
paint.transform = transform;
|
|
11866
|
-
return pattern;
|
|
11867
|
-
};
|
|
11868
|
-
}
|
|
11869
|
-
|
|
11870
11852
|
export { AlignHelper, 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, Filter, Frame, FrameData, Group, GroupData, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, 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, 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, Resource, 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, naturalBoundsType, opacityType, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, sortType, strokeType, surfaceType, tempBounds$1 as tempBounds, tempMatrix, tempPoint$3 as tempPoint, useCanvas, useModule, version, visibleType, zoomLayerType };
|
|
11871
11853
|
//# sourceMappingURL=miniapp.module.js.map
|