@leafer/web 1.0.0-beta.5 → 1.0.0-beta.7

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.
Files changed (2) hide show
  1. package/package.json +7 -7
  2. package/src/index.ts +12 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer/web",
3
- "version": "1.0.0-beta.5",
3
+ "version": "1.0.0-beta.7",
4
4
  "description": "@leafer/web",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -19,13 +19,13 @@
19
19
  "leaferjs"
20
20
  ],
21
21
  "dependencies": {
22
- "@leafer/core": "1.0.0-beta.5",
23
- "@leafer/partner": "1.0.0-beta.5",
24
- "@leafer/canvas-web": "1.0.0-beta.5",
25
- "@leafer/interaction-web": "1.0.0-beta.5",
26
- "@leafer/image-web": "1.0.0-beta.5"
22
+ "@leafer/core": "1.0.0-beta.7",
23
+ "@leafer/partner": "1.0.0-beta.7",
24
+ "@leafer/canvas-web": "1.0.0-beta.7",
25
+ "@leafer/interaction-web": "1.0.0-beta.7",
26
+ "@leafer/image-web": "1.0.0-beta.7"
27
27
  },
28
28
  "devDependencies": {
29
- "@leafer/interface": "1.0.0-beta.5"
29
+ "@leafer/interface": "1.0.0-beta.7"
30
30
  }
31
31
  }
package/src/index.ts CHANGED
@@ -6,12 +6,11 @@ export * from '@leafer/image-web'
6
6
  export * from '@leafer/interaction-web'
7
7
 
8
8
  import { ICreator, IFunction, IExportImageType, IExportFileType, IObject, ICanvasType } from '@leafer/interface'
9
- import { Platform, Creator } from '@leafer/core'
9
+ import { Platform, Creator, FileHelper } from '@leafer/core'
10
10
 
11
11
  import { LeaferCanvas } from '@leafer/canvas-web'
12
12
  import { LeaferImage } from '@leafer/image-web'
13
13
  import { Interaction } from '@leafer/interaction-web'
14
- import { FileHelper } from '@leafer/file'
15
14
 
16
15
 
17
16
  const { mineType, fileType } = FileHelper
@@ -64,8 +63,10 @@ export function useCanvas(_canvasType: ICanvasType, _power?: IObject): void {
64
63
  Platform.conicGradientSupport = !!Platform.canvas.context.createConicGradient
65
64
  }
66
65
 
66
+ Platform.name = 'web'
67
67
  Platform.requestRender = function (render: IFunction): void { window.requestAnimationFrame(render) }
68
68
  Platform.devicePixelRatio = devicePixelRatio
69
+ Platform.realtimeLayout = true
69
70
 
70
71
  const { userAgent } = navigator
71
72
 
@@ -75,3 +76,12 @@ if (userAgent.indexOf("Firefox") > -1) {
75
76
  } else if (userAgent.indexOf("Safari") > -1 && userAgent.indexOf("Chrome") === -1) {
76
77
  Platform.fullImageShadow = true
77
78
  }
79
+
80
+ if (userAgent.indexOf('Windows') > -1) {
81
+ Platform.os = 'Windows'
82
+ Platform.intWheelDeltaY = true
83
+ } else if (userAgent.indexOf('Mac') > -1) {
84
+ Platform.os = 'Mac'
85
+ } else if (userAgent.indexOf('Linux') > -1) {
86
+ Platform.os = 'Linux'
87
+ }