Commit 2f8ff5e
authored
Replace JPEG with PNG with background for export-as-image (#19305)
## Description
Replace JPEG with PNG (with optional background) for the visual
designer's export-as-image feature.
## Changes
- Replace `ExportFormat` (`png` | `jpeg`) with `ExportBackgroundMode`
(`transparent` | `solid`) to let users choose the background style
instead of the file format.
- Always export as PNG (with 2x pixel ratio for retina quality),
removing JPEG support and the `toJpeg` import from `html-to-image`.
- Simplify `captureGraphElement` and `saveDataUrl` by removing the
format parameter; background color is now passed as `undefined` for
transparent mode.
- Update the export toolbar UI:
- Replace the Format dropdown with a Background dropdown (Transparent /
Solid).
- Shorten high-contrast theme labels to `Dark HC` and `Light HC`.
- Rename the export button from `Save As` to `Export`.
- Clean up removed constants (`FORMAT_MIME`, `FORMAT_DESC`,
`DEFAULT_EXPORT_FORMAT`) and update atom/type exports.
###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/Azure/bicep/pull/19305)1 parent 48cf443 commit 2f8ff5e
File tree
5 files changed
+45
-62
lines changed- src/vscode-bicep-ui/apps/visual-designer/src/features/export
5 files changed
+45
-62
lines changedLines changed: 32 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | | - | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
| 53 | + | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
147 | 151 | | |
148 | 152 | | |
149 | 153 | | |
| |||
213 | 217 | | |
214 | 218 | | |
215 | 219 | | |
216 | | - | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
217 | 224 | | |
218 | 225 | | |
219 | 226 | | |
220 | 227 | | |
221 | 228 | | |
222 | | - | |
223 | | - | |
| 229 | + | |
| 230 | + | |
224 | 231 | | |
225 | 232 | | |
226 | 233 | | |
| |||
232 | 239 | | |
233 | 240 | | |
234 | 241 | | |
235 | | - | |
| 242 | + | |
236 | 243 | | |
237 | 244 | | |
238 | 245 | | |
239 | 246 | | |
240 | 247 | | |
241 | | - | |
| 248 | + | |
242 | 249 | | |
243 | 250 | | |
244 | 251 | | |
| |||
252 | 259 | | |
253 | 260 | | |
254 | 261 | | |
255 | | - | |
| 262 | + | |
| 263 | + | |
256 | 264 | | |
257 | | - | |
| 265 | + | |
258 | 266 | | |
259 | 267 | | |
260 | 268 | | |
261 | 269 | | |
262 | 270 | | |
263 | | - | |
| 271 | + | |
264 | 272 | | |
265 | 273 | | |
266 | 274 | | |
| |||
297 | 305 | | |
298 | 306 | | |
299 | 307 | | |
300 | | - | |
| 308 | + | |
301 | 309 | | |
302 | | - | |
| 310 | + | |
303 | 311 | | |
304 | | - | |
| 312 | + | |
305 | 313 | | |
306 | 314 | | |
307 | 315 | | |
| |||
314 | 322 | | |
315 | 323 | | |
316 | 324 | | |
317 | | - | |
| 325 | + | |
318 | 326 | | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
324 | 332 | | |
325 | 333 | | |
326 | | - | |
| 334 | + | |
327 | 335 | | |
328 | 336 | | |
329 | 337 | | |
| |||
368 | 376 | | |
369 | 377 | | |
370 | 378 | | |
371 | | - | |
372 | | - | |
| 379 | + | |
373 | 380 | | |
374 | 381 | | |
375 | 382 | | |
| |||
Lines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
16 | | - | |
| 15 | + | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| |||
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
33 | | - | |
| 32 | + | |
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
| |||
Lines changed: 8 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
| 4 | + | |
7 | 5 | | |
8 | 6 | | |
9 | 7 | | |
| |||
76 | 74 | | |
77 | 75 | | |
78 | 76 | | |
79 | | - | |
80 | 77 | | |
81 | | - | |
| 78 | + | |
82 | 79 | | |
83 | 80 | | |
84 | 81 | | |
| |||
131 | 128 | | |
132 | 129 | | |
133 | 130 | | |
134 | | - | |
| 131 | + | |
| 132 | + | |
135 | 133 | | |
136 | 134 | | |
137 | 135 | | |
| |||
141 | 139 | | |
142 | 140 | | |
143 | 141 | | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
| 142 | + | |
154 | 143 | | |
155 | 144 | | |
156 | 145 | | |
157 | 146 | | |
158 | 147 | | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | 148 | | |
172 | 149 | | |
173 | 150 | | |
| |||
194 | 171 | | |
195 | 172 | | |
196 | 173 | | |
197 | | - | |
| 174 | + | |
198 | 175 | | |
199 | 176 | | |
200 | 177 | | |
| |||
204 | 181 | | |
205 | 182 | | |
206 | 183 | | |
207 | | - | |
208 | | - | |
| 184 | + | |
| 185 | + | |
209 | 186 | | |
210 | 187 | | |
211 | 188 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
0 commit comments