@leafer-game/miniapp 1.3.3 → 1.4.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 +1 -0
- package/dist/miniapp.cjs.map +1 -0
- package/dist/miniapp.esm.js +1 -0
- package/dist/miniapp.esm.js.map +1 -0
- package/dist/miniapp.esm.min.js +1 -0
- package/dist/miniapp.esm.min.js.map +1 -0
- package/dist/miniapp.min.cjs +1 -0
- package/dist/miniapp.min.cjs.map +1 -0
- package/dist/miniapp.module.js +66 -64
- package/dist/miniapp.module.js.map +1 -0
- package/dist/miniapp.module.min.js +2 -1
- package/dist/miniapp.module.min.js.map +1 -0
- package/package.json +15 -15
package/dist/miniapp.cjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"miniapp.cjs","sources":["../../../../../../../src/miniapp/src/patch.ts"],"sourcesContent":["\nimport { IMatrixData, ILeaferImagePatternPaint, ICanvasPattern } from '@leafer/interface'\nimport { MatrixHelper, Platform, LeaferImage } from '@leafer/core'\n\n/**\n * android、ios下不支持离屏画布对画\n */\n\n// LeaferCanvas.prototype.__createContext = function () {\n// if (this.viewSelect) {\n// const offscreenView = Platform.origin.createCanvas(1, 1)\n// const context = this.view.getContext('2d')\n\n// this.testView = this.view\n// this.testContext = context\n// this.view = offscreenView\n// }\n\n// this.context = this.view.getContext('2d')\n// this.__bindContext()\n// }\n\n// LeaferCanvas.prototype.updateRender = function (bounds: IBoundsData) {\n// if (this.testView) {\n\n// // 把离屏画布同步到视图画布中: imageData 复制模式 android / ios均有效\n// const { x, y, width, height } = this.bounds.getIntersect(bounds).scale(this.pixelRatio).ceil()\n// let data = this.context.getImageData(x, y, width, height)\n// this.testContext.clearRect(x, y, width, height)\n// this.testContext.putImageData(data, x, y)\n// data = null\n\n// // pattern 下只有 android 有效\n// // let pattern = this.context.createPattern(this.view, Platform.origin.noRepeat)\n// // this.testContext.clearRect(0, 0, this.view.width, this.view.height)\n// // this.testContext.fillStyle = pattern\n// // this.testContext.fillRect(0, 0, this.view.width, this.view.height)\n// // this.testContext.fillStyle = pattern = null\n// }\n// }\n\n// LeaferCanvas.prototype.updateViewSize = function () {\n// const { width, height, pixelRatio, view, testView } = this\n// view.width = width * pixelRatio\n// view.height = height * pixelRatio\n\n// if (testView) {\n// testView.width = view.width\n// testView.height = view.height\n// }\n// }\n\n\n/**\n * ios 下图案填充不能使用离屏画布,改用原图\n */\n\nconst systemInfo = wx.getSystemInfoSync()\nconst platform = systemInfo.platform\n\nif (platform === 'ios') {\n\n LeaferImage.prototype.getPattern = function (canvas: any, repeat: string | null, transform?: IMatrixData, paint?: ILeaferImagePatternPaint): ICanvasPattern {\n //const pattern = Platform.canvas.createPattern(canvas, repeat)\n const pattern = Platform.canvas.createPattern(this.view, repeat)\n\n // 增加使用原图的矩阵\n const { width, height } = canvas\n if (this.width !== width || this.height !== height) {\n if (!transform) transform = MatrixHelper.get()\n MatrixHelper.scale(transform, width / this.width, height / this.height)\n }\n\n try {\n if (transform && pattern.setTransform) {\n pattern.setTransform(transform) // maybe error \n transform = null\n }\n } catch { }\n\n if (paint) paint.transform = transform\n return pattern\n }\n\n}"],"names":["LeaferImage","Platform","MatrixHelper"],"mappings":";;;;;;;;;;AAyDA,MAAM,UAAU,GAAG,EAAE,CAAC,iBAAiB,EAAE;AACzC,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ;AAEpC,IAAI,QAAQ,KAAK,KAAK,EAAE;AAEpB,IAAAA,gBAAW,CAAC,SAAS,CAAC,UAAU,GAAG,UAAU,MAAW,EAAE,MAAqB,EAAE,SAAuB,EAAE,KAAgC,EAAA;AAEtI,QAAA,MAAM,OAAO,GAAGC,aAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC;AAGhE,QAAA,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM;AAChC,QAAA,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM,EAAE;AAChD,YAAA,IAAI,CAAC,SAAS;AAAE,gBAAA,SAAS,GAAGC,iBAAY,CAAC,GAAG,EAAE;AAC9C,YAAAA,iBAAY,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;;AAG3E,QAAA,IAAI;AACA,YAAA,IAAI,SAAS,IAAI,OAAO,CAAC,YAAY,EAAE;AACnC,gBAAA,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC;gBAC/B,SAAS,GAAG,IAAI;;;QAEtB,OAAM,EAAA,EAAA;AAER,QAAA,IAAI,KAAK;AAAE,YAAA,KAAK,CAAC,SAAS,GAAG,SAAS;AACtC,QAAA,OAAO,OAAO;AAClB,KAAC;AAEL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/miniapp.esm.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"miniapp.esm.js","sources":["../../../../../../../src/miniapp/src/patch.ts"],"sourcesContent":["\nimport { IMatrixData, ILeaferImagePatternPaint, ICanvasPattern } from '@leafer/interface'\nimport { MatrixHelper, Platform, LeaferImage } from '@leafer/core'\n\n/**\n * android、ios下不支持离屏画布对画\n */\n\n// LeaferCanvas.prototype.__createContext = function () {\n// if (this.viewSelect) {\n// const offscreenView = Platform.origin.createCanvas(1, 1)\n// const context = this.view.getContext('2d')\n\n// this.testView = this.view\n// this.testContext = context\n// this.view = offscreenView\n// }\n\n// this.context = this.view.getContext('2d')\n// this.__bindContext()\n// }\n\n// LeaferCanvas.prototype.updateRender = function (bounds: IBoundsData) {\n// if (this.testView) {\n\n// // 把离屏画布同步到视图画布中: imageData 复制模式 android / ios均有效\n// const { x, y, width, height } = this.bounds.getIntersect(bounds).scale(this.pixelRatio).ceil()\n// let data = this.context.getImageData(x, y, width, height)\n// this.testContext.clearRect(x, y, width, height)\n// this.testContext.putImageData(data, x, y)\n// data = null\n\n// // pattern 下只有 android 有效\n// // let pattern = this.context.createPattern(this.view, Platform.origin.noRepeat)\n// // this.testContext.clearRect(0, 0, this.view.width, this.view.height)\n// // this.testContext.fillStyle = pattern\n// // this.testContext.fillRect(0, 0, this.view.width, this.view.height)\n// // this.testContext.fillStyle = pattern = null\n// }\n// }\n\n// LeaferCanvas.prototype.updateViewSize = function () {\n// const { width, height, pixelRatio, view, testView } = this\n// view.width = width * pixelRatio\n// view.height = height * pixelRatio\n\n// if (testView) {\n// testView.width = view.width\n// testView.height = view.height\n// }\n// }\n\n\n/**\n * ios 下图案填充不能使用离屏画布,改用原图\n */\n\nconst systemInfo = wx.getSystemInfoSync()\nconst platform = systemInfo.platform\n\nif (platform === 'ios') {\n\n LeaferImage.prototype.getPattern = function (canvas: any, repeat: string | null, transform?: IMatrixData, paint?: ILeaferImagePatternPaint): ICanvasPattern {\n //const pattern = Platform.canvas.createPattern(canvas, repeat)\n const pattern = Platform.canvas.createPattern(this.view, repeat)\n\n // 增加使用原图的矩阵\n const { width, height } = canvas\n if (this.width !== width || this.height !== height) {\n if (!transform) transform = MatrixHelper.get()\n MatrixHelper.scale(transform, width / this.width, height / this.height)\n }\n\n try {\n if (transform && pattern.setTransform) {\n pattern.setTransform(transform) // maybe error \n transform = null\n }\n } catch { }\n\n if (paint) paint.transform = transform\n return pattern\n }\n\n}"],"names":[],"mappings":";;;;;;;;AAyDA,MAAM,UAAU,GAAG,EAAE,CAAC,iBAAiB,EAAE;AACzC,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ;AAEpC,IAAI,QAAQ,KAAK,KAAK,EAAE;AAEpB,IAAA,WAAW,CAAC,SAAS,CAAC,UAAU,GAAG,UAAU,MAAW,EAAE,MAAqB,EAAE,SAAuB,EAAE,KAAgC,EAAA;AAEtI,QAAA,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC;AAGhE,QAAA,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM;AAChC,QAAA,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM,EAAE;AAChD,YAAA,IAAI,CAAC,SAAS;AAAE,gBAAA,SAAS,GAAG,YAAY,CAAC,GAAG,EAAE;AAC9C,YAAA,YAAY,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;;AAG3E,QAAA,IAAI;AACA,YAAA,IAAI,SAAS,IAAI,OAAO,CAAC,YAAY,EAAE;AACnC,gBAAA,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC;gBAC/B,SAAS,GAAG,IAAI;;;QAEtB,OAAM,EAAA,EAAA;AAER,QAAA,IAAI,KAAK;AAAE,YAAA,KAAK,CAAC,SAAS,GAAG,SAAS;AACtC,QAAA,OAAO,OAAO;AAClB,KAAC;AAEL"}
|
package/dist/miniapp.esm.min.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
1
|
export*from"@leafer-ui/miniapp";export*from"@leafer-in/robot";export*from"@leafer-in/state";export*from"@leafer-in/animate";export*from"@leafer-in/motion-path";export*from"@leafer-in/find";import{LeaferImage as t,Platform as e,MatrixHelper as r}from"@leafer/core";"ios"===wx.getSystemInfoSync().platform&&(t.prototype.getPattern=function(t,o,i,a){const n=e.canvas.createPattern(this.view,o),{width:f,height:h}=t;this.width===f&&this.height===h||(i||(i=r.get()),r.scale(i,f/this.width,h/this.height));try{i&&n.setTransform&&(n.setTransform(i),i=null)}catch(t){}return a&&(a.transform=i),n});
|
|
2
|
+
//# sourceMappingURL=miniapp.esm.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"miniapp.esm.min.js","sources":["../../../../../../../src/miniapp/src/patch.ts"],"sourcesContent":["\nimport { IMatrixData, ILeaferImagePatternPaint, ICanvasPattern } from '@leafer/interface'\nimport { MatrixHelper, Platform, LeaferImage } from '@leafer/core'\n\n/**\n * android、ios下不支持离屏画布对画\n */\n\n// LeaferCanvas.prototype.__createContext = function () {\n// if (this.viewSelect) {\n// const offscreenView = Platform.origin.createCanvas(1, 1)\n// const context = this.view.getContext('2d')\n\n// this.testView = this.view\n// this.testContext = context\n// this.view = offscreenView\n// }\n\n// this.context = this.view.getContext('2d')\n// this.__bindContext()\n// }\n\n// LeaferCanvas.prototype.updateRender = function (bounds: IBoundsData) {\n// if (this.testView) {\n\n// // 把离屏画布同步到视图画布中: imageData 复制模式 android / ios均有效\n// const { x, y, width, height } = this.bounds.getIntersect(bounds).scale(this.pixelRatio).ceil()\n// let data = this.context.getImageData(x, y, width, height)\n// this.testContext.clearRect(x, y, width, height)\n// this.testContext.putImageData(data, x, y)\n// data = null\n\n// // pattern 下只有 android 有效\n// // let pattern = this.context.createPattern(this.view, Platform.origin.noRepeat)\n// // this.testContext.clearRect(0, 0, this.view.width, this.view.height)\n// // this.testContext.fillStyle = pattern\n// // this.testContext.fillRect(0, 0, this.view.width, this.view.height)\n// // this.testContext.fillStyle = pattern = null\n// }\n// }\n\n// LeaferCanvas.prototype.updateViewSize = function () {\n// const { width, height, pixelRatio, view, testView } = this\n// view.width = width * pixelRatio\n// view.height = height * pixelRatio\n\n// if (testView) {\n// testView.width = view.width\n// testView.height = view.height\n// }\n// }\n\n\n/**\n * ios 下图案填充不能使用离屏画布,改用原图\n */\n\nconst systemInfo = wx.getSystemInfoSync()\nconst platform = systemInfo.platform\n\nif (platform === 'ios') {\n\n LeaferImage.prototype.getPattern = function (canvas: any, repeat: string | null, transform?: IMatrixData, paint?: ILeaferImagePatternPaint): ICanvasPattern {\n //const pattern = Platform.canvas.createPattern(canvas, repeat)\n const pattern = Platform.canvas.createPattern(this.view, repeat)\n\n // 增加使用原图的矩阵\n const { width, height } = canvas\n if (this.width !== width || this.height !== height) {\n if (!transform) transform = MatrixHelper.get()\n MatrixHelper.scale(transform, width / this.width, height / this.height)\n }\n\n try {\n if (transform && pattern.setTransform) {\n pattern.setTransform(transform) // maybe error \n transform = null\n }\n } catch { }\n\n if (paint) paint.transform = transform\n return pattern\n }\n\n}"],"names":["wx","getSystemInfoSync","platform","LeaferImage","prototype","getPattern","canvas","repeat","transform","paint","pattern","Platform","createPattern","this","view","width","height","MatrixHelper","get","scale","setTransform","_a"],"mappings":"wQA4DiB,QAHEA,GAAGC,oBACMC,WAIxBC,EAAYC,UAAUC,WAAa,SAAUC,EAAaC,EAAuBC,EAAyBC,GAEtG,MAAMC,EAAUC,EAASL,OAAOM,cAAcC,KAAKC,KAAMP,IAGnDQ,MAAEA,EAAKC,OAAEA,GAAWV,EACtBO,KAAKE,QAAUA,GAASF,KAAKG,SAAWA,IACnCR,IAAWA,EAAYS,EAAaC,OACzCD,EAAaE,MAAMX,EAAWO,EAAQF,KAAKE,MAAOC,EAASH,KAAKG,SAGpE,IACQR,GAAaE,EAAQU,eACrBV,EAAQU,aAAaZ,GACrBA,EAAY,MAElB,MAAMa,GAAA,CAGR,OADIZ,IAAOA,EAAMD,UAAYA,GACtBE,CACV"}
|
package/dist/miniapp.min.cjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
1
|
"use strict";var e=require("@leafer-ui/miniapp"),t=require("@leafer-in/robot"),r=require("@leafer-in/state"),n=require("@leafer-in/animate"),o=require("@leafer-in/motion-path"),a=require("@leafer-in/find"),i=require("@leafer/core");"ios"===wx.getSystemInfoSync().platform&&(i.LeaferImage.prototype.getPattern=function(e,t,r,n){const o=i.Platform.canvas.createPattern(this.view,t),{width:a,height:c}=e;this.width===a&&this.height===c||(r||(r=i.MatrixHelper.get()),i.MatrixHelper.scale(r,a/this.width,c/this.height));try{r&&o.setTransform&&(o.setTransform(r),r=null)}catch(e){}return n&&(n.transform=r),o}),Object.keys(e).forEach((function(t){"default"===t||Object.prototype.hasOwnProperty.call(exports,t)||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})})),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(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(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(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(a).forEach((function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return a[e]}})}));
|
|
2
|
+
//# sourceMappingURL=miniapp.min.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"miniapp.min.cjs","sources":["../../../../../../../src/miniapp/src/patch.ts"],"sourcesContent":["\nimport { IMatrixData, ILeaferImagePatternPaint, ICanvasPattern } from '@leafer/interface'\nimport { MatrixHelper, Platform, LeaferImage } from '@leafer/core'\n\n/**\n * android、ios下不支持离屏画布对画\n */\n\n// LeaferCanvas.prototype.__createContext = function () {\n// if (this.viewSelect) {\n// const offscreenView = Platform.origin.createCanvas(1, 1)\n// const context = this.view.getContext('2d')\n\n// this.testView = this.view\n// this.testContext = context\n// this.view = offscreenView\n// }\n\n// this.context = this.view.getContext('2d')\n// this.__bindContext()\n// }\n\n// LeaferCanvas.prototype.updateRender = function (bounds: IBoundsData) {\n// if (this.testView) {\n\n// // 把离屏画布同步到视图画布中: imageData 复制模式 android / ios均有效\n// const { x, y, width, height } = this.bounds.getIntersect(bounds).scale(this.pixelRatio).ceil()\n// let data = this.context.getImageData(x, y, width, height)\n// this.testContext.clearRect(x, y, width, height)\n// this.testContext.putImageData(data, x, y)\n// data = null\n\n// // pattern 下只有 android 有效\n// // let pattern = this.context.createPattern(this.view, Platform.origin.noRepeat)\n// // this.testContext.clearRect(0, 0, this.view.width, this.view.height)\n// // this.testContext.fillStyle = pattern\n// // this.testContext.fillRect(0, 0, this.view.width, this.view.height)\n// // this.testContext.fillStyle = pattern = null\n// }\n// }\n\n// LeaferCanvas.prototype.updateViewSize = function () {\n// const { width, height, pixelRatio, view, testView } = this\n// view.width = width * pixelRatio\n// view.height = height * pixelRatio\n\n// if (testView) {\n// testView.width = view.width\n// testView.height = view.height\n// }\n// }\n\n\n/**\n * ios 下图案填充不能使用离屏画布,改用原图\n */\n\nconst systemInfo = wx.getSystemInfoSync()\nconst platform = systemInfo.platform\n\nif (platform === 'ios') {\n\n LeaferImage.prototype.getPattern = function (canvas: any, repeat: string | null, transform?: IMatrixData, paint?: ILeaferImagePatternPaint): ICanvasPattern {\n //const pattern = Platform.canvas.createPattern(canvas, repeat)\n const pattern = Platform.canvas.createPattern(this.view, repeat)\n\n // 增加使用原图的矩阵\n const { width, height } = canvas\n if (this.width !== width || this.height !== height) {\n if (!transform) transform = MatrixHelper.get()\n MatrixHelper.scale(transform, width / this.width, height / this.height)\n }\n\n try {\n if (transform && pattern.setTransform) {\n pattern.setTransform(transform) // maybe error \n transform = null\n }\n } catch { }\n\n if (paint) paint.transform = transform\n return pattern\n }\n\n}"],"names":["wx","getSystemInfoSync","platform","LeaferImage","prototype","getPattern","canvas","repeat","transform","paint","pattern","Platform","createPattern","this","view","width","height","MatrixHelper","get","scale","setTransform","_a"],"mappings":"wOA4DiB,QAHEA,GAAGC,oBACMC,WAIxBC,EAAWA,YAACC,UAAUC,WAAa,SAAUC,EAAaC,EAAuBC,EAAyBC,GAEtG,MAAMC,EAAUC,EAAAA,SAASL,OAAOM,cAAcC,KAAKC,KAAMP,IAGnDQ,MAAEA,EAAKC,OAAEA,GAAWV,EACtBO,KAAKE,QAAUA,GAASF,KAAKG,SAAWA,IACnCR,IAAWA,EAAYS,EAAYA,aAACC,OACzCD,eAAaE,MAAMX,EAAWO,EAAQF,KAAKE,MAAOC,EAASH,KAAKG,SAGpE,IACQR,GAAaE,EAAQU,eACrBV,EAAQU,aAAaZ,GACrBA,EAAY,MAElB,MAAMa,GAAA,CAGR,OADIZ,IAAOA,EAAMD,UAAYA,GACtBE,CACV"}
|
package/dist/miniapp.module.js
CHANGED
|
@@ -3821,10 +3821,10 @@ function autoLayoutType(defaultValue) {
|
|
|
3821
3821
|
return decorateLeafAttr(defaultValue, (key) => attr({
|
|
3822
3822
|
set(value) {
|
|
3823
3823
|
if (this.__setAttr(key, value)) {
|
|
3824
|
-
this.__layout.matrixChanged || this.__layout.matrixChange();
|
|
3825
3824
|
this.__hasAutoLayout = !!(this.origin || this.around || this.flow);
|
|
3826
3825
|
if (!this.__local)
|
|
3827
3826
|
this.__layout.createLocal();
|
|
3827
|
+
doBoundsType(this);
|
|
3828
3828
|
}
|
|
3829
3829
|
}
|
|
3830
3830
|
}));
|
|
@@ -4207,55 +4207,62 @@ const LeafHelper = {
|
|
|
4207
4207
|
y += t.y;
|
|
4208
4208
|
transition ? t.animate({ x, y }, transition) : (t.x = x, t.y = y);
|
|
4209
4209
|
},
|
|
4210
|
-
zoomOfWorld(t, origin, scaleX, scaleY, resize) {
|
|
4211
|
-
L$1.zoomOfLocal(t, getTempLocal(t, origin), scaleX, scaleY, resize);
|
|
4210
|
+
zoomOfWorld(t, origin, scaleX, scaleY, resize, transition) {
|
|
4211
|
+
L$1.zoomOfLocal(t, getTempLocal(t, origin), scaleX, scaleY, resize, transition);
|
|
4212
4212
|
},
|
|
4213
|
-
zoomOfLocal(t, origin, scaleX, scaleY = scaleX, resize) {
|
|
4214
|
-
|
|
4213
|
+
zoomOfLocal(t, origin, scaleX, scaleY = scaleX, resize, transition) {
|
|
4214
|
+
const o = t.__localMatrix;
|
|
4215
|
+
if (typeof scaleY !== 'number') {
|
|
4216
|
+
if (scaleY)
|
|
4217
|
+
transition = scaleY;
|
|
4218
|
+
scaleY = scaleX;
|
|
4219
|
+
}
|
|
4220
|
+
copy$7(matrix$1, o);
|
|
4215
4221
|
scaleOfOuter$2(matrix$1, origin, scaleX, scaleY);
|
|
4216
4222
|
if (t.origin || t.around) {
|
|
4217
|
-
L$1.setTransform(t, matrix$1, resize);
|
|
4223
|
+
L$1.setTransform(t, matrix$1, resize, transition);
|
|
4218
4224
|
}
|
|
4219
4225
|
else {
|
|
4220
|
-
|
|
4221
|
-
|
|
4226
|
+
const x = t.x + matrix$1.e - o.e, y = t.y + matrix$1.f - o.f;
|
|
4227
|
+
if (transition && !resize)
|
|
4228
|
+
t.animate({ x, y, scaleX: t.scaleX * scaleX, scaleY: t.scaleY * scaleY }, transition);
|
|
4229
|
+
else
|
|
4230
|
+
t.x = x, t.y = y, t.scaleResize(scaleX, scaleY, resize !== true);
|
|
4222
4231
|
}
|
|
4223
4232
|
},
|
|
4224
|
-
rotateOfWorld(t, origin, angle) {
|
|
4225
|
-
L$1.rotateOfLocal(t, getTempLocal(t, origin), angle);
|
|
4233
|
+
rotateOfWorld(t, origin, angle, transition) {
|
|
4234
|
+
L$1.rotateOfLocal(t, getTempLocal(t, origin), angle, transition);
|
|
4226
4235
|
},
|
|
4227
|
-
rotateOfLocal(t, origin, angle) {
|
|
4228
|
-
|
|
4236
|
+
rotateOfLocal(t, origin, angle, transition) {
|
|
4237
|
+
const o = t.__localMatrix;
|
|
4238
|
+
copy$7(matrix$1, o);
|
|
4229
4239
|
rotateOfOuter$2(matrix$1, origin, angle);
|
|
4230
|
-
if (t.origin || t.around)
|
|
4231
|
-
L$1.setTransform(t, matrix$1);
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
moveByMatrix(t, matrix$1);
|
|
4235
|
-
t.rotation = MathHelper.formatRotation(t.rotation + angle);
|
|
4236
|
-
}
|
|
4240
|
+
if (t.origin || t.around)
|
|
4241
|
+
L$1.setTransform(t, matrix$1, false, transition);
|
|
4242
|
+
else
|
|
4243
|
+
t.set({ x: t.x + matrix$1.e - o.e, y: t.y + matrix$1.f - o.f, rotation: MathHelper.formatRotation(t.rotation + angle) }, transition);
|
|
4237
4244
|
},
|
|
4238
|
-
skewOfWorld(t, origin, skewX, skewY, resize) {
|
|
4239
|
-
L$1.skewOfLocal(t, getTempLocal(t, origin), skewX, skewY, resize);
|
|
4245
|
+
skewOfWorld(t, origin, skewX, skewY, resize, transition) {
|
|
4246
|
+
L$1.skewOfLocal(t, getTempLocal(t, origin), skewX, skewY, resize, transition);
|
|
4240
4247
|
},
|
|
4241
|
-
skewOfLocal(t, origin, skewX, skewY = 0, resize) {
|
|
4248
|
+
skewOfLocal(t, origin, skewX, skewY = 0, resize, transition) {
|
|
4242
4249
|
copy$7(matrix$1, t.__localMatrix);
|
|
4243
4250
|
skewOfOuter(matrix$1, origin, skewX, skewY);
|
|
4244
|
-
L$1.setTransform(t, matrix$1, resize);
|
|
4251
|
+
L$1.setTransform(t, matrix$1, resize, transition);
|
|
4245
4252
|
},
|
|
4246
|
-
transformWorld(t, transform, resize) {
|
|
4253
|
+
transformWorld(t, transform, resize, transition) {
|
|
4247
4254
|
copy$7(matrix$1, t.worldTransform);
|
|
4248
4255
|
multiplyParent$2(matrix$1, transform);
|
|
4249
4256
|
if (t.parent)
|
|
4250
4257
|
divideParent(matrix$1, t.parent.worldTransform);
|
|
4251
|
-
L$1.setTransform(t, matrix$1, resize);
|
|
4258
|
+
L$1.setTransform(t, matrix$1, resize, transition);
|
|
4252
4259
|
},
|
|
4253
|
-
transform(t, transform, resize) {
|
|
4260
|
+
transform(t, transform, resize, transition) {
|
|
4254
4261
|
copy$7(matrix$1, t.localTransform);
|
|
4255
4262
|
multiplyParent$2(matrix$1, transform);
|
|
4256
|
-
L$1.setTransform(t, matrix$1, resize);
|
|
4263
|
+
L$1.setTransform(t, matrix$1, resize, transition);
|
|
4257
4264
|
},
|
|
4258
|
-
setTransform(t, transform, resize) {
|
|
4265
|
+
setTransform(t, transform, resize, transition) {
|
|
4259
4266
|
const data = t.__, originPoint = data.origin && L$1.getInnerOrigin(t, data.origin);
|
|
4260
4267
|
const layout = getLayout(transform, originPoint, data.around && L$1.getInnerOrigin(t, data.around));
|
|
4261
4268
|
if (resize) {
|
|
@@ -4270,7 +4277,7 @@ const LeafHelper = {
|
|
|
4270
4277
|
t.scaleResize(scaleX, scaleY, false);
|
|
4271
4278
|
}
|
|
4272
4279
|
else
|
|
4273
|
-
t.set(layout);
|
|
4280
|
+
t.set(layout, transition);
|
|
4274
4281
|
},
|
|
4275
4282
|
getFlipTransform(t, axis) {
|
|
4276
4283
|
const m = getMatrixData();
|
|
@@ -4307,11 +4314,6 @@ const LeafHelper = {
|
|
|
4307
4314
|
};
|
|
4308
4315
|
const L$1 = LeafHelper;
|
|
4309
4316
|
const { updateAllMatrix: updateAllMatrix$4, updateMatrix: updateMatrix$3, updateAllWorldOpacity: updateAllWorldOpacity$1, updateAllChange: updateAllChange$1 } = L$1;
|
|
4310
|
-
function moveByMatrix(t, matrix) {
|
|
4311
|
-
const { e, f } = t.__localMatrix;
|
|
4312
|
-
t.x += matrix.e - e;
|
|
4313
|
-
t.y += matrix.f - f;
|
|
4314
|
-
}
|
|
4315
4317
|
function getTempLocal(t, world) {
|
|
4316
4318
|
t.__layout.update();
|
|
4317
4319
|
return t.parent ? PointHelper.tempToInnerOf(world, t.parent.__world) : world;
|
|
@@ -5585,11 +5587,11 @@ let Leaf = class Leaf {
|
|
|
5585
5587
|
const layer = this.leafer ? this.leafer.zoomLayer : this;
|
|
5586
5588
|
return layer.getWorldPoint(page, relative, distance, change);
|
|
5587
5589
|
}
|
|
5588
|
-
setTransform(matrix, resize) {
|
|
5589
|
-
setTransform(this, matrix, resize);
|
|
5590
|
+
setTransform(matrix, resize, transition) {
|
|
5591
|
+
setTransform(this, matrix, resize, transition);
|
|
5590
5592
|
}
|
|
5591
|
-
transform(matrix, resize) {
|
|
5592
|
-
transform(this, matrix, resize);
|
|
5593
|
+
transform(matrix, resize, transition) {
|
|
5594
|
+
transform(this, matrix, resize, transition);
|
|
5593
5595
|
}
|
|
5594
5596
|
move(x, y, transition) {
|
|
5595
5597
|
moveLocal(this, x, y, transition);
|
|
@@ -5597,32 +5599,32 @@ let Leaf = class Leaf {
|
|
|
5597
5599
|
moveInner(x, y, transition) {
|
|
5598
5600
|
moveWorld(this, x, y, true, transition);
|
|
5599
5601
|
}
|
|
5600
|
-
scaleOf(origin, scaleX, scaleY, resize) {
|
|
5601
|
-
zoomOfLocal(this, getLocalOrigin(this, origin), scaleX, scaleY, resize);
|
|
5602
|
+
scaleOf(origin, scaleX, scaleY, resize, transition) {
|
|
5603
|
+
zoomOfLocal(this, getLocalOrigin(this, origin), scaleX, scaleY, resize, transition);
|
|
5602
5604
|
}
|
|
5603
|
-
rotateOf(origin, rotation) {
|
|
5604
|
-
rotateOfLocal(this, getLocalOrigin(this, origin), rotation);
|
|
5605
|
+
rotateOf(origin, rotation, transition) {
|
|
5606
|
+
rotateOfLocal(this, getLocalOrigin(this, origin), rotation, transition);
|
|
5605
5607
|
}
|
|
5606
|
-
skewOf(origin, skewX, skewY, resize) {
|
|
5607
|
-
skewOfLocal(this, getLocalOrigin(this, origin), skewX, skewY, resize);
|
|
5608
|
+
skewOf(origin, skewX, skewY, resize, transition) {
|
|
5609
|
+
skewOfLocal(this, getLocalOrigin(this, origin), skewX, skewY, resize, transition);
|
|
5608
5610
|
}
|
|
5609
|
-
transformWorld(worldTransform, resize) {
|
|
5610
|
-
transformWorld(this, worldTransform, resize);
|
|
5611
|
+
transformWorld(worldTransform, resize, transition) {
|
|
5612
|
+
transformWorld(this, worldTransform, resize, transition);
|
|
5611
5613
|
}
|
|
5612
5614
|
moveWorld(x, y, transition) {
|
|
5613
5615
|
moveWorld(this, x, y, false, transition);
|
|
5614
5616
|
}
|
|
5615
|
-
scaleOfWorld(worldOrigin, scaleX, scaleY, resize) {
|
|
5616
|
-
zoomOfWorld(this, worldOrigin, scaleX, scaleY, resize);
|
|
5617
|
+
scaleOfWorld(worldOrigin, scaleX, scaleY, resize, transition) {
|
|
5618
|
+
zoomOfWorld(this, worldOrigin, scaleX, scaleY, resize, transition);
|
|
5617
5619
|
}
|
|
5618
5620
|
rotateOfWorld(worldOrigin, rotation) {
|
|
5619
5621
|
rotateOfWorld(this, worldOrigin, rotation);
|
|
5620
5622
|
}
|
|
5621
|
-
skewOfWorld(worldOrigin, skewX, skewY, resize) {
|
|
5622
|
-
skewOfWorld(this, worldOrigin, skewX, skewY, resize);
|
|
5623
|
+
skewOfWorld(worldOrigin, skewX, skewY, resize, transition) {
|
|
5624
|
+
skewOfWorld(this, worldOrigin, skewX, skewY, resize, transition);
|
|
5623
5625
|
}
|
|
5624
|
-
flip(axis) {
|
|
5625
|
-
transform(this, getFlipTransform(this, axis));
|
|
5626
|
+
flip(axis, transition) {
|
|
5627
|
+
transform(this, getFlipTransform(this, axis), false, transition);
|
|
5626
5628
|
}
|
|
5627
5629
|
scaleResize(scaleX, scaleY = scaleX, _noResize) {
|
|
5628
5630
|
this.scaleX *= scaleX;
|
|
@@ -6010,7 +6012,7 @@ class LeafLevelList {
|
|
|
6010
6012
|
}
|
|
6011
6013
|
}
|
|
6012
6014
|
|
|
6013
|
-
const version = "1.
|
|
6015
|
+
const version = "1.4.0";
|
|
6014
6016
|
|
|
6015
6017
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6016
6018
|
get allowBackgroundColor() { return false; }
|
|
@@ -9654,10 +9656,9 @@ class InteractionBase {
|
|
|
9654
9656
|
}
|
|
9655
9657
|
}
|
|
9656
9658
|
pointerMoveReal(data) {
|
|
9657
|
-
const { dragHover, dragDistance } = this.p;
|
|
9658
9659
|
this.emit(PointerEvent.BEFORE_MOVE, data, this.defaultPath);
|
|
9659
9660
|
if (this.downData) {
|
|
9660
|
-
const canDrag = PointHelper.getDistance(this.downData, data) > dragDistance;
|
|
9661
|
+
const canDrag = PointHelper.getDistance(this.downData, data) > this.p.dragDistance;
|
|
9661
9662
|
if (canDrag) {
|
|
9662
9663
|
if (this.waitTap)
|
|
9663
9664
|
this.pointerWaitCancel();
|
|
@@ -9669,9 +9670,8 @@ class InteractionBase {
|
|
|
9669
9670
|
this.updateHoverData(data);
|
|
9670
9671
|
this.checkPath(data);
|
|
9671
9672
|
this.emit(PointerEvent.MOVE, data);
|
|
9672
|
-
|
|
9673
|
-
|
|
9674
|
-
if (this.dragger.dragging) {
|
|
9673
|
+
this.pointerHover(data);
|
|
9674
|
+
if (this.dragging) {
|
|
9675
9675
|
this.dragger.dragOverOrOut(data);
|
|
9676
9676
|
this.dragger.dragEnterOrLeave(data);
|
|
9677
9677
|
}
|
|
@@ -9752,7 +9752,8 @@ class InteractionBase {
|
|
|
9752
9752
|
this.updateCursor();
|
|
9753
9753
|
}
|
|
9754
9754
|
pointerHover(data) {
|
|
9755
|
-
if (this.canHover) {
|
|
9755
|
+
if (this.canHover && !(this.dragging && !this.p.dragHover)) {
|
|
9756
|
+
data.path || (data.path = new LeafList());
|
|
9756
9757
|
this.pointerOverOrOut(data);
|
|
9757
9758
|
this.pointerEnterOrLeave(data);
|
|
9758
9759
|
}
|
|
@@ -11504,11 +11505,11 @@ const TextMode = 2;
|
|
|
11504
11505
|
function layoutChar(drawData, style, width, _height) {
|
|
11505
11506
|
const { rows } = drawData;
|
|
11506
11507
|
const { textAlign, paraIndent, letterSpacing } = style;
|
|
11507
|
-
let charX, addWordWidth, indentWidth, mode, wordChar;
|
|
11508
|
+
let charX, addWordWidth, indentWidth, mode, wordChar, wordsLength;
|
|
11508
11509
|
rows.forEach(row => {
|
|
11509
11510
|
if (row.words) {
|
|
11510
|
-
indentWidth = paraIndent && row.paraStart ? paraIndent : 0;
|
|
11511
|
-
addWordWidth = (width && (textAlign === 'justify' || textAlign === 'both') &&
|
|
11511
|
+
indentWidth = paraIndent && row.paraStart ? paraIndent : 0, wordsLength = row.words.length;
|
|
11512
|
+
addWordWidth = (width && (textAlign === 'justify' || textAlign === 'both') && wordsLength > 1) ? (width - row.width - indentWidth) / (wordsLength - 1) : 0;
|
|
11512
11513
|
mode = (letterSpacing || row.isOverflow) ? CharMode : (addWordWidth > 0.01 ? WordMode : TextMode);
|
|
11513
11514
|
if (row.isOverflow && !letterSpacing)
|
|
11514
11515
|
row.textMode = true;
|
|
@@ -11520,7 +11521,7 @@ function layoutChar(drawData, style, width, _height) {
|
|
|
11520
11521
|
row.x += indentWidth;
|
|
11521
11522
|
charX = row.x;
|
|
11522
11523
|
row.data = [];
|
|
11523
|
-
row.words.forEach(word => {
|
|
11524
|
+
row.words.forEach((word, index) => {
|
|
11524
11525
|
if (mode === WordMode) {
|
|
11525
11526
|
wordChar = { char: '', x: charX };
|
|
11526
11527
|
charX = toWordChar(word.data, charX, wordChar);
|
|
@@ -11530,7 +11531,7 @@ function layoutChar(drawData, style, width, _height) {
|
|
|
11530
11531
|
else {
|
|
11531
11532
|
charX = toChar(word.data, charX, row.data, row.isOverflow);
|
|
11532
11533
|
}
|
|
11533
|
-
if (addWordWidth && (!row.paraEnd || textAlign === 'both')) {
|
|
11534
|
+
if (addWordWidth && (!row.paraEnd || textAlign === 'both') && (index !== wordsLength - 1)) {
|
|
11534
11535
|
charX += addWordWidth;
|
|
11535
11536
|
row.width += addWordWidth;
|
|
11536
11537
|
}
|
|
@@ -13832,3 +13833,4 @@ if (platform === 'ios') {
|
|
|
13832
13833
|
}
|
|
13833
13834
|
|
|
13834
13835
|
export { AlignHelper, Animate, AnimateEasing, AnimateEvent, AnimateList, Answer, App, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragEvent, Dragger, DropEvent, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Finder, Frame, FrameData, Group, GroupData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, Interaction, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferImage, Line, LineData, MathHelper, Matrix, MatrixHelper, MoveEvent, MyDragEvent, MyImage, MyPointerEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Robot, RobotData, RotateEvent, Run, Selector, Star, StarData, State, StringNumberMap, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, ZoomEvent, affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, doBoundsType, doStrokeType, effectType, emptyData, eraserType, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isNull, layoutProcessor, maskType, motionPathType, naturalBoundsType, opacityType, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, sortType, stateStyleType, stateType, strokeType, surfaceType, tempBounds$1 as tempBounds, tempMatrix, tempPoint$4 as tempPoint, useCanvas, useModule, version, visibleType, zoomLayerType };
|
|
13836
|
+
//# sourceMappingURL=miniapp.module.js.map
|