@leafer-ui/external 1.12.3 → 2.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-ui/external",
3
- "version": "1.12.3",
3
+ "version": "2.0.0",
4
4
  "description": "@leafer-ui/external",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,9 +22,9 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/core": "1.12.3"
25
+ "@leafer/core": "2.0.0"
26
26
  },
27
27
  "devDependencies": {
28
- "@leafer-ui/interface": "1.12.3"
28
+ "@leafer-ui/interface": "2.0.0"
29
29
  }
30
30
  }
package/src/index.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  // Implemented in partner
2
- import { IPaintModule, IPaintImageModule, IPaintGradientModule, IEffectModule, ITextConvertModule, IExportModule, IColorConvertModule, IPathArrowModule, IStateModule, IUnitData, ITransitionModule, ITransitionFunction, IFilterModule } from "@leafer-ui/interface"
3
- import { Plugin, isObject } from '@leafer/core'
2
+ import { IPaintModule, IPaintImageModule, IPaintGradientModule, IEffectModule, ITextConvertModule, IExportModule, IColorConvertModule, IPathArrowModule, IStateModule, ITransitionModule, ITransitionFunction, IFilterModule } from "@leafer-ui/interface"
3
+ import { Plugin, UnitConvertHelper } from '@leafer/core'
4
4
  import { hasTransparent } from './color'
5
5
 
6
6
 
@@ -10,12 +10,7 @@ export const ColorConvert = {
10
10
  hasTransparent
11
11
  } as IColorConvertModule
12
12
 
13
- export const UnitConvert = {
14
- number(value: number | IUnitData, percentRefer?: number): number {
15
- return isObject(value) ? (value.type === 'percent' ? value.value * percentRefer : value.value) : value
16
- }
17
- }
18
-
13
+ export const UnitConvert = UnitConvertHelper
19
14
 
20
15
  export const PathArrow = {} as IPathArrowModule
21
16
 
package/types/index.d.ts CHANGED
@@ -1,9 +1,10 @@
1
- import { ITextConvertModule, IColorConvertModule, IUnitData, IPathArrowModule, IPaintModule, IPaintImageModule, IPaintGradientModule, IEffectModule, IFilterModule, IExportModule, IStateModule, ITransitionModule } from '@leafer-ui/interface';
1
+ import * as _leafer_ui_interface from '@leafer-ui/interface';
2
+ import { ITextConvertModule, IColorConvertModule, IPathArrowModule, IPaintModule, IPaintImageModule, IPaintGradientModule, IEffectModule, IFilterModule, IExportModule, IStateModule, ITransitionModule } from '@leafer-ui/interface';
2
3
 
3
4
  declare const TextConvert: ITextConvertModule;
4
5
  declare const ColorConvert: IColorConvertModule;
5
6
  declare const UnitConvert: {
6
- number(value: number | IUnitData, percentRefer?: number): number;
7
+ number(value: number | _leafer_ui_interface.IUnitData, percentRefer?: number): number;
7
8
  };
8
9
  declare const PathArrow: IPathArrowModule;
9
10
  declare const Paint: IPaintModule;