@visactor/vrender-kits 0.21.4 → 0.21.5-vstory.1
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/cjs/env/contributions/feishu-contribution.js +1 -2
- package/cjs/env/contributions/lynx-contribution.js +2 -1
- package/cjs/event/extension/drag.js +1 -1
- package/cjs/event/extension/gesture.js +1 -1
- package/cjs/graphic/Lottie.d.ts +49 -0
- package/cjs/graphic/Lottie.js +62 -0
- package/cjs/graphic/Lottie.js.map +1 -0
- package/cjs/graphic/constants.d.ts +1 -0
- package/cjs/graphic/constants.js +9 -0
- package/cjs/graphic/constants.js.map +1 -0
- package/cjs/graphic/interface/lottie.d.ts +10 -0
- package/cjs/graphic/interface/lottie.js +6 -0
- package/cjs/graphic/interface/lottie.js.map +1 -0
- package/cjs/index.d.ts +3 -0
- package/cjs/index.js +11 -9
- package/cjs/index.js.map +1 -1
- package/cjs/jsx/index.js +2 -1
- package/cjs/picker/canvas-picker-service.d.ts +3 -2
- package/cjs/picker/canvas-picker-service.js +7 -4
- package/cjs/picker/canvas-picker-service.js.map +1 -1
- package/cjs/picker/contributions/canvas-picker/lottie-module.d.ts +2 -0
- package/cjs/picker/contributions/canvas-picker/lottie-module.js +15 -0
- package/cjs/picker/contributions/canvas-picker/lottie-module.js.map +1 -0
- package/cjs/picker/contributions/canvas-picker/lottie-picker.d.ts +6 -0
- package/cjs/picker/contributions/canvas-picker/lottie-picker.js +30 -0
- package/cjs/picker/contributions/canvas-picker/lottie-picker.js.map +1 -0
- package/cjs/picker/contributions/constants.d.ts +1 -0
- package/cjs/picker/contributions/constants.js +7 -7
- package/cjs/picker/contributions/constants.js.map +1 -1
- package/cjs/picker/math-picker-service.d.ts +3 -2
- package/cjs/picker/math-picker-service.js +5 -3
- package/cjs/picker/math-picker-service.js.map +1 -1
- package/cjs/register/register-image.js +1 -2
- package/cjs/register/register-path.js +2 -1
- package/cjs/render/contributions/canvas/lottie-module.d.ts +2 -0
- package/cjs/render/contributions/canvas/lottie-module.js +15 -0
- package/cjs/render/contributions/canvas/lottie-module.js.map +1 -0
- package/cjs/render/contributions/canvas/lottie-render.d.ts +9 -0
- package/cjs/render/contributions/canvas/lottie-render.js +40 -0
- package/cjs/render/contributions/canvas/lottie-render.js.map +1 -0
- package/dist/index.es.js +824 -8
- package/es/env/contributions/feishu-contribution.js +1 -2
- package/es/env/contributions/lynx-contribution.js +2 -1
- package/es/event/extension/drag.js +1 -1
- package/es/event/extension/gesture.js +1 -1
- package/es/graphic/Lottie.d.ts +49 -0
- package/es/graphic/Lottie.js +53 -0
- package/es/graphic/Lottie.js.map +1 -0
- package/es/graphic/constants.d.ts +1 -0
- package/es/graphic/constants.js +3 -0
- package/es/graphic/constants.js.map +1 -0
- package/es/graphic/interface/lottie.d.ts +10 -0
- package/es/graphic/interface/lottie.js +2 -0
- package/es/graphic/interface/lottie.js.map +1 -0
- package/es/index.d.ts +3 -0
- package/es/index.js +6 -0
- package/es/index.js.map +1 -1
- package/es/jsx/index.js +2 -1
- package/es/picker/canvas-picker-service.d.ts +3 -2
- package/es/picker/canvas-picker-service.js +7 -5
- package/es/picker/canvas-picker-service.js.map +1 -1
- package/es/picker/contributions/canvas-picker/lottie-module.d.ts +2 -0
- package/es/picker/contributions/canvas-picker/lottie-module.js +13 -0
- package/es/picker/contributions/canvas-picker/lottie-module.js.map +1 -0
- package/es/picker/contributions/canvas-picker/lottie-picker.d.ts +6 -0
- package/es/picker/contributions/canvas-picker/lottie-picker.js +26 -0
- package/es/picker/contributions/canvas-picker/lottie-picker.js.map +1 -0
- package/es/picker/contributions/constants.d.ts +1 -0
- package/es/picker/contributions/constants.js +2 -0
- package/es/picker/contributions/constants.js.map +1 -1
- package/es/picker/math-picker-service.d.ts +3 -2
- package/es/picker/math-picker-service.js +5 -4
- package/es/picker/math-picker-service.js.map +1 -1
- package/es/register/register-image.js +1 -2
- package/es/register/register-path.js +2 -1
- package/es/render/contributions/canvas/lottie-module.d.ts +2 -0
- package/es/render/contributions/canvas/lottie-module.js +11 -0
- package/es/render/contributions/canvas/lottie-module.js.map +1 -0
- package/es/render/contributions/canvas/lottie-render.d.ts +9 -0
- package/es/render/contributions/canvas/lottie-render.js +36 -0
- package/es/render/contributions/canvas/lottie-render.js.map +1 -0
- package/package.json +4 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/render/contributions/canvas/lottie-render.ts"],"names":[],"mappings":";;;;;;AASA,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACvF,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAIzD,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,uBAAuB;IAA/D;;QAEL,eAAU,GAAW,kBAAkB,CAAC;IA8C1C,CAAC;IA5CC,SAAS,CACP,MAAe,EACf,OAAmB,EACnB,CAAS,EACT,CAAS,EACT,WAAyB,EACzB,MAAiC,EACjC,MAIY,EACZ,QAIY;QAEZ,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;QACzG,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IACjF,CAAC;IAED,UAAU,CACR,MAAe,EACf,OAAmB,EACnB,CAAS,EACT,CAAS,EACT,WAAyB,EACzB,MAAiC;;QAEjC,MAAM,eAAe,GAAG,MAAA,IAAI,CAAC,SAAS,mCAAI,QAAQ,CAAC,MAAM,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAC,CAAC,IAAI,CAAC;QAC/E,MAAM,EAAE,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,SAAS,CAAC;QAC5F,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,GAAG,CAAC,EAAE,OAAO,GAAG,CAAC,EAAE,eAAe,CAAC,CAAC;QAE5F,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC7B,IAAI,MAAM,EAAE;YAEV,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;YAC3D,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;YACxB,OAAO,CAAC,YAAY,IAAI,OAAO,CAAC,YAAY,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5F,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC;SAC7B;QACD,OAAO,CAAC,IAAI,EAAE,CAAC;IACjB,CAAC;CACF,CAAA;AAhDY,yBAAyB;IADrC,UAAU,EAAE;GACA,yBAAyB,CAgDrC;SAhDY,yBAAyB","file":"lottie-render.js","sourcesContent":["import type {\n IContext2d,\n IDrawContext,\n IGraphicAttribute,\n IGraphicRender,\n IGraphicRenderDrawParams,\n IMarkAttribute,\n IThemeAttribute\n} from '@visactor/vrender-core';\nimport { DefaultCanvasRectRender, getTheme, injectable } from '@visactor/vrender-core';\nimport { LOTTIE_NUMBER_TYPE } from '../../../graphic/constants';\nimport type { ILottie } from '../../../graphic/interface/lottie';\n\n@injectable()\nexport class DefaultCanvasLottieRender extends DefaultCanvasRectRender implements IGraphicRender {\n type: 'glyph';\n numberType: number = LOTTIE_NUMBER_TYPE;\n\n drawShape(\n lottie: ILottie,\n context: IContext2d,\n x: number,\n y: number,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ): void {\n const _fillCb = fillCb || (() => this._drawShape.call(this, lottie, context, x, y, drawContext, params));\n super.drawShape(lottie, context, x, y, drawContext, params, _fillCb, strokeCb);\n }\n\n _drawShape(\n lottie: ILottie,\n context: IContext2d,\n x: number,\n y: number,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams\n ): void {\n const lottieAttribute = this.tempTheme ?? getTheme(lottie, params?.theme).rect;\n const { x: originX = lottieAttribute.x, y: originY = lottieAttribute.y } = lottie.attribute;\n context.setCommonStyle(lottie, lottie.attribute, originX - x, originY - y, lottieAttribute);\n // 设置pattern,绘制lottie\n const canvas = lottie.canvas;\n if (canvas) {\n // const _ctx = canvas.getContext('2d');\n const pattern = context.createPattern(canvas, 'no-repeat');\n const dpr = context.dpr;\n pattern.setTransform && pattern.setTransform(new DOMMatrix([1 / dpr, 0, 0, 1 / dpr, x, y]));\n context.fillStyle = pattern;\n }\n context.fill();\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visactor/vrender-kits",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.5-vstory.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "cjs/index.js",
|
|
@@ -13,9 +13,10 @@
|
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@visactor/vutils": "~0.19.2",
|
|
16
|
-
"@visactor/vrender-core": "0.21.
|
|
16
|
+
"@visactor/vrender-core": "0.21.5-vstory.1",
|
|
17
17
|
"@resvg/resvg-js": "2.4.1",
|
|
18
|
-
"roughjs": "4.5.2"
|
|
18
|
+
"roughjs": "4.5.2",
|
|
19
|
+
"lottie-web": "^5.12.2"
|
|
19
20
|
},
|
|
20
21
|
"devDependencies": {
|
|
21
22
|
"@rushstack/eslint-patch": "~1.1.4",
|