File tree Expand file tree Collapse file tree 8 files changed +105
-108
lines changed Expand file tree Collapse file tree 8 files changed +105
-108
lines changed File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change 1
1
import { SymbolMaster } from '../models' ;
2
- import { defaultSymbolParamsList } from '../utils/sketchSymbolParams ' ;
2
+ import { defaultSymbolParamsList } from '../constraints/symbolParams ' ;
3
3
import nodeToGroup from './nodeToGroup' ;
4
4
import adjustSymbolParams from './adjustSymbolParams' ;
5
5
import { AnyLayer , NodeToSketchSymbolOptions } from '../types' ;
Original file line number Diff line number Diff line change
1
+ import Color , { ColorParam } from '../models/Style/Color' ;
2
+ import { CGPoint , SketchFormat } from '.' ;
3
+
4
+ /**
5
+ * 传入颜色间隔点的参数
6
+ */
7
+ export interface ColorStopParam {
8
+ color : ColorParam ;
9
+ offset : number ;
10
+ }
11
+
12
+ export type StopParam = ColorParam | ColorStopParam ;
13
+
14
+ export interface GradientProps {
15
+ /**
16
+ * 渐变类型
17
+ */
18
+ type ?: SketchFormat . GradientType ;
19
+ /**
20
+ * 终点
21
+ */
22
+ to ?: CGPoint ;
23
+ /**
24
+ * 起点
25
+ */
26
+ from ?: CGPoint ;
27
+ /**
28
+ * 色彩间隔点
29
+ */
30
+ stops ?: StopParam [ ] ;
31
+ /**
32
+ * 渐变名称
33
+ */
34
+ name ?: string ;
35
+ /**
36
+ * 如果是圆形渐变 则需要传入 radius 值
37
+ */
38
+ radius ?: number ;
39
+ }
40
+
41
+ export interface ColorStop {
42
+ /**
43
+ * 偏移位置 取值 0-1
44
+ */
45
+ offset ?: number ;
46
+ /**
47
+ * 颜色对象
48
+ */
49
+ color : Color ;
50
+ }
Original file line number Diff line number Diff line change 1
- export { SketchFormat } from './sketchFormat' ;
2
1
export * from './type' ;
3
2
export * from './model' ;
4
3
export * from './layout' ;
5
4
export * from './symbol' ;
5
+ export * from './gradient' ;
6
+ export { SketchFormat } from './sketchFormat' ;
Original file line number Diff line number Diff line change @@ -122,6 +122,7 @@ export interface SvgDefsStyle {
122
122
class : 'classStyle' ;
123
123
rules : CssStyleRule [ ] ;
124
124
}
125
+
125
126
export type SvgLayerType =
126
127
| Group
127
128
| ShapeGroup
@@ -135,56 +136,3 @@ export interface CssStyleRule {
135
136
className : string ;
136
137
styles : { [ key : string ] : string } ;
137
138
}
138
- export declare enum LayerClassValue {
139
- Artboard = 'artboard' ,
140
- Bitmap = 'bitmap' ,
141
- Border = 'border' ,
142
- BorderOptions = 'borderOptions' ,
143
- Color = 'color' ,
144
- Fill = 'fill' ,
145
- Gradient = 'gradient' ,
146
- Group = 'group' ,
147
- InnerShadow = 'innerShadow' ,
148
- Oval = 'oval' ,
149
- Page = 'page' ,
150
- Polygon = 'polygon' ,
151
- Rect = 'rect' ,
152
- Rectangle = 'rectangle' ,
153
- Shadow = 'shadow' ,
154
- ShapeGroup = 'shapeGroup' ,
155
- ShapePath = 'shapePath' ,
156
- Slice = 'slice' ,
157
- Star = 'star' ,
158
- SymbolInstance = 'symbolInstance' ,
159
- SymbolMaster = 'symbolMaster' ,
160
- Text = 'text' ,
161
- Triangle = 'triangle' ,
162
- Svg = 'svg' ,
163
- }
164
-
165
- export type LayerClassType =
166
- | 'artboard'
167
- | 'bitmap'
168
- | 'border'
169
- | 'borderOptions'
170
- | 'color'
171
- | 'fill'
172
- | 'gradient'
173
- | 'group'
174
- | 'innerShadow'
175
- | 'ellipse'
176
- | 'oval' // sketch 中 用的是 oval
177
- | 'page'
178
- | 'polygon'
179
- | 'rect'
180
- | 'rectangle'
181
- | 'shadow'
182
- | 'shapeGroup'
183
- | 'shapePath'
184
- | 'slice'
185
- | 'star'
186
- | 'symbolInstance'
187
- | 'symbolMaster'
188
- | 'text'
189
- | 'triangle'
190
- | 'svg' ;
Original file line number Diff line number Diff line change 1
- import { SketchFormat } from './sketchFormat' ;
2
-
3
- import Color , { ColorParam } from '../models/Style/Color' ;
4
-
5
1
/**
6
2
* 获得 CG 点的配置
7
3
*/
@@ -10,54 +6,56 @@ export interface CGPoint {
10
6
y : number ;
11
7
}
12
8
13
- /**
14
- * =====渐变定义=====
15
- */
16
-
17
- /**
18
- * 传入颜色间隔点的参数
19
- */
20
- export interface ColorStopParam {
21
- color : ColorParam ;
22
- offset : number ;
9
+ export declare enum LayerClassValue {
10
+ Artboard = 'artboard' ,
11
+ Bitmap = 'bitmap' ,
12
+ Border = 'border' ,
13
+ BorderOptions = 'borderOptions' ,
14
+ Color = 'color' ,
15
+ Fill = 'fill' ,
16
+ Gradient = 'gradient' ,
17
+ Group = 'group' ,
18
+ InnerShadow = 'innerShadow' ,
19
+ Oval = 'oval' ,
20
+ Page = 'page' ,
21
+ Polygon = 'polygon' ,
22
+ Rect = 'rect' ,
23
+ Rectangle = 'rectangle' ,
24
+ Shadow = 'shadow' ,
25
+ ShapeGroup = 'shapeGroup' ,
26
+ ShapePath = 'shapePath' ,
27
+ Slice = 'slice' ,
28
+ Star = 'star' ,
29
+ SymbolInstance = 'symbolInstance' ,
30
+ SymbolMaster = 'symbolMaster' ,
31
+ Text = 'text' ,
32
+ Triangle = 'triangle' ,
33
+ Svg = 'svg' ,
23
34
}
24
35
25
- export type StopParam = ColorParam | ColorStopParam ;
26
-
27
- export interface GradientProps {
28
- /**
29
- * 渐变类型
30
- */
31
- type ?: SketchFormat . GradientType ;
32
- /**
33
- * 终点
34
- */
35
- to ?: CGPoint ;
36
- /**
37
- * 起点
38
- */
39
- from ?: CGPoint ;
40
- /**
41
- * 色彩间隔点
42
- */
43
- stops ?: StopParam [ ] ;
44
- /**
45
- * 渐变名称
46
- */
47
- name ?: string ;
48
- /**
49
- * 如果是圆形渐变 则需要传入 radius 值
50
- */
51
- radius ?: number ;
52
- }
53
-
54
- export interface ColorStop {
55
- /**
56
- * 偏移位置 取值 0-1
57
- */
58
- offset ?: number ;
59
- /**
60
- * 颜色对象
61
- */
62
- color : Color ;
63
- }
36
+ export type LayerClassType =
37
+ | 'artboard'
38
+ | 'bitmap'
39
+ | 'border'
40
+ | 'borderOptions'
41
+ | 'color'
42
+ | 'fill'
43
+ | 'gradient'
44
+ | 'group'
45
+ | 'innerShadow'
46
+ | 'ellipse'
47
+ | 'oval' // sketch 中 用的是 oval
48
+ | 'page'
49
+ | 'polygon'
50
+ | 'rect'
51
+ | 'rectangle'
52
+ | 'shadow'
53
+ | 'shapeGroup'
54
+ | 'shapePath'
55
+ | 'slice'
56
+ | 'star'
57
+ | 'symbolInstance'
58
+ | 'symbolMaster'
59
+ | 'text'
60
+ | 'triangle'
61
+ | 'svg' ;
You can’t perform that action at this time.
0 commit comments