@figma-export/core
Advanced tools
Comparing version 4.8.0-alpha.2 to 4.8.0-alpha.3
@@ -17,2 +17,4 @@ /// <reference types="react" /> | ||
readonly [key: string]: string; | ||
} | { | ||
readonly [key: string]: string | null; | ||
}>; | ||
@@ -19,0 +21,0 @@ declare type FigmaExportFileSvg = { |
@@ -157,3 +157,12 @@ "use strict"; | ||
}); | ||
return response.data.images; | ||
/** | ||
* // TODO: wrong `Figma.FileImageResponse` type on `figma-js` | ||
* | ||
* Important: the image map may contain values that are null. | ||
* This indicates that rendering of that specific node has failed. | ||
* This may be due to the node id not existing, or other reasons such has the node having no renderable components. | ||
* For example, a node that is invisible or has 0 % opacity cannot be rendered. | ||
*/ | ||
const { images } = response.data; | ||
return images; | ||
}); | ||
@@ -175,3 +184,5 @@ const getImages = (client, fileId, ids, version) => __awaiter(void 0, void 0, void 0, function* () { | ||
let index = 0; | ||
const svgPromises = Object.entries(images).map(([id, url]) => __awaiter(void 0, void 0, void 0, function* () { | ||
const svgPromises = Object.entries(images) | ||
.filter((image) => typeof image[1] === 'string') | ||
.map(([id, url]) => __awaiter(void 0, void 0, void 0, function* () { | ||
const svg = yield limit(() => (0, p_retry_1.default)(() => (0, utils_1.fetchAsSvgXml)(url), { retries })); | ||
@@ -178,0 +189,0 @@ const svgTransformed = yield (0, utils_1.promiseSequentially)(transformers, svg); |
{ | ||
"name": "@figma-export/core", | ||
"version": "4.8.0-alpha.2", | ||
"version": "4.8.0-alpha.3", | ||
"description": "@figma-export core functionalities", | ||
@@ -26,3 +26,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@figma-export/types": "^4.8.0-alpha.2", | ||
"@figma-export/types": "^4.8.0-alpha.3", | ||
"axios": "^1.6.7", | ||
@@ -39,3 +39,3 @@ "figma-js": "~1.16.0", | ||
}, | ||
"gitHead": "341bf8555cfde03f7ff861aaebe1b58aa560b629" | ||
"gitHead": "f32461a8a167e607fe5d8442f986c3e7f369ebb1" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
64580
791