@pixldocs/canvas-renderer 0.5.425 → 0.5.427
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-C3izL-t6.js → index-BMuhbMdO.js} +52 -5
- package/dist/index-BMuhbMdO.js.map +1 -0
- package/dist/{index-qOAH-a4l.cjs → index-DKaw5wif.cjs} +52 -5
- package/dist/index-DKaw5wif.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-ygzscD4n.cjs → vectorPdfExport-BUi4rX_J.cjs} +4 -4
- package/dist/{vectorPdfExport-ygzscD4n.cjs.map → vectorPdfExport-BUi4rX_J.cjs.map} +1 -1
- package/dist/{vectorPdfExport-DR3TOj0C.js → vectorPdfExport-Bc2upktw.js} +4 -4
- package/dist/{vectorPdfExport-DR3TOj0C.js.map → vectorPdfExport-Bc2upktw.js.map} +1 -1
- package/package.json +1 -1
- package/dist/index-C3izL-t6.js.map +0 -1
- package/dist/index-qOAH-a4l.cjs.map +0 -1
|
@@ -11273,6 +11273,48 @@ try {
|
|
|
11273
11273
|
ControlProto.__pixldocsCanvaCursorFallback = true;
|
|
11274
11274
|
ControlProto.__pixldocsCanvaCursorFallbackVersion = 2;
|
|
11275
11275
|
}
|
|
11276
|
+
if (ControlProto && ControlProto.__pixldocsCanvaFullEdgeActivateVersion !== 1) {
|
|
11277
|
+
const originalShouldActivate = ControlProto.__pixldocsOriginalShouldActivate ?? ControlProto.shouldActivate;
|
|
11278
|
+
ControlProto.__pixldocsOriginalShouldActivate = originalShouldActivate;
|
|
11279
|
+
const edgeSegments = {
|
|
11280
|
+
ml: ["tl", "bl"],
|
|
11281
|
+
mr: ["tr", "br"],
|
|
11282
|
+
mt: ["tl", "tr"],
|
|
11283
|
+
mb: ["bl", "br"]
|
|
11284
|
+
};
|
|
11285
|
+
const distanceToSegment = (p, a, b) => {
|
|
11286
|
+
const vx = b.x - a.x;
|
|
11287
|
+
const vy = b.y - a.y;
|
|
11288
|
+
const lenSq = vx * vx + vy * vy;
|
|
11289
|
+
if (lenSq <= 1e-4) return { distance: Number.POSITIVE_INFINITY, t: 0 };
|
|
11290
|
+
const rawT = ((p.x - a.x) * vx + (p.y - a.y) * vy) / lenSq;
|
|
11291
|
+
const t = Math.max(0, Math.min(1, rawT));
|
|
11292
|
+
const x = a.x + vx * t;
|
|
11293
|
+
const y = a.y + vy * t;
|
|
11294
|
+
const dx = p.x - x;
|
|
11295
|
+
const dy = p.y - y;
|
|
11296
|
+
return { distance: Math.hypot(dx, dy), t: rawT };
|
|
11297
|
+
};
|
|
11298
|
+
ControlProto.shouldActivate = function(controlKey, fabricObject, pointer, corners) {
|
|
11299
|
+
var _a2, _b2, _c2;
|
|
11300
|
+
if (typeof originalShouldActivate === "function" && originalShouldActivate.call(this, controlKey, fabricObject, pointer, corners)) {
|
|
11301
|
+
return true;
|
|
11302
|
+
}
|
|
11303
|
+
const segment = edgeSegments[controlKey];
|
|
11304
|
+
if (!segment || !(fabricObject == null ? void 0 : fabricObject.canvas) || ((_b2 = (_a2 = fabricObject.canvas).getActiveObject) == null ? void 0 : _b2.call(_a2)) !== fabricObject) return false;
|
|
11305
|
+
if (!((_c2 = fabricObject.isControlVisible) == null ? void 0 : _c2.call(fabricObject, controlKey)) || shouldCollapseHandles(fabricObject)) return false;
|
|
11306
|
+
const coords = fabricObject.oCoords;
|
|
11307
|
+
const a = coords == null ? void 0 : coords[segment[0]];
|
|
11308
|
+
const b = coords == null ? void 0 : coords[segment[1]];
|
|
11309
|
+
if (!a || !b || !pointer) return false;
|
|
11310
|
+
const len = Math.hypot((b.x ?? 0) - (a.x ?? 0), (b.y ?? 0) - (a.y ?? 0));
|
|
11311
|
+
if (len <= 1) return false;
|
|
11312
|
+
const alongPad = Math.min(24, len * 0.35);
|
|
11313
|
+
const { distance, t } = distanceToSegment(pointer, a, b);
|
|
11314
|
+
return t >= alongPad / len && t <= 1 - alongPad / len && distance <= EDGE_HIT_PERP / 2 + 3;
|
|
11315
|
+
};
|
|
11316
|
+
ControlProto.__pixldocsCanvaFullEdgeActivateVersion = 1;
|
|
11317
|
+
}
|
|
11276
11318
|
ensureCanvaControlRenders = (obj) => {
|
|
11277
11319
|
try {
|
|
11278
11320
|
if (obj && obj.controls) installPillRenders(obj.controls);
|
|
@@ -12506,6 +12548,7 @@ const PageCanvas = react.forwardRef(
|
|
|
12506
12548
|
installCanvaMaskControls(group);
|
|
12507
12549
|
applyControlSizeForZoom(group.canvas ?? fabricRef.current, group);
|
|
12508
12550
|
ensureCanvaControlRenders(group);
|
|
12551
|
+
ensureCanvaEdgeHitArea(group);
|
|
12509
12552
|
}, [calculateScaleSnapGuidesCallback, canvasHeight, canvasWidth, getLogicalGroupSnapBoundsCallback, getResizeExcludeIdsCallback, snapDuringScaleCallback]);
|
|
12510
12553
|
const isTransforming = react.useCallback((canvas2) => {
|
|
12511
12554
|
if (!canvas2) return false;
|
|
@@ -14358,6 +14401,10 @@ const PageCanvas = react.forwardRef(
|
|
|
14358
14401
|
if (activeObj.__cornerResizeStart) {
|
|
14359
14402
|
delete activeObj.__cornerResizeStart;
|
|
14360
14403
|
}
|
|
14404
|
+
installImageResizeControlsWithSnap(activeObj);
|
|
14405
|
+
ensureCanvaControlRenders(activeObj);
|
|
14406
|
+
ensureCanvaEdgeHitArea(activeObj);
|
|
14407
|
+
activeObj.setCoords();
|
|
14361
14408
|
}
|
|
14362
14409
|
if (!didTransformRef.current) {
|
|
14363
14410
|
editLockRef.current = false;
|
|
@@ -25653,9 +25700,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
25653
25700
|
}
|
|
25654
25701
|
return svgString;
|
|
25655
25702
|
}
|
|
25656
|
-
const resolvedPackageVersion = "0.5.
|
|
25703
|
+
const resolvedPackageVersion = "0.5.427";
|
|
25657
25704
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
25658
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
25705
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.427";
|
|
25659
25706
|
const roundParityValue = (value) => {
|
|
25660
25707
|
if (typeof value !== "number") return value;
|
|
25661
25708
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -26469,7 +26516,7 @@ class PixldocsRenderer {
|
|
|
26469
26516
|
await this.waitForCanvasScene(container, cloned, i);
|
|
26470
26517
|
}
|
|
26471
26518
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
26472
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
26519
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-BUi4rX_J.cjs"));
|
|
26473
26520
|
const prepared = preparePagesForExport(
|
|
26474
26521
|
cloned.pages,
|
|
26475
26522
|
canvasWidth,
|
|
@@ -28789,7 +28836,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
28789
28836
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
28790
28837
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
28791
28838
|
try {
|
|
28792
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
28839
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-BUi4rX_J.cjs"));
|
|
28793
28840
|
try {
|
|
28794
28841
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
28795
28842
|
} catch {
|
|
@@ -29186,4 +29233,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
29186
29233
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
29187
29234
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
29188
29235
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
29189
|
-
//# sourceMappingURL=index-
|
|
29236
|
+
//# sourceMappingURL=index-DKaw5wif.cjs.map
|