@leafer/miniapp 1.0.0-beta.8 → 1.0.0-rc.2
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 +11 -8
- package/src/index.ts +5 -3
- package/types/index.d.ts +10 -0
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer/miniapp",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-rc.2",
|
|
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,13 @@
|
|
|
19
22
|
"leaferjs"
|
|
20
23
|
],
|
|
21
24
|
"dependencies": {
|
|
22
|
-
"@leafer/core": "1.0.0-
|
|
23
|
-
"@leafer/partner": "1.0.0-
|
|
24
|
-
"@leafer/canvas-miniapp": "1.0.0-
|
|
25
|
-
"@leafer/
|
|
26
|
-
"@leafer/
|
|
25
|
+
"@leafer/core": "1.0.0-rc.2",
|
|
26
|
+
"@leafer/partner": "1.0.0-rc.2",
|
|
27
|
+
"@leafer/canvas-miniapp": "1.0.0-rc.2",
|
|
28
|
+
"@leafer/image-miniapp": "1.0.0-rc.2",
|
|
29
|
+
"@leafer/interaction-miniapp": "1.0.0-rc.2"
|
|
27
30
|
},
|
|
28
31
|
"devDependencies": {
|
|
29
|
-
"@leafer/interface": "1.0.0-
|
|
32
|
+
"@leafer/interface": "1.0.0-rc.2"
|
|
30
33
|
}
|
|
31
34
|
}
|
package/src/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from '@leafer/partner'
|
|
|
3
3
|
|
|
4
4
|
export * from '@leafer/canvas-miniapp'
|
|
5
5
|
export * from '@leafer/image-miniapp'
|
|
6
|
+
export * from '@leafer/interaction-miniapp'
|
|
6
7
|
|
|
7
8
|
import { ICanvasType, ICreator, IExportFileType, IExportImageType, IFunction, IObject, IMiniappSelect, IMiniappSizeView, IBoundsData } from '@leafer/interface'
|
|
8
9
|
import { Platform, Creator, FileHelper } from '@leafer/core'
|
|
@@ -58,14 +59,15 @@ export function useCanvas(_canvasType: ICanvasType, app?: IObject): void {
|
|
|
58
59
|
})
|
|
59
60
|
})
|
|
60
61
|
},
|
|
61
|
-
loadImage(
|
|
62
|
+
loadImage(url: string): Promise<HTMLImageElement> {
|
|
62
63
|
return new Promise((resolve, reject) => {
|
|
63
64
|
const img = Platform.canvas.view.createImage()
|
|
64
65
|
img.onload = () => { resolve(img) }
|
|
65
66
|
img.onerror = (error: any) => { reject(error) }
|
|
66
|
-
img.src =
|
|
67
|
+
img.src = url
|
|
67
68
|
})
|
|
68
|
-
}
|
|
69
|
+
},
|
|
70
|
+
noRepeat: 'repeat-x' // fix: 微信小程序 createPattern 直接使用 no-repeat 有bug,导致无法显示
|
|
69
71
|
}
|
|
70
72
|
|
|
71
73
|
Platform.miniapp = {
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from '@leafer/core';
|
|
2
|
+
export * from '@leafer/partner';
|
|
3
|
+
export * from '@leafer/canvas-miniapp';
|
|
4
|
+
export * from '@leafer/image-miniapp';
|
|
5
|
+
export * from '@leafer/interaction-miniapp';
|
|
6
|
+
import { ICanvasType, IObject } from '@leafer/interface';
|
|
7
|
+
|
|
8
|
+
declare function useCanvas(_canvasType: ICanvasType, app?: IObject): void;
|
|
9
|
+
|
|
10
|
+
export { useCanvas };
|