@leafer/worker 1.0.0-rc.2 → 1.0.0-rc.21

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/worker",
3
- "version": "1.0.0-rc.2",
3
+ "version": "1.0.0-rc.21",
4
4
  "description": "@leafer/worker",
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.2",
26
- "@leafer/partner": "1.0.0-rc.2",
27
- "@leafer/canvas-worker": "1.0.0-rc.2",
28
- "@leafer/image-worker": "1.0.0-rc.2"
25
+ "@leafer/core": "1.0.0-rc.21",
26
+ "@leafer/canvas-worker": "1.0.0-rc.21",
27
+ "@leafer/image-worker": "1.0.0-rc.21"
29
28
  },
30
29
  "devDependencies": {
31
- "@leafer/interface": "1.0.0-rc.2"
30
+ "@leafer/interface": "1.0.0-rc.21"
32
31
  }
33
32
  }
package/src/index.ts CHANGED
@@ -1,11 +1,10 @@
1
1
  export * from '@leafer/core'
2
- export * from '@leafer/partner'
3
2
 
4
3
  export * from '@leafer/canvas-worker'
5
4
  export * from '@leafer/image-worker'
6
5
 
7
6
  import { ICreator, IFunction, IExportImageType, IExportFileType, IObject, ICanvasType } from '@leafer/interface'
8
- import { Platform, Creator, FileHelper, InteractionBase } from '@leafer/core'
7
+ import { Platform, Creator, FileHelper } from '@leafer/core'
9
8
 
10
9
  import { LeaferCanvas } from '@leafer/canvas-worker'
11
10
  import { LeaferImage } from '@leafer/image-worker'
@@ -15,10 +14,7 @@ const { mineType } = FileHelper
15
14
 
16
15
  Object.assign(Creator, {
17
16
  canvas: (options?, manager?) => new LeaferCanvas(options, manager),
18
- image: (options) => new LeaferImage(options),
19
- hitCanvas: (options?, manager?) => new LeaferCanvas(options, manager),
20
-
21
- interaction: (target, canvas, selector, options?) => new InteractionBase(target, canvas, selector, options),
17
+ image: (options) => new LeaferImage(options)
22
18
  } as ICreator)
23
19
 
24
20
 
@@ -39,9 +35,10 @@ export function useCanvas(_canvasType: ICanvasType, _power?: IObject): void {
39
35
  },
40
36
  canvasToBolb: (canvas: OffscreenCanvas, type?: IExportFileType, quality?: number) => (canvas as any).convertToBlob({ type: mineType(type), quality }),
41
37
  canvasSaveAs: (_canvas: OffscreenCanvas, _filename: string, _quality?: any) => new Promise((resolve) => resolve()),
38
+ download(_url: string, _filename: string): Promise<void> { return undefined },
42
39
  loadImage(src: any): Promise<ImageBitmap> {
43
40
  return new Promise((resolve, reject) => {
44
- if (!src.startsWith('data:') && Platform.imageSuffix) src += (src.includes("?") ? "&" : "?") + Platform.imageSuffix
41
+ if (!src.startsWith('data:') && Platform.image.suffix) src += (src.includes("?") ? "&" : "?") + Platform.image.suffix
45
42
  let req = new XMLHttpRequest()
46
43
  req.open('GET', src, true)
47
44
  req.responseType = "blob"
@@ -66,7 +63,6 @@ Platform.name = 'web'
66
63
  Platform.isWorker = true
67
64
  Platform.requestRender = function (render: IFunction): void { requestAnimationFrame(render) }
68
65
  Platform.devicePixelRatio = 1
69
- Platform.realtimeLayout = true
70
66
 
71
67
 
72
68
  // same as web
package/types/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  export * from '@leafer/core';
2
- export * from '@leafer/partner';
3
2
  export * from '@leafer/canvas-worker';
4
3
  export * from '@leafer/image-worker';
5
4
  import { ICanvasType, IObject } from '@leafer/interface';