leafer-ui 2.2.5 → 2.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -5
- package/dist/web.esm.min.js.map +1 -1
- package/dist/web.js +27 -16
- package/dist/web.min.cjs.map +1 -1
- package/dist/web.min.js +1 -1
- package/dist/web.min.js.map +1 -1
- package/dist/web.module.js +30 -17
- package/dist/web.module.min.js +1 -1
- package/dist/web.module.min.js.map +1 -1
- package/package.json +11 -11
package/dist/web.js
CHANGED
|
@@ -1814,7 +1814,7 @@ var LeaferUI = function(exports) {
|
|
|
1814
1814
|
return name;
|
|
1815
1815
|
}
|
|
1816
1816
|
const D$5 = Debug;
|
|
1817
|
-
const debug$
|
|
1817
|
+
const debug$h = Debug.get("RunTime");
|
|
1818
1818
|
const Run = {
|
|
1819
1819
|
currentId: 0,
|
|
1820
1820
|
currentName: "",
|
|
@@ -1832,7 +1832,7 @@ var LeaferUI = function(exports) {
|
|
|
1832
1832
|
const time = R$1.idMap[id], name = R$1.nameMap[id];
|
|
1833
1833
|
const duration = microsecond ? (performance.now() - time) / 1e3 : Date.now() - time;
|
|
1834
1834
|
R$1.idMap[id] = R$1.nameMap[id] = R$1.nameToIdMap[name] = undefined;
|
|
1835
|
-
debug$
|
|
1835
|
+
debug$h.log(name, duration, "ms");
|
|
1836
1836
|
},
|
|
1837
1837
|
endOfName(name, microsecond) {
|
|
1838
1838
|
const id = R$1.nameToIdMap[name];
|
|
@@ -1862,17 +1862,17 @@ var LeaferUI = function(exports) {
|
|
|
1862
1862
|
return Plugin.need("editor");
|
|
1863
1863
|
}
|
|
1864
1864
|
};
|
|
1865
|
-
const debug$
|
|
1865
|
+
const debug$g = Debug.get("UICreator");
|
|
1866
1866
|
const UICreator = {
|
|
1867
1867
|
list: {},
|
|
1868
1868
|
register(UI) {
|
|
1869
1869
|
const {__tag: tag} = UI.prototype;
|
|
1870
|
-
if (list$1[tag]) debug$
|
|
1870
|
+
if (list$1[tag]) debug$g.repeat(tag);
|
|
1871
1871
|
list$1[tag] = UI;
|
|
1872
1872
|
},
|
|
1873
1873
|
get(tag, data, x, y, width, height) {
|
|
1874
1874
|
if (!list$1[tag]) {
|
|
1875
|
-
debug$
|
|
1875
|
+
debug$g.warn("not register " + tag);
|
|
1876
1876
|
return undefined;
|
|
1877
1877
|
}
|
|
1878
1878
|
const ui = new list$1[tag](data);
|
|
@@ -1886,14 +1886,14 @@ var LeaferUI = function(exports) {
|
|
|
1886
1886
|
}
|
|
1887
1887
|
};
|
|
1888
1888
|
const {list: list$1} = UICreator;
|
|
1889
|
-
const debug$
|
|
1889
|
+
const debug$f = Debug.get("EventCreator");
|
|
1890
1890
|
const EventCreator = {
|
|
1891
1891
|
nameList: {},
|
|
1892
1892
|
register(Event) {
|
|
1893
1893
|
let name;
|
|
1894
1894
|
Object.keys(Event).forEach(key => {
|
|
1895
1895
|
name = Event[key];
|
|
1896
|
-
if (isString(name)) nameList[name] && debug$
|
|
1896
|
+
if (isString(name)) nameList[name] && debug$f.repeat(name), nameList[name] = Event;
|
|
1897
1897
|
});
|
|
1898
1898
|
},
|
|
1899
1899
|
changeName(oldName, newName) {
|
|
@@ -2807,7 +2807,7 @@ var LeaferUI = function(exports) {
|
|
|
2807
2807
|
const {M: M$4, m: m, L: L$5, l: l, H: H, h: h, V: V, v: v, C: C$3, c: c, S: S, s: s, Q: Q$3, q: q, T: T, t: t, A: A, a: a, Z: Z$4, z: z, N: N$3, D: D$4, X: X$3, G: G$3, F: F$4, O: O$3, P: P$3, U: U$3} = PathCommandMap;
|
|
2808
2808
|
const {rect: rect$3, roundRect: roundRect$2, arcTo: arcTo$3, arc: arc$3, ellipse: ellipse$4, quadraticCurveTo: quadraticCurveTo$1} = BezierHelper;
|
|
2809
2809
|
const {ellipticalArc: ellipticalArc} = EllipseHelper;
|
|
2810
|
-
const debug$
|
|
2810
|
+
const debug$e = Debug.get("PathConvert");
|
|
2811
2811
|
const setEndPoint$1 = {};
|
|
2812
2812
|
const PathConvert = {
|
|
2813
2813
|
current: {
|
|
@@ -3072,7 +3072,7 @@ var LeaferUI = function(exports) {
|
|
|
3072
3072
|
break;
|
|
3073
3073
|
|
|
3074
3074
|
default:
|
|
3075
|
-
debug$
|
|
3075
|
+
debug$e.error(`command: ${command} [index:${i}]`, old);
|
|
3076
3076
|
return data;
|
|
3077
3077
|
}
|
|
3078
3078
|
lastCommand = command;
|
|
@@ -3129,7 +3129,9 @@ var LeaferUI = function(exports) {
|
|
|
3129
3129
|
const {getMinDistanceFrom: getMinDistanceFrom, getRadianFrom: getRadianFrom} = PointHelper;
|
|
3130
3130
|
const {tan: tan, min: min$1, abs: abs$4} = Math;
|
|
3131
3131
|
const startPoint = {};
|
|
3132
|
+
const debug$d = Debug.get("PointsCurve");
|
|
3132
3133
|
const PathCommandDataHelper = {
|
|
3134
|
+
pointsCurveList: {},
|
|
3133
3135
|
beginPath(data) {
|
|
3134
3136
|
data.length = 0;
|
|
3135
3137
|
},
|
|
@@ -3199,11 +3201,19 @@ var LeaferUI = function(exports) {
|
|
|
3199
3201
|
data.push(M$3, startPoint.x, startPoint.y);
|
|
3200
3202
|
arc$2(data, x, y, radius, startAngle, endAngle, anticlockwise);
|
|
3201
3203
|
},
|
|
3202
|
-
drawPoints(data, points, curve, close) {
|
|
3203
|
-
|
|
3204
|
+
drawPoints(data, points, curve, close, options) {
|
|
3205
|
+
let type = "Q";
|
|
3206
|
+
if (isObject(curve)) type = curve.type, curve = curve.value;
|
|
3207
|
+
if (!pointsCurveList[type]) debug$d.warn("not found:", type), type = "Q";
|
|
3208
|
+
pointsCurveList[type](data, points, curve, close, options);
|
|
3204
3209
|
}
|
|
3205
3210
|
};
|
|
3206
|
-
const {ellipse: ellipse$3, arc: arc$2} = PathCommandDataHelper;
|
|
3211
|
+
const {ellipse: ellipse$3, arc: arc$2, pointsCurveList: pointsCurveList} = PathCommandDataHelper;
|
|
3212
|
+
function registerPointsCurve(type, fn) {
|
|
3213
|
+
if (pointsCurveList[type]) debug$d.repeat(type);
|
|
3214
|
+
pointsCurveList[type] = fn;
|
|
3215
|
+
}
|
|
3216
|
+
registerPointsCurve("Q", BezierHelper.points);
|
|
3207
3217
|
const {moveTo: moveTo$4, lineTo: lineTo$3, quadraticCurveTo: quadraticCurveTo, bezierCurveTo: bezierCurveTo, closePath: closePath$3, beginPath: beginPath, rect: rect$2, roundRect: roundRect$1, ellipse: ellipse$2, arc: arc$1, arcTo: arcTo$2, drawEllipse: drawEllipse, drawArc: drawArc, drawPoints: drawPoints$2} = PathCommandDataHelper;
|
|
3208
3218
|
class PathCreator {
|
|
3209
3219
|
set path(value) {
|
|
@@ -6606,7 +6616,7 @@ var LeaferUI = function(exports) {
|
|
|
6606
6616
|
this.levelMap = null;
|
|
6607
6617
|
}
|
|
6608
6618
|
}
|
|
6609
|
-
const version = "2.2.
|
|
6619
|
+
const version = "2.2.6";
|
|
6610
6620
|
const debug$5 = Debug.get("LeaferCanvas");
|
|
6611
6621
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6612
6622
|
set zIndex(zIndex) {
|
|
@@ -8073,7 +8083,7 @@ var LeaferUI = function(exports) {
|
|
|
8073
8083
|
}
|
|
8074
8084
|
if (data.__useEffect) {
|
|
8075
8085
|
const {shadow: shadow, fill: fill, stroke: stroke} = data, otherEffect = data.innerShadow || data.blur || data.backgroundBlur || data.filter;
|
|
8076
|
-
stintSet$2(data, "__isFastShadow", shadow && !otherEffect && shadow.length < 2 && !shadow[0].spread && !Effect.isTransformShadow(shadow[0]) && fill && !data.__isTransparentFill && !(isArray(fill) && fill.length > 1) && (this.useFastShadow || !stroke || stroke && data.strokeAlign === "inside"));
|
|
8086
|
+
stintSet$2(data, "__isFastShadow", shadow && !otherEffect && shadow.length < 2 && !shadow[0].spread && !Effect.isTransformShadow(shadow[0]) && !(shadow[0].blendMode && shadow[0].blendMode !== "pass-through") && fill && !data.__isTransparentFill && !(isArray(fill) && fill.length > 1) && (this.useFastShadow || !stroke || stroke && data.strokeAlign === "inside"));
|
|
8077
8087
|
data.__useEffect = !!(shadow || otherEffect);
|
|
8078
8088
|
}
|
|
8079
8089
|
data.__checkSingle();
|
|
@@ -9005,7 +9015,7 @@ var LeaferUI = function(exports) {
|
|
|
9005
9015
|
const data = this.__;
|
|
9006
9016
|
const path = data.path = [];
|
|
9007
9017
|
if (data.points) {
|
|
9008
|
-
drawPoints$1(path, data.points, data.curve, data.closed);
|
|
9018
|
+
drawPoints$1(path, data.points, data.curve, data.closed, data);
|
|
9009
9019
|
} else {
|
|
9010
9020
|
const {width: width, height: height, sides: sides, startAngle: startAngle} = data;
|
|
9011
9021
|
const rx = width / 2, ry = height / 2;
|
|
@@ -9080,7 +9090,7 @@ var LeaferUI = function(exports) {
|
|
|
9080
9090
|
const data = this.__;
|
|
9081
9091
|
const path = data.path = [];
|
|
9082
9092
|
if (data.points) {
|
|
9083
|
-
drawPoints(path, data.points, data.curve, data.closed);
|
|
9093
|
+
drawPoints(path, data.points, data.curve, data.closed, data);
|
|
9084
9094
|
} else {
|
|
9085
9095
|
moveTo(path, 0, 0);
|
|
9086
9096
|
lineTo(path, this.width, 0);
|
|
@@ -12798,6 +12808,7 @@ var LeaferUI = function(exports) {
|
|
|
12798
12808
|
exports.pathType = pathType;
|
|
12799
12809
|
exports.pen = pen;
|
|
12800
12810
|
exports.positionType = positionType;
|
|
12811
|
+
exports.registerPointsCurve = registerPointsCurve;
|
|
12801
12812
|
exports.registerUI = registerUI;
|
|
12802
12813
|
exports.registerUIEvent = registerUIEvent;
|
|
12803
12814
|
exports.resizeType = resizeType;
|