File tree Expand file tree Collapse file tree 4 files changed +63
-2
lines changed Expand file tree Collapse file tree 4 files changed +63
-2
lines changed Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" UTF-8" standalone =" yes" ?>
2
2
<rss xmlns : sparkle =" http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns : dc =" http://purl.org/dc/elements/1.1/" version =" 2.0" >
3
3
<channel >
4
+ <item >
5
+ <enclosure url =" https://github.com/Coding/coding-sketch-toolkit/releases/download/v0.4.0/coding-toolkit.sketchplugin.zip" sparkle : version =" 0.4.0" />
6
+ </item >
4
7
<item >
5
8
<enclosure url =" https://github.com/Coding/coding-sketch-toolkit/releases/download/v0.3.0/coding-toolkit.sketchplugin.zip" sparkle : version =" 0.3.0" />
6
9
</item >
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ Dev Library 分类中的命令主要用于开发 Sketch Library 时使用。
8
8
### 1. Update Icon 升级图标
9
9
用于替换旧版 CODING Icon 至新版 CODING Icon,在设计稿中选中来自旧版的 CODING Icon Library 的 symbol 然后执行此命令即可自动替换为对应的新版 CODING ICON,并且保留原来 icon 覆盖的颜色。
10
10
11
- ### 2. Genrarte Icon Library Collection 生成图标合集
11
+ ### 2. Generate Icon Library Collection 生成图标合集
12
12
用与在 CODING Icon Library 文件中修改或添加 icon 后重新生成 icon 集合,以便在 Abstract 中查找 icon。执行此命令将会自动删除原 Page 1 中的 icon collection 画板然后重新生成新的画板。
13
13
更新 CODING Icon 的具体方法请查看此 [ Wiki] ( https://codingcorp.coding.net/p/Design-Center/wiki/1495 )
14
14
Original file line number Diff line number Diff line change
1
+ const sketch = require ( 'sketch' )
2
+
3
+ export default function ( ) {
4
+ const document = sketch . getSelectedDocument ( )
5
+ const selection = document . selectedLayers . layers
6
+
7
+ function postIcon ( iconCatalog , iconName , iconCode ) {
8
+ let requestOptions = {
9
+ method : 'POST' ,
10
+ headers : {
11
+ "Authorization" : "Basic cHQxMTVrMnBmcDU0OmJmM2NiNWYzM2M0ZGU5ZmJlNmNjYWFhNjZhM2QwZmEwYzAxY2Q3ODk=" ,
12
+ "Content-Type" : "application/json"
13
+ } ,
14
+ body : JSON . stringify ( {
15
+ "ref" : "master" ,
16
+ "envs" : [
17
+ {
18
+ "name" : "ICON_CATALOG" ,
19
+ "value" : iconCatalog ,
20
+ "sensitive" : 0
21
+ } ,
22
+ {
23
+ "name" : "ICON_NAME" ,
24
+ "value" : iconName ,
25
+ "sensitive" : 0
26
+ } ,
27
+ {
28
+ "name" : "ICON_CODE" ,
29
+ "value" : iconCode . replace ( / " / g, '\\\"' ) ,
30
+ "sensitive" : 0
31
+ }
32
+ ]
33
+ } )
34
+ }
35
+
36
+ fetch ( "https://codingcorp.coding.net/api/cci/job/168479/trigger" , requestOptions )
37
+ . then ( response => response . text ( ) )
38
+ . then ( result => console . log ( result ) )
39
+ . catch ( error => console . log ( 'error' , error ) ) ;
40
+ }
41
+
42
+ selection . map ( layer => {
43
+ console . log ( layer )
44
+ const options = { formats : 'svg' , output : false , compact : true }
45
+ const sketchSVG = sketch . export ( layer , options )
46
+ console . log ( sketchSVG . toString ( ) )
47
+ postIcon ( "Arrow" , "right-arrow" , sketchSVG . toString ( ) )
48
+ } )
49
+
50
+ sketch . UI . message ( "Well Done!" )
51
+
52
+ }
Original file line number Diff line number Diff line change 18
18
"identifier" : " coding-toolkit.create-symbol-instance" ,
19
19
"script" : " ./dev-library/create-symbol-instance.js"
20
20
},
21
+ {
22
+ "name" : " Push New Icon To UIKit" ,
23
+ "identifier" : " coding-toolkit.push-new-icon-to-uikit" ,
24
+ "script" : " ./dev-library/push-new-icon-to-uikit.js"
25
+ },
21
26
{
22
27
"script" : " data-supplier.js" ,
23
28
"handlers" : {
41
46
"title" : " Dev Library" ,
42
47
"items" : [
43
48
" coding-toolkit.generate-icons-collection" ,
44
- " coding-toolkit.create-symbol-instance"
49
+ " coding-toolkit.create-symbol-instance" ,
50
+ " coding-toolkit.push-new-icon-to-uikit"
45
51
]
46
52
}
47
53
]
You can’t perform that action at this time.
0 commit comments