@visactor/vrender-kits 1.1.0-alpha.8 → 1.1.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/cjs/canvas/contributions/harmony/canvas.js +5 -1
- package/cjs/canvas/contributions/harmony/canvas.js.map +1 -1
- package/cjs/env/contributions/browser-contribution.js +1 -1
- package/cjs/env/contributions/canvas-wrap.js +1 -1
- package/cjs/env/contributions/feishu-contribution.d.ts +15 -8
- package/cjs/env/contributions/feishu-contribution.js +26 -14
- package/cjs/env/contributions/feishu-contribution.js.map +1 -1
- package/cjs/env/contributions/harmony-contribution.d.ts +26 -7
- package/cjs/env/contributions/harmony-contribution.js +129 -21
- package/cjs/env/contributions/harmony-contribution.js.map +1 -1
- package/cjs/env/contributions/lynx-contribution.d.ts +35 -10
- package/cjs/env/contributions/lynx-contribution.js +128 -31
- package/cjs/env/contributions/lynx-contribution.js.map +1 -1
- package/cjs/env/contributions/miniapp-canvas.d.ts +18 -0
- package/cjs/env/contributions/miniapp-canvas.js +46 -0
- package/cjs/env/contributions/miniapp-canvas.js.map +1 -0
- package/cjs/env/contributions/node-contribution.d.ts +2 -2
- package/cjs/env/contributions/node-contribution.js +8 -3
- package/cjs/env/contributions/node-contribution.js.map +1 -1
- package/cjs/env/contributions/taro-contribution.d.ts +6 -10
- package/cjs/env/contributions/taro-contribution.js +17 -18
- package/cjs/env/contributions/taro-contribution.js.map +1 -1
- package/cjs/env/contributions/tt-contribution.d.ts +14 -8
- package/cjs/env/contributions/tt-contribution.js +26 -49
- package/cjs/env/contributions/tt-contribution.js.map +1 -1
- package/cjs/env/contributions/wx-contribution.d.ts +15 -11
- package/cjs/env/contributions/wx-contribution.js +30 -54
- package/cjs/env/contributions/wx-contribution.js.map +1 -1
- package/cjs/env/feishu.js +2 -3
- package/cjs/env/feishu.js.map +1 -1
- package/cjs/env/harmony.js +2 -3
- package/cjs/env/harmony.js.map +1 -1
- package/cjs/env/lynx.js +2 -3
- package/cjs/env/lynx.js.map +1 -1
- package/cjs/env/taro.js +2 -3
- package/cjs/env/taro.js.map +1 -1
- package/cjs/env/tt.js +2 -3
- package/cjs/env/tt.js.map +1 -1
- package/cjs/env/wx.js +4 -4
- package/cjs/env/wx.js.map +1 -1
- package/cjs/event/extension/drag.js +1 -1
- package/cjs/graphic/Lottie.js +1 -2
- package/cjs/graphic/constants.js +2 -1
- package/cjs/graphic/constants.js.map +1 -1
- package/cjs/index-node.d.ts +1 -1
- package/cjs/index-node.js +36 -1
- package/cjs/index-node.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +36 -1
- package/cjs/index.js.map +1 -1
- package/cjs/installers/app.d.ts +10 -3
- package/cjs/installers/app.js +90 -12
- package/cjs/installers/app.js.map +1 -1
- package/cjs/installers/browser-lite.d.ts +3 -0
- package/cjs/installers/browser-lite.js +63 -0
- package/cjs/installers/browser-lite.js.map +1 -0
- package/cjs/installers/browser.d.ts +3 -0
- package/cjs/installers/browser.js +75 -0
- package/cjs/installers/browser.js.map +1 -0
- package/cjs/installers/graphics-lite.d.ts +2 -0
- package/cjs/installers/graphics-lite.js +54 -0
- package/cjs/installers/graphics-lite.js.map +1 -0
- package/cjs/installers/graphics.d.ts +2 -0
- package/cjs/installers/graphics.js +81 -0
- package/cjs/installers/graphics.js.map +1 -0
- package/cjs/jsx/graphicType.d.ts +4 -4
- package/cjs/jsx/graphicType.js.map +1 -1
- package/cjs/jsx/jsx-classic.js +3 -3
- package/cjs/jsx/jsx-classic.js.map +1 -1
- package/cjs/react-tree.js +3 -3
- package/cjs/react-tree.js.map +1 -1
- package/cjs/register/env.js +2 -3
- package/cjs/register/env.js.map +1 -1
- package/cjs/register/register-arc.js +3 -3
- package/cjs/register/register-arc.js.map +1 -1
- package/cjs/register/register-arc3d.js +6 -5
- package/cjs/register/register-arc3d.js.map +1 -1
- package/cjs/register/register-area.js +3 -3
- package/cjs/register/register-area.js.map +1 -1
- package/cjs/register/register-circle.js +3 -3
- package/cjs/register/register-circle.js.map +1 -1
- package/cjs/register/register-glyph.js +3 -3
- package/cjs/register/register-glyph.js.map +1 -1
- package/cjs/register/register-group.js +2 -2
- package/cjs/register/register-group.js.map +1 -1
- package/cjs/register/register-image.js +3 -3
- package/cjs/register/register-image.js.map +1 -1
- package/cjs/register/register-line.js +3 -3
- package/cjs/register/register-line.js.map +1 -1
- package/cjs/register/register-path.js +3 -3
- package/cjs/register/register-path.js.map +1 -1
- package/cjs/register/register-polygon.js +3 -3
- package/cjs/register/register-polygon.js.map +1 -1
- package/cjs/register/register-pyramid3d.js +4 -4
- package/cjs/register/register-pyramid3d.js.map +1 -1
- package/cjs/register/register-rect.js +3 -3
- package/cjs/register/register-rect.js.map +1 -1
- package/cjs/register/register-rect3d.js +3 -3
- package/cjs/register/register-rect3d.js.map +1 -1
- package/cjs/register/register-richtext.js +3 -3
- package/cjs/register/register-richtext.js.map +1 -1
- package/cjs/register/register-shadowRoot.js +3 -4
- package/cjs/register/register-shadowRoot.js.map +1 -1
- package/cjs/register/register-star.js +3 -3
- package/cjs/register/register-star.js.map +1 -1
- package/cjs/register/register-symbol.js +5 -4
- package/cjs/register/register-symbol.js.map +1 -1
- package/cjs/register/register-text.js +3 -3
- package/cjs/register/register-text.js.map +1 -1
- package/cjs/register/register-wraptext.js +2 -2
- package/cjs/register/register-wraptext.js.map +1 -1
- package/cjs/window/contributions/feishu-contribution.js +10 -7
- package/cjs/window/contributions/feishu-contribution.js.map +1 -1
- package/cjs/window/contributions/harmony-contribution.js +74 -17
- package/cjs/window/contributions/harmony-contribution.js.map +1 -1
- package/cjs/window/contributions/lynx-contribution.d.ts +1 -2
- package/cjs/window/contributions/lynx-contribution.js +67 -15
- package/cjs/window/contributions/lynx-contribution.js.map +1 -1
- package/cjs/window/contributions/taro-contribution.js +10 -7
- package/cjs/window/contributions/taro-contribution.js.map +1 -1
- package/cjs/window/contributions/tt-contribution.js +10 -7
- package/cjs/window/contributions/tt-contribution.js.map +1 -1
- package/cjs/window/contributions/wx-contribution.d.ts +1 -2
- package/cjs/window/contributions/wx-contribution.js +33 -16
- package/cjs/window/contributions/wx-contribution.js.map +1 -1
- package/dist/index.es.js +18523 -4923
- package/es/canvas/contributions/harmony/canvas.js +5 -1
- package/es/canvas/contributions/harmony/canvas.js.map +1 -1
- package/es/env/contributions/browser-contribution.js +1 -1
- package/es/env/contributions/canvas-wrap.js +1 -1
- package/es/env/contributions/feishu-contribution.d.ts +15 -8
- package/es/env/contributions/feishu-contribution.js +27 -14
- package/es/env/contributions/feishu-contribution.js.map +1 -1
- package/es/env/contributions/harmony-contribution.d.ts +26 -7
- package/es/env/contributions/harmony-contribution.js +132 -22
- package/es/env/contributions/harmony-contribution.js.map +1 -1
- package/es/env/contributions/lynx-contribution.d.ts +35 -10
- package/es/env/contributions/lynx-contribution.js +128 -29
- package/es/env/contributions/lynx-contribution.js.map +1 -1
- package/es/env/contributions/miniapp-canvas.d.ts +18 -0
- package/es/env/contributions/miniapp-canvas.js +37 -0
- package/es/env/contributions/miniapp-canvas.js.map +1 -0
- package/es/env/contributions/node-contribution.d.ts +2 -2
- package/es/env/contributions/node-contribution.js +8 -3
- package/es/env/contributions/node-contribution.js.map +1 -1
- package/es/env/contributions/taro-contribution.d.ts +6 -10
- package/es/env/contributions/taro-contribution.js +17 -17
- package/es/env/contributions/taro-contribution.js.map +1 -1
- package/es/env/contributions/tt-contribution.d.ts +14 -8
- package/es/env/contributions/tt-contribution.js +28 -48
- package/es/env/contributions/tt-contribution.js.map +1 -1
- package/es/env/contributions/wx-contribution.d.ts +15 -11
- package/es/env/contributions/wx-contribution.js +32 -53
- package/es/env/contributions/wx-contribution.js.map +1 -1
- package/es/env/feishu.js +2 -3
- package/es/env/feishu.js.map +1 -1
- package/es/env/harmony.js +2 -3
- package/es/env/harmony.js.map +1 -1
- package/es/env/lynx.js +2 -3
- package/es/env/lynx.js.map +1 -1
- package/es/env/taro.js +2 -3
- package/es/env/taro.js.map +1 -1
- package/es/env/tt.js +2 -3
- package/es/env/tt.js.map +1 -1
- package/es/env/wx.js +4 -4
- package/es/env/wx.js.map +1 -1
- package/es/event/extension/drag.js +1 -1
- package/es/graphic/Lottie.js +1 -2
- package/es/graphic/constants.js +3 -3
- package/es/graphic/constants.js.map +1 -1
- package/es/index-node.d.ts +1 -1
- package/es/index-node.js +1 -1
- package/es/index-node.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/installers/app.d.ts +10 -3
- package/es/installers/app.js +120 -8
- package/es/installers/app.js.map +1 -1
- package/es/installers/browser-lite.d.ts +3 -0
- package/es/installers/browser-lite.js +86 -0
- package/es/installers/browser-lite.js.map +1 -0
- package/es/installers/browser.d.ts +3 -0
- package/es/installers/browser.js +115 -0
- package/es/installers/browser.js.map +1 -0
- package/es/installers/graphics-lite.d.ts +2 -0
- package/es/installers/graphics-lite.js +52 -0
- package/es/installers/graphics-lite.js.map +1 -0
- package/es/installers/graphics.d.ts +2 -0
- package/es/installers/graphics.js +79 -0
- package/es/installers/graphics.js.map +1 -0
- package/es/jsx/graphicType.d.ts +4 -4
- package/es/jsx/graphicType.js.map +1 -1
- package/es/jsx/jsx-classic.js +3 -3
- package/es/jsx/jsx-classic.js.map +1 -1
- package/es/react-tree.js +3 -3
- package/es/react-tree.js.map +1 -1
- package/es/register/env.js +2 -3
- package/es/register/env.js.map +1 -1
- package/es/register/register-arc.js +5 -1
- package/es/register/register-arc.js.map +1 -1
- package/es/register/register-arc3d.js +9 -2
- package/es/register/register-arc3d.js.map +1 -1
- package/es/register/register-area.js +5 -1
- package/es/register/register-area.js.map +1 -1
- package/es/register/register-circle.js +5 -1
- package/es/register/register-circle.js.map +1 -1
- package/es/register/register-glyph.js +5 -1
- package/es/register/register-glyph.js.map +1 -1
- package/es/register/register-group.js +1 -1
- package/es/register/register-group.js.map +1 -1
- package/es/register/register-image.js +5 -1
- package/es/register/register-image.js.map +1 -1
- package/es/register/register-line.js +5 -1
- package/es/register/register-line.js.map +1 -1
- package/es/register/register-path.js +5 -1
- package/es/register/register-path.js.map +1 -1
- package/es/register/register-polygon.js +5 -1
- package/es/register/register-polygon.js.map +1 -1
- package/es/register/register-pyramid3d.js +7 -1
- package/es/register/register-pyramid3d.js.map +1 -1
- package/es/register/register-rect.js +5 -1
- package/es/register/register-rect.js.map +1 -1
- package/es/register/register-rect3d.js +5 -1
- package/es/register/register-rect3d.js.map +1 -1
- package/es/register/register-richtext.js +5 -1
- package/es/register/register-richtext.js.map +1 -1
- package/es/register/register-shadowRoot.js +2 -3
- package/es/register/register-shadowRoot.js.map +1 -1
- package/es/register/register-star.js +5 -1
- package/es/register/register-star.js.map +1 -1
- package/es/register/register-symbol.js +7 -2
- package/es/register/register-symbol.js.map +1 -1
- package/es/register/register-text.js +5 -1
- package/es/register/register-text.js.map +1 -1
- package/es/register/register-wraptext.js +1 -1
- package/es/register/register-wraptext.js.map +1 -1
- package/es/window/contributions/feishu-contribution.js +9 -5
- package/es/window/contributions/feishu-contribution.js.map +1 -1
- package/es/window/contributions/harmony-contribution.js +73 -15
- package/es/window/contributions/harmony-contribution.js.map +1 -1
- package/es/window/contributions/lynx-contribution.d.ts +1 -2
- package/es/window/contributions/lynx-contribution.js +65 -14
- package/es/window/contributions/lynx-contribution.js.map +1 -1
- package/es/window/contributions/taro-contribution.js +9 -5
- package/es/window/contributions/taro-contribution.js.map +1 -1
- package/es/window/contributions/tt-contribution.js +9 -5
- package/es/window/contributions/tt-contribution.js.map +1 -1
- package/es/window/contributions/wx-contribution.d.ts +1 -2
- package/es/window/contributions/wx-contribution.js +31 -15
- package/es/window/contributions/wx-contribution.js.map +1 -1
- package/package.json +240 -4
- package/cjs/env/contributions/module.d.ts +0 -1
- package/cjs/env/contributions/module.js +0 -3
- package/cjs/env/contributions/module.js.map +0 -1
- package/cjs/node-bind.d.ts +0 -1
- package/cjs/node-bind.js +0 -1
- package/cjs/node-bind.js.map +0 -1
- package/cjs/picker/index.d.ts +0 -1
- package/cjs/picker/index.js +0 -1
- package/cjs/picker/index.js.map +0 -1
- package/cjs/render/contributions/render-module.d.ts +0 -1
- package/cjs/render/contributions/render-module.js +0 -3
- package/cjs/render/contributions/render-module.js.map +0 -1
- package/cjs/tools/dynamicTexture.d.ts +0 -1
- package/cjs/tools/dynamicTexture.js +0 -1
- package/cjs/tools/dynamicTexture.js.map +0 -1
- package/cjs/window/contributions/native-contribution.d.ts +0 -1
- package/cjs/window/contributions/native-contribution.js +0 -3
- package/cjs/window/contributions/native-contribution.js.map +0 -1
- package/es/env/contributions/module.d.ts +0 -1
- package/es/env/contributions/module.js +0 -3
- package/es/env/contributions/module.js.map +0 -1
- package/es/node-bind.d.ts +0 -1
- package/es/node-bind.js +0 -1
- package/es/node-bind.js.map +0 -1
- package/es/picker/index.d.ts +0 -1
- package/es/picker/index.js +0 -1
- package/es/picker/index.js.map +0 -1
- package/es/render/contributions/render-module.d.ts +0 -1
- package/es/render/contributions/render-module.js +0 -3
- package/es/render/contributions/render-module.js.map +0 -1
- package/es/tools/dynamicTexture.d.ts +0 -1
- package/es/tools/dynamicTexture.js +0 -1
- package/es/tools/dynamicTexture.js.map +0 -1
- package/es/window/contributions/native-contribution.d.ts +0 -1
- package/es/window/contributions/native-contribution.js +0 -3
- package/es/window/contributions/native-contribution.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/window/contributions/wx-contribution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,6BAA6B,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAW7G,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,mBAAmB;IAAzB;QAyBE,UAAK,GAAuE,EAAE,CAAC;IACjF,CAAC;IAzBC,gBAAgB,CAAC,IAAY,EAAE,IAAwC;QACrE,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI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C,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACvF,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;QAC9D,IAAI,KAAK,EAAE;YACT,OAAO,CAAC,SAAS,GAAG,KAAK,CAAC;YAC1B,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;SAC9D;QACD,OAAO,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;IAClC,CAAC;;AA1LM,+BAAG,GAAY,IAAI,CAAC;AA6L7B,IAAI,yBAAyB,GAAG,KAAK,CAAC;AAEtC,MAAM,UAAU,wBAAwB,CAAC,SAAc;IACrD,IAAI,yBAAyB,EAAE;QAC7B,OAAO;KACR;IACD,yBAAyB,GAAG,IAAI,CAAC;IACjC,SAAS,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC,MAAM,EAAE,CAAC;IACrD,SAAS;SACN,IAAI,CAAC,yBAAyB,CAAC;SAC/B,SAAS,CAAC,2BAA2B,CAAC;SACtC,eAAe,CAAC,2BAA2B,CAAC,GAAG,CAAC,CAAC;AACtD,CAAC","file":"wx-contribution.js","sourcesContent":["import { Generator, BaseWindowHandlerContribution, WindowHandlerContribution } from '@visactor/vrender-core';\nimport type {\n EnvType,\n IGlobal,\n IContext2d,\n ICanvas,\n IDomRectLike,\n IWindowHandlerContribution,\n IWindowParams\n} from '@visactor/vrender-core';\nimport type { IBoundsLike } from '@visactor/vutils';\nimport { WxCanvas } from '../../canvas/contributions/wx';\nimport { application } from '@visactor/vrender-core';\n\nclass MiniAppEventManager {\n addEventListener(type: string, func: EventListenerOrEventListenerObject) {\n if (!type || !func) {\n return;\n }\n this.cache[type] = this.cache[type] || {\n listener: []\n };\n this.cache[type].listener.push(func);\n }\n removeEventListener(type: string, func: EventListenerOrEventListenerObject) {\n if (!type || !func) {\n return;\n }\n if (!this.cache[type]) {\n return;\n }\n const index = this.cache[type].listener.findIndex((f: EventListenerOrEventListenerObject) => f === func);\n if (index >= 0) {\n this.cache[type].listener.splice(index, 1);\n }\n }\n cleanEvent() {\n this.cache = {};\n }\n cache: Record<string, { listener: EventListenerOrEventListenerObject[] }> = {};\n}\n\nexport class WxWindowHandlerContribution extends BaseWindowHandlerContribution implements IWindowHandlerContribution {\n static env: EnvType = 'wx';\n type: EnvType = 'wx';\n\n protected eventManager = new MiniAppEventManager();\n\n canvas: ICanvas;\n get container(): HTMLElement | null {\n return null;\n }\n\n constructor(private readonly global: IGlobal = application.global) {\n super();\n }\n\n getTitle(): string {\n return this.canvas.id.toString();\n }\n\n getWH(): { width: number; height: number } {\n return {\n width: this.canvas.width / (this.canvas.dpr || 1),\n height: this.canvas.height / (this.canvas.dpr || 1)\n };\n }\n\n getXY(): { x: number; y: number } {\n return { x: 0, y: 0 };\n }\n\n createWindow(params: IWindowParams): void {\n // 如果没有传入canvas,那么就创建一个canvas\n if (!params.canvas) {\n this.createWindowByConfig(params);\n } else {\n this.createWindowByCanvas(params);\n }\n }\n private createWindowByConfig(params: IWindowParams) {\n // 创建canvas\n const nativeCanvas = this.global.createCanvas({\n width: params.width,\n height: params.height\n });\n\n // 绑定\n const options = {\n width: params.width,\n height: params.height,\n dpr: params.dpr,\n nativeCanvas,\n id: Generator.GenAutoIncrementId().toString(),\n canvasControled: false\n };\n this.canvas = new WxCanvas(options);\n }\n private createWindowByCanvas(params: IWindowParams) {\n // 获取canvas\n let canvas: HTMLCanvasElement | null;\n if (typeof params.canvas === 'string') {\n canvas = this.global.getElementById(params.canvas) as HTMLCanvasElement | null;\n if (!canvas) {\n throw new Error('canvasId 参数不正确,请确认canvas存在并插入dom');\n }\n } else {\n canvas = params!.canvas as HTMLCanvasElement | null;\n }\n\n // 如果没有传入wh,或者是不受控制的canvas,那就用canvas的原始wh\n let width = params.width;\n let height = params.height;\n if (width == null || height == null || !params.canvasControled) {\n const data = canvas.getBoundingClientRect();\n width = data.width;\n height = data.height;\n }\n // 如果没有dpr,就使用canvas的原始dpr\n let dpr = params.dpr;\n if (dpr == null) {\n dpr = canvas.width / width;\n }\n this.canvas = new WxCanvas({\n width: width,\n height: height,\n dpr: dpr,\n nativeCanvas: canvas,\n canvasControled: params.canvasControled\n });\n }\n releaseWindow(): void {\n return;\n }\n resizeWindow(width: number, height: number): void {\n return;\n }\n setDpr(dpr: number): void {\n this.canvas.dpr = dpr;\n }\n\n getContext(): IContext2d {\n return this.canvas.getContext();\n }\n getNativeHandler(): ICanvas {\n return this.canvas;\n }\n getDpr(): number {\n return this.canvas.dpr;\n }\n\n addEventListener<K extends keyof DocumentEventMap>(\n type: K,\n listener: (this: Document, ev: DocumentEventMap[K]) => any,\n options?: boolean | AddEventListenerOptions\n ): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject): void {\n this.eventManager.addEventListener(type, listener);\n }\n removeEventListener<K extends keyof DocumentEventMap>(\n type: K,\n listener: (this: Document, ev: DocumentEventMap[K]) => any,\n options?: boolean | EventListenerOptions\n ): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject): void {\n this.eventManager.removeEventListener(type, listener);\n }\n dispatchEvent(event: any): boolean {\n const { type } = event;\n if (!this.eventManager.cache[type]) {\n return false;\n }\n\n // hack for offsetX offsetY\n if (event.changedTouches && event.changedTouches[0]) {\n event.offsetX = event.changedTouches[0].x;\n event.changedTouches[0].offsetX = event.changedTouches[0].x ?? event.changedTouches[0].pageX;\n event.changedTouches[0].clientX = event.changedTouches[0].x ?? event.changedTouches[0].pageX;\n event.offsetY = event.changedTouches[0].y;\n event.changedTouches[0].offsetY = event.changedTouches[0].y ?? event.changedTouches[0].pageY;\n event.changedTouches[0].clientY = event.changedTouches[0].y ?? event.changedTouches[0].pageY;\n }\n event.preventDefault = () => {\n return;\n };\n event.stopPropagation = () => {\n return;\n };\n if (this.eventManager.cache[type].listener) {\n this.eventManager.cache[type].listener.forEach((f: EventListener) => {\n f(event);\n });\n }\n return true;\n }\n\n getStyle(): CSSStyleDeclaration | Record<string, any> {\n return {};\n }\n setStyle(style: CSSStyleDeclaration | Record<string, any>) {\n return;\n }\n\n getBoundingClientRect(): IDomRectLike {\n const wh = this.getWH();\n return {\n x: 0,\n y: 0,\n width: wh.width,\n height: wh.height,\n left: 0,\n top: 0,\n right: 0,\n bottom: 0\n };\n }\n\n clearViewBox(color?: string): void {\n const vb = this.viewBox;\n const context = this.getContext();\n const dpr = this.getDpr();\n context.nativeContext.save();\n (context.nativeContext as CanvasRenderingContext2D).setTransform(dpr, 0, 0, dpr, 0, 0);\n context.clearRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1);\n if (color) {\n context.fillStyle = color;\n context.fillRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1);\n }\n context.nativeContext.restore();\n }\n}\n\nlet wxWindowContributionBound = false;\n\nexport function bindWxWindowContribution(container: any) {\n if (wxWindowContributionBound) {\n return;\n }\n wxWindowContributionBound = true;\n container.bind(WxWindowHandlerContribution).toSelf();\n container\n .bind(WindowHandlerContribution)\n .toService(WxWindowHandlerContribution)\n .whenTargetNamed(WxWindowHandlerContribution.env);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/window/contributions/wx-contribution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,6BAA6B,EAC7B,yBAAyB,EACzB,WAAW,EAQZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAEzD,MAAM,mBAAmB;IAAzB;QAyBE,UAAK,GAAuE,EAAE,CAAC;IACjF,CAAC;IAzBC,gBAA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,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;SAC9D;QACD,OAAO,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;IAClC,CAAC;;AAtMM,+BAAG,GAAY,IAAI,CAAC;AAyM7B,MAAM,UAAU,wBAAwB,CAAC,SAAc;;IACrD,IAAI,CAAC,CAAA,MAAA,SAAS,CAAC,OAAO,0DAAG,2BAA2B,CAAC,CAAA,EAAE;QACrD,SAAS,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC,MAAM,EAAE,CAAC;KACtD;IACD,IAAI,CAAC,CAAA,MAAA,SAAS,CAAC,QAAQ,0DAAG,yBAAyB,EAAE,2BAA2B,CAAC,GAAG,CAAC,CAAA,EAAE;QACrF,SAAS;aACN,IAAI,CAAC,yBAAyB,CAAC;aAC/B,SAAS,CAAC,2BAA2B,CAAC;aACtC,eAAe,CAAC,2BAA2B,CAAC,GAAG,CAAC,CAAC;KACrD;AACH,CAAC","file":"wx-contribution.js","sourcesContent":["import {\n Generator,\n BaseWindowHandlerContribution,\n WindowHandlerContribution,\n application,\n type EnvType,\n type IGlobal,\n type IContext2d,\n type ICanvas,\n type IDomRectLike,\n type IWindowHandlerContribution,\n type IWindowParams\n} from '@visactor/vrender-core';\nimport { WxCanvas } from '../../canvas/contributions/wx';\n\nclass MiniAppEventManager {\n addEventListener(type: string, func: EventListenerOrEventListenerObject) {\n if (!type || !func) {\n return;\n }\n this.cache[type] = this.cache[type] || {\n listener: []\n };\n this.cache[type].listener.push(func);\n }\n removeEventListener(type: string, func: EventListenerOrEventListenerObject) {\n if (!type || !func) {\n return;\n }\n if (!this.cache[type]) {\n return;\n }\n const index = this.cache[type].listener.findIndex((f: EventListenerOrEventListenerObject) => f === func);\n if (index >= 0) {\n this.cache[type].listener.splice(index, 1);\n }\n }\n cleanEvent() {\n this.cache = {};\n }\n cache: Record<string, { listener: EventListenerOrEventListenerObject[] }> = {};\n}\n\nfunction setMiniAppEventTarget(event: any, key: 'target' | 'currentTarget', value: any) {\n if (!event || !value) {\n return;\n }\n\n try {\n event[key] = value;\n } catch {\n Object.defineProperty(event, key, {\n configurable: true,\n value\n });\n }\n}\n\nexport class WxWindowHandlerContribution extends BaseWindowHandlerContribution implements IWindowHandlerContribution {\n static env: EnvType = 'wx';\n type: EnvType = 'wx';\n\n protected eventManager = new MiniAppEventManager();\n\n canvas: ICanvas;\n get container(): HTMLElement | null {\n return null;\n }\n\n constructor(private readonly global: IGlobal = application.global) {\n super();\n }\n\n getTitle(): string {\n return this.canvas.id.toString();\n }\n\n getWH(): { width: number; height: number } {\n return {\n width: this.canvas.width / (this.canvas.dpr || 1),\n height: this.canvas.height / (this.canvas.dpr || 1)\n };\n }\n\n getXY(): { x: number; y: number } {\n return { x: 0, y: 0 };\n }\n\n createWindow(params: IWindowParams): void {\n // 如果没有传入canvas,那么就创建一个canvas\n if (!params.canvas) {\n this.createWindowByConfig(params);\n } else {\n this.createWindowByCanvas(params);\n }\n }\n private createWindowByConfig(params: IWindowParams) {\n // 创建canvas\n const nativeCanvas = this.global.createCanvas({\n width: params.width,\n height: params.height\n });\n\n // 绑定\n const options = {\n width: params.width,\n height: params.height,\n dpr: params.dpr,\n nativeCanvas,\n id: Generator.GenAutoIncrementId().toString(),\n canvasControled: false\n };\n this.canvas = new WxCanvas(options);\n }\n private createWindowByCanvas(params: IWindowParams) {\n // 获取canvas\n let canvas: HTMLCanvasElement | null;\n if (typeof params.canvas === 'string') {\n canvas = this.global.getElementById(params.canvas) as HTMLCanvasElement | null;\n if (!canvas) {\n canvas = this.global.createCanvas({\n id: params.canvas,\n width: params.width,\n height: params.height,\n dpr: params.dpr\n }) as HTMLCanvasElement | null;\n }\n if (!canvas) {\n throw new Error('canvasId 参数不正确,请确认canvas存在并插入dom');\n }\n } else {\n canvas = params.canvas as HTMLCanvasElement | null;\n }\n\n // 如果没有传入wh,或者是不受控制的canvas,那就用canvas的原始wh\n let width = params.width;\n let height = params.height;\n if (width == null || height == null || !params.canvasControled) {\n const data = canvas.getBoundingClientRect();\n width = data.width;\n height = data.height;\n }\n // 如果没有dpr,就使用canvas的原始dpr\n let dpr = params.dpr;\n if (dpr == null) {\n dpr = canvas.width / width;\n }\n this.canvas = new WxCanvas({\n width: width,\n height: height,\n dpr: dpr,\n nativeCanvas: canvas,\n canvasControled: params.canvasControled\n });\n }\n releaseWindow(): void {\n return;\n }\n resizeWindow(width: number, height: number): void {\n return;\n }\n setDpr(dpr: number): void {\n this.canvas.dpr = dpr;\n }\n\n getContext(): IContext2d {\n return this.canvas.getContext();\n }\n getNativeHandler(): ICanvas {\n return this.canvas;\n }\n getDpr(): number {\n return this.canvas.dpr;\n }\n\n addEventListener<K extends keyof DocumentEventMap>(\n type: K,\n listener: (this: Document, ev: DocumentEventMap[K]) => any,\n options?: boolean | AddEventListenerOptions\n ): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject): void {\n this.eventManager.addEventListener(type, listener);\n }\n removeEventListener<K extends keyof DocumentEventMap>(\n type: K,\n listener: (this: Document, ev: DocumentEventMap[K]) => any,\n options?: boolean | EventListenerOptions\n ): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject): void {\n this.eventManager.removeEventListener(type, listener);\n }\n dispatchEvent(event: any): boolean {\n const { type } = event;\n if (!this.eventManager.cache[type]) {\n return false;\n }\n\n const nativeCanvas = this.canvas?.nativeCanvas;\n setMiniAppEventTarget(event, 'target', nativeCanvas);\n setMiniAppEventTarget(event, 'currentTarget', nativeCanvas);\n\n // hack for offsetX offsetY\n if (event.changedTouches && event.changedTouches[0]) {\n event.offsetX = event.changedTouches[0].x;\n event.changedTouches[0].offsetX = event.changedTouches[0].x ?? event.changedTouches[0].pageX;\n event.changedTouches[0].clientX = event.changedTouches[0].x ?? event.changedTouches[0].pageX;\n event.offsetY = event.changedTouches[0].y;\n event.changedTouches[0].offsetY = event.changedTouches[0].y ?? event.changedTouches[0].pageY;\n event.changedTouches[0].clientY = event.changedTouches[0].y ?? event.changedTouches[0].pageY;\n }\n event.preventDefault = () => {\n return;\n };\n event.stopPropagation = () => {\n return;\n };\n if (this.eventManager.cache[type].listener) {\n this.eventManager.cache[type].listener.forEach((f: EventListener) => {\n f(event);\n });\n }\n return true;\n }\n\n getStyle(): CSSStyleDeclaration | Record<string, any> {\n return {};\n }\n setStyle(style: CSSStyleDeclaration | Record<string, any>) {\n return;\n }\n\n getBoundingClientRect(): IDomRectLike {\n const wh = this.getWH();\n return {\n x: 0,\n y: 0,\n width: wh.width,\n height: wh.height,\n left: 0,\n top: 0,\n right: 0,\n bottom: 0\n };\n }\n\n clearViewBox(color?: string): void {\n const vb = this.viewBox;\n const context = this.getContext();\n const dpr = this.getDpr();\n context.nativeContext.save();\n (context.nativeContext as CanvasRenderingContext2D).setTransform(dpr, 0, 0, dpr, 0, 0);\n context.clearRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1);\n if (color) {\n context.fillStyle = color;\n context.fillRect(vb.x1, vb.y1, vb.x2 - vb.x1, vb.y2 - vb.y1);\n }\n context.nativeContext.restore();\n }\n}\n\nexport function bindWxWindowContribution(container: any) {\n if (!container.isBound?.(WxWindowHandlerContribution)) {\n container.bind(WxWindowHandlerContribution).toSelf();\n }\n if (!container.getNamed?.(WindowHandlerContribution, WxWindowHandlerContribution.env)) {\n container\n .bind(WindowHandlerContribution)\n .toService(WxWindowHandlerContribution)\n .whenTargetNamed(WxWindowHandlerContribution.env);\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,11 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visactor/vrender-kits",
|
|
3
|
-
"version": "1.1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "cjs/index-node.js",
|
|
7
7
|
"module": "es/index.js",
|
|
8
8
|
"types": "es/index.d.ts",
|
|
9
|
+
"typesVersions": {
|
|
10
|
+
"*": {
|
|
11
|
+
"env": [
|
|
12
|
+
"es/env/index.d.ts"
|
|
13
|
+
],
|
|
14
|
+
"env/*": [
|
|
15
|
+
"es/env/*"
|
|
16
|
+
],
|
|
17
|
+
"event/extension": [
|
|
18
|
+
"es/event/extension/index.d.ts"
|
|
19
|
+
],
|
|
20
|
+
"event/extension/*": [
|
|
21
|
+
"es/event/extension/*"
|
|
22
|
+
],
|
|
23
|
+
"installers/*": [
|
|
24
|
+
"es/installers/*"
|
|
25
|
+
],
|
|
26
|
+
"jsx/*": [
|
|
27
|
+
"es/jsx/*"
|
|
28
|
+
],
|
|
29
|
+
"picker/*": [
|
|
30
|
+
"es/picker/*"
|
|
31
|
+
],
|
|
32
|
+
"register/*": [
|
|
33
|
+
"es/register/*"
|
|
34
|
+
],
|
|
35
|
+
"tools/*": [
|
|
36
|
+
"es/tools/*"
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
9
40
|
"files": [
|
|
10
41
|
"cjs",
|
|
11
42
|
"es",
|
|
@@ -13,7 +44,7 @@
|
|
|
13
44
|
],
|
|
14
45
|
"dependencies": {
|
|
15
46
|
"@visactor/vutils": "~1.0.12",
|
|
16
|
-
"@visactor/vrender-core": "1.1.0
|
|
47
|
+
"@visactor/vrender-core": "1.1.0",
|
|
17
48
|
"@resvg/resvg-js": "2.4.1",
|
|
18
49
|
"roughjs": "4.6.6",
|
|
19
50
|
"gifuct-js": "2.1.2",
|
|
@@ -38,9 +69,9 @@
|
|
|
38
69
|
"vite": "3.2.6",
|
|
39
70
|
"typescript": "4.9.5",
|
|
40
71
|
"cross-env": "^7.0.3",
|
|
41
|
-
"@internal/eslint-config": "0.0.1",
|
|
42
72
|
"@internal/ts-config": "0.0.1",
|
|
43
|
-
"@internal/bundler": "0.0.1"
|
|
73
|
+
"@internal/bundler": "0.0.1",
|
|
74
|
+
"@internal/eslint-config": "0.0.1"
|
|
44
75
|
},
|
|
45
76
|
"keywords": [
|
|
46
77
|
"VisActor",
|
|
@@ -68,6 +99,211 @@
|
|
|
68
99
|
".": {
|
|
69
100
|
"import": "./es/index.js",
|
|
70
101
|
"require": "./cjs/index-node.js"
|
|
102
|
+
},
|
|
103
|
+
"./env": {
|
|
104
|
+
"types": "./es/env/index.d.ts",
|
|
105
|
+
"import": "./es/env/index.js",
|
|
106
|
+
"require": "./cjs/env/index.js"
|
|
107
|
+
},
|
|
108
|
+
"./env/browser": {
|
|
109
|
+
"types": "./es/env/browser.d.ts",
|
|
110
|
+
"import": "./es/env/browser.js",
|
|
111
|
+
"require": "./cjs/env/browser.js"
|
|
112
|
+
},
|
|
113
|
+
"./env/feishu": {
|
|
114
|
+
"types": "./es/env/feishu.d.ts",
|
|
115
|
+
"import": "./es/env/feishu.js",
|
|
116
|
+
"require": "./cjs/env/feishu.js"
|
|
117
|
+
},
|
|
118
|
+
"./env/harmony": {
|
|
119
|
+
"types": "./es/env/harmony.d.ts",
|
|
120
|
+
"import": "./es/env/harmony.js",
|
|
121
|
+
"require": "./cjs/env/harmony.js"
|
|
122
|
+
},
|
|
123
|
+
"./env/lynx": {
|
|
124
|
+
"types": "./es/env/lynx.d.ts",
|
|
125
|
+
"import": "./es/env/lynx.js",
|
|
126
|
+
"require": "./cjs/env/lynx.js"
|
|
127
|
+
},
|
|
128
|
+
"./env/node": {
|
|
129
|
+
"types": "./es/env/node.d.ts",
|
|
130
|
+
"import": "./es/env/node.js",
|
|
131
|
+
"require": "./cjs/env/node.js"
|
|
132
|
+
},
|
|
133
|
+
"./env/taro": {
|
|
134
|
+
"types": "./es/env/taro.d.ts",
|
|
135
|
+
"import": "./es/env/taro.js",
|
|
136
|
+
"require": "./cjs/env/taro.js"
|
|
137
|
+
},
|
|
138
|
+
"./env/tt": {
|
|
139
|
+
"types": "./es/env/tt.d.ts",
|
|
140
|
+
"import": "./es/env/tt.js",
|
|
141
|
+
"require": "./cjs/env/tt.js"
|
|
142
|
+
},
|
|
143
|
+
"./env/wx": {
|
|
144
|
+
"types": "./es/env/wx.d.ts",
|
|
145
|
+
"import": "./es/env/wx.js",
|
|
146
|
+
"require": "./cjs/env/wx.js"
|
|
147
|
+
},
|
|
148
|
+
"./event/extension": {
|
|
149
|
+
"types": "./es/event/extension/index.d.ts",
|
|
150
|
+
"import": "./es/event/extension/index.js",
|
|
151
|
+
"require": "./cjs/event/extension/index.js"
|
|
152
|
+
},
|
|
153
|
+
"./event/extension/drag": {
|
|
154
|
+
"types": "./es/event/extension/drag.d.ts",
|
|
155
|
+
"import": "./es/event/extension/drag.js",
|
|
156
|
+
"require": "./cjs/event/extension/drag.js"
|
|
157
|
+
},
|
|
158
|
+
"./event/extension/gesture": {
|
|
159
|
+
"types": "./es/event/extension/gesture.d.ts",
|
|
160
|
+
"import": "./es/event/extension/gesture.js",
|
|
161
|
+
"require": "./cjs/event/extension/gesture.js"
|
|
162
|
+
},
|
|
163
|
+
"./installers/app": {
|
|
164
|
+
"types": "./es/installers/app.d.ts",
|
|
165
|
+
"import": "./es/installers/app.js",
|
|
166
|
+
"require": "./cjs/installers/app.js"
|
|
167
|
+
},
|
|
168
|
+
"./installers/browser": {
|
|
169
|
+
"types": "./es/installers/browser.d.ts",
|
|
170
|
+
"import": "./es/installers/browser.js",
|
|
171
|
+
"require": "./cjs/installers/browser.js"
|
|
172
|
+
},
|
|
173
|
+
"./installers/browser-lite": {
|
|
174
|
+
"types": "./es/installers/browser-lite.d.ts",
|
|
175
|
+
"import": "./es/installers/browser-lite.js",
|
|
176
|
+
"require": "./cjs/installers/browser-lite.js"
|
|
177
|
+
},
|
|
178
|
+
"./installers/graphics": {
|
|
179
|
+
"types": "./es/installers/graphics.d.ts",
|
|
180
|
+
"import": "./es/installers/graphics.js",
|
|
181
|
+
"require": "./cjs/installers/graphics.js"
|
|
182
|
+
},
|
|
183
|
+
"./installers/graphics-lite": {
|
|
184
|
+
"types": "./es/installers/graphics-lite.d.ts",
|
|
185
|
+
"import": "./es/installers/graphics-lite.js",
|
|
186
|
+
"require": "./cjs/installers/graphics-lite.js"
|
|
187
|
+
},
|
|
188
|
+
"./jsx/graphicType": {
|
|
189
|
+
"types": "./es/jsx/graphicType.d.ts",
|
|
190
|
+
"import": "./es/jsx/graphicType.js",
|
|
191
|
+
"require": "./cjs/jsx/graphicType.js"
|
|
192
|
+
},
|
|
193
|
+
"./picker/contributions/constants": {
|
|
194
|
+
"types": "./es/picker/contributions/constants.d.ts",
|
|
195
|
+
"import": "./es/picker/contributions/constants.js",
|
|
196
|
+
"require": "./cjs/picker/contributions/constants.js"
|
|
197
|
+
},
|
|
198
|
+
"./register/env": {
|
|
199
|
+
"types": "./es/register/env.d.ts",
|
|
200
|
+
"import": "./es/register/env.js",
|
|
201
|
+
"require": "./cjs/register/env.js"
|
|
202
|
+
},
|
|
203
|
+
"./register/register-arc": {
|
|
204
|
+
"types": "./es/register/register-arc.d.ts",
|
|
205
|
+
"import": "./es/register/register-arc.js",
|
|
206
|
+
"require": "./cjs/register/register-arc.js"
|
|
207
|
+
},
|
|
208
|
+
"./register/register-arc3d": {
|
|
209
|
+
"types": "./es/register/register-arc3d.d.ts",
|
|
210
|
+
"import": "./es/register/register-arc3d.js",
|
|
211
|
+
"require": "./cjs/register/register-arc3d.js"
|
|
212
|
+
},
|
|
213
|
+
"./register/register-area": {
|
|
214
|
+
"types": "./es/register/register-area.d.ts",
|
|
215
|
+
"import": "./es/register/register-area.js",
|
|
216
|
+
"require": "./cjs/register/register-area.js"
|
|
217
|
+
},
|
|
218
|
+
"./register/register-circle": {
|
|
219
|
+
"types": "./es/register/register-circle.d.ts",
|
|
220
|
+
"import": "./es/register/register-circle.js",
|
|
221
|
+
"require": "./cjs/register/register-circle.js"
|
|
222
|
+
},
|
|
223
|
+
"./register/register-gif": {
|
|
224
|
+
"types": "./es/register/register-gif.d.ts",
|
|
225
|
+
"import": "./es/register/register-gif.js",
|
|
226
|
+
"require": "./cjs/register/register-gif.js"
|
|
227
|
+
},
|
|
228
|
+
"./register/register-glyph": {
|
|
229
|
+
"types": "./es/register/register-glyph.d.ts",
|
|
230
|
+
"import": "./es/register/register-glyph.js",
|
|
231
|
+
"require": "./cjs/register/register-glyph.js"
|
|
232
|
+
},
|
|
233
|
+
"./register/register-group": {
|
|
234
|
+
"types": "./es/register/register-group.d.ts",
|
|
235
|
+
"import": "./es/register/register-group.js",
|
|
236
|
+
"require": "./cjs/register/register-group.js"
|
|
237
|
+
},
|
|
238
|
+
"./register/register-image": {
|
|
239
|
+
"types": "./es/register/register-image.d.ts",
|
|
240
|
+
"import": "./es/register/register-image.js",
|
|
241
|
+
"require": "./cjs/register/register-image.js"
|
|
242
|
+
},
|
|
243
|
+
"./register/register-line": {
|
|
244
|
+
"types": "./es/register/register-line.d.ts",
|
|
245
|
+
"import": "./es/register/register-line.js",
|
|
246
|
+
"require": "./cjs/register/register-line.js"
|
|
247
|
+
},
|
|
248
|
+
"./register/register-path": {
|
|
249
|
+
"types": "./es/register/register-path.d.ts",
|
|
250
|
+
"import": "./es/register/register-path.js",
|
|
251
|
+
"require": "./cjs/register/register-path.js"
|
|
252
|
+
},
|
|
253
|
+
"./register/register-polygon": {
|
|
254
|
+
"types": "./es/register/register-polygon.d.ts",
|
|
255
|
+
"import": "./es/register/register-polygon.js",
|
|
256
|
+
"require": "./cjs/register/register-polygon.js"
|
|
257
|
+
},
|
|
258
|
+
"./register/register-pyramid3d": {
|
|
259
|
+
"types": "./es/register/register-pyramid3d.d.ts",
|
|
260
|
+
"import": "./es/register/register-pyramid3d.js",
|
|
261
|
+
"require": "./cjs/register/register-pyramid3d.js"
|
|
262
|
+
},
|
|
263
|
+
"./register/register-rect": {
|
|
264
|
+
"types": "./es/register/register-rect.d.ts",
|
|
265
|
+
"import": "./es/register/register-rect.js",
|
|
266
|
+
"require": "./cjs/register/register-rect.js"
|
|
267
|
+
},
|
|
268
|
+
"./register/register-rect3d": {
|
|
269
|
+
"types": "./es/register/register-rect3d.d.ts",
|
|
270
|
+
"import": "./es/register/register-rect3d.js",
|
|
271
|
+
"require": "./cjs/register/register-rect3d.js"
|
|
272
|
+
},
|
|
273
|
+
"./register/register-richtext": {
|
|
274
|
+
"types": "./es/register/register-richtext.d.ts",
|
|
275
|
+
"import": "./es/register/register-richtext.js",
|
|
276
|
+
"require": "./cjs/register/register-richtext.js"
|
|
277
|
+
},
|
|
278
|
+
"./register/register-shadowRoot": {
|
|
279
|
+
"types": "./es/register/register-shadowRoot.d.ts",
|
|
280
|
+
"import": "./es/register/register-shadowRoot.js",
|
|
281
|
+
"require": "./cjs/register/register-shadowRoot.js"
|
|
282
|
+
},
|
|
283
|
+
"./register/register-star": {
|
|
284
|
+
"types": "./es/register/register-star.d.ts",
|
|
285
|
+
"import": "./es/register/register-star.js",
|
|
286
|
+
"require": "./cjs/register/register-star.js"
|
|
287
|
+
},
|
|
288
|
+
"./register/register-symbol": {
|
|
289
|
+
"types": "./es/register/register-symbol.d.ts",
|
|
290
|
+
"import": "./es/register/register-symbol.js",
|
|
291
|
+
"require": "./cjs/register/register-symbol.js"
|
|
292
|
+
},
|
|
293
|
+
"./register/register-text": {
|
|
294
|
+
"types": "./es/register/register-text.d.ts",
|
|
295
|
+
"import": "./es/register/register-text.js",
|
|
296
|
+
"require": "./cjs/register/register-text.js"
|
|
297
|
+
},
|
|
298
|
+
"./register/register-wraptext": {
|
|
299
|
+
"types": "./es/register/register-wraptext.d.ts",
|
|
300
|
+
"import": "./es/register/register-wraptext.js",
|
|
301
|
+
"require": "./cjs/register/register-wraptext.js"
|
|
302
|
+
},
|
|
303
|
+
"./tools/dynamicTexture/effect": {
|
|
304
|
+
"types": "./es/tools/dynamicTexture/effect.d.ts",
|
|
305
|
+
"import": "./es/tools/dynamicTexture/effect.js",
|
|
306
|
+
"require": "./cjs/tools/dynamicTexture/effect.js"
|
|
71
307
|
}
|
|
72
308
|
},
|
|
73
309
|
"scripts": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/env/contributions/module.ts"],"names":[],"mappings":"","file":"module.js","sourcesContent":["// import { ContainerModule, EnvContribution } from '@visactor/vrender-core';\n// import { BrowserEnvContribution } from './browser-contribution';\n// import { FeishuEnvContribution } from './feishu-contribution';\n// import { TaroEnvContribution } from './taro-contribution';\n// import { LynxEnvContribution } from './lynx-contribution';\n// import { WxEnvContribution } from './wx-contribution';\n// import { NodeEnvContribution } from './node-contribution';\n\n// let isBrowserBound = false;\n// export const browserEnvModule = new ContainerModule(bind => {\n// // browser\n// if (!isBrowserBound) {\n// isBrowserBound = true;\n// bind(BrowserEnvContribution).toSelf().inSingletonScope();\n// bind(EnvContribution).toService(BrowserEnvContribution);\n// }\n// });\n\n// let isFeishuBound = false;\n// export const feishuEnvModule = new ContainerModule(bind => {\n// // feishu\n// if (!isFeishuBound) {\n// isFeishuBound = true;\n// bind(FeishuEnvContribution).toSelf().inSingletonScope();\n// bind(EnvContribution).toService(FeishuEnvContribution);\n// }\n// });\n\n// let isTaroBound = false;\n// export const taroEnvModule = new ContainerModule(bind => {\n// // taro\n// if (!isTaroBound) {\n// isTaroBound = true;\n// bind(TaroEnvContribution).toSelf().inSingletonScope();\n// bind(EnvContribution).toService(TaroEnvContribution);\n// }\n// });\n\n// let isTTBound = false;\n// export const ttEnvModule = new ContainerModule(bind => {\n// if (!isTTBound) {\n// isTTBound = true;\n// bind(TaroEnvContribution).toSelf().inSingletonScope();\n// bind(EnvContribution).toService(TaroEnvContribution);\n// }\n// });\n\n// let isLynxBound = false;\n// export const lynxEnvModule = new ContainerModule(bind => {\n// // lynx\n// if (!isLynxBound) {\n// isLynxBound = true;\n// bind(LynxEnvContribution).toSelf().inSingletonScope();\n// bind(EnvContribution).toService(LynxEnvContribution);\n// }\n// });\n\n// let isWxBound = false;\n// export const wxEnvModule = new ContainerModule(bind => {\n// // wx\n// if (!isWxBound) {\n// isWxBound = true;\n// bind(WxEnvContribution).toSelf().inSingletonScope();\n// bind(EnvContribution).toService(WxEnvContribution);\n// }\n// });\n\n// let isNodeBound = false;\n// export const nodeEnvModule = new ContainerModule(bind => {\n// // node\n// if (!isNodeBound) {\n// isNodeBound = true;\n// bind(NodeEnvContribution).toSelf().inSingletonScope();\n// bind(EnvContribution).toService(NodeEnvContribution);\n// }\n// });\n"]}
|
package/cjs/node-bind.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
package/cjs/node-bind.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=node-bind.js.map
|
package/cjs/node-bind.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/node-bind.ts"],"names":[],"mappings":"","file":"node-bind.js","sourcesContent":["// import type { Container } from 'inversify';\n// import nodeEnv from './env/contributions/module';\n// import nodeWindow from './window/contributions/modules';\n// import nodeCanvas from './canvas/contributions/node/modules';\n\n// // 直接绑定node环境\n// export function nodeLoader(container: Container) {\n// container.load(nodeEnv);\n// container.load(nodeWindow);\n// container.load(nodeCanvas);\n// }\n"]}
|
package/cjs/picker/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
package/cjs/picker/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=index.js.map
|
package/cjs/picker/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/picker/index.ts"],"names":[],"mappings":"","file":"index.js","sourcesContent":["// export * from './canvas-module';\n// export * from './math-module';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/render/contributions/render-module.ts"],"names":[],"mappings":"","file":"render-module.js","sourcesContent":["// import { Container } from 'inversify';\n// import roughModule from './rough/module';\n\n// export default function load(container: Container) {\n// container.load(roughModule);\n// }\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=dynamicTexture.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/tools/dynamicTexture.ts"],"names":[],"mappings":"","file":"dynamicTexture.js","sourcesContent":["// import type { IContext2d, IGraphic } from '@visactor/vrender-core';\n\n// export function randomOpacity(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// if (!graphic.dynamicTextureCache) {\n// graphic.dynamicTextureCache = new Array(rowCount * columnCount).fill(0).map(item => Math.random() * 2 * Math.PI);\n// }\n// const targetRandomValue = graphic.dynamicTextureCache[row * columnCount + column];\n// const _r = (Math.sin(ratio * 2 * Math.PI + targetRandomValue) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 从左到右的列式渐变\n// export function columnLeftToRight(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// // 根据列号计算延迟\n// const delay = column / columnCount;\n// // 使用连续的sin函数,不需要max(0,ratio-delay)的截断\n// const _r = (Math.sin(ratio * 2 * Math.PI - delay * 2 * Math.PI) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 从右到左的列式渐变\n// export function columnRightToLeft(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// const delay = (columnCount - 1 - column) / columnCount;\n// const _r = (Math.sin(ratio * 2 * Math.PI - delay * 2 * Math.PI) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 从上到下的行式渐变\n// export function rowTopToBottom(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// const delay = row / rowCount;\n// const _r = (Math.sin(ratio * 2 * Math.PI - delay * 2 * Math.PI) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 从下到上的行式渐变\n// export function rowBottomToTop(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// const delay = (rowCount - 1 - row) / rowCount;\n// const _r = (Math.sin(ratio * 2 * Math.PI - delay * 2 * Math.PI) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 从中心向两边的对角线渐变\n// export function diagonalCenterToEdge(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// const centerRow = rowCount / 2;\n// const centerCol = columnCount / 2;\n// const distance = Math.sqrt(\n// Math.pow((row - centerRow) / rowCount, 2) + Math.pow((column - centerCol) / columnCount, 2)\n// );\n// const _r = (Math.sin(ratio * 2 * Math.PI - distance * 2 * Math.PI) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 从左上角到右下角的对角线渐变\n// export function diagonalTopLeftToBottomRight(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// const delay = (row / rowCount + column / columnCount) / 2;\n// const _r = (Math.sin(ratio * 2 * Math.PI - delay * 2 * Math.PI) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 旋转扫描效果\n// export function rotationScan(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// // 计算当前点相对于中心点的角度\n// const centerRow = rowCount / 2;\n// const centerCol = columnCount / 2;\n// const angle = Math.atan2(row - centerRow, column - centerCol);\n// // 将角度归一化到 [0, 2π]\n// const normalizedAngle = angle < 0 ? angle + 2 * Math.PI : angle;\n// // 计算扫描延迟\n// const delay = normalizedAngle / (2 * Math.PI);\n// const _r = (Math.sin(ratio * 2 * Math.PI - delay * 2 * Math.PI) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 波纹扩散效果\n// export function rippleEffect(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// const centerRow = rowCount / 2;\n// const centerCol = columnCount / 2;\n// // 计算到中心的距离\n// const distance = Math.sqrt(Math.pow(row - centerRow, 2) + Math.pow(column - centerCol, 2));\n// // 归一化距离\n// const normalizedDistance = distance / Math.sqrt(Math.pow(rowCount / 2, 2) + Math.pow(columnCount / 2, 2));\n// // 创建多个波纹\n// const waves = 3;\n// const _r = (Math.sin(ratio * 2 * Math.PI * waves - normalizedDistance * 2 * Math.PI) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 蛇形波动效果\n// export function snakeWave(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// // 使用行和列的位置创建蛇形路径\n// const delay = ((row + column) % (rowCount + columnCount)) / (rowCount + columnCount);\n// const _r = (Math.sin(ratio * 2 * Math.PI - delay * 4 * Math.PI) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 交错波纹效果\n// export function alternatingWave(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// // 行和列的交错波纹\n// const rowPhase = row / rowCount;\n// const colPhase = column / columnCount;\n// const _r =\n// (Math.sin(ratio * 2 * Math.PI - rowPhase * 2 * Math.PI) * Math.sin(ratio * 2 * Math.PI - colPhase * 2 * Math.PI) +\n// 1) /\n// 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 螺旋效果\n// export function spiralEffect(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// const centerRow = rowCount / 2;\n// const centerCol = columnCount / 2;\n// // 计算到中心的距离和角度\n// const distance = Math.sqrt(Math.pow(row - centerRow, 2) + Math.pow(column - centerCol, 2));\n// const angle = Math.atan2(row - centerRow, column - centerCol);\n// // 归一化距离\n// const normalizedDistance = distance / Math.sqrt(Math.pow(rowCount / 2, 2) + Math.pow(columnCount / 2, 2));\n// // 组合距离和角度创建螺旋效果\n// const delay = (normalizedDistance + angle / (2 * Math.PI)) / 2;\n// const _r = (Math.sin(ratio * 2 * Math.PI - delay * 4 * Math.PI) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/window/contributions/native-contribution.ts"],"names":[],"mappings":"","file":"native-contribution.js","sourcesContent":["// import { createCanvas, createImageData, loadImage } from 'canvas';\n// import { VGlobal, IWindow, EnvType, IGlobal, IWindowHandlerContribution, IWindowParams } from '../..';\n// import { BaseWindowHandlerContribution } from './base-contribution';\n\n// type NodePkg = {\n// createCanvas: typeof createCanvas;\n// createImageData: typeof createImageData;\n// loadImage: typeof loadImage;\n// };\n\n// export class NodeWindowHandlerContribution extends BaseWindowHandlerContribution implements IWindowHandlerContribution {\n// type: EnvType = 'native';\n\n// pkg: NodePkg;\n\n// configure(window: IWindow, global: IGlobal) {\n// if (global.env === this.type) {\n// window.setWindowHandler(this);\n// this.pkg = global.envParams;\n// }\n// }\n\n// get container(): HTMLElement | null {\n// // return this.canvas.nativeCanvas.parentElement;\n// return null;\n// }\n\n// constructor(private readonly global: IGlobal) {\n// super();\n// }\n\n// createWindow(params: IWindowParams): void {\n// // 如果没有传入canvas,那么就创建一个canvas\n// params.CreateWindow && params.CreateWindow(params.width, params.height, params.title);\n// }\n\n// destroyWindow(): void {\n// return;\n// }\n// resizeWindow(width: number, height: number): void {\n// return;\n// }\n// setDpr(dpr: number): void {\n// return;\n// }\n\n// getContext(): any {\n// throw new Error('暂不支持');\n// }\n\n// getWH(): { width: number; height: number } {\n// throw new Error('暂不支持');\n// }\n// getTitle(): string {\n// throw new Error('暂不支持');\n// }\n// getXY(): { x: number; y: number } {\n// throw new Error('暂不支持');\n// }\n// }\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/env/contributions/module.ts"],"names":[],"mappings":"","file":"module.js","sourcesContent":["// import { ContainerModule, EnvContribution } from '@visactor/vrender-core';\n// import { BrowserEnvContribution } from './browser-contribution';\n// import { FeishuEnvContribution } from './feishu-contribution';\n// import { TaroEnvContribution } from './taro-contribution';\n// import { LynxEnvContribution } from './lynx-contribution';\n// import { WxEnvContribution } from './wx-contribution';\n// import { NodeEnvContribution } from './node-contribution';\n\n// let isBrowserBound = false;\n// export const browserEnvModule = new ContainerModule(bind => {\n// // browser\n// if (!isBrowserBound) {\n// isBrowserBound = true;\n// bind(BrowserEnvContribution).toSelf().inSingletonScope();\n// bind(EnvContribution).toService(BrowserEnvContribution);\n// }\n// });\n\n// let isFeishuBound = false;\n// export const feishuEnvModule = new ContainerModule(bind => {\n// // feishu\n// if (!isFeishuBound) {\n// isFeishuBound = true;\n// bind(FeishuEnvContribution).toSelf().inSingletonScope();\n// bind(EnvContribution).toService(FeishuEnvContribution);\n// }\n// });\n\n// let isTaroBound = false;\n// export const taroEnvModule = new ContainerModule(bind => {\n// // taro\n// if (!isTaroBound) {\n// isTaroBound = true;\n// bind(TaroEnvContribution).toSelf().inSingletonScope();\n// bind(EnvContribution).toService(TaroEnvContribution);\n// }\n// });\n\n// let isTTBound = false;\n// export const ttEnvModule = new ContainerModule(bind => {\n// if (!isTTBound) {\n// isTTBound = true;\n// bind(TaroEnvContribution).toSelf().inSingletonScope();\n// bind(EnvContribution).toService(TaroEnvContribution);\n// }\n// });\n\n// let isLynxBound = false;\n// export const lynxEnvModule = new ContainerModule(bind => {\n// // lynx\n// if (!isLynxBound) {\n// isLynxBound = true;\n// bind(LynxEnvContribution).toSelf().inSingletonScope();\n// bind(EnvContribution).toService(LynxEnvContribution);\n// }\n// });\n\n// let isWxBound = false;\n// export const wxEnvModule = new ContainerModule(bind => {\n// // wx\n// if (!isWxBound) {\n// isWxBound = true;\n// bind(WxEnvContribution).toSelf().inSingletonScope();\n// bind(EnvContribution).toService(WxEnvContribution);\n// }\n// });\n\n// let isNodeBound = false;\n// export const nodeEnvModule = new ContainerModule(bind => {\n// // node\n// if (!isNodeBound) {\n// isNodeBound = true;\n// bind(NodeEnvContribution).toSelf().inSingletonScope();\n// bind(EnvContribution).toService(NodeEnvContribution);\n// }\n// });\n"]}
|
package/es/node-bind.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
package/es/node-bind.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=node-bind.js.map
|
package/es/node-bind.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/node-bind.ts"],"names":[],"mappings":"","file":"node-bind.js","sourcesContent":["// import type { Container } from 'inversify';\n// import nodeEnv from './env/contributions/module';\n// import nodeWindow from './window/contributions/modules';\n// import nodeCanvas from './canvas/contributions/node/modules';\n\n// // 直接绑定node环境\n// export function nodeLoader(container: Container) {\n// container.load(nodeEnv);\n// container.load(nodeWindow);\n// container.load(nodeCanvas);\n// }\n"]}
|
package/es/picker/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
package/es/picker/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=index.js.map
|
package/es/picker/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/picker/index.ts"],"names":[],"mappings":"","file":"index.js","sourcesContent":["// export * from './canvas-module';\n// export * from './math-module';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/render/contributions/render-module.ts"],"names":[],"mappings":"","file":"render-module.js","sourcesContent":["// import { Container } from 'inversify';\n// import roughModule from './rough/module';\n\n// export default function load(container: Container) {\n// container.load(roughModule);\n// }\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=dynamicTexture.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/tools/dynamicTexture.ts"],"names":[],"mappings":"","file":"dynamicTexture.js","sourcesContent":["// import type { IContext2d, IGraphic } from '@visactor/vrender-core';\n\n// export function randomOpacity(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// if (!graphic.dynamicTextureCache) {\n// graphic.dynamicTextureCache = new Array(rowCount * columnCount).fill(0).map(item => Math.random() * 2 * Math.PI);\n// }\n// const targetRandomValue = graphic.dynamicTextureCache[row * columnCount + column];\n// const _r = (Math.sin(ratio * 2 * Math.PI + targetRandomValue) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 从左到右的列式渐变\n// export function columnLeftToRight(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// // 根据列号计算延迟\n// const delay = column / columnCount;\n// // 使用连续的sin函数,不需要max(0,ratio-delay)的截断\n// const _r = (Math.sin(ratio * 2 * Math.PI - delay * 2 * Math.PI) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 从右到左的列式渐变\n// export function columnRightToLeft(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// const delay = (columnCount - 1 - column) / columnCount;\n// const _r = (Math.sin(ratio * 2 * Math.PI - delay * 2 * Math.PI) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 从上到下的行式渐变\n// export function rowTopToBottom(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// const delay = row / rowCount;\n// const _r = (Math.sin(ratio * 2 * Math.PI - delay * 2 * Math.PI) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 从下到上的行式渐变\n// export function rowBottomToTop(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// const delay = (rowCount - 1 - row) / rowCount;\n// const _r = (Math.sin(ratio * 2 * Math.PI - delay * 2 * Math.PI) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 从中心向两边的对角线渐变\n// export function diagonalCenterToEdge(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// const centerRow = rowCount / 2;\n// const centerCol = columnCount / 2;\n// const distance = Math.sqrt(\n// Math.pow((row - centerRow) / rowCount, 2) + Math.pow((column - centerCol) / columnCount, 2)\n// );\n// const _r = (Math.sin(ratio * 2 * Math.PI - distance * 2 * Math.PI) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 从左上角到右下角的对角线渐变\n// export function diagonalTopLeftToBottomRight(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// const delay = (row / rowCount + column / columnCount) / 2;\n// const _r = (Math.sin(ratio * 2 * Math.PI - delay * 2 * Math.PI) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 旋转扫描效果\n// export function rotationScan(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// // 计算当前点相对于中心点的角度\n// const centerRow = rowCount / 2;\n// const centerCol = columnCount / 2;\n// const angle = Math.atan2(row - centerRow, column - centerCol);\n// // 将角度归一化到 [0, 2π]\n// const normalizedAngle = angle < 0 ? angle + 2 * Math.PI : angle;\n// // 计算扫描延迟\n// const delay = normalizedAngle / (2 * Math.PI);\n// const _r = (Math.sin(ratio * 2 * Math.PI - delay * 2 * Math.PI) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 波纹扩散效果\n// export function rippleEffect(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// const centerRow = rowCount / 2;\n// const centerCol = columnCount / 2;\n// // 计算到中心的距离\n// const distance = Math.sqrt(Math.pow(row - centerRow, 2) + Math.pow(column - centerCol, 2));\n// // 归一化距离\n// const normalizedDistance = distance / Math.sqrt(Math.pow(rowCount / 2, 2) + Math.pow(columnCount / 2, 2));\n// // 创建多个波纹\n// const waves = 3;\n// const _r = (Math.sin(ratio * 2 * Math.PI * waves - normalizedDistance * 2 * Math.PI) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 蛇形波动效果\n// export function snakeWave(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// // 使用行和列的位置创建蛇形路径\n// const delay = ((row + column) % (rowCount + columnCount)) / (rowCount + columnCount);\n// const _r = (Math.sin(ratio * 2 * Math.PI - delay * 4 * Math.PI) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 交错波纹效果\n// export function alternatingWave(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// // 行和列的交错波纹\n// const rowPhase = row / rowCount;\n// const colPhase = column / columnCount;\n// const _r =\n// (Math.sin(ratio * 2 * Math.PI - rowPhase * 2 * Math.PI) * Math.sin(ratio * 2 * Math.PI - colPhase * 2 * Math.PI) +\n// 1) /\n// 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n\n// // 螺旋效果\n// export function spiralEffect(\n// ctx: IContext2d,\n// row: number,\n// column: number,\n// rowCount: number,\n// columnCount: number,\n// ratio: number,\n// graphic: IGraphic\n// ) {\n// const centerRow = rowCount / 2;\n// const centerCol = columnCount / 2;\n// // 计算到中心的距离和角度\n// const distance = Math.sqrt(Math.pow(row - centerRow, 2) + Math.pow(column - centerCol, 2));\n// const angle = Math.atan2(row - centerRow, column - centerCol);\n// // 归一化距离\n// const normalizedDistance = distance / Math.sqrt(Math.pow(rowCount / 2, 2) + Math.pow(columnCount / 2, 2));\n// // 组合距离和角度创建螺旋效果\n// const delay = (normalizedDistance + angle / (2 * Math.PI)) / 2;\n// const _r = (Math.sin(ratio * 2 * Math.PI - delay * 4 * Math.PI) + 1) / 2;\n// ctx.globalAlpha = _r;\n// ctx.fill();\n// }\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/window/contributions/native-contribution.ts"],"names":[],"mappings":"","file":"native-contribution.js","sourcesContent":["// import { createCanvas, createImageData, loadImage } from 'canvas';\n// import { VGlobal, IWindow, EnvType, IGlobal, IWindowHandlerContribution, IWindowParams } from '../..';\n// import { BaseWindowHandlerContribution } from './base-contribution';\n\n// type NodePkg = {\n// createCanvas: typeof createCanvas;\n// createImageData: typeof createImageData;\n// loadImage: typeof loadImage;\n// };\n\n// export class NodeWindowHandlerContribution extends BaseWindowHandlerContribution implements IWindowHandlerContribution {\n// type: EnvType = 'native';\n\n// pkg: NodePkg;\n\n// configure(window: IWindow, global: IGlobal) {\n// if (global.env === this.type) {\n// window.setWindowHandler(this);\n// this.pkg = global.envParams;\n// }\n// }\n\n// get container(): HTMLElement | null {\n// // return this.canvas.nativeCanvas.parentElement;\n// return null;\n// }\n\n// constructor(private readonly global: IGlobal) {\n// super();\n// }\n\n// createWindow(params: IWindowParams): void {\n// // 如果没有传入canvas,那么就创建一个canvas\n// params.CreateWindow && params.CreateWindow(params.width, params.height, params.title);\n// }\n\n// destroyWindow(): void {\n// return;\n// }\n// resizeWindow(width: number, height: number): void {\n// return;\n// }\n// setDpr(dpr: number): void {\n// return;\n// }\n\n// getContext(): any {\n// throw new Error('暂不支持');\n// }\n\n// getWH(): { width: number; height: number } {\n// throw new Error('暂不支持');\n// }\n// getTitle(): string {\n// throw new Error('暂不支持');\n// }\n// getXY(): { x: number; y: number } {\n// throw new Error('暂不支持');\n// }\n// }\n"]}
|