You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/services/figma/index.ts
+62-19Lines changed: 62 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -102,34 +102,65 @@ export class FigmaTools {
102
102
name: 'Download-Figma-Images',
103
103
description: 'Download SVG and PNG images used in a Figma file based on the IDs of image or icon nodes',
104
104
parameters: z.object({
105
-
fileKey: z.string().describe('The key of the Figma file containing the node'),
105
+
fileKey: z.string().describe("The key of the Figma file containing the node"),
106
106
nodes: z
107
107
.object({
108
108
nodeId: z
109
109
.string()
110
-
.describe('The ID of the Figma image node to fetch, formatted as 1234:5678'),
110
+
.describe("The ID of the Figma image node to fetch, formatted as 1234:5678"),
111
111
imageRef: z
112
112
.string()
113
113
.optional()
114
114
.describe(
115
-
'If a node has an imageRef fill, you must include this variable. Leave blank when downloading Vector SVG images.',
115
+
"If a node has an imageRef fill, you must include this variable. Leave blank when downloading Vector SVG images.",
116
116
),
117
-
fileName: z.string().describe('The local name for saving the fetched file'),
117
+
fileName: z.string().describe("The local name for saving the fetched file"),
118
118
})
119
119
.array()
120
-
.describe('The nodes to fetch as images'),
120
+
.describe("The nodes to fetch as images"),
121
+
pngScale: z
122
+
.number()
123
+
.positive()
124
+
.optional()
125
+
.default(2)
126
+
.describe(
127
+
"Export scale for PNG images. Optional, defaults to 2 if not specified. Affects PNG images only.",
128
+
),
121
129
localPath: z
122
130
.string()
123
131
.describe(
124
-
'The absolute path to the directory where images are stored in the project. If the directory does not exist, it will be created. The format of this path should respect the directory format of the operating system you are running on. Don\'t use any special character escaping in the path name either.',
132
+
"The absolute path to the directory where images are stored in the project. If the directory does not exist, it will be created. The format of this path should respect the directory format of the operating system you are running on. Don't use any special character escaping in the path name either.",
125
133
),
134
+
svgOptions: z
135
+
.object({
136
+
outlineText: z
137
+
.boolean()
138
+
.optional()
139
+
.default(true)
140
+
.describe("Whether to outline text in SVG exports. Default is true."),
141
+
includeId: z
142
+
.boolean()
143
+
.optional()
144
+
.default(false)
145
+
.describe("Whether to include IDs in SVG exports. Default is false."),
146
+
simplifyStroke: z
147
+
.boolean()
148
+
.optional()
149
+
.default(true)
150
+
.describe("Whether to simplify strokes in SVG exports. Default is true."),
Copy file name to clipboardExpand all lines: src/services/utility/index.ts
+38-7Lines changed: 38 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -40,34 +40,65 @@ export class UtilityTools {
40
40
name: 'download-svg-assets',
41
41
description: '根据图像或图标节点的ID,仅下载Figma文件中使用的SVG资源',
42
42
parameters: z.object({
43
-
fileKey: z.string().describe('The key of the Figma file containing the node'),
43
+
fileKey: z.string().describe("The key of the Figma file containing the node"),
44
44
nodes: z
45
45
.object({
46
46
nodeId: z
47
47
.string()
48
-
.describe('The ID of the Figma image node to fetch, formatted as 1234:5678'),
48
+
.describe("The ID of the Figma image node to fetch, formatted as 1234:5678"),
49
49
imageRef: z
50
50
.string()
51
51
.optional()
52
52
.describe(
53
-
'If a node has an imageRef fill, you must include this variable. Leave blank when downloading Vector SVG images.',
53
+
"If a node has an imageRef fill, you must include this variable. Leave blank when downloading Vector SVG images.",
54
54
),
55
-
fileName: z.string().describe('The local name for saving the fetched file'),
55
+
fileName: z.string().describe("The local name for saving the fetched file"),
56
56
})
57
57
.array()
58
-
.describe('The nodes to fetch as images'),
58
+
.describe("The nodes to fetch as images"),
59
+
pngScale: z
60
+
.number()
61
+
.positive()
62
+
.optional()
63
+
.default(2)
64
+
.describe(
65
+
"Export scale for PNG images. Optional, defaults to 2 if not specified. Affects PNG images only.",
66
+
),
59
67
localPath: z
60
68
.string()
61
69
.describe(
62
-
'The absolute path to the directory where images are stored in the project. If the directory does not exist, it will be created. The format of this path should respect the directory format of the operating system you are running on. Don\'t use any special character escaping in the path name either.',
70
+
"The absolute path to the directory where images are stored in the project. If the directory does not exist, it will be created. The format of this path should respect the directory format of the operating system you are running on. Don't use any special character escaping in the path name either.",
63
71
),
72
+
svgOptions: z
73
+
.object({
74
+
outlineText: z
75
+
.boolean()
76
+
.optional()
77
+
.default(true)
78
+
.describe("Whether to outline text in SVG exports. Default is true."),
79
+
includeId: z
80
+
.boolean()
81
+
.optional()
82
+
.default(false)
83
+
.describe("Whether to include IDs in SVG exports. Default is false."),
84
+
simplifyStroke: z
85
+
.boolean()
86
+
.optional()
87
+
.default(true)
88
+
.describe("Whether to simplify strokes in SVG exports. Default is true."),
0 commit comments