@pixldocs/canvas-renderer 0.5.467 → 0.5.468
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-MX3VJ8nQ.js → index-CGFOtPDx.js} +34 -34
- package/dist/index-CGFOtPDx.js.map +1 -0
- package/dist/{index-JJbf0DOF.cjs → index-DoJk8IkH.cjs} +34 -34
- package/dist/index-DoJk8IkH.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-v-hlKrdw.js → vectorPdfExport-C7FmPpVD.js} +4 -4
- package/dist/{vectorPdfExport-v-hlKrdw.js.map → vectorPdfExport-C7FmPpVD.js.map} +1 -1
- package/dist/{vectorPdfExport-CYxG1Qy-.cjs → vectorPdfExport-CsY4HpZu.cjs} +4 -4
- package/dist/{vectorPdfExport-CYxG1Qy-.cjs.map → vectorPdfExport-CsY4HpZu.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/index-JJbf0DOF.cjs.map +0 -1
- package/dist/index-MX3VJ8nQ.js.map +0 -1
|
@@ -5255,22 +5255,6 @@ function updateCoverLayout(g) {
|
|
|
5255
5255
|
if (g.clipPath) {
|
|
5256
5256
|
g.clipPath.dirty = true;
|
|
5257
5257
|
}
|
|
5258
|
-
if (fitContain && g.clipPath) {
|
|
5259
|
-
const clip = g.clipPath;
|
|
5260
|
-
const isSpecialMask = isSvgMaskClipPath(clip) || isLuminanceMaskClipPath(clip) || clip.__svgMask || clip.__edgeFadeMask;
|
|
5261
|
-
if (!isSpecialMask) {
|
|
5262
|
-
const clipW = Math.max(frameW, dispW);
|
|
5263
|
-
const clipH = Math.max(frameH, dispH);
|
|
5264
|
-
if (clip instanceof fabric__namespace.Rect) {
|
|
5265
|
-
const rxRatioCt = Number(ct.rx) || 0;
|
|
5266
|
-
const rxPx = rxRatioCt > 0.5 ? Math.min(rxRatioCt, clipW / 2, clipH / 2) : Math.max(0, Math.min(rxRatioCt * Math.min(clipW, clipH), clipW / 2, clipH / 2));
|
|
5267
|
-
clip.set({ width: clipW, height: clipH, rx: rxPx, ry: rxPx, left: offsetX, top: offsetY });
|
|
5268
|
-
} else if (clip instanceof fabric__namespace.Ellipse) {
|
|
5269
|
-
clip.set({ rx: clipW / 2, ry: clipH / 2, left: offsetX, top: offsetY });
|
|
5270
|
-
}
|
|
5271
|
-
clip.dirty = true;
|
|
5272
|
-
}
|
|
5273
|
-
}
|
|
5274
5258
|
finalizeCropGroupCoords(g);
|
|
5275
5259
|
if (g.canvas) {
|
|
5276
5260
|
g.setCoords();
|
|
@@ -12315,18 +12299,21 @@ const PageCanvas = react.forwardRef(
|
|
|
12315
12299
|
if (id && id !== "__background__") {
|
|
12316
12300
|
const width = (obj.width ?? 0) * (obj.scaleX ?? 1);
|
|
12317
12301
|
const height = (obj.height ?? 0) * (obj.scaleY ?? 1);
|
|
12318
|
-
|
|
12319
|
-
let
|
|
12320
|
-
|
|
12321
|
-
|
|
12322
|
-
|
|
12323
|
-
|
|
12324
|
-
|
|
12325
|
-
|
|
12326
|
-
|
|
12327
|
-
|
|
12302
|
+
const angle = obj.angle ?? 0;
|
|
12303
|
+
let left;
|
|
12304
|
+
let top;
|
|
12305
|
+
const centerFn = obj.getCenterPoint;
|
|
12306
|
+
if (typeof centerFn === "function") {
|
|
12307
|
+
const c = centerFn.call(obj);
|
|
12308
|
+
left = c.x - width / 2;
|
|
12309
|
+
top = c.y - height / 2;
|
|
12310
|
+
} else {
|
|
12311
|
+
left = obj.left ?? 0;
|
|
12312
|
+
top = obj.top ?? 0;
|
|
12313
|
+
if (obj.originX === "center") left -= width / 2;
|
|
12314
|
+
if (obj.originY === "center") top -= height / 2;
|
|
12328
12315
|
}
|
|
12329
|
-
result.set(id, { left, top, width, height });
|
|
12316
|
+
result.set(id, { left, top, width, height, angle });
|
|
12330
12317
|
}
|
|
12331
12318
|
});
|
|
12332
12319
|
return result;
|
|
@@ -17501,6 +17488,17 @@ const PageCanvas = react.forwardRef(
|
|
|
17501
17488
|
const fadeKeyChanged = newFadeKey !== oldFadeKey || newFadeKey !== innerOldKey || cropFadeRendererMissing;
|
|
17502
17489
|
const needsReload = sourceUrlChanged || colorMapChanged || fadeKeyChanged && !isCropGroup2;
|
|
17503
17490
|
const needsCropGroupFadeUpdate = isCropGroup2 && fadeKeyChanged;
|
|
17491
|
+
let cropFrameSizeChanged = false;
|
|
17492
|
+
if (isCropGroup2) {
|
|
17493
|
+
const liveCt = existingObj.__cropData;
|
|
17494
|
+
const liveW = Number(liveCt == null ? void 0 : liveCt.frameW) || 0;
|
|
17495
|
+
const liveH = Number(liveCt == null ? void 0 : liveCt.frameH) || 0;
|
|
17496
|
+
const schemaW = (Number(element.width) || 0) * (Number(element.scaleX) || 1);
|
|
17497
|
+
const schemaH = (Number(element.height) || 0) * (Number(element.scaleY) || 1);
|
|
17498
|
+
if (schemaW > 0 && schemaH > 0 && (Math.abs(schemaW - liveW) > 0.5 || Math.abs(schemaH - liveH) > 0.5)) {
|
|
17499
|
+
cropFrameSizeChanged = true;
|
|
17500
|
+
}
|
|
17501
|
+
}
|
|
17504
17502
|
const hadUrlBefore = storedImageUrl && String(storedImageUrl).trim() !== "";
|
|
17505
17503
|
if (!hasUrl && hadUrlBefore) {
|
|
17506
17504
|
const resolvedSizeImg = (pageChildren == null ? void 0 : pageChildren.length) ? getNodeBounds(element, pageChildren) : { width: typeof element.width === "number" ? element.width : 200, height: typeof element.height === "number" ? element.height : 50 };
|
|
@@ -17537,7 +17535,7 @@ const PageCanvas = react.forwardRef(
|
|
|
17537
17535
|
const clipShapeForReplace = element.clipShape ?? ((_g = element.style) == null ? void 0 : _g.imageFrameShape) ?? (isPreviewMode ? "rectangle" : "none");
|
|
17538
17536
|
const needCropGroupForElement = imageFitForReplace !== "fill" || clipShapeForReplace && clipShapeForReplace !== "none";
|
|
17539
17537
|
const plainImageNeedsCropGroup = hasUrl && !isCropGroup2 && existingObj instanceof fabric__namespace.FabricImage && needCropGroupForElement;
|
|
17540
|
-
if (hasUrl && (needsReload || isPlaceholder || plainImageNeedsCropGroup || needsCropGroupFadeUpdate)) {
|
|
17538
|
+
if (hasUrl && (needsReload || isPlaceholder || plainImageNeedsCropGroup || needsCropGroupFadeUpdate || cropFrameSizeChanged)) {
|
|
17541
17539
|
if (needsReload && !isBeingTransformed && (!wasJustModified || sourceUrlChanged)) {
|
|
17542
17540
|
loadImageAsync2(element, existingObj, fc);
|
|
17543
17541
|
} else if (plainImageNeedsCropGroup) {
|
|
@@ -20476,7 +20474,9 @@ function PreviewCanvas({
|
|
|
20476
20474
|
border: isHovered ? "2px solid rgb(59 130 246)" : "none",
|
|
20477
20475
|
backgroundColor: isHovered ? "rgba(59, 130, 246, 0.1)" : "transparent",
|
|
20478
20476
|
borderRadius: 4,
|
|
20479
|
-
pointerEvents: "auto"
|
|
20477
|
+
pointerEvents: "auto",
|
|
20478
|
+
transform: (bounds == null ? void 0 : bounds.angle) ? `rotate(${bounds.angle}deg)` : void 0,
|
|
20479
|
+
transformOrigin: "center center"
|
|
20480
20480
|
},
|
|
20481
20481
|
onMouseEnter: () => setHoveredFieldId(element.id),
|
|
20482
20482
|
onMouseLeave: () => setHoveredFieldId(null),
|
|
@@ -26313,9 +26313,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
26313
26313
|
}
|
|
26314
26314
|
return svgString;
|
|
26315
26315
|
}
|
|
26316
|
-
const resolvedPackageVersion = "0.5.
|
|
26316
|
+
const resolvedPackageVersion = "0.5.468";
|
|
26317
26317
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
26318
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
26318
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.468";
|
|
26319
26319
|
const roundParityValue = (value) => {
|
|
26320
26320
|
if (typeof value !== "number") return value;
|
|
26321
26321
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -27129,7 +27129,7 @@ class PixldocsRenderer {
|
|
|
27129
27129
|
await this.waitForCanvasScene(container, cloned, i);
|
|
27130
27130
|
}
|
|
27131
27131
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
27132
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
27132
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-CsY4HpZu.cjs"));
|
|
27133
27133
|
const prepared = preparePagesForExport(
|
|
27134
27134
|
cloned.pages,
|
|
27135
27135
|
canvasWidth,
|
|
@@ -29449,7 +29449,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
29449
29449
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
29450
29450
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
29451
29451
|
try {
|
|
29452
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
29452
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-CsY4HpZu.cjs"));
|
|
29453
29453
|
try {
|
|
29454
29454
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
29455
29455
|
} catch {
|
|
@@ -29763,4 +29763,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
29763
29763
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
29764
29764
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
29765
29765
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
29766
|
-
//# sourceMappingURL=index-
|
|
29766
|
+
//# sourceMappingURL=index-DoJk8IkH.cjs.map
|