@leafer/miniapp 1.0.0-beta.9 → 1.0.0-rc.11

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/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "@leafer/miniapp",
3
- "version": "1.0.0-beta.9",
3
+ "version": "1.0.0-rc.11",
4
4
  "description": "@leafer/miniapp",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
7
7
  "main": "src/index.ts",
8
+ "types": "types/index.d.ts",
8
9
  "files": [
9
- "src"
10
+ "src",
11
+ "types",
12
+ "dist"
10
13
  ],
11
14
  "repository": {
12
15
  "type": "git",
@@ -19,13 +22,11 @@
19
22
  "leaferjs"
20
23
  ],
21
24
  "dependencies": {
22
- "@leafer/core": "1.0.0-beta.9",
23
- "@leafer/partner": "1.0.0-beta.9",
24
- "@leafer/canvas-miniapp": "1.0.0-beta.9",
25
- "@leafer/interaction-miniapp": "1.0.0-beta.9",
26
- "@leafer/image-miniapp": "1.0.0-beta.9"
25
+ "@leafer/core": "1.0.0-rc.11",
26
+ "@leafer/canvas-miniapp": "1.0.0-rc.11",
27
+ "@leafer/image-miniapp": "1.0.0-rc.11"
27
28
  },
28
29
  "devDependencies": {
29
- "@leafer/interface": "1.0.0-beta.9"
30
+ "@leafer/interface": "1.0.0-rc.11"
30
31
  }
31
32
  }
package/src/index.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  export * from '@leafer/core'
2
- export * from '@leafer/partner'
3
2
 
4
3
  export * from '@leafer/canvas-miniapp'
5
4
  export * from '@leafer/image-miniapp'
@@ -9,7 +8,6 @@ import { Platform, Creator, FileHelper } from '@leafer/core'
9
8
 
10
9
  import { LeaferCanvas } from '@leafer/canvas-miniapp'
11
10
  import { LeaferImage } from '@leafer/image-miniapp'
12
- import { Interaction } from '@leafer/interaction-miniapp'
13
11
 
14
12
 
15
13
  const { mineType, fileType } = FileHelper
@@ -17,10 +15,7 @@ const { mineType, fileType } = FileHelper
17
15
 
18
16
  Object.assign(Creator, {
19
17
  canvas: (options?, manager?) => new LeaferCanvas(options, manager),
20
- image: (options) => new LeaferImage(options),
21
- hitCanvas: (options?, manager?) => new LeaferCanvas(options, manager),
22
-
23
- interaction: (target, canvas, selector, options?) => { return new Interaction(target, canvas, selector, options) }
18
+ image: (options) => new LeaferImage(options)
24
19
  } as ICreator)
25
20
 
26
21
 
@@ -58,14 +53,15 @@ export function useCanvas(_canvasType: ICanvasType, app?: IObject): void {
58
53
  })
59
54
  })
60
55
  },
61
- loadImage(src: any): Promise<HTMLImageElement> {
56
+ loadImage(url: string): Promise<HTMLImageElement> {
62
57
  return new Promise((resolve, reject) => {
63
58
  const img = Platform.canvas.view.createImage()
64
59
  img.onload = () => { resolve(img) }
65
60
  img.onerror = (error: any) => { reject(error) }
66
- img.src = src
61
+ img.src = url
67
62
  })
68
- }
63
+ },
64
+ noRepeat: 'repeat-x' // fix: 微信小程序 createPattern 直接使用 no-repeat 有bug,导致无法显示
69
65
  }
70
66
 
71
67
  Platform.miniapp = {
@@ -121,6 +117,12 @@ export function useCanvas(_canvasType: ICanvasType, app?: IObject): void {
121
117
  }
122
118
  }
123
119
 
120
+ Platform.event = {
121
+ stopDefault(_origin: IObject): void { },
122
+ stopNow(_origin: IObject): void { },
123
+ stop(_origin: IObject): void { }
124
+ }
125
+
124
126
  Platform.canvas = Creator.canvas()
125
127
  Platform.conicGradientSupport = !!Platform.canvas.context.createConicGradient
126
128
  }
@@ -129,4 +131,3 @@ export function useCanvas(_canvasType: ICanvasType, app?: IObject): void {
129
131
  Platform.name = 'miniapp'
130
132
  Platform.requestRender = function (render: IFunction): void { Platform.canvas.view.requestAnimationFrame(render) }
131
133
  Platform.devicePixelRatio = wx.getSystemInfoSync().pixelRatio
132
- Platform.realtimeLayout = true
@@ -0,0 +1,8 @@
1
+ export * from '@leafer/core';
2
+ export * from '@leafer/canvas-miniapp';
3
+ export * from '@leafer/image-miniapp';
4
+ import { ICanvasType, IObject } from '@leafer/interface';
5
+
6
+ declare function useCanvas(_canvasType: ICanvasType, app?: IObject): void;
7
+
8
+ export { useCanvas };