@leafer/node 1.0.0-rc.9 → 1.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer/node",
3
- "version": "1.0.0-rc.9",
3
+ "version": "1.0.0",
4
4
  "description": "@leafer/node",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,12 +22,11 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/core": "1.0.0-rc.9",
26
- "@leafer/partner": "1.0.0-rc.9",
27
- "@leafer/canvas-node": "1.0.0-rc.9",
28
- "@leafer/image-node": "1.0.0-rc.9"
25
+ "@leafer/core": "1.0.0",
26
+ "@leafer/canvas-node": "1.0.0",
27
+ "@leafer/image-node": "1.0.0"
29
28
  },
30
29
  "devDependencies": {
31
- "@leafer/interface": "1.0.0-rc.9"
30
+ "@leafer/interface": "1.0.0"
32
31
  }
33
32
  }
package/src/index.ts CHANGED
@@ -1,12 +1,10 @@
1
1
  export * from '@leafer/core'
2
2
 
3
- export * from '@leafer/partner'
4
-
5
3
  export * from '@leafer/canvas-node'
6
- export * from '@leafer/image-web'
4
+ export * from '@leafer/image-node'
7
5
 
8
6
  import { ICanvasType, ICreator, IExportFileType, IExportImageType, IFunction, IObject, ISkiaCanvas, ISkiaNAPICanvas } from '@leafer/interface'
9
- import { Platform, Creator, InteractionBase, FileHelper } from '@leafer/core'
7
+ import { Platform, Creator, FileHelper } from '@leafer/core'
10
8
 
11
9
  import { LeaferCanvas } from '@leafer/canvas-node'
12
10
  import { LeaferImage } from '@leafer/image-node'
@@ -19,10 +17,7 @@ const { mineType, fileType } = FileHelper
19
17
 
20
18
  Object.assign(Creator, {
21
19
  canvas: (options?, manager?) => new LeaferCanvas(options, manager),
22
- image: (options) => new LeaferImage(options),
23
- hitCanvas: (options?, manager?) => new LeaferCanvas(options, manager),
24
-
25
- interaction: (target, canvas, selector, options?) => { return new InteractionBase(target, canvas, selector, options) }
20
+ image: (options) => new LeaferImage(options)
26
21
  } as ICreator)
27
22
 
28
23
 
@@ -39,7 +34,8 @@ export function useCanvas(canvasType: ICanvasType, power: IObject): void {
39
34
  canvasToDataURL: (canvas: ISkiaCanvas, type?: IExportImageType, quality?: number) => canvas.toDataURLSync(type, { quality }),
40
35
  canvasToBolb: (canvas: ISkiaCanvas, type?: IExportFileType, quality?: number) => canvas.toBuffer(type, { quality }),
41
36
  canvasSaveAs: (canvas: ISkiaCanvas, filename: string, quality?: number) => canvas.saveAs(filename, { quality }),
42
- loadImage
37
+ download(_url: string, _filename: string): Promise<void> { return undefined },
38
+ loadImage(src: any) { return loadImage(Platform.image.getRealURL(src)) }
43
39
  }
44
40
 
45
41
  Platform.roundRectPatch = true
@@ -52,7 +48,8 @@ export function useCanvas(canvasType: ICanvasType, power: IObject): void {
52
48
  canvasToDataURL: (canvas: ISkiaNAPICanvas, type?: IExportImageType, quality?: number) => canvas.toDataURL(mineType(type), quality),
53
49
  canvasToBolb: async (canvas: ISkiaNAPICanvas, type?: IExportFileType, quality?: number) => canvas.toBuffer(mineType(type), quality),
54
50
  canvasSaveAs: async (canvas: ISkiaNAPICanvas, filename: string, quality?: number) => writeFileSync(filename, canvas.toBuffer(mineType(fileType(filename)), quality)),
55
- loadImage
51
+ download(_url: string, _filename: string): Promise<void> { return undefined },
52
+ loadImage(src: any) { return loadImage(Platform.image.getRealURL(src)) }
56
53
  }
57
54
 
58
55
  }
package/types/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  export * from '@leafer/core';
2
- export * from '@leafer/partner';
3
2
  export * from '@leafer/canvas-node';
4
- export * from '@leafer/image-web';
3
+ export * from '@leafer/image-node';
5
4
  import { ICanvasType, IObject } from '@leafer/interface';
6
5
 
7
6
  declare function useCanvas(canvasType: ICanvasType, power: IObject): void;