@pixldocs/canvas-renderer 0.5.422 → 0.5.424
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-yOZRi1jo.cjs → index-4LN7KRW_.cjs} +73 -21
- package/dist/index-4LN7KRW_.cjs.map +1 -0
- package/dist/{index-DFjuU6N6.js → index-C7ab3jgT.js} +73 -21
- package/dist/{index-DFjuU6N6.js.map → index-C7ab3jgT.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-CnV1fqDs.js → vectorPdfExport-Bm9r1fXg.js} +4 -4
- package/dist/{vectorPdfExport-CnV1fqDs.js.map → vectorPdfExport-Bm9r1fXg.js.map} +1 -1
- package/dist/{vectorPdfExport-DdBfenYt.cjs → vectorPdfExport-JXuSAPvC.cjs} +4 -4
- package/dist/{vectorPdfExport-DdBfenYt.cjs.map → vectorPdfExport-JXuSAPvC.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/index-yOZRi1jo.cjs.map +0 -1
|
@@ -12746,6 +12746,64 @@ const PageCanvas = react.forwardRef(
|
|
|
12746
12746
|
prevKey = null;
|
|
12747
12747
|
});
|
|
12748
12748
|
}
|
|
12749
|
+
{
|
|
12750
|
+
const EDGE_HIT_ALONG_MIN = 44;
|
|
12751
|
+
const CORNER_BUFFER = 24;
|
|
12752
|
+
const syncEdgeHitSizes = (obj) => {
|
|
12753
|
+
var _a2;
|
|
12754
|
+
if (!obj || !obj.controls) return;
|
|
12755
|
+
try {
|
|
12756
|
+
const zoom3 = fabricCanvas.getZoom() || 1;
|
|
12757
|
+
let scaleX = obj.scaleX ?? 1;
|
|
12758
|
+
let scaleY = obj.scaleY ?? 1;
|
|
12759
|
+
try {
|
|
12760
|
+
const m = (_a2 = obj.calcTransformMatrix) == null ? void 0 : _a2.call(obj);
|
|
12761
|
+
if (m) {
|
|
12762
|
+
const dec = fabric__namespace.util.qrDecompose(m);
|
|
12763
|
+
scaleX = Math.abs(dec.scaleX ?? scaleX);
|
|
12764
|
+
scaleY = Math.abs(dec.scaleY ?? scaleY);
|
|
12765
|
+
}
|
|
12766
|
+
} catch {
|
|
12767
|
+
}
|
|
12768
|
+
const screenW = (obj.width ?? 0) * scaleX * zoom3;
|
|
12769
|
+
const screenH = (obj.height ?? 0) * scaleY * zoom3;
|
|
12770
|
+
const alongW = Math.max(EDGE_HIT_ALONG_MIN, screenW - CORNER_BUFFER);
|
|
12771
|
+
const alongH = Math.max(EDGE_HIT_ALONG_MIN, screenH - CORNER_BUFFER);
|
|
12772
|
+
for (const k of ["ml", "mr"]) {
|
|
12773
|
+
const c = obj.controls[k];
|
|
12774
|
+
if (!c) continue;
|
|
12775
|
+
c.sizeY = alongH;
|
|
12776
|
+
c.touchSizeY = alongH;
|
|
12777
|
+
}
|
|
12778
|
+
for (const k of ["mt", "mb"]) {
|
|
12779
|
+
const c = obj.controls[k];
|
|
12780
|
+
if (!c) continue;
|
|
12781
|
+
c.sizeX = alongW;
|
|
12782
|
+
c.touchSizeX = alongW;
|
|
12783
|
+
}
|
|
12784
|
+
} catch {
|
|
12785
|
+
}
|
|
12786
|
+
};
|
|
12787
|
+
const syncActive = () => {
|
|
12788
|
+
const obj = fabricCanvas.getActiveObject();
|
|
12789
|
+
if (obj) syncEdgeHitSizes(obj);
|
|
12790
|
+
};
|
|
12791
|
+
fabricCanvas.on("selection:created", syncActive);
|
|
12792
|
+
fabricCanvas.on("selection:updated", syncActive);
|
|
12793
|
+
fabricCanvas.on("object:scaling", (e) => syncEdgeHitSizes(e == null ? void 0 : e.target));
|
|
12794
|
+
fabricCanvas.on("object:modified", (e) => syncEdgeHitSizes(e == null ? void 0 : e.target));
|
|
12795
|
+
fabricCanvas.on("object:resizing", (e) => syncEdgeHitSizes(e == null ? void 0 : e.target));
|
|
12796
|
+
fabricCanvas.on("after:render", () => {
|
|
12797
|
+
const obj = fabricCanvas.getActiveObject();
|
|
12798
|
+
if (!obj) return;
|
|
12799
|
+
const lastZoom = obj.__pixldocsLastEdgeHitZoom;
|
|
12800
|
+
const z = fabricCanvas.getZoom() || 1;
|
|
12801
|
+
if (lastZoom !== z) {
|
|
12802
|
+
obj.__pixldocsLastEdgeHitZoom = z;
|
|
12803
|
+
syncEdgeHitSizes(obj);
|
|
12804
|
+
}
|
|
12805
|
+
});
|
|
12806
|
+
}
|
|
12749
12807
|
const initFonts = async () => {
|
|
12750
12808
|
try {
|
|
12751
12809
|
await preloadAllFonts();
|
|
@@ -14372,7 +14430,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14372
14430
|
fabricCanvas.on("selection:cleared", () => {
|
|
14373
14431
|
});
|
|
14374
14432
|
fabricCanvas.on("object:scaling", (e) => {
|
|
14375
|
-
var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
14433
|
+
var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
|
|
14376
14434
|
if (!isActiveRef.current) return;
|
|
14377
14435
|
const t = e.target;
|
|
14378
14436
|
if (t) lastResizeScaleTargetRef.current = t;
|
|
@@ -14662,20 +14720,12 @@ const PageCanvas = react.forwardRef(
|
|
|
14662
14720
|
const asRect0 = obj.getBoundingRect();
|
|
14663
14721
|
let didReflowTextChild = false;
|
|
14664
14722
|
for (const child of obj.getObjects()) {
|
|
14665
|
-
|
|
14666
|
-
|
|
14667
|
-
|
|
14668
|
-
|
|
14669
|
-
const selectionMatrix = obj.calcTransformMatrix();
|
|
14670
|
-
const childMatrix = child.calcOwnMatrix();
|
|
14671
|
-
const worldMatrix = fabric__namespace.util.multiplyTransformMatrices(selectionMatrix, childMatrix);
|
|
14672
|
-
const liveWorldAngle = fabric__namespace.util.qrDecompose(worldMatrix).angle ?? 0;
|
|
14673
|
-
matrixLocalAngle = liveWorldAngle - (obj.angle ?? 0);
|
|
14674
|
-
} catch {
|
|
14675
|
-
}
|
|
14676
|
-
child.__asLiveOrigAngle = currentLocalAngle ?? matrixLocalAngle ?? 0;
|
|
14723
|
+
const liveGestureKey = `${obj.__pixldocsGroupSelection ?? "selection"}:${corner}:${((_k = groupSelectionTransformStartRef.current) == null ? void 0 : _k.selectionLeft) ?? obj.left ?? 0}:${((_l = groupSelectionTransformStartRef.current) == null ? void 0 : _l.selectionTop) ?? obj.top ?? 0}`;
|
|
14724
|
+
if (child.__asLiveGestureKey !== liveGestureKey) {
|
|
14725
|
+
child.__asLiveGestureKey = liveGestureKey;
|
|
14726
|
+
child.__asLiveOrigAngle = Number.isFinite(child.angle) ? child.angle ?? 0 : 0;
|
|
14677
14727
|
}
|
|
14678
|
-
if (child instanceof fabric__namespace.Group && (child.__cropGroup || ((
|
|
14728
|
+
if (child instanceof fabric__namespace.Group && (child.__cropGroup || ((_m = child._ct) == null ? void 0 : _m.isCropGroup))) {
|
|
14679
14729
|
const ct = child.__cropData;
|
|
14680
14730
|
if (!ct) continue;
|
|
14681
14731
|
if (child.__asLiveOrigAngle == null) {
|
|
@@ -14844,7 +14894,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14844
14894
|
child.dirty = true;
|
|
14845
14895
|
didReflowTextChild = true;
|
|
14846
14896
|
}
|
|
14847
|
-
if (isXSide && ((
|
|
14897
|
+
if (isXSide && ((_n = groupShiftReflowSnapshotRef.current) == null ? void 0 : _n.selection) === obj) {
|
|
14848
14898
|
const snap = groupShiftReflowSnapshotRef.current;
|
|
14849
14899
|
const anchorEntry = snap.children[0];
|
|
14850
14900
|
const anchorTopLive = anchorEntry.obj.top ?? 0;
|
|
@@ -15005,7 +15055,7 @@ const PageCanvas = react.forwardRef(
|
|
|
15005
15055
|
setGuides(gridGuidesForScale.length ? [...scaleGuides, ...gridGuidesForScale] : scaleGuides);
|
|
15006
15056
|
if (drilledGroupIdRef.current) {
|
|
15007
15057
|
try {
|
|
15008
|
-
(
|
|
15058
|
+
(_o = fabricCanvas.__updateDrilledGroupOutline) == null ? void 0 : _o.call(fabricCanvas);
|
|
15009
15059
|
} catch {
|
|
15010
15060
|
}
|
|
15011
15061
|
}
|
|
@@ -15229,6 +15279,7 @@ const PageCanvas = react.forwardRef(
|
|
|
15229
15279
|
delete child.__asLiveOrigW;
|
|
15230
15280
|
delete child.__asLiveOrigH;
|
|
15231
15281
|
delete child.__asLiveRotSnap;
|
|
15282
|
+
delete child.__asLiveGestureKey;
|
|
15232
15283
|
}
|
|
15233
15284
|
}
|
|
15234
15285
|
} catch {
|
|
@@ -16505,6 +16556,7 @@ const PageCanvas = react.forwardRef(
|
|
|
16505
16556
|
if (t instanceof fabric__namespace.ActiveSelection) {
|
|
16506
16557
|
for (const child of t.getObjects()) {
|
|
16507
16558
|
delete child.__asLiveOrigAngle;
|
|
16559
|
+
delete child.__asLiveGestureKey;
|
|
16508
16560
|
delete child.__asLiveWorldAngle;
|
|
16509
16561
|
delete child.__asLiveWorldCenterX;
|
|
16510
16562
|
delete child.__asLiveWorldCenterY;
|
|
@@ -25582,9 +25634,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
25582
25634
|
}
|
|
25583
25635
|
return svgString;
|
|
25584
25636
|
}
|
|
25585
|
-
const resolvedPackageVersion = "0.5.
|
|
25637
|
+
const resolvedPackageVersion = "0.5.424";
|
|
25586
25638
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
25587
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
25639
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.424";
|
|
25588
25640
|
const roundParityValue = (value) => {
|
|
25589
25641
|
if (typeof value !== "number") return value;
|
|
25590
25642
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -26398,7 +26450,7 @@ class PixldocsRenderer {
|
|
|
26398
26450
|
await this.waitForCanvasScene(container, cloned, i);
|
|
26399
26451
|
}
|
|
26400
26452
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
26401
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
26453
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-JXuSAPvC.cjs"));
|
|
26402
26454
|
const prepared = preparePagesForExport(
|
|
26403
26455
|
cloned.pages,
|
|
26404
26456
|
canvasWidth,
|
|
@@ -28718,7 +28770,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
28718
28770
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
28719
28771
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
28720
28772
|
try {
|
|
28721
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
28773
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-JXuSAPvC.cjs"));
|
|
28722
28774
|
try {
|
|
28723
28775
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
28724
28776
|
} catch {
|
|
@@ -29115,4 +29167,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
29115
29167
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
29116
29168
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
29117
29169
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
29118
|
-
//# sourceMappingURL=index-
|
|
29170
|
+
//# sourceMappingURL=index-4LN7KRW_.cjs.map
|