@pixldocs/canvas-renderer 0.5.140 → 0.5.142
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-DhQsu_MH.cjs → index-CBXAcuts.cjs} +20 -13
- package/dist/{index-DhQsu_MH.cjs.map → index-CBXAcuts.cjs.map} +1 -1
- package/dist/{index-Dk-69Lq1.js → index-MJxDhnDv.js} +20 -13
- package/dist/{index-Dk-69Lq1.js.map → index-MJxDhnDv.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/{pdfFonts-BU2Lqz_O.cjs → pdfFonts-BTEVnYX8.cjs} +3 -1
- package/dist/{pdfFonts-BU2Lqz_O.cjs.map → pdfFonts-BTEVnYX8.cjs.map} +1 -1
- package/dist/{pdfFonts-BVHbPFEz.js → pdfFonts-b3_bv7F0.js} +3 -1
- package/dist/{pdfFonts-BVHbPFEz.js.map → pdfFonts-b3_bv7F0.js.map} +1 -1
- package/dist/{svgTextToPath-GeR0CexD.cjs → svgTextToPath-DolCNU9g.cjs} +2 -2
- package/dist/{svgTextToPath-GeR0CexD.cjs.map → svgTextToPath-DolCNU9g.cjs.map} +1 -1
- package/dist/{svgTextToPath-DG7rcbDE.js → svgTextToPath-ws6Fh3rx.js} +2 -2
- package/dist/{svgTextToPath-DG7rcbDE.js.map → svgTextToPath-ws6Fh3rx.js.map} +1 -1
- package/dist/{vectorPdfExport-CAZ5WjdB.js → vectorPdfExport-CnC7-RiI.js} +28 -7
- package/dist/vectorPdfExport-CnC7-RiI.js.map +1 -0
- package/dist/{vectorPdfExport-uR2FxMCo.cjs → vectorPdfExport-fTlcySFg.cjs} +28 -7
- package/dist/vectorPdfExport-fTlcySFg.cjs.map +1 -0
- package/package.json +1 -1
- package/dist/vectorPdfExport-CAZ5WjdB.js.map +0 -1
- package/dist/vectorPdfExport-uR2FxMCo.cjs.map +0 -1
|
@@ -14894,7 +14894,7 @@ function collectFontsFromConfig(config) {
|
|
|
14894
14894
|
}
|
|
14895
14895
|
return fonts;
|
|
14896
14896
|
}
|
|
14897
|
-
function collectFontDescriptorsFromConfig(config) {
|
|
14897
|
+
function collectFontDescriptorsFromConfig(config, includeCommonTextVariants = true) {
|
|
14898
14898
|
var _a;
|
|
14899
14899
|
const seen = /* @__PURE__ */ new Set();
|
|
14900
14900
|
const descriptors = [];
|
|
@@ -14914,7 +14914,7 @@ function collectFontDescriptorsFromConfig(config) {
|
|
|
14914
14914
|
for (const node of nodes) {
|
|
14915
14915
|
if (node.fontFamily) {
|
|
14916
14916
|
add(node.fontFamily, node.fontWeight, node.fontStyle);
|
|
14917
|
-
if (node.type === "text") {
|
|
14917
|
+
if (includeCommonTextVariants && node.type === "text") {
|
|
14918
14918
|
for (const w of [300, 400, 500, 600, 700]) {
|
|
14919
14919
|
add(node.fontFamily, w, node.fontStyle);
|
|
14920
14920
|
add(node.fontFamily, w, "italic");
|
|
@@ -14974,12 +14974,19 @@ function collectFontDescriptorsFromConfig(config) {
|
|
|
14974
14974
|
}
|
|
14975
14975
|
async function ensureFontsForResolvedConfig(config) {
|
|
14976
14976
|
if (typeof document === "undefined") return;
|
|
14977
|
-
const descriptors = collectFontDescriptorsFromConfig(config);
|
|
14977
|
+
const descriptors = collectFontDescriptorsFromConfig(config, false);
|
|
14978
14978
|
const families = new Set(descriptors.map((d) => d.family));
|
|
14979
|
-
await withTimeout(Promise.all(
|
|
14980
|
-
|
|
14981
|
-
|
|
14982
|
-
)
|
|
14979
|
+
const proxyOutcomes = await withTimeout(Promise.all(
|
|
14980
|
+
descriptors.map(async (d) => ({ family: d.family, ok: await registerRemoteFontFaceViaProxy(d.family, d.weight, d.style) }))
|
|
14981
|
+
), 9e3);
|
|
14982
|
+
const proxyLoadedFamilies = new Set((proxyOutcomes || []).filter((r) => r.ok).map((r) => r.family));
|
|
14983
|
+
await withTimeout(Promise.all([...families].map((f) => {
|
|
14984
|
+
if (proxyLoadedFamilies.has(f)) {
|
|
14985
|
+
loadedFonts.add(f);
|
|
14986
|
+
return Promise.resolve();
|
|
14987
|
+
}
|
|
14988
|
+
return loadGoogleFontCSS(f);
|
|
14989
|
+
})), 3500);
|
|
14983
14990
|
if (document.fonts) {
|
|
14984
14991
|
descriptors.forEach((d) => {
|
|
14985
14992
|
const stylePrefix = d.style === "italic" ? "italic " : "";
|
|
@@ -15009,7 +15016,7 @@ function configHasAutoShrinkText$1(config) {
|
|
|
15009
15016
|
async function awaitFontsForConfig(config, maxWaitMs) {
|
|
15010
15017
|
if (typeof document === "undefined" || !document.fonts) return;
|
|
15011
15018
|
await ensureFontsForResolvedConfig(config);
|
|
15012
|
-
const descriptors = collectFontDescriptorsFromConfig(config);
|
|
15019
|
+
const descriptors = collectFontDescriptorsFromConfig(config, false);
|
|
15013
15020
|
if (descriptors.length === 0) return;
|
|
15014
15021
|
const overallBudget = Math.max(maxWaitMs, 5e3);
|
|
15015
15022
|
const loads = Promise.all(
|
|
@@ -15967,7 +15974,7 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
15967
15974
|
}
|
|
15968
15975
|
return svgString;
|
|
15969
15976
|
}
|
|
15970
|
-
const PACKAGE_VERSION = "0.5.
|
|
15977
|
+
const PACKAGE_VERSION = "0.5.142";
|
|
15971
15978
|
const roundParityValue = (value) => {
|
|
15972
15979
|
if (typeof value !== "number") return value;
|
|
15973
15980
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -16392,7 +16399,7 @@ class PixldocsRenderer {
|
|
|
16392
16399
|
await this.waitForCanvasScene(container, cloned, i);
|
|
16393
16400
|
}
|
|
16394
16401
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
16395
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
16402
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-fTlcySFg.cjs"));
|
|
16396
16403
|
const prepared = preparePagesForExport(
|
|
16397
16404
|
cloned.pages,
|
|
16398
16405
|
canvasWidth,
|
|
@@ -18490,7 +18497,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
18490
18497
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
18491
18498
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
18492
18499
|
try {
|
|
18493
|
-
const { bakeTextAnchorPositionsFromLiveSvg } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
18500
|
+
const { bakeTextAnchorPositionsFromLiveSvg } = await Promise.resolve().then(() => require("./vectorPdfExport-fTlcySFg.cjs"));
|
|
18494
18501
|
await bakeTextAnchorPositionsFromLiveSvg(svgToDraw);
|
|
18495
18502
|
} catch (e) {
|
|
18496
18503
|
console.warn("[canvas-renderer][pdf-export] anchor-bake pass failed (continuing):", e);
|
|
@@ -18621,7 +18628,7 @@ async function assemblePdfFromSvgs(svgResults, options = {}) {
|
|
|
18621
18628
|
}
|
|
18622
18629
|
if (shouldOutlineText) {
|
|
18623
18630
|
try {
|
|
18624
|
-
const { convertAllTextToPath } = await Promise.resolve().then(() => require("./svgTextToPath-
|
|
18631
|
+
const { convertAllTextToPath } = await Promise.resolve().then(() => require("./svgTextToPath-DolCNU9g.cjs"));
|
|
18625
18632
|
pageSvg = await convertAllTextToPath(pageSvg, fontBaseUrl, { mode: outlineSubMode });
|
|
18626
18633
|
try {
|
|
18627
18634
|
dumpSvgTextDiagnostics(pageSvg, i, PARITY_TAG, "STAGE-1b-after-text-to-path-raw");
|
|
@@ -18832,4 +18839,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
18832
18839
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
18833
18840
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
18834
18841
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
18835
|
-
//# sourceMappingURL=index-
|
|
18842
|
+
//# sourceMappingURL=index-CBXAcuts.cjs.map
|