@pixldocs/canvas-renderer 0.5.374 → 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-DQyoK8Nv.js → index-CXbUNfGV.js} +73 -55
- package/dist/index-CXbUNfGV.js.map +1 -0
- package/dist/{index-DpwFuxG9.cjs → index-UF12OZmE.cjs} +73 -55
- package/dist/index-UF12OZmE.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-HghwbAxV.js → vectorPdfExport-BUGumNZN.js} +4 -4
- package/dist/{vectorPdfExport-HghwbAxV.js.map → vectorPdfExport-BUGumNZN.js.map} +1 -1
- package/dist/{vectorPdfExport-Cfe50WTF.cjs → vectorPdfExport-BkHsGRzd.cjs} +4 -4
- package/dist/{vectorPdfExport-Cfe50WTF.cjs.map → vectorPdfExport-BkHsGRzd.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/index-DQyoK8Nv.js.map +0 -1
- package/dist/index-DpwFuxG9.cjs.map +0 -1
|
@@ -10532,6 +10532,24 @@ try {
|
|
|
10532
10532
|
const height = Math.max(0, ((size == null ? void 0 : size.y) ?? 0) - border);
|
|
10533
10533
|
ctx.strokeRect(-width / 2, -height / 2, width, height);
|
|
10534
10534
|
};
|
|
10535
|
+
if (typeof InteractiveBase.prototype.drawControlsConnectingLines === "function") {
|
|
10536
|
+
const originalDrawControlConnections = InteractiveBase.prototype.drawControlsConnectingLines;
|
|
10537
|
+
InteractiveBase.prototype.drawControlsConnectingLines = function(ctx, size) {
|
|
10538
|
+
var _a2;
|
|
10539
|
+
const disabledRotateConnections = [];
|
|
10540
|
+
try {
|
|
10541
|
+
(_a2 = this.forEachControl) == null ? void 0 : _a2.call(this, (control, key) => {
|
|
10542
|
+
if (key === "mtr" || String((control == null ? void 0 : control.actionName) ?? "") === "rotate") {
|
|
10543
|
+
disabledRotateConnections.push([control, control.withConnection]);
|
|
10544
|
+
control.withConnection = false;
|
|
10545
|
+
}
|
|
10546
|
+
});
|
|
10547
|
+
originalDrawControlConnections.call(this, ctx, size);
|
|
10548
|
+
} finally {
|
|
10549
|
+
for (const [control, wasConnected] of disabledRotateConnections) control.withConnection = wasConnected;
|
|
10550
|
+
}
|
|
10551
|
+
};
|
|
10552
|
+
}
|
|
10535
10553
|
}
|
|
10536
10554
|
if (InteractiveBase == null ? void 0 : InteractiveBase.ownDefaults) {
|
|
10537
10555
|
Object.assign(InteractiveBase.ownDefaults, {
|
|
@@ -10676,6 +10694,53 @@ try {
|
|
|
10676
10694
|
if (p < 1) ctx.stroke();
|
|
10677
10695
|
ctx.restore();
|
|
10678
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
|
+
};
|
|
10679
10744
|
const installPillRenders = (controls) => {
|
|
10680
10745
|
var _a2;
|
|
10681
10746
|
const CUR_SIZE = 22;
|
|
@@ -10740,14 +10805,6 @@ try {
|
|
|
10740
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"),
|
|
10741
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")
|
|
10742
10807
|
];
|
|
10743
|
-
const ROTATE_PATHS_2D = [
|
|
10744
|
-
new Path2D("M22 12l-3 3-3-3"),
|
|
10745
|
-
new Path2D("M2 12l3-3 3 3"),
|
|
10746
|
-
new Path2D("M19.016 14v-1.95A7.05 7.05 0 0 0 8 6.22"),
|
|
10747
|
-
new Path2D("M16.016 17.845A7.05 7.05 0 0 1 5 12.015V10"),
|
|
10748
|
-
new Path2D("M5 10V9"),
|
|
10749
|
-
new Path2D("M19 15v-1")
|
|
10750
|
-
];
|
|
10751
10808
|
const baseAngleFor = {
|
|
10752
10809
|
ml: 0,
|
|
10753
10810
|
mr: 0,
|
|
@@ -10828,48 +10885,7 @@ try {
|
|
|
10828
10885
|
}
|
|
10829
10886
|
return cursor;
|
|
10830
10887
|
};
|
|
10831
|
-
mtr.render =
|
|
10832
|
-
var _a3, _b2;
|
|
10833
|
-
const action = (_b2 = (_a3 = fabricObject.canvas) == null ? void 0 : _a3._currentTransform) == null ? void 0 : _b2.action;
|
|
10834
|
-
if (action === "drag" && fabricObject.__pixldocsDragMoved) return;
|
|
10835
|
-
const scale = getVisualScale(fabricObject);
|
|
10836
|
-
const p = getHoverProgress(fabricObject, "mtr");
|
|
10837
|
-
const r = 11 * scale;
|
|
10838
|
-
ctx.save();
|
|
10839
|
-
ctx.beginPath();
|
|
10840
|
-
ctx.arc(left, top, r, 0, Math.PI * 2);
|
|
10841
|
-
ctx.closePath();
|
|
10842
|
-
ctx.fillStyle = lerpFill(p);
|
|
10843
|
-
ctx.strokeStyle = `rgba(15, 23, 42, ${0.18 * (1 - p)})`;
|
|
10844
|
-
ctx.lineWidth = 0.75 * (1 - p);
|
|
10845
|
-
ctx.shadowColor = "rgba(15, 23, 42, 0.4)";
|
|
10846
|
-
ctx.shadowBlur = 10;
|
|
10847
|
-
ctx.shadowOffsetY = 2;
|
|
10848
|
-
ctx.fill();
|
|
10849
|
-
if (p < 1) ctx.stroke();
|
|
10850
|
-
ctx.shadowColor = "transparent";
|
|
10851
|
-
ctx.shadowBlur = 0;
|
|
10852
|
-
ctx.shadowOffsetY = 0;
|
|
10853
|
-
const iconColor = p > 0.5 ? "#ffffff" : "rgba(15, 23, 42, 0.85)";
|
|
10854
|
-
ctx.strokeStyle = iconColor;
|
|
10855
|
-
ctx.fillStyle = iconColor;
|
|
10856
|
-
ctx.lineJoin = "miter";
|
|
10857
|
-
ctx.miterLimit = 4;
|
|
10858
|
-
{
|
|
10859
|
-
const target = r * 1.55;
|
|
10860
|
-
const s = target / 24;
|
|
10861
|
-
ctx.translate(left, top);
|
|
10862
|
-
ctx.scale(s, s);
|
|
10863
|
-
ctx.translate(-12, -12);
|
|
10864
|
-
ctx.strokeStyle = iconColor;
|
|
10865
|
-
ctx.lineWidth = 1 / s;
|
|
10866
|
-
ROTATE_PATHS_2D.forEach((p2d, index) => {
|
|
10867
|
-
ctx.lineCap = index >= 4 ? "round" : "square";
|
|
10868
|
-
ctx.stroke(p2d);
|
|
10869
|
-
});
|
|
10870
|
-
}
|
|
10871
|
-
ctx.restore();
|
|
10872
|
-
};
|
|
10888
|
+
mtr.render = renderRotateHandle;
|
|
10873
10889
|
}
|
|
10874
10890
|
const moveActionHandler = (eventData, transform, x, y) => {
|
|
10875
10891
|
const target = transform.target;
|
|
@@ -10965,6 +10981,8 @@ try {
|
|
|
10965
10981
|
const originalControlRender = ControlProto.render;
|
|
10966
10982
|
ControlProto.render = function(ctx, left, top, styleOverride, fabricObject) {
|
|
10967
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);
|
|
10968
10986
|
if (actionName !== "rotate" && actionName !== "drag") {
|
|
10969
10987
|
const x = Number(this.x ?? 0);
|
|
10970
10988
|
const y = Number(this.y ?? 0);
|
|
@@ -24710,9 +24728,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
24710
24728
|
}
|
|
24711
24729
|
return svgString;
|
|
24712
24730
|
}
|
|
24713
|
-
const resolvedPackageVersion = "0.5.
|
|
24731
|
+
const resolvedPackageVersion = "0.5.376";
|
|
24714
24732
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
24715
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
24733
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.376";
|
|
24716
24734
|
const roundParityValue = (value) => {
|
|
24717
24735
|
if (typeof value !== "number") return value;
|
|
24718
24736
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -25526,7 +25544,7 @@ class PixldocsRenderer {
|
|
|
25526
25544
|
await this.waitForCanvasScene(container, cloned, i);
|
|
25527
25545
|
}
|
|
25528
25546
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
25529
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
25547
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-BkHsGRzd.cjs"));
|
|
25530
25548
|
const prepared = preparePagesForExport(
|
|
25531
25549
|
cloned.pages,
|
|
25532
25550
|
canvasWidth,
|
|
@@ -27846,7 +27864,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
27846
27864
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
27847
27865
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
27848
27866
|
try {
|
|
27849
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
27867
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-BkHsGRzd.cjs"));
|
|
27850
27868
|
try {
|
|
27851
27869
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
27852
27870
|
} catch {
|
|
@@ -28243,4 +28261,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
28243
28261
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
28244
28262
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
28245
28263
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
28246
|
-
//# sourceMappingURL=index-
|
|
28264
|
+
//# sourceMappingURL=index-UF12OZmE.cjs.map
|