@leafer/miniapp 2.0.3 → 2.0.5
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 +11 -0
- package/dist/miniapp.esm.js +2 -0
- 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 +204 -41
- package/dist/miniapp.module.min.js +1 -1
- package/dist/miniapp.module.min.js.map +1 -1
- package/package.json +24 -23
- package/src/index.ts +2 -0
- package/types/index.d.ts +2 -0
package/dist/miniapp.cjs
CHANGED
|
@@ -38,6 +38,8 @@ var scroller = require("@leafer-in/scroller");
|
|
|
38
38
|
|
|
39
39
|
var scaleFixed = require("@leafer-in/scale-fixed");
|
|
40
40
|
|
|
41
|
+
var box = require("@leafer-in/box");
|
|
42
|
+
|
|
41
43
|
exports.PathNodeHandleType = void 0;
|
|
42
44
|
|
|
43
45
|
(function(PathNodeHandleType) {
|
|
@@ -217,3 +219,12 @@ Object.keys(scaleFixed).forEach(function(k) {
|
|
|
217
219
|
}
|
|
218
220
|
});
|
|
219
221
|
});
|
|
222
|
+
|
|
223
|
+
Object.keys(box).forEach(function(k) {
|
|
224
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
225
|
+
enumerable: true,
|
|
226
|
+
get: function() {
|
|
227
|
+
return box[k];
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
});
|
package/dist/miniapp.esm.js
CHANGED
package/dist/miniapp.esm.min.js
CHANGED
|
@@ -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";export*from"@leafer-in/scroller";export*from"@leafer-in/scale-fixed";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};
|
|
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";export*from"@leafer-in/scroller";export*from"@leafer-in/scale-fixed";export*from"@leafer-in/box";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":["../../../../../../../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":"
|
|
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":"mnBA4HYA,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"}
|
package/dist/miniapp.min.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
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"),
|
|
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"),b=require("@leafer-in/export"),y=require("@leafer-in/filter"),O=require("@leafer-in/color"),j=require("@leafer-in/resize"),d=require("@leafer-in/bright"),x=require("@leafer-in/scroller"),h=require("@leafer-in/scale-fixed"),P=require("@leafer-in/box");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(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]}})}),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]}})}),Object.keys(x).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return x[e]}})}),Object.keys(h).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return h[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]}})});
|
|
2
2
|
//# sourceMappingURL=miniapp.min.cjs.map
|
package/dist/miniapp.min.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,inBAAAA,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"}
|
package/dist/miniapp.module.js
CHANGED
|
@@ -2794,10 +2794,10 @@ const BezierHelper = {
|
|
|
2794
2794
|
const centerY = y1 + c * sin$4(startRadian + totalRadian / 2 + PI_2 * sign);
|
|
2795
2795
|
startRadian -= PI_2 * sign;
|
|
2796
2796
|
endRadian -= PI_2 * sign;
|
|
2797
|
-
return ellipse$
|
|
2797
|
+
return ellipse$8(data, centerX, centerY, radius, radius, 0, startRadian / OneRadian, endRadian / OneRadian, anticlockwise, setPointBounds, setEndPoint, setStartPoint);
|
|
2798
2798
|
},
|
|
2799
2799
|
arc(data, x, y, radius, startAngle, endAngle, anticlockwise, setPointBounds, setEndPoint, setStartPoint) {
|
|
2800
|
-
return ellipse$
|
|
2800
|
+
return ellipse$8(data, x, y, radius, radius, 0, startAngle, endAngle, anticlockwise, setPointBounds, setEndPoint, setStartPoint);
|
|
2801
2801
|
},
|
|
2802
2802
|
ellipse(data, cx, cy, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise, setPointBounds, setEndPoint, setStartPoint) {
|
|
2803
2803
|
const rotationRadian = rotation * OneRadian;
|
|
@@ -2899,11 +2899,11 @@ const BezierHelper = {
|
|
|
2899
2899
|
}
|
|
2900
2900
|
};
|
|
2901
2901
|
|
|
2902
|
-
const {getPointAndSet: getPointAndSet, toTwoPointBounds: toTwoPointBounds$1, ellipse: ellipse$
|
|
2902
|
+
const {getPointAndSet: getPointAndSet, toTwoPointBounds: toTwoPointBounds$1, ellipse: ellipse$8} = BezierHelper;
|
|
2903
2903
|
|
|
2904
2904
|
const {sin: sin$3, cos: cos$3, sqrt: sqrt$2, atan2: atan2} = Math;
|
|
2905
2905
|
|
|
2906
|
-
const {ellipse: ellipse$
|
|
2906
|
+
const {ellipse: ellipse$7} = BezierHelper;
|
|
2907
2907
|
|
|
2908
2908
|
const EllipseHelper = {
|
|
2909
2909
|
ellipticalArc(data, fromX, fromY, radiusX, radiusY, rotation, largeFlag, sweepFlag, toX, toY, curveMode) {
|
|
@@ -2941,7 +2941,7 @@ const EllipseHelper = {
|
|
|
2941
2941
|
const centerY = fromY + halfY + rotationSin * cx + rotationCos * cy;
|
|
2942
2942
|
const anticlockwise = totalRadian < 0 ? 1 : 0;
|
|
2943
2943
|
if (curveMode || Platform.ellipseToCurve) {
|
|
2944
|
-
ellipse$
|
|
2944
|
+
ellipse$7(data, centerX, centerY, radiusX, radiusY, rotation, startRadian / OneRadian, endRadian / OneRadian, anticlockwise);
|
|
2945
2945
|
} else {
|
|
2946
2946
|
if (radiusX === radiusY && !rotation) {
|
|
2947
2947
|
data.push(PathCommandMap.O, centerX, centerY, radiusX, startRadian / OneRadian, endRadian / OneRadian, anticlockwise);
|
|
@@ -2963,7 +2963,7 @@ const PathCommandNodeHelper = {
|
|
|
2963
2963
|
|
|
2964
2964
|
const {M: M$9, m: m, L: L$9, l: l, H: H, h: h, V: V, v: v, C: C$7, c: c, S: S$1, s: s, Q: Q$6, q: q, T: T, t: t, A: A, a: a, Z: Z$7, z: z, N: N$5, D: D$6, X: X$5, G: G$5, F: F$6, O: O$6, P: P$5, U: U$5} = PathCommandMap;
|
|
2965
2965
|
|
|
2966
|
-
const {rect: rect$3, roundRect: roundRect$2, arcTo: arcTo$3, arc: arc$3, ellipse: ellipse$
|
|
2966
|
+
const {rect: rect$3, roundRect: roundRect$2, arcTo: arcTo$3, arc: arc$3, ellipse: ellipse$6, quadraticCurveTo: quadraticCurveTo$1} = BezierHelper;
|
|
2967
2967
|
|
|
2968
2968
|
const {ellipticalArc: ellipticalArc} = EllipseHelper;
|
|
2969
2969
|
|
|
@@ -3196,14 +3196,14 @@ const PathConvert = {
|
|
|
3196
3196
|
break;
|
|
3197
3197
|
|
|
3198
3198
|
case G$5:
|
|
3199
|
-
ellipse$
|
|
3199
|
+
ellipse$6(curveMode ? data : copyData(data, old, i, 9), old[i + 1], old[i + 2], old[i + 3], old[i + 4], old[i + 5], old[i + 6], old[i + 7], old[i + 8], null, setEndPoint$1);
|
|
3200
3200
|
x = setEndPoint$1.x;
|
|
3201
3201
|
y = setEndPoint$1.y;
|
|
3202
3202
|
i += 9;
|
|
3203
3203
|
break;
|
|
3204
3204
|
|
|
3205
3205
|
case F$6:
|
|
3206
|
-
curveMode ? ellipse$
|
|
3206
|
+
curveMode ? ellipse$6(data, old[i + 1], old[i + 2], old[i + 3], old[i + 4], 0, 0, 360, false) : copyData(data, old, i, 5);
|
|
3207
3207
|
x = old[i + 1] + old[i + 3];
|
|
3208
3208
|
y = old[i + 2];
|
|
3209
3209
|
i += 5;
|
|
@@ -3357,7 +3357,7 @@ const PathCommandDataHelper = {
|
|
|
3357
3357
|
drawEllipse(data, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {
|
|
3358
3358
|
BezierHelper.ellipse(null, x, y, radiusX, radiusY, isNull(rotation) ? 0 : rotation, isNull(startAngle) ? 0 : startAngle, isNull(endAngle) ? 360 : endAngle, anticlockwise, null, null, startPoint);
|
|
3359
3359
|
data.push(M$8, startPoint.x, startPoint.y);
|
|
3360
|
-
ellipse$
|
|
3360
|
+
ellipse$5(data, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
|
|
3361
3361
|
},
|
|
3362
3362
|
drawArc(data, x, y, radius, startAngle, endAngle, anticlockwise) {
|
|
3363
3363
|
BezierHelper.arc(null, x, y, radius, isNull(startAngle) ? 0 : startAngle, isNull(endAngle) ? 360 : endAngle, anticlockwise, null, null, startPoint);
|
|
@@ -3369,9 +3369,9 @@ const PathCommandDataHelper = {
|
|
|
3369
3369
|
}
|
|
3370
3370
|
};
|
|
3371
3371
|
|
|
3372
|
-
const {ellipse: ellipse$
|
|
3372
|
+
const {ellipse: ellipse$5, arc: arc$2} = PathCommandDataHelper;
|
|
3373
3373
|
|
|
3374
|
-
const {moveTo: moveTo$4, lineTo: lineTo$3, quadraticCurveTo: quadraticCurveTo, bezierCurveTo: bezierCurveTo, closePath: closePath$3, beginPath: beginPath, rect: rect$2, roundRect: roundRect$1, ellipse: ellipse$
|
|
3374
|
+
const {moveTo: moveTo$4, lineTo: lineTo$3, quadraticCurveTo: quadraticCurveTo, bezierCurveTo: bezierCurveTo, closePath: closePath$3, beginPath: beginPath, rect: rect$2, roundRect: roundRect$1, ellipse: ellipse$4, arc: arc$1, arcTo: arcTo$2, drawEllipse: drawEllipse, drawArc: drawArc, drawPoints: drawPoints$2} = PathCommandDataHelper;
|
|
3375
3375
|
|
|
3376
3376
|
class PathCreator {
|
|
3377
3377
|
set path(value) {
|
|
@@ -3428,7 +3428,7 @@ class PathCreator {
|
|
|
3428
3428
|
return this;
|
|
3429
3429
|
}
|
|
3430
3430
|
ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {
|
|
3431
|
-
ellipse$
|
|
3431
|
+
ellipse$4(this.__path, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
|
|
3432
3432
|
this.paint();
|
|
3433
3433
|
return this;
|
|
3434
3434
|
}
|
|
@@ -3550,7 +3550,7 @@ const PathDrawer = {
|
|
|
3550
3550
|
|
|
3551
3551
|
const {M: M$6, L: L$6, C: C$4, Q: Q$3, Z: Z$4, N: N$2, D: D$3, X: X$2, G: G$2, F: F$3, O: O$3, P: P$2, U: U$2} = PathCommandMap;
|
|
3552
3552
|
|
|
3553
|
-
const {toTwoPointBounds: toTwoPointBounds, toTwoPointBoundsByQuadraticCurve: toTwoPointBoundsByQuadraticCurve, arcTo: arcTo$1, arc: arc, ellipse: ellipse$
|
|
3553
|
+
const {toTwoPointBounds: toTwoPointBounds, toTwoPointBoundsByQuadraticCurve: toTwoPointBoundsByQuadraticCurve, arcTo: arcTo$1, arc: arc, ellipse: ellipse$3} = BezierHelper;
|
|
3554
3554
|
|
|
3555
3555
|
const {addPointBounds: addPointBounds, copy: copy$9, addPoint: addPoint$1, setPoint: setPoint$3, addBounds: addBounds, toBounds: toBounds$2} = TwoPointBoundsHelper;
|
|
3556
3556
|
|
|
@@ -3633,7 +3633,7 @@ const PathBounds = {
|
|
|
3633
3633
|
break;
|
|
3634
3634
|
|
|
3635
3635
|
case G$2:
|
|
3636
|
-
ellipse$
|
|
3636
|
+
ellipse$3(null, data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], data[i + 6], data[i + 7], data[i + 8], tempPointBounds, setEndPoint);
|
|
3637
3637
|
i === 0 ? copy$9(setPointBounds, tempPointBounds) : addPointBounds(setPointBounds, tempPointBounds);
|
|
3638
3638
|
x = setEndPoint.x;
|
|
3639
3639
|
y = setEndPoint.y;
|
|
@@ -5620,7 +5620,7 @@ class BoundsEvent extends Event {
|
|
|
5620
5620
|
}
|
|
5621
5621
|
}
|
|
5622
5622
|
static emitWorld(leaf) {
|
|
5623
|
-
if (leaf.leaferIsReady) leaf.emit(WORLD,
|
|
5623
|
+
if (leaf.leaferIsReady) leaf.emit(WORLD, leaf);
|
|
5624
5624
|
}
|
|
5625
5625
|
}
|
|
5626
5626
|
|
|
@@ -6581,14 +6581,16 @@ let Leaf = class Leaf {
|
|
|
6581
6581
|
relative.innerToWorld(world, to, distance);
|
|
6582
6582
|
world = to ? to : world;
|
|
6583
6583
|
}
|
|
6584
|
-
toInnerPoint(this.
|
|
6584
|
+
toInnerPoint(this.worldTransform, world, to, distance);
|
|
6585
6585
|
}
|
|
6586
6586
|
innerToWorld(inner, to, distance, relative) {
|
|
6587
|
-
toOuterPoint(this.
|
|
6587
|
+
toOuterPoint(this.worldTransform, inner, to, distance);
|
|
6588
6588
|
if (relative) relative.worldToInner(to ? to : inner, null, distance);
|
|
6589
6589
|
}
|
|
6590
6590
|
getBoxPoint(world, relative, distance, change) {
|
|
6591
|
-
|
|
6591
|
+
const inner = this.getInnerPoint(world, relative, distance, change);
|
|
6592
|
+
if (distance) return inner;
|
|
6593
|
+
return this.getBoxPointByInner(inner, null, null, true);
|
|
6592
6594
|
}
|
|
6593
6595
|
getBoxPointByInner(inner, _relative, _distance, change) {
|
|
6594
6596
|
const point = change ? inner : Object.assign({}, inner), {x: x, y: y} = this.boxBounds;
|
|
@@ -7051,7 +7053,7 @@ class LeafLevelList {
|
|
|
7051
7053
|
}
|
|
7052
7054
|
}
|
|
7053
7055
|
|
|
7054
|
-
const version = "2.0.
|
|
7056
|
+
const version = "2.0.5";
|
|
7055
7057
|
|
|
7056
7058
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
7057
7059
|
get allowBackgroundColor() {
|
|
@@ -8393,7 +8395,11 @@ class EllipseData extends UIData {
|
|
|
8393
8395
|
|
|
8394
8396
|
class PolygonData extends LineData {}
|
|
8395
8397
|
|
|
8396
|
-
class StarData extends UIData {
|
|
8398
|
+
class StarData extends UIData {
|
|
8399
|
+
get __boxStroke() {
|
|
8400
|
+
return !this.__pathInputed;
|
|
8401
|
+
}
|
|
8402
|
+
}
|
|
8397
8403
|
|
|
8398
8404
|
class PathData extends UIData {
|
|
8399
8405
|
get __pathInputed() {
|
|
@@ -9405,6 +9411,9 @@ let Box = class Box extends Group {
|
|
|
9405
9411
|
get isBranchLeaf() {
|
|
9406
9412
|
return true;
|
|
9407
9413
|
}
|
|
9414
|
+
get __useSelfBox() {
|
|
9415
|
+
return this.pathInputed;
|
|
9416
|
+
}
|
|
9408
9417
|
constructor(data) {
|
|
9409
9418
|
super(data);
|
|
9410
9419
|
this.__layout.renderChanged || this.__layout.renderChange();
|
|
@@ -9420,7 +9429,7 @@ let Box = class Box extends Group {
|
|
|
9420
9429
|
}
|
|
9421
9430
|
__updateRectBoxBounds() {}
|
|
9422
9431
|
__updateBoxBounds(_secondLayout) {
|
|
9423
|
-
if (this.children.length && !this.
|
|
9432
|
+
if (this.children.length && !this.__useSelfBox) {
|
|
9424
9433
|
const data = this.__;
|
|
9425
9434
|
if (data.__autoSide) {
|
|
9426
9435
|
if (data.__hasSurface) this.__extraUpdate();
|
|
@@ -9529,7 +9538,7 @@ __decorate([ affectRenderBoundsType("hide") ], Frame.prototype, "overflow", void
|
|
|
9529
9538
|
|
|
9530
9539
|
Frame = __decorate([ registerUI() ], Frame);
|
|
9531
9540
|
|
|
9532
|
-
const {moveTo: moveTo$3, closePath: closePath$2, ellipse: ellipse} = PathCommandDataHelper;
|
|
9541
|
+
const {moveTo: moveTo$3, closePath: closePath$2, ellipse: ellipse$2} = PathCommandDataHelper;
|
|
9533
9542
|
|
|
9534
9543
|
let Ellipse = class Ellipse extends UI {
|
|
9535
9544
|
get __tag() {
|
|
@@ -9542,21 +9551,21 @@ let Ellipse = class Ellipse extends UI {
|
|
|
9542
9551
|
let open;
|
|
9543
9552
|
if (innerRadius) {
|
|
9544
9553
|
if (startAngle || endAngle) {
|
|
9545
|
-
if (innerRadius < 1) ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius, 0, startAngle, endAngle, false); else open = true;
|
|
9546
|
-
ellipse(path, rx, ry, rx, ry, 0, endAngle, startAngle, true);
|
|
9554
|
+
if (innerRadius < 1) ellipse$2(path, rx, ry, rx * innerRadius, ry * innerRadius, 0, startAngle, endAngle, false); else open = true;
|
|
9555
|
+
ellipse$2(path, rx, ry, rx, ry, 0, endAngle, startAngle, true);
|
|
9547
9556
|
} else {
|
|
9548
9557
|
if (innerRadius < 1) {
|
|
9549
|
-
ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius);
|
|
9558
|
+
ellipse$2(path, rx, ry, rx * innerRadius, ry * innerRadius);
|
|
9550
9559
|
moveTo$3(path, width, ry);
|
|
9551
9560
|
}
|
|
9552
|
-
ellipse(path, rx, ry, rx, ry, 0, 360, 0, true);
|
|
9561
|
+
ellipse$2(path, rx, ry, rx, ry, 0, 360, 0, true);
|
|
9553
9562
|
}
|
|
9554
9563
|
} else {
|
|
9555
9564
|
if (startAngle || endAngle) {
|
|
9556
9565
|
moveTo$3(path, rx, ry);
|
|
9557
|
-
ellipse(path, rx, ry, rx, ry, 0, startAngle, endAngle, false);
|
|
9566
|
+
ellipse$2(path, rx, ry, rx, ry, 0, startAngle, endAngle, false);
|
|
9558
9567
|
} else {
|
|
9559
|
-
ellipse(path, rx, ry, rx, ry);
|
|
9568
|
+
ellipse$2(path, rx, ry, rx, ry);
|
|
9560
9569
|
}
|
|
9561
9570
|
}
|
|
9562
9571
|
if (!open) closePath$2(path);
|
|
@@ -11152,6 +11161,14 @@ class InteractionBase {
|
|
|
11152
11161
|
stopDragAnimate() {
|
|
11153
11162
|
this.dragger.stopAnimate();
|
|
11154
11163
|
}
|
|
11164
|
+
replaceDownTarget(target) {
|
|
11165
|
+
const {downData: downData} = this;
|
|
11166
|
+
if (downData && target) {
|
|
11167
|
+
const {path: path} = downData;
|
|
11168
|
+
path.remove(path.list[0]);
|
|
11169
|
+
path.addAt(target, 0);
|
|
11170
|
+
}
|
|
11171
|
+
}
|
|
11155
11172
|
updateDownData(data, options, merge) {
|
|
11156
11173
|
const {downData: downData} = this;
|
|
11157
11174
|
if (!data && downData) data = downData;
|
|
@@ -12350,7 +12367,7 @@ function checkImage(paint, drawImage, ui, canvas, renderOptions) {
|
|
|
12350
12367
|
if (drawImage) {
|
|
12351
12368
|
if (data.repeat) {
|
|
12352
12369
|
drawImage = false;
|
|
12353
|
-
} else if (!(originPaint.changeful || paint.film || Platform.name === "miniapp"
|
|
12370
|
+
} else if (!(originPaint.changeful || paint.film || Platform.name === "miniapp" || exporting)) {
|
|
12354
12371
|
drawImage = Platform.image.isLarge(image, scaleX, scaleY) || image.width * scaleX > 8096 || image.height * scaleY > 8096;
|
|
12355
12372
|
}
|
|
12356
12373
|
}
|
|
@@ -12903,7 +12920,7 @@ function createRows(drawData, content, style) {
|
|
|
12903
12920
|
}, row = {
|
|
12904
12921
|
words: []
|
|
12905
12922
|
};
|
|
12906
|
-
|
|
12923
|
+
content = [ ...content ];
|
|
12907
12924
|
for (let i = 0, len = content.length; i < len; i++) {
|
|
12908
12925
|
char = content[i];
|
|
12909
12926
|
if (char === "\n") {
|
|
@@ -13382,10 +13399,10 @@ function targetAttr(fn) {
|
|
|
13382
13399
|
});
|
|
13383
13400
|
if (isObject(check)) value = check; else if (check === false) return;
|
|
13384
13401
|
}
|
|
13385
|
-
|
|
13386
|
-
if (!isUndefined(dimOthers) || !isUndefined(bright)) {
|
|
13402
|
+
if (t.hasDimOthers) {
|
|
13387
13403
|
t.setDimOthers(false);
|
|
13388
13404
|
t.setBright(false);
|
|
13405
|
+
t.hasDimOthers = undefined;
|
|
13389
13406
|
}
|
|
13390
13407
|
if (isArray(value) && value.length > 1 && value[0].locked) value.splice(0, 1);
|
|
13391
13408
|
if (t.single) {
|
|
@@ -14318,6 +14335,7 @@ class EditBox extends Group {
|
|
|
14318
14335
|
if (!isUndefined(dimOthers) || !isUndefined(bright)) {
|
|
14319
14336
|
editor.setDimOthers(dimOthers);
|
|
14320
14337
|
editor.setBright(!!dimOthers || bright);
|
|
14338
|
+
editor.hasDimOthers = true;
|
|
14321
14339
|
}
|
|
14322
14340
|
if (spread) BoundsHelper.spread(bounds, spread);
|
|
14323
14341
|
if (this.view.worldOpacity) {
|
|
@@ -14424,8 +14442,9 @@ class EditBox extends Group {
|
|
|
14424
14442
|
onDragStart(e) {
|
|
14425
14443
|
this.dragging = true;
|
|
14426
14444
|
const point = this.dragPoint = e.current, {pointType: pointType} = point;
|
|
14427
|
-
const {moveable: moveable, resizeable: resizeable, rotateable: rotateable, skewable: skewable} = this.mergeConfig;
|
|
14445
|
+
const {moveable: moveable, resizeable: resizeable, rotateable: rotateable, skewable: skewable, onCopy: onCopy} = this.mergeConfig;
|
|
14428
14446
|
if (pointType === "move") {
|
|
14447
|
+
if (e.altKey && onCopy && onCopy() && this.editor.single) this.app.interaction.replaceDownTarget(this.target);
|
|
14429
14448
|
moveable && (this.moving = true);
|
|
14430
14449
|
} else {
|
|
14431
14450
|
if (pointType.includes("rotate") || this.isHoldRotateKey(e) || !resizeable) {
|
|
@@ -14544,26 +14563,31 @@ class EditBox extends Group {
|
|
|
14544
14563
|
updatePointCursor(this, e);
|
|
14545
14564
|
}
|
|
14546
14565
|
onArrow(e) {
|
|
14547
|
-
if (this.canUse
|
|
14566
|
+
if (this.canUse) {
|
|
14548
14567
|
let x = 0, y = 0;
|
|
14549
|
-
const distance = e.shiftKey ? 10 : 1;
|
|
14550
14568
|
switch (e.code) {
|
|
14551
14569
|
case "ArrowDown":
|
|
14552
|
-
y =
|
|
14570
|
+
y = 1;
|
|
14553
14571
|
break;
|
|
14554
14572
|
|
|
14555
14573
|
case "ArrowUp":
|
|
14556
|
-
y = -
|
|
14574
|
+
y = -1;
|
|
14557
14575
|
break;
|
|
14558
14576
|
|
|
14559
14577
|
case "ArrowLeft":
|
|
14560
|
-
x = -
|
|
14578
|
+
x = -1;
|
|
14561
14579
|
break;
|
|
14562
14580
|
|
|
14563
14581
|
case "ArrowRight":
|
|
14564
|
-
x =
|
|
14582
|
+
x = 1;
|
|
14583
|
+
}
|
|
14584
|
+
if (x || y) {
|
|
14585
|
+
const {keyEvent: keyEvent, arrowStep: arrowStep, arrowFastStep: arrowFastStep} = this.mergeConfig;
|
|
14586
|
+
if (keyEvent) {
|
|
14587
|
+
const step = e.shiftKey ? arrowFastStep : arrowStep;
|
|
14588
|
+
this.transformTool.move(x * step, y * step);
|
|
14589
|
+
}
|
|
14565
14590
|
}
|
|
14566
|
-
if (x || y) this.transformTool.move(x, y);
|
|
14567
14591
|
}
|
|
14568
14592
|
}
|
|
14569
14593
|
onDoubleTap(e) {
|
|
@@ -14675,6 +14699,8 @@ const config$1 = {
|
|
|
14675
14699
|
pointSize: 10,
|
|
14676
14700
|
pointRadius: 16,
|
|
14677
14701
|
rotateGap: 45,
|
|
14702
|
+
arrowStep: 1,
|
|
14703
|
+
arrowFastStep: 10,
|
|
14678
14704
|
buttonsDirection: "bottom",
|
|
14679
14705
|
buttonsMargin: 12,
|
|
14680
14706
|
hideOnSmall: true,
|
|
@@ -20588,4 +20614,141 @@ Plugin.add("scale-fixed");
|
|
|
20588
20614
|
|
|
20589
20615
|
UI.addAttr("scaleFixed", undefined, scaleFixedType);
|
|
20590
20616
|
|
|
20591
|
-
|
|
20617
|
+
class EllipseBoxData extends BoxData {}
|
|
20618
|
+
|
|
20619
|
+
const ellipse$1 = Ellipse.prototype;
|
|
20620
|
+
|
|
20621
|
+
let EllipseBox = class EllipseBox extends Box {
|
|
20622
|
+
get __tag() {
|
|
20623
|
+
return "EllipseBox";
|
|
20624
|
+
}
|
|
20625
|
+
__updatePath() {}
|
|
20626
|
+
};
|
|
20627
|
+
|
|
20628
|
+
__decorate([ dataProcessor(EllipseBoxData) ], EllipseBox.prototype, "__", void 0);
|
|
20629
|
+
|
|
20630
|
+
__decorate([ pathType(0) ], EllipseBox.prototype, "innerRadius", void 0);
|
|
20631
|
+
|
|
20632
|
+
__decorate([ pathType(0) ], EllipseBox.prototype, "startAngle", void 0);
|
|
20633
|
+
|
|
20634
|
+
__decorate([ pathType(0) ], EllipseBox.prototype, "endAngle", void 0);
|
|
20635
|
+
|
|
20636
|
+
__decorate([ rewrite(ellipse$1.__updatePath) ], EllipseBox.prototype, "__updatePath", null);
|
|
20637
|
+
|
|
20638
|
+
EllipseBox = __decorate([ rewriteAble(), registerUI() ], EllipseBox);
|
|
20639
|
+
|
|
20640
|
+
class PolygonBoxData extends BoxData {
|
|
20641
|
+
get __usePathBox() {
|
|
20642
|
+
return this.points || this.__pathInputed;
|
|
20643
|
+
}
|
|
20644
|
+
}
|
|
20645
|
+
|
|
20646
|
+
const polygon = Polygon.prototype;
|
|
20647
|
+
|
|
20648
|
+
let PolygonBox = class PolygonBox extends Box {
|
|
20649
|
+
get __tag() {
|
|
20650
|
+
return "PolygonBox";
|
|
20651
|
+
}
|
|
20652
|
+
__updatePath() {}
|
|
20653
|
+
};
|
|
20654
|
+
|
|
20655
|
+
__decorate([ dataProcessor(PolygonBoxData) ], PolygonBox.prototype, "__", void 0);
|
|
20656
|
+
|
|
20657
|
+
__decorate([ pathType(3) ], PolygonBox.prototype, "sides", void 0);
|
|
20658
|
+
|
|
20659
|
+
__decorate([ pathType() ], PolygonBox.prototype, "points", void 0);
|
|
20660
|
+
|
|
20661
|
+
__decorate([ pathType(0) ], PolygonBox.prototype, "curve", void 0);
|
|
20662
|
+
|
|
20663
|
+
__decorate([ rewrite(polygon.__updatePath) ], PolygonBox.prototype, "__updatePath", null);
|
|
20664
|
+
|
|
20665
|
+
PolygonBox = __decorate([ rewriteAble(), registerUI() ], PolygonBox);
|
|
20666
|
+
|
|
20667
|
+
class StarBoxData extends BoxData {}
|
|
20668
|
+
|
|
20669
|
+
const ellipse = Star.prototype;
|
|
20670
|
+
|
|
20671
|
+
let StarBox = class StarBox extends Box {
|
|
20672
|
+
get __tag() {
|
|
20673
|
+
return "StarBox";
|
|
20674
|
+
}
|
|
20675
|
+
__updatePath() {}
|
|
20676
|
+
};
|
|
20677
|
+
|
|
20678
|
+
__decorate([ pathType(5) ], StarBox.prototype, "corners", void 0);
|
|
20679
|
+
|
|
20680
|
+
__decorate([ pathType(.382) ], StarBox.prototype, "innerRadius", void 0);
|
|
20681
|
+
|
|
20682
|
+
__decorate([ dataProcessor(StarBoxData) ], StarBox.prototype, "__", void 0);
|
|
20683
|
+
|
|
20684
|
+
__decorate([ rewrite(ellipse.__updatePath) ], StarBox.prototype, "__updatePath", null);
|
|
20685
|
+
|
|
20686
|
+
StarBox = __decorate([ rewriteAble(), registerUI() ], StarBox);
|
|
20687
|
+
|
|
20688
|
+
class PathBoxData extends BoxData {}
|
|
20689
|
+
|
|
20690
|
+
let PathBox = class PathBox extends Box {
|
|
20691
|
+
get __tag() {
|
|
20692
|
+
return "PathBox";
|
|
20693
|
+
}
|
|
20694
|
+
};
|
|
20695
|
+
|
|
20696
|
+
__decorate([ dataProcessor(PathBoxData) ], PathBox.prototype, "__", void 0);
|
|
20697
|
+
|
|
20698
|
+
__decorate([ affectStrokeBoundsType("center") ], PathBox.prototype, "strokeAlign", void 0);
|
|
20699
|
+
|
|
20700
|
+
PathBox = __decorate([ registerUI() ], PathBox);
|
|
20701
|
+
|
|
20702
|
+
class ImageBoxData extends BoxData {
|
|
20703
|
+
get __urlType() {
|
|
20704
|
+
return "image";
|
|
20705
|
+
}
|
|
20706
|
+
setUrl(value) {
|
|
20707
|
+
this.__setImageFill(value);
|
|
20708
|
+
this._url = value;
|
|
20709
|
+
}
|
|
20710
|
+
__setImageFill(value) {
|
|
20711
|
+
this.fill = value ? {
|
|
20712
|
+
type: this.__urlType,
|
|
20713
|
+
mode: "stretch",
|
|
20714
|
+
url: value
|
|
20715
|
+
} : undefined;
|
|
20716
|
+
}
|
|
20717
|
+
__getData() {
|
|
20718
|
+
const data = super.__getData();
|
|
20719
|
+
if (data.url) delete data.fill;
|
|
20720
|
+
return data;
|
|
20721
|
+
}
|
|
20722
|
+
__getInputData(names, options) {
|
|
20723
|
+
const data = super.__getInputData(names, options);
|
|
20724
|
+
if (data.url) delete data.fill;
|
|
20725
|
+
return data;
|
|
20726
|
+
}
|
|
20727
|
+
}
|
|
20728
|
+
|
|
20729
|
+
let ImageBox = class ImageBox extends Box {
|
|
20730
|
+
get __tag() {
|
|
20731
|
+
return "ImageBox";
|
|
20732
|
+
}
|
|
20733
|
+
get ready() {
|
|
20734
|
+
const {image: image} = this;
|
|
20735
|
+
return image && image.ready;
|
|
20736
|
+
}
|
|
20737
|
+
get image() {
|
|
20738
|
+
const {fill: fill} = this.__;
|
|
20739
|
+
return isArray(fill) && fill[0].image;
|
|
20740
|
+
}
|
|
20741
|
+
get __useSelfBox() {
|
|
20742
|
+
return true;
|
|
20743
|
+
}
|
|
20744
|
+
};
|
|
20745
|
+
|
|
20746
|
+
__decorate([ dataProcessor(ImageBoxData) ], ImageBox.prototype, "__", void 0);
|
|
20747
|
+
|
|
20748
|
+
__decorate([ boundsType("") ], ImageBox.prototype, "url", void 0);
|
|
20749
|
+
|
|
20750
|
+
ImageBox = __decorate([ registerUI() ], ImageBox);
|
|
20751
|
+
|
|
20752
|
+
Plugin.add("box");
|
|
20753
|
+
|
|
20754
|
+
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, EllipseBox, EllipseBoxData, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, Finder, Flow, FourNumberHelper, Frame, FrameData, Group, GroupData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, ImageBox, ImageBoxData, 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, LeaferFilm, LeaferImage, LeaferTypeCreator, LeaferVideo, Line, LineData, LineEditTool, MathHelper, Matrix, MatrixHelper, MoveEvent, MultiTouchHelper, MyDragEvent, MyImage, MyPointerEvent, MyTouchEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathArrowModule, PathBounds, PathBox, PathBoxData, PathCommandDataHelper, PathCommandMap, PathCommandNodeHelper, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathMatrixHelper, PathNodeHandleType, PathNumberCommandLengthMap, PathNumberCommandMap, PathScaler, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonBox, PolygonBoxData, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, Robot, RobotData, RotateEvent, Run, ScrollBar, Scroller, SelectArea, Selector, Star, StarBox, StarBoxData, StarData, State, StringNumberMap, Stroker, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, TouchEvent, TransformTool, Transformer, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, UnitConvertHelper, 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$3 as tempBounds, tempMatrix$2 as tempMatrix, tempPoint$4 as tempPoint, tryToNumber, useCanvas, useModule, version, visibleType, zoomLayerType };
|