@pixldocs/canvas-renderer 0.5.375 → 0.5.376
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-B0HRibrY.js → index-CXbUNfGV.js} +55 -55
- package/dist/index-CXbUNfGV.js.map +1 -0
- package/dist/{index-DGMdAoOS.cjs → index-UF12OZmE.cjs} +55 -55
- package/dist/index-UF12OZmE.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-BDdjWeve.js → vectorPdfExport-BUGumNZN.js} +4 -4
- package/dist/{vectorPdfExport-BDdjWeve.js.map → vectorPdfExport-BUGumNZN.js.map} +1 -1
- package/dist/{vectorPdfExport-DsexMYcA.cjs → vectorPdfExport-BkHsGRzd.cjs} +4 -4
- package/dist/{vectorPdfExport-DsexMYcA.cjs.map → vectorPdfExport-BkHsGRzd.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/index-B0HRibrY.js.map +0 -1
- package/dist/index-DGMdAoOS.cjs.map +0 -1
|
@@ -10694,6 +10694,53 @@ try {
|
|
|
10694
10694
|
if (p < 1) ctx.stroke();
|
|
10695
10695
|
ctx.restore();
|
|
10696
10696
|
};
|
|
10697
|
+
const ROTATE_PATHS_2D = [
|
|
10698
|
+
new Path2D("M22 12l-3 3-3-3"),
|
|
10699
|
+
new Path2D("M2 12l3-3 3 3"),
|
|
10700
|
+
new Path2D("M19.016 14v-1.95A7.05 7.05 0 0 0 8 6.22"),
|
|
10701
|
+
new Path2D("M16.016 17.845A7.05 7.05 0 0 1 5 12.015V10"),
|
|
10702
|
+
new Path2D("M5 10V9"),
|
|
10703
|
+
new Path2D("M19 15v-1")
|
|
10704
|
+
];
|
|
10705
|
+
const renderRotateHandle = (ctx, left, top, _styleOverride, fabricObject) => {
|
|
10706
|
+
var _a2, _b2;
|
|
10707
|
+
const action = (_b2 = (_a2 = fabricObject.canvas) == null ? void 0 : _a2._currentTransform) == null ? void 0 : _b2.action;
|
|
10708
|
+
if (action === "drag" && fabricObject.__pixldocsDragMoved) return;
|
|
10709
|
+
const scale = getVisualScale(fabricObject);
|
|
10710
|
+
const p = getHoverProgress(fabricObject, "mtr");
|
|
10711
|
+
const r = 11 * scale;
|
|
10712
|
+
ctx.save();
|
|
10713
|
+
ctx.beginPath();
|
|
10714
|
+
ctx.arc(left, top, r, 0, Math.PI * 2);
|
|
10715
|
+
ctx.closePath();
|
|
10716
|
+
ctx.fillStyle = lerpFill(p);
|
|
10717
|
+
ctx.strokeStyle = `rgba(15, 23, 42, ${0.18 * (1 - p)})`;
|
|
10718
|
+
ctx.lineWidth = 0.75 * (1 - p);
|
|
10719
|
+
ctx.shadowColor = "rgba(15, 23, 42, 0.4)";
|
|
10720
|
+
ctx.shadowBlur = 10;
|
|
10721
|
+
ctx.shadowOffsetY = 2;
|
|
10722
|
+
ctx.fill();
|
|
10723
|
+
if (p < 1) ctx.stroke();
|
|
10724
|
+
ctx.shadowColor = "transparent";
|
|
10725
|
+
ctx.shadowBlur = 0;
|
|
10726
|
+
ctx.shadowOffsetY = 0;
|
|
10727
|
+
const iconColor = p > 0.5 ? "#ffffff" : "rgba(15, 23, 42, 0.85)";
|
|
10728
|
+
const target = r * 1.55;
|
|
10729
|
+
const s = target / 24;
|
|
10730
|
+
ctx.translate(left, top);
|
|
10731
|
+
ctx.scale(s, s);
|
|
10732
|
+
ctx.translate(-12, -12);
|
|
10733
|
+
ctx.strokeStyle = iconColor;
|
|
10734
|
+
ctx.fillStyle = iconColor;
|
|
10735
|
+
ctx.lineJoin = "miter";
|
|
10736
|
+
ctx.miterLimit = 4;
|
|
10737
|
+
ctx.lineWidth = 1 / s;
|
|
10738
|
+
ROTATE_PATHS_2D.forEach((p2d, index) => {
|
|
10739
|
+
ctx.lineCap = index >= 4 ? "round" : "square";
|
|
10740
|
+
ctx.stroke(p2d);
|
|
10741
|
+
});
|
|
10742
|
+
ctx.restore();
|
|
10743
|
+
};
|
|
10697
10744
|
const installPillRenders = (controls) => {
|
|
10698
10745
|
var _a2;
|
|
10699
10746
|
const CUR_SIZE = 22;
|
|
@@ -10758,14 +10805,6 @@ try {
|
|
|
10758
10805
|
new Path2D("M12 21L12.3648 21.342L12 21.7311L11.6352 21.342L12 21ZM11.5 15C11.5 14.7239 11.7239 14.5 12 14.5C12.2761 14.5 12.5 14.7239 12.5 15H11.5ZM15.3648 18.142L12.3648 21.342L11.6352 20.658L14.6352 17.458L15.3648 18.142ZM11.6352 21.342L8.63523 18.142L9.36477 17.458L12.3648 20.658L11.6352 21.342ZM11.5 21V15H12.5V21H11.5Z"),
|
|
10759
10806
|
new Path2D("M3 12L2.65803 12.3648L2.26894 12L2.65803 11.6352L3 12ZM9 11.5C9.27614 11.5 9.5 11.7239 9.5 12C9.5 12.2761 9.27614 12.5 9 12.5L9 11.5ZM5.85803 15.3648L2.65803 12.3648L3.34197 11.6352L6.54197 14.6352L5.85803 15.3648ZM2.65803 11.6352L5.85803 8.63523L6.54197 9.36477L3.34197 12.3648L2.65803 11.6352ZM3 11.5L9 11.5L9 12.5L3 12.5L3 11.5Z")
|
|
10760
10807
|
];
|
|
10761
|
-
const ROTATE_PATHS_2D = [
|
|
10762
|
-
new Path2D("M22 12l-3 3-3-3"),
|
|
10763
|
-
new Path2D("M2 12l3-3 3 3"),
|
|
10764
|
-
new Path2D("M19.016 14v-1.95A7.05 7.05 0 0 0 8 6.22"),
|
|
10765
|
-
new Path2D("M16.016 17.845A7.05 7.05 0 0 1 5 12.015V10"),
|
|
10766
|
-
new Path2D("M5 10V9"),
|
|
10767
|
-
new Path2D("M19 15v-1")
|
|
10768
|
-
];
|
|
10769
10808
|
const baseAngleFor = {
|
|
10770
10809
|
ml: 0,
|
|
10771
10810
|
mr: 0,
|
|
@@ -10846,48 +10885,7 @@ try {
|
|
|
10846
10885
|
}
|
|
10847
10886
|
return cursor;
|
|
10848
10887
|
};
|
|
10849
|
-
mtr.render =
|
|
10850
|
-
var _a3, _b2;
|
|
10851
|
-
const action = (_b2 = (_a3 = fabricObject.canvas) == null ? void 0 : _a3._currentTransform) == null ? void 0 : _b2.action;
|
|
10852
|
-
if (action === "drag" && fabricObject.__pixldocsDragMoved) return;
|
|
10853
|
-
const scale = getVisualScale(fabricObject);
|
|
10854
|
-
const p = getHoverProgress(fabricObject, "mtr");
|
|
10855
|
-
const r = 11 * scale;
|
|
10856
|
-
ctx.save();
|
|
10857
|
-
ctx.beginPath();
|
|
10858
|
-
ctx.arc(left, top, r, 0, Math.PI * 2);
|
|
10859
|
-
ctx.closePath();
|
|
10860
|
-
ctx.fillStyle = lerpFill(p);
|
|
10861
|
-
ctx.strokeStyle = `rgba(15, 23, 42, ${0.18 * (1 - p)})`;
|
|
10862
|
-
ctx.lineWidth = 0.75 * (1 - p);
|
|
10863
|
-
ctx.shadowColor = "rgba(15, 23, 42, 0.4)";
|
|
10864
|
-
ctx.shadowBlur = 10;
|
|
10865
|
-
ctx.shadowOffsetY = 2;
|
|
10866
|
-
ctx.fill();
|
|
10867
|
-
if (p < 1) ctx.stroke();
|
|
10868
|
-
ctx.shadowColor = "transparent";
|
|
10869
|
-
ctx.shadowBlur = 0;
|
|
10870
|
-
ctx.shadowOffsetY = 0;
|
|
10871
|
-
const iconColor = p > 0.5 ? "#ffffff" : "rgba(15, 23, 42, 0.85)";
|
|
10872
|
-
ctx.strokeStyle = iconColor;
|
|
10873
|
-
ctx.fillStyle = iconColor;
|
|
10874
|
-
ctx.lineJoin = "miter";
|
|
10875
|
-
ctx.miterLimit = 4;
|
|
10876
|
-
{
|
|
10877
|
-
const target = r * 1.55;
|
|
10878
|
-
const s = target / 24;
|
|
10879
|
-
ctx.translate(left, top);
|
|
10880
|
-
ctx.scale(s, s);
|
|
10881
|
-
ctx.translate(-12, -12);
|
|
10882
|
-
ctx.strokeStyle = iconColor;
|
|
10883
|
-
ctx.lineWidth = 1 / s;
|
|
10884
|
-
ROTATE_PATHS_2D.forEach((p2d, index) => {
|
|
10885
|
-
ctx.lineCap = index >= 4 ? "round" : "square";
|
|
10886
|
-
ctx.stroke(p2d);
|
|
10887
|
-
});
|
|
10888
|
-
}
|
|
10889
|
-
ctx.restore();
|
|
10890
|
-
};
|
|
10888
|
+
mtr.render = renderRotateHandle;
|
|
10891
10889
|
}
|
|
10892
10890
|
const moveActionHandler = (eventData, transform, x, y) => {
|
|
10893
10891
|
const target = transform.target;
|
|
@@ -10983,6 +10981,8 @@ try {
|
|
|
10983
10981
|
const originalControlRender = ControlProto.render;
|
|
10984
10982
|
ControlProto.render = function(ctx, left, top, styleOverride, fabricObject) {
|
|
10985
10983
|
const actionName = String(this.actionName ?? "");
|
|
10984
|
+
const isRotateHandle = actionName === "rotate" || Math.abs(Number(this.x ?? 0)) < 1e-3 && Math.abs(Number(this.y ?? 0) + 0.5) < 1e-3 && Number(this.offsetY ?? 0) < 0;
|
|
10985
|
+
if (isRotateHandle) return renderRotateHandle(ctx, left, top, styleOverride, fabricObject);
|
|
10986
10986
|
if (actionName !== "rotate" && actionName !== "drag") {
|
|
10987
10987
|
const x = Number(this.x ?? 0);
|
|
10988
10988
|
const y = Number(this.y ?? 0);
|
|
@@ -24728,9 +24728,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
24728
24728
|
}
|
|
24729
24729
|
return svgString;
|
|
24730
24730
|
}
|
|
24731
|
-
const resolvedPackageVersion = "0.5.
|
|
24731
|
+
const resolvedPackageVersion = "0.5.376";
|
|
24732
24732
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
24733
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
24733
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.376";
|
|
24734
24734
|
const roundParityValue = (value) => {
|
|
24735
24735
|
if (typeof value !== "number") return value;
|
|
24736
24736
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -25544,7 +25544,7 @@ class PixldocsRenderer {
|
|
|
25544
25544
|
await this.waitForCanvasScene(container, cloned, i);
|
|
25545
25545
|
}
|
|
25546
25546
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
25547
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
25547
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-BkHsGRzd.cjs"));
|
|
25548
25548
|
const prepared = preparePagesForExport(
|
|
25549
25549
|
cloned.pages,
|
|
25550
25550
|
canvasWidth,
|
|
@@ -27864,7 +27864,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
27864
27864
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
27865
27865
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
27866
27866
|
try {
|
|
27867
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
27867
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-BkHsGRzd.cjs"));
|
|
27868
27868
|
try {
|
|
27869
27869
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
27870
27870
|
} catch {
|
|
@@ -28261,4 +28261,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
28261
28261
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
28262
28262
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
28263
28263
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
28264
|
-
//# sourceMappingURL=index-
|
|
28264
|
+
//# sourceMappingURL=index-UF12OZmE.cjs.map
|