@leafer/miniapp 1.11.1 → 1.12.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 CHANGED
@@ -34,6 +34,15 @@ var resize = require("@leafer-in/resize");
34
34
 
35
35
  var bright = require("@leafer-in/bright");
36
36
 
37
+ exports.PathNodeHandleType = void 0;
38
+
39
+ (function(PathNodeHandleType) {
40
+ PathNodeHandleType[PathNodeHandleType["none"] = 1] = "none";
41
+ PathNodeHandleType[PathNodeHandleType["free"] = 2] = "free";
42
+ PathNodeHandleType[PathNodeHandleType["mirrorAngle"] = 3] = "mirrorAngle";
43
+ PathNodeHandleType[PathNodeHandleType["mirror"] = 4] = "mirror";
44
+ })(exports.PathNodeHandleType || (exports.PathNodeHandleType = {}));
45
+
37
46
  Object.keys(miniapp).forEach(function(k) {
38
47
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
39
48
  enumerable: true,
@@ -31,3 +31,14 @@ export * from "@leafer-in/color";
31
31
  export * from "@leafer-in/resize";
32
32
 
33
33
  export * from "@leafer-in/bright";
34
+
35
+ var PathNodeHandleType;
36
+
37
+ (function(PathNodeHandleType) {
38
+ PathNodeHandleType[PathNodeHandleType["none"] = 1] = "none";
39
+ PathNodeHandleType[PathNodeHandleType["free"] = 2] = "free";
40
+ PathNodeHandleType[PathNodeHandleType["mirrorAngle"] = 3] = "mirrorAngle";
41
+ PathNodeHandleType[PathNodeHandleType["mirror"] = 4] = "mirror";
42
+ })(PathNodeHandleType || (PathNodeHandleType = {}));
43
+
44
+ export { PathNodeHandleType };
@@ -1,2 +1,2 @@
1
- export*from"@leafer-ui/miniapp";export*from"@leafer-in/editor";export*from"@leafer-in/viewport";export*from"@leafer-in/view";export*from"@leafer-in/scroll";export*from"@leafer-in/arrow";export*from"@leafer-in/flow";export*from"@leafer-in/animate";export*from"@leafer-in/motion-path";export*from"@leafer-in/state";export*from"@leafer-in/robot";export*from"@leafer-in/find";export*from"@leafer-in/export";export*from"@leafer-in/filter";export*from"@leafer-in/color";export*from"@leafer-in/resize";export*from"@leafer-in/bright";
1
+ export*from"@leafer-ui/miniapp";export*from"@leafer-in/editor";export*from"@leafer-in/viewport";export*from"@leafer-in/view";export*from"@leafer-in/scroll";export*from"@leafer-in/arrow";export*from"@leafer-in/flow";export*from"@leafer-in/animate";export*from"@leafer-in/motion-path";export*from"@leafer-in/state";export*from"@leafer-in/robot";export*from"@leafer-in/find";export*from"@leafer-in/export";export*from"@leafer-in/filter";export*from"@leafer-in/color";export*from"@leafer-in/resize";export*from"@leafer-in/bright";var r;!function(r){r[r.none=1]="none",r[r.free=2]="free",r[r.mirrorAngle=3]="mirrorAngle",r[r.mirror=4]="mirror"}(r||(r={}));export{r as PathNodeHandleType};
2
2
  //# sourceMappingURL=miniapp.esm.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"miniapp.esm.min.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"miniapp.esm.min.js","sources":["../../../../../../../src/leafer/packages/interface/src/path/IPathCommand.ts"],"sourcesContent":["import { IPointData } from '../math/IMath'\n\ntype Command = number\ntype x = number\ntype y = number\ntype x1 = number\ntype y1 = number\ntype x2 = number\ntype y2 = number\ntype radiusX = number\ntype radiusY = number\ntype xAxisRotation = number\ntype largeArcFlag = number\ntype sweepFlag = number\n\n\nexport type MCommandData = [Command, x, y]\nexport type HCommandData = [Command, x]\nexport type VCommandData = [Command, y]\nexport type LCommandData = MCommandData\n\nexport type CCommandData = [Command, x1, y1, x2, y2, x, y]\nexport type SCommandData = [Command, x2, y2, x, y]\n\nexport type QCommandData = [Command, x1, y1, x, y]\nexport type TCommandData = [Command, x, y]\n\nexport type ZCommandData = [Command]\n\nexport type ACommandData = [Command, radiusX, radiusY, xAxisRotation, largeArcFlag, sweepFlag, x, y]\n\n\n// 非svg标准的canvas绘图命令\ntype width = number\ntype height = number\ntype rotation = number\ntype startAngle = number\ntype endAngle = number\ntype anticlockwise = boolean\ntype cornerRadius = number | number[]\ntype radius = number\n\nexport type RectCommandData = [Command, x, y, width, height]\nexport type RoundRectCommandData = [Command, x, y, width, height, cornerRadius]\nexport type EllipseCommandData = [Command, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise]\nexport type ArcCommandData = [Command, x, y, radius, startAngle, endAngle, anticlockwise]\nexport type ArcToCommandData = [Command, x1, y1, x2, y2, radius]\n\n\nexport type CanvasPathCommand = 1 | 2 | 5 | 7 | 11 // M | L | C | Q | Z canvas可以绘制的命令\n\nexport type IPathCommandData = number[] // ...(MCommandData | LCommandData | CCommandData | QCommandData | ZCommandData)\n\n\n// 路径命令对象\nexport interface MoveToCommandObject {\n name: 'M'\n x: number\n y: number\n}\nexport interface LineToCommandObject {\n name: 'L'\n x: number\n y: number\n}\n\nexport interface BezierCurveToCommandObject {\n name: 'C'\n x1: number\n y1: number\n x2: number\n y2: number\n x: number\n y: number\n}\n\nexport interface QuadraticCurveToCommandObject {\n name: 'Q'\n x1: number\n y1: number\n x: number\n y: number\n}\n\nexport interface ClosePathCommandObject {\n name: 'Z'\n}\n\nexport type IPathCommandObject = MoveToCommandObject | LineToCommandObject | BezierCurveToCommandObject | QuadraticCurveToCommandObject | ClosePathCommandObject // M | L | C | Q | Z canvas可以绘制的命令\n\n\n// 可视化路径节点\n\nexport interface IPathCommandNodeBase {\n name: 'M^' | 'L^' | 'C^' | 'Z^'\n x: number\n y: number\n a?: IPointData // 第一个手柄,连接上一个节点\n b?: IPointData // 第二个手柄,连接下一个节点\n ab?: PathNodeHandleType // 手柄类型\n}\n\nexport interface MoveToCommandNode extends IPathCommandNodeBase {\n name: 'M^'\n}\nexport interface LineToCommandNode extends IPathCommandNodeBase {\n name: 'L^'\n}\n\nexport interface BezierCurveToCommandNode extends IPathCommandNodeBase {\n name: 'C^'\n}\n\nexport interface ClosePathCommandNode {\n name: 'Z^'\n x?: number\n y?: number\n a?: IPointData\n b?: IPointData\n ab?: PathNodeHandleType\n}\n\nexport type IPathCommandNode = MoveToCommandNode | LineToCommandNode | BezierCurveToCommandNode | ClosePathCommandNode // M | L | C | Z 路径节点命令(适合可视化编辑)\n\nexport enum PathNodeHandleType { // 手柄类型\n none = 1, // 无手柄\n free = 2, // 每个手柄自由控制\n mirrorAngle = 3, // 仅镜像角度\n mirror = 4, // 镜像角度和长度\n}\n\nexport type PathNodeHandleName = 'a' | 'b' // 手柄名称\n\nexport interface IPathNodeBase {\n pathNode: IPathCommandNode\n}"],"names":["PathNodeHandleType"],"mappings":"khBA4HYA,GAAZ,SAAYA,GACRA,EAAAA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,YAAA,GAAA,cACAA,EAAAA,EAAA,OAAA,GAAA,QACH,CALD,CAAYA,IAAAA,EAAkB,CAAA"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("@leafer-ui/miniapp"),r=require("@leafer-in/editor"),t=require("@leafer-in/viewport"),o=require("@leafer-in/view"),n=require("@leafer-in/scroll"),c=require("@leafer-in/arrow"),a=require("@leafer-in/flow"),p=require("@leafer-in/animate"),f=require("@leafer-in/motion-path"),u=require("@leafer-in/state"),i=require("@leafer-in/robot"),l=require("@leafer-in/find"),s=require("@leafer-in/export"),b=require("@leafer-in/filter"),y=require("@leafer-in/color"),O=require("@leafer-in/resize"),j=require("@leafer-in/bright");Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(exports,r)||Object.defineProperty(exports,r,{enumerable:!0,get:function(){return e[r]}})}),Object.keys(r).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return r[e]}})}),Object.keys(t).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return t[e]}})}),Object.keys(o).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return o[e]}})}),Object.keys(n).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return n[e]}})}),Object.keys(c).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return c[e]}})}),Object.keys(a).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return a[e]}})}),Object.keys(p).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return p[e]}})}),Object.keys(f).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return f[e]}})}),Object.keys(u).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return u[e]}})}),Object.keys(i).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return i[e]}})}),Object.keys(l).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return l[e]}})}),Object.keys(s).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return s[e]}})}),Object.keys(b).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return b[e]}})}),Object.keys(y).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return y[e]}})}),Object.keys(O).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return O[e]}})}),Object.keys(j).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return j[e]}})});
1
+ "use strict";var e,r=require("@leafer-ui/miniapp"),t=require("@leafer-in/editor"),o=require("@leafer-in/viewport"),n=require("@leafer-in/view"),c=require("@leafer-in/scroll"),a=require("@leafer-in/arrow"),p=require("@leafer-in/flow"),f=require("@leafer-in/animate"),u=require("@leafer-in/motion-path"),i=require("@leafer-in/state"),l=require("@leafer-in/robot"),s=require("@leafer-in/find"),y=require("@leafer-in/export"),b=require("@leafer-in/filter"),O=require("@leafer-in/color"),j=require("@leafer-in/resize"),d=require("@leafer-in/bright");exports.PathNodeHandleType=void 0,(e=exports.PathNodeHandleType||(exports.PathNodeHandleType={}))[e.none=1]="none",e[e.free=2]="free",e[e.mirrorAngle=3]="mirrorAngle",e[e.mirror=4]="mirror",Object.keys(r).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return r[e]}})}),Object.keys(t).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return t[e]}})}),Object.keys(o).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return o[e]}})}),Object.keys(n).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return n[e]}})}),Object.keys(c).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return c[e]}})}),Object.keys(a).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return a[e]}})}),Object.keys(p).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return p[e]}})}),Object.keys(f).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return f[e]}})}),Object.keys(u).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return u[e]}})}),Object.keys(i).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return i[e]}})}),Object.keys(l).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return l[e]}})}),Object.keys(s).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return s[e]}})}),Object.keys(y).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return y[e]}})}),Object.keys(b).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return b[e]}})}),Object.keys(O).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return O[e]}})}),Object.keys(j).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return j[e]}})}),Object.keys(d).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return d[e]}})});
2
2
  //# sourceMappingURL=miniapp.min.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"miniapp.min.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"miniapp.min.cjs","sources":["../../../../../../../src/leafer/packages/interface/src/path/IPathCommand.ts"],"sourcesContent":["import { IPointData } from '../math/IMath'\n\ntype Command = number\ntype x = number\ntype y = number\ntype x1 = number\ntype y1 = number\ntype x2 = number\ntype y2 = number\ntype radiusX = number\ntype radiusY = number\ntype xAxisRotation = number\ntype largeArcFlag = number\ntype sweepFlag = number\n\n\nexport type MCommandData = [Command, x, y]\nexport type HCommandData = [Command, x]\nexport type VCommandData = [Command, y]\nexport type LCommandData = MCommandData\n\nexport type CCommandData = [Command, x1, y1, x2, y2, x, y]\nexport type SCommandData = [Command, x2, y2, x, y]\n\nexport type QCommandData = [Command, x1, y1, x, y]\nexport type TCommandData = [Command, x, y]\n\nexport type ZCommandData = [Command]\n\nexport type ACommandData = [Command, radiusX, radiusY, xAxisRotation, largeArcFlag, sweepFlag, x, y]\n\n\n// 非svg标准的canvas绘图命令\ntype width = number\ntype height = number\ntype rotation = number\ntype startAngle = number\ntype endAngle = number\ntype anticlockwise = boolean\ntype cornerRadius = number | number[]\ntype radius = number\n\nexport type RectCommandData = [Command, x, y, width, height]\nexport type RoundRectCommandData = [Command, x, y, width, height, cornerRadius]\nexport type EllipseCommandData = [Command, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise]\nexport type ArcCommandData = [Command, x, y, radius, startAngle, endAngle, anticlockwise]\nexport type ArcToCommandData = [Command, x1, y1, x2, y2, radius]\n\n\nexport type CanvasPathCommand = 1 | 2 | 5 | 7 | 11 // M | L | C | Q | Z canvas可以绘制的命令\n\nexport type IPathCommandData = number[] // ...(MCommandData | LCommandData | CCommandData | QCommandData | ZCommandData)\n\n\n// 路径命令对象\nexport interface MoveToCommandObject {\n name: 'M'\n x: number\n y: number\n}\nexport interface LineToCommandObject {\n name: 'L'\n x: number\n y: number\n}\n\nexport interface BezierCurveToCommandObject {\n name: 'C'\n x1: number\n y1: number\n x2: number\n y2: number\n x: number\n y: number\n}\n\nexport interface QuadraticCurveToCommandObject {\n name: 'Q'\n x1: number\n y1: number\n x: number\n y: number\n}\n\nexport interface ClosePathCommandObject {\n name: 'Z'\n}\n\nexport type IPathCommandObject = MoveToCommandObject | LineToCommandObject | BezierCurveToCommandObject | QuadraticCurveToCommandObject | ClosePathCommandObject // M | L | C | Q | Z canvas可以绘制的命令\n\n\n// 可视化路径节点\n\nexport interface IPathCommandNodeBase {\n name: 'M^' | 'L^' | 'C^' | 'Z^'\n x: number\n y: number\n a?: IPointData // 第一个手柄,连接上一个节点\n b?: IPointData // 第二个手柄,连接下一个节点\n ab?: PathNodeHandleType // 手柄类型\n}\n\nexport interface MoveToCommandNode extends IPathCommandNodeBase {\n name: 'M^'\n}\nexport interface LineToCommandNode extends IPathCommandNodeBase {\n name: 'L^'\n}\n\nexport interface BezierCurveToCommandNode extends IPathCommandNodeBase {\n name: 'C^'\n}\n\nexport interface ClosePathCommandNode {\n name: 'Z^'\n x?: number\n y?: number\n a?: IPointData\n b?: IPointData\n ab?: PathNodeHandleType\n}\n\nexport type IPathCommandNode = MoveToCommandNode | LineToCommandNode | BezierCurveToCommandNode | ClosePathCommandNode // M | L | C | Z 路径节点命令(适合可视化编辑)\n\nexport enum PathNodeHandleType { // 手柄类型\n none = 1, // 无手柄\n free = 2, // 每个手柄自由控制\n mirrorAngle = 3, // 仅镜像角度\n mirror = 4, // 镜像角度和长度\n}\n\nexport type PathNodeHandleName = 'a' | 'b' // 手柄名称\n\nexport interface IPathNodeBase {\n pathNode: IPathCommandNode\n}"],"names":["PathNodeHandleType"],"mappings":"iBA4HYA,ghBAAAA,QAAAA,wBAAAA,GAAAA,EAAAA,QAAAA,qBAAAA,2BAAkB,CAAA,IAC1BA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,YAAA,GAAA,cACAA,EAAAA,EAAA,OAAA,GAAA"}
@@ -1,3 +1,12 @@
1
+ var PathNodeHandleType;
2
+
3
+ (function(PathNodeHandleType) {
4
+ PathNodeHandleType[PathNodeHandleType["none"] = 1] = "none";
5
+ PathNodeHandleType[PathNodeHandleType["free"] = 2] = "free";
6
+ PathNodeHandleType[PathNodeHandleType["mirrorAngle"] = 3] = "mirrorAngle";
7
+ PathNodeHandleType[PathNodeHandleType["mirror"] = 4] = "mirror";
8
+ })(PathNodeHandleType || (PathNodeHandleType = {}));
9
+
1
10
  var Answer;
2
11
 
3
12
  (function(Answer) {
@@ -4047,16 +4056,27 @@ const ImageManager = {
4047
4056
  recycle(image) {
4048
4057
  image.use--;
4049
4058
  setTimeout(() => {
4050
- if (!image.use) I$1.recycledList.push(image);
4059
+ if (!image.use) {
4060
+ if (Platform.image.isLarge(image)) {
4061
+ if (image.url) Resource.remove(image.url);
4062
+ } else {
4063
+ image.clearLevels();
4064
+ I$1.recycledList.push(image);
4065
+ }
4066
+ }
4051
4067
  });
4052
4068
  },
4053
- clearRecycled() {
4069
+ recyclePaint(paint) {
4070
+ I$1.recycle(paint.image);
4071
+ },
4072
+ clearRecycled(force) {
4054
4073
  const list = I$1.recycledList;
4055
- if (list.length > I$1.maxRecycled) {
4056
- list.forEach(image => !image.use && image.url && Resource.remove(image.url));
4074
+ if (list.length > I$1.maxRecycled || force) {
4075
+ list.forEach(image => (!image.use || force) && image.url && Resource.remove(image.url));
4057
4076
  list.length = 0;
4058
4077
  }
4059
4078
  },
4079
+ clearLevels() {},
4060
4080
  hasAlphaPixel(config) {
4061
4081
  return FileHelper.alphaPixelTypes.some(item => I$1.isFormat(item, config));
4062
4082
  },
@@ -4071,7 +4091,7 @@ const ImageManager = {
4071
4091
  return false;
4072
4092
  },
4073
4093
  destroy() {
4074
- I$1.recycledList = [];
4094
+ this.clearRecycled(true);
4075
4095
  }
4076
4096
  };
4077
4097
 
@@ -4174,11 +4194,15 @@ class LeaferImage {
4174
4194
  Platform.image.setPatternTransform(pattern, transform, paint);
4175
4195
  return pattern;
4176
4196
  }
4197
+ clearLevels(_checkUse) {}
4177
4198
  destroy() {
4199
+ this.clearLevels();
4200
+ const {view: view} = this;
4201
+ if (view && view.close) view.close();
4178
4202
  this.config = {
4179
4203
  url: ""
4180
4204
  };
4181
- this.cache = null;
4205
+ this.cache = this.view = null;
4182
4206
  this.waitComplete.length = 0;
4183
4207
  }
4184
4208
  }
@@ -5957,6 +5981,7 @@ const LeafBounds = {
5957
5981
  const LeafRender = {
5958
5982
  __render(canvas, options) {
5959
5983
  if (options.shape) return this.__renderShape(canvas, options);
5984
+ if (options.cellList && !options.cellList.has(this)) return;
5960
5985
  if (this.__worldOpacity) {
5961
5986
  const data = this.__;
5962
5987
  if (data.bright && !options.topRendering) return options.topList.add(this);
@@ -6855,7 +6880,7 @@ class LeafLevelList {
6855
6880
  }
6856
6881
  }
6857
6882
 
6858
- const version = "1.11.1";
6883
+ const version = "1.12.0";
6859
6884
 
6860
6885
  class LeaferCanvas extends LeaferCanvasBase {
6861
6886
  get allowBackgroundColor() {
@@ -7125,7 +7150,7 @@ class Watcher {
7125
7150
  return this.hasAdd || this.hasRemove || this.hasVisible;
7126
7151
  }
7127
7152
  get updatedList() {
7128
- if (this.hasRemove) {
7153
+ if (this.hasRemove && this.config.usePartLayout) {
7129
7154
  const updatedList = new LeafList;
7130
7155
  this.__updatedList.list.forEach(item => {
7131
7156
  if (item.leafer) updatedList.add(item);
@@ -7160,16 +7185,18 @@ class Watcher {
7160
7185
  if (this.running) this.target.emit(RenderEvent.REQUEST);
7161
7186
  }
7162
7187
  __onAttrChange(event) {
7163
- this.__updatedList.add(event.target);
7188
+ if (this.config.usePartLayout) this.__updatedList.add(event.target);
7164
7189
  this.update();
7165
7190
  }
7166
7191
  __onChildEvent(event) {
7167
- if (event.type === ChildEvent.ADD) {
7168
- this.hasAdd = true;
7169
- this.__pushChild(event.child);
7170
- } else {
7171
- this.hasRemove = true;
7172
- this.__updatedList.add(event.parent);
7192
+ if (this.config.usePartLayout) {
7193
+ if (event.type === ChildEvent.ADD) {
7194
+ this.hasAdd = true;
7195
+ this.__pushChild(event.child);
7196
+ } else {
7197
+ this.hasRemove = true;
7198
+ this.__updatedList.add(event.parent);
7199
+ }
7173
7200
  }
7174
7201
  this.update();
7175
7202
  }
@@ -7286,7 +7313,9 @@ const debug$7 = Debug.get("Layouter");
7286
7313
  class Layouter {
7287
7314
  constructor(target, userConfig) {
7288
7315
  this.totalTimes = 0;
7289
- this.config = {};
7316
+ this.config = {
7317
+ usePartLayout: true
7318
+ };
7290
7319
  this.__levelList = new LeafLevelList;
7291
7320
  this.target = target;
7292
7321
  if (userConfig) this.config = DataHelper.default(userConfig, this.config);
@@ -7331,7 +7360,7 @@ class Layouter {
7331
7360
  this.totalTimes++;
7332
7361
  this.layouting = true;
7333
7362
  this.target.emit(WatchEvent.REQUEST);
7334
- if (this.totalTimes > 1) {
7363
+ if (this.totalTimes > 1 && this.config.usePartLayout) {
7335
7364
  this.partLayout();
7336
7365
  } else {
7337
7366
  this.fullLayout();
@@ -7448,7 +7477,7 @@ class Renderer {
7448
7477
  }
7449
7478
  update(change = true) {
7450
7479
  if (!this.changed) this.changed = change;
7451
- this.__requestRender();
7480
+ if (!this.requestTime) this.__requestRender();
7452
7481
  }
7453
7482
  requestLayout() {
7454
7483
  this.target.emit(LayoutEvent.REQUEST);
@@ -7555,7 +7584,7 @@ class Renderer {
7555
7584
  Run.end(t);
7556
7585
  }
7557
7586
  __render(bounds, realBounds) {
7558
- const {canvas: canvas} = this, includes = bounds.includes(this.target.__world), options = includes ? {
7587
+ const {canvas: canvas, target: target} = this, includes = bounds.includes(target.__world), options = includes ? {
7559
7588
  includes: includes
7560
7589
  } : {
7561
7590
  bounds: bounds,
@@ -7563,12 +7592,16 @@ class Renderer {
7563
7592
  };
7564
7593
  if (this.needFill) canvas.fillWorld(bounds, this.config.fill);
7565
7594
  if (Debug.showRepaint) Debug.drawRepaint(canvas, bounds);
7566
- Platform.render(this.target, canvas, options);
7595
+ if (this.config.useCellRender) options.cellList = this.getCellList();
7596
+ Platform.render(target, canvas, options);
7567
7597
  this.renderBounds = realBounds = realBounds || bounds;
7568
7598
  this.renderOptions = options;
7569
7599
  this.totalBounds.isEmpty() ? this.totalBounds = realBounds : this.totalBounds.add(realBounds);
7570
7600
  canvas.updateRender(realBounds);
7571
7601
  }
7602
+ getCellList() {
7603
+ return undefined;
7604
+ }
7572
7605
  addBlock(block) {
7573
7606
  if (!this.updateBlocks) this.updateBlocks = [];
7574
7607
  this.updateBlocks.push(block);
@@ -8225,6 +8258,11 @@ class TextData extends UIData {
8225
8258
  }
8226
8259
  this._boxStyle = value;
8227
8260
  }
8261
+ __getInputData(names, options) {
8262
+ const data = super.__getInputData(names, options);
8263
+ if (data.textEditing) delete data.textEditing;
8264
+ return data;
8265
+ }
8228
8266
  }
8229
8267
 
8230
8268
  class ImageData extends RectData {
@@ -11676,6 +11714,7 @@ function getLeafPaint(attrName, paint, ui) {
11676
11714
  const {boxBounds: boxBounds} = ui.__layout;
11677
11715
  switch (paint.type) {
11678
11716
  case "image":
11717
+ if (!paint.url) return undefined;
11679
11718
  leafPaint = PaintImage.image(ui, attrName, paint, boxBounds, !recycleMap || !recycleMap[paint.url]);
11680
11719
  break;
11681
11720
 
@@ -12016,7 +12055,7 @@ function layout$3(transform, box, x, y, scaleX, scaleY, rotation, skew) {
12016
12055
  translate(transform, box.x + x, box.y + y);
12017
12056
  }
12018
12057
 
12019
- const {get: get$1, scale: scale$2, copy: copy$4} = MatrixHelper;
12058
+ const {get: get$1, scale: scale$1, copy: copy$4} = MatrixHelper;
12020
12059
 
12021
12060
  const {getFloorScale: getFloorScale} = MathHelper, {abs: abs$6} = Math;
12022
12061
 
@@ -12048,7 +12087,7 @@ function createPattern(paint, ui, canvas, renderOptions) {
12048
12087
  scaleY *= getFloorScale(height + (yGap || 0));
12049
12088
  imageMatrix = get$1();
12050
12089
  if (transform) copy$4(imageMatrix, transform);
12051
- scale$2(imageMatrix, 1 / scaleX, 1 / scaleY);
12090
+ scale$1(imageMatrix, 1 / scaleX, 1 / scaleY);
12052
12091
  }
12053
12092
  const imageCanvas = image.getCanvas(width, height, data.opacity, data.filters, xGap, yGap, ui.leafer && ui.leafer.config.smooth);
12054
12093
  const pattern = image.getPattern(imageCanvas, data.repeat || (Platform.origin.noRepeat || "no-repeat"), imageMatrix, paint);
@@ -12080,7 +12119,7 @@ function checkImage(paint, drawImage, ui, canvas, renderOptions) {
12080
12119
  if (data.repeat) {
12081
12120
  drawImage = false;
12082
12121
  } else if (!(originPaint.changeful || Platform.name === "miniapp" && ResizeEvent.isResizing(ui) || exporting)) {
12083
- drawImage = Platform.image.isLarge(image, scaleX, scaleY);
12122
+ drawImage = Platform.image.isLarge(image, scaleX, scaleY) || image.width * scaleX > 8096 || image.height * scaleY > 8096;
12084
12123
  }
12085
12124
  }
12086
12125
  if (drawImage) {
@@ -12139,7 +12178,7 @@ function recycleImage(attrName, data) {
12139
12178
  if (url) {
12140
12179
  if (!recycleMap) recycleMap = {};
12141
12180
  recycleMap[url] = true;
12142
- ImageManager.recycle(image);
12181
+ ImageManager.recyclePaint(paint);
12143
12182
  if (image.loading) {
12144
12183
  if (!input) {
12145
12184
  input = data.__input && data.__input[attrName] || [];
@@ -13163,7 +13202,7 @@ function mergeConfigAttr() {
13163
13202
 
13164
13203
  const {abs: abs$4} = Math;
13165
13204
 
13166
- const {copy: copy$2, scale: scale$1} = MatrixHelper;
13205
+ const {copy: copy$2} = MatrixHelper;
13167
13206
 
13168
13207
  const {setListWithFn: setListWithFn} = BoundsHelper;
13169
13208
 
@@ -13207,19 +13246,10 @@ class Stroker extends UI {
13207
13246
  const aScaleX = abs$4(worldTransform.scaleX), aScaleY = abs$4(worldTransform.scaleY);
13208
13247
  copy$2(matrix$1, worldTransform);
13209
13248
  matrix$1.half = strokeWidth % 2;
13210
- if (aScaleX !== aScaleY) {
13211
- scale$1(matrix$1, 1 / aScaleX, 1 / aScaleY);
13212
- canvas.setWorld(matrix$1, options.matrix);
13213
- canvas.beginPath();
13214
- data.strokeWidth = strokeWidth;
13215
- const {x: x, y: y, width: width, height: height} = leaf.__layout.boxBounds;
13216
- canvas.rect(x * aScaleX, y * aScaleY, width * aScaleX, height * aScaleY);
13217
- } else {
13218
- canvas.setWorld(matrix$1, options.matrix);
13219
- canvas.beginPath();
13220
- if (leaf.__.__useArrow) leaf.__drawPath(canvas); else leaf.__.__pathForRender ? leaf.__drawRenderPath(canvas) : leaf.__drawPathByBox(canvas);
13221
- data.strokeWidth = strokeWidth / abs$4(worldTransform.scaleX);
13222
- }
13249
+ canvas.setWorld(matrix$1, options.matrix);
13250
+ canvas.beginPath();
13251
+ if (leaf.__.__useArrow) leaf.__drawPath(canvas); else leaf.__.__pathForRender ? leaf.__drawRenderPath(canvas) : leaf.__drawPathByBox(canvas);
13252
+ data.strokeWidth = strokeWidth / Math.max(aScaleX, aScaleY);
13223
13253
  if (stroke) isString(stroke) ? Paint.stroke(stroke, this, canvas, options) : Paint.strokes(stroke, this, canvas, options);
13224
13254
  if (fill) isString(fill) ? Paint.fill(fill, this, canvas, options) : Paint.fills(fill, this, canvas, options);
13225
13255
  }
@@ -19785,4 +19815,4 @@ Plugin.add("bright");
19785
19815
 
19786
19816
  UI.addAttr("bright", false, dimType);
19787
19817
 
19788
- export { AlignHelper, Animate, AnimateEasing, AnimateEvent, AnimateList, Answer, App, AroundHelper, Arrow, ArrowData, AutoBounds, BezierHelper, Bounds, BoundsEvent, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragBoundsHelper, 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, FourNumberHelper, 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, MyTouchEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathArrowModule, PathBounds, PathCommandDataHelper, PathCommandMap, PathCommandNodeHelper, 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, TouchEvent, TransformTool, 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, createAttr, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, dimType, doBoundsType, doStrokeType, effectType, emptyData, eraserType, extraPropertyEventMap, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isArray, isData, isEmptyData, isFinite$1 as isFinite, isNull, isNumber, isObject, isString, isUndefined, layoutProcessor, leaferTransformAttrMap, maskType, motionPathType, naturalBoundsType, opacityType, path, pathInputType, pathType, pen, positionType, registerEditTool, registerInnerEditor, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleResize, scaleResizeFontSize, scaleResizeGroup, scaleResizePath, scaleResizePoints, scaleType, scrollType, sortType, stateStyleType, stateType, strokeType, surfaceType, tempBounds$2 as tempBounds, tempMatrix$2 as tempMatrix, tempPoint$3 as tempPoint, tryToNumber, useCanvas, useModule, version, visibleType, zoomLayerType };
19818
+ export { AlignHelper, Animate, AnimateEasing, AnimateEvent, AnimateList, Answer, App, AroundHelper, Arrow, ArrowData, AutoBounds, BezierHelper, Bounds, BoundsEvent, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragBoundsHelper, 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, FourNumberHelper, 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, MyTouchEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathArrowModule, PathBounds, PathCommandDataHelper, PathCommandMap, PathCommandNodeHelper, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathMatrixHelper, PathNodeHandleType, 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, TouchEvent, TransformTool, 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, createAttr, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, dimType, doBoundsType, doStrokeType, effectType, emptyData, eraserType, extraPropertyEventMap, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isArray, isData, isEmptyData, isFinite$1 as isFinite, isNull, isNumber, isObject, isString, isUndefined, layoutProcessor, leaferTransformAttrMap, maskType, motionPathType, naturalBoundsType, opacityType, path, pathInputType, pathType, pen, positionType, registerEditTool, registerInnerEditor, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleResize, scaleResizeFontSize, scaleResizeGroup, scaleResizePath, scaleResizePoints, scaleType, scrollType, sortType, stateStyleType, stateType, strokeType, surfaceType, tempBounds$2 as tempBounds, tempMatrix$2 as tempMatrix, tempPoint$3 as tempPoint, tryToNumber, useCanvas, useModule, version, visibleType, zoomLayerType };