@pixldocs/canvas-renderer 0.5.71 → 0.5.72
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.cjs +4 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -34
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -256,7 +256,7 @@ export declare function normalizeFontFamily(fontStack: string): string;
|
|
|
256
256
|
* Package version banner. Bump alongside package.json so we can confirm
|
|
257
257
|
* (via browser:log) that the deployed bundle matches the expected build.
|
|
258
258
|
*/
|
|
259
|
-
export declare const PACKAGE_VERSION = "0.5.
|
|
259
|
+
export declare const PACKAGE_VERSION = "0.5.72";
|
|
260
260
|
|
|
261
261
|
export declare interface PageSettings {
|
|
262
262
|
backgroundColor?: string;
|
package/dist/index.js
CHANGED
|
@@ -12369,7 +12369,6 @@ function PixldocsPreview(props) {
|
|
|
12369
12369
|
const [resolvedConfig, setResolvedConfig] = useState(null);
|
|
12370
12370
|
const [isLoading, setIsLoading] = useState(false);
|
|
12371
12371
|
const [fontsReady, setFontsReady] = useState(false);
|
|
12372
|
-
const [fontsReadyVersion, setFontsReadyVersion] = useState(0);
|
|
12373
12372
|
const [canvasSettled, setCanvasSettled] = useState(false);
|
|
12374
12373
|
const [stabilizationPass, setStabilizationPass] = useState(0);
|
|
12375
12374
|
const isResolveMode = !("config" in props && props.config);
|
|
@@ -12442,38 +12441,9 @@ function PixldocsPreview(props) {
|
|
|
12442
12441
|
isResolveMode ? props.themeId : void 0
|
|
12443
12442
|
]);
|
|
12444
12443
|
const config = isResolveMode ? resolvedConfig : props.config;
|
|
12445
|
-
useEffect(() => {
|
|
12446
|
-
var _a, _b, _c;
|
|
12447
|
-
if (!config) return;
|
|
12448
|
-
let cancelled = false;
|
|
12449
|
-
setCanvasSettled(false);
|
|
12450
|
-
setStabilizationPass(0);
|
|
12451
|
-
console.log(PREVIEW_DEBUG_PREFIX, "config-changed", {
|
|
12452
|
-
pageIndex,
|
|
12453
|
-
pages: ((_a = config.pages) == null ? void 0 : _a.length) ?? 0,
|
|
12454
|
-
underlinedNodes: countUnderlinedNodes(config),
|
|
12455
|
-
isResolveMode
|
|
12456
|
-
});
|
|
12457
|
-
const bump = () => {
|
|
12458
|
-
if (cancelled) return;
|
|
12459
|
-
clearMeasurementCache();
|
|
12460
|
-
clearFabricCharCache();
|
|
12461
|
-
setFontsReadyVersion((v) => {
|
|
12462
|
-
const next = v + 1;
|
|
12463
|
-
console.log(PREVIEW_DEBUG_PREFIX, "font-bump", { pageIndex, next, stabilizationPass });
|
|
12464
|
-
return next;
|
|
12465
|
-
});
|
|
12466
|
-
};
|
|
12467
|
-
(_c = (_b = document.fonts) == null ? void 0 : _b.ready) == null ? void 0 : _c.then(bump);
|
|
12468
|
-
const timeoutId = window.setTimeout(bump, 350);
|
|
12469
|
-
return () => {
|
|
12470
|
-
cancelled = true;
|
|
12471
|
-
window.clearTimeout(timeoutId);
|
|
12472
|
-
};
|
|
12473
|
-
}, [config]);
|
|
12474
12444
|
const previewKey = useMemo(
|
|
12475
|
-
() => `${pageIndex}-${
|
|
12476
|
-
[pageIndex,
|
|
12445
|
+
() => `${pageIndex}-${stabilizationPass}`,
|
|
12446
|
+
[pageIndex, stabilizationPass]
|
|
12477
12447
|
);
|
|
12478
12448
|
useEffect(() => {
|
|
12479
12449
|
if (isResolveMode) return;
|
|
@@ -12542,7 +12512,7 @@ function PixldocsPreview(props) {
|
|
|
12542
12512
|
!canvasSettled && /* @__PURE__ */ jsx("div", { style: { position: "absolute", inset: 0, display: "flex", alignItems: "center", justifyContent: "center", minHeight: 200 }, children: /* @__PURE__ */ jsx("div", { style: { color: "#888", fontSize: 14 }, children: "Loading preview..." }) })
|
|
12543
12513
|
] });
|
|
12544
12514
|
}
|
|
12545
|
-
const PACKAGE_VERSION = "0.5.
|
|
12515
|
+
const PACKAGE_VERSION = "0.5.72";
|
|
12546
12516
|
let __underlineFixInstalled = false;
|
|
12547
12517
|
function installUnderlineFix(fab) {
|
|
12548
12518
|
var _a;
|
|
@@ -15659,7 +15629,7 @@ async function assemblePdfFromSvgs(svgResults, options = {}) {
|
|
|
15659
15629
|
const hasGradient = !!((_b = (_a = page.backgroundGradient) == null ? void 0 : _a.stops) == null ? void 0 : _b.length);
|
|
15660
15630
|
drawPageBackground(pdf, i, page.width, page.height, page.backgroundColor, page.backgroundGradient);
|
|
15661
15631
|
const shouldStripBg = stripPageBackground ?? hasGradient;
|
|
15662
|
-
const shouldOutlineText = options.outlineText
|
|
15632
|
+
const shouldOutlineText = options.outlineText !== false;
|
|
15663
15633
|
const pageSvg = page.svg;
|
|
15664
15634
|
let processedSvg = await prepareLiveCanvasSvgForPdf(pageSvg, page.width, page.height, `page-${i + 1}`, {
|
|
15665
15635
|
stripPageBackground: shouldStripBg
|