image-exporter 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.browser.js +13 -13
- package/dist/index.browser.js.map +4 -4
- package/dist/index.cjs +18 -2
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -2
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2,4 +2,6 @@ import { capture } from "./capture";
|
|
|
2
2
|
import { downloadImages } from "./capture/download-images";
|
|
3
3
|
/** Exports for use as an imported package */
|
|
4
4
|
export { capture, downloadImages };
|
|
5
|
+
/** Type exports */
|
|
6
|
+
export type { ImageOptions, Config, ParsedImageOptions, Image, Label, Format, Scale, Quality, IncludeScaleInLabel, LoggingLevel, } from "./types";
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAQ3D,6CAA6C;AAC7C,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAQ3D,6CAA6C;AAC7C,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC;AAEnC,mBAAmB;AACnB,YAAY,EACV,YAAY,EACZ,MAAM,EACN,kBAAkB,EAClB,KAAK,EACL,KAAK,EACL,MAAM,EACN,KAAK,EACL,OAAO,EACP,mBAAmB,EACnB,YAAY,GACb,MAAM,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -12972,6 +12972,7 @@ var IN_FIREFOX = USER_AGENT.includes("Firefox");
|
|
|
12972
12972
|
var isContext = (value) => value && ("__CONTEXT__" in value);
|
|
12973
12973
|
var isCssFontFaceRule = (rule) => rule.constructor.name === "CSSFontFaceRule";
|
|
12974
12974
|
var isCSSImportRule = (rule) => rule.constructor.name === "CSSImportRule";
|
|
12975
|
+
var isLayerBlockRule = (rule) => rule.constructor.name === "CSSLayerBlockRule";
|
|
12975
12976
|
var isElementNode = (node) => node.nodeType === 1;
|
|
12976
12977
|
var isSVGElementNode = (node) => typeof node.className === "object";
|
|
12977
12978
|
var isSVGImageElementNode = (node) => node.tagName === "image";
|
|
@@ -14133,7 +14134,10 @@ async function embedWebFont(clone, context) {
|
|
|
14133
14134
|
}
|
|
14134
14135
|
});
|
|
14135
14136
|
}));
|
|
14136
|
-
const cssRules =
|
|
14137
|
+
const cssRules = [];
|
|
14138
|
+
styleSheets.forEach((sheet) => {
|
|
14139
|
+
unwrapCssLayers(sheet.cssRules, cssRules);
|
|
14140
|
+
});
|
|
14137
14141
|
cssRules.filter((cssRule) => isCssFontFaceRule(cssRule) && hasCssUrl(cssRule.style.getPropertyValue("src")) && splitFontFamily(cssRule.style.getPropertyValue("font-family"))?.some((val) => fontFamilies.has(val))).forEach((value) => {
|
|
14138
14142
|
const rule = value;
|
|
14139
14143
|
const cssText = fontCssTexts.get(rule.cssText);
|
|
@@ -14198,6 +14202,18 @@ function filterPreferredFormat(str, context) {
|
|
|
14198
14202
|
}
|
|
14199
14203
|
}) : str;
|
|
14200
14204
|
}
|
|
14205
|
+
function unwrapCssLayers(rules, out = []) {
|
|
14206
|
+
for (const rule of Array.from(rules)) {
|
|
14207
|
+
if (isLayerBlockRule(rule)) {
|
|
14208
|
+
out.push(...unwrapCssLayers(rule.cssRules));
|
|
14209
|
+
} else if ("cssRules" in rule) {
|
|
14210
|
+
unwrapCssLayers(rule.cssRules, out);
|
|
14211
|
+
} else {
|
|
14212
|
+
out.push(rule);
|
|
14213
|
+
}
|
|
14214
|
+
}
|
|
14215
|
+
return out;
|
|
14216
|
+
}
|
|
14201
14217
|
async function domToForeignObjectSvg(node, options) {
|
|
14202
14218
|
const context = await orCreateContext(node, options);
|
|
14203
14219
|
if (isElementNode(context.node) && isSVGElementNode(context.node))
|
|
@@ -14866,4 +14882,4 @@ export {
|
|
|
14866
14882
|
capture
|
|
14867
14883
|
};
|
|
14868
14884
|
|
|
14869
|
-
//# debugId=
|
|
14885
|
+
//# debugId=645E7EC2D314578E64756E2164756E21
|