@pixldocs/canvas-renderer 0.5.357 → 0.5.359
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-DH3qeHgQ.cjs → index-B8DKV_MC.cjs} +22 -108
- package/dist/index-B8DKV_MC.cjs.map +1 -0
- package/dist/{index-ErPNn7zc.js → index-lU7E8PIC.js} +22 -108
- package/dist/index-lU7E8PIC.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-yx-dKQqT.js → vectorPdfExport-CaEmOpLs.js} +4 -4
- package/dist/{vectorPdfExport-yx-dKQqT.js.map → vectorPdfExport-CaEmOpLs.js.map} +1 -1
- package/dist/{vectorPdfExport-Ure_JliT.cjs → vectorPdfExport-Cnxqr8BW.cjs} +4 -4
- package/dist/{vectorPdfExport-Ure_JliT.cjs.map → vectorPdfExport-Cnxqr8BW.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/index-DH3qeHgQ.cjs.map +0 -1
- package/dist/index-ErPNn7zc.js.map +0 -1
|
@@ -11200,7 +11200,18 @@ function applyWarpAwareSelectionBorders(selection) {
|
|
|
11200
11200
|
invSelection,
|
|
11201
11201
|
worldMatrices[index]
|
|
11202
11202
|
);
|
|
11203
|
-
|
|
11203
|
+
const savedLayout = k.layoutManager;
|
|
11204
|
+
try {
|
|
11205
|
+
if (savedLayout) k.layoutManager = void 0;
|
|
11206
|
+
fabric.util.applyTransformToObject(k, localMatrix);
|
|
11207
|
+
const decomposed = fabric.util.qrDecompose(
|
|
11208
|
+
localMatrix
|
|
11209
|
+
);
|
|
11210
|
+
const expectedCenter = new fabric.Point(decomposed.translateX, decomposed.translateY);
|
|
11211
|
+
k.setPositionByOrigin(expectedCenter, "center", "center");
|
|
11212
|
+
} finally {
|
|
11213
|
+
if (savedLayout) k.layoutManager = savedLayout;
|
|
11214
|
+
}
|
|
11204
11215
|
k.setCoords();
|
|
11205
11216
|
k.dirty = true;
|
|
11206
11217
|
});
|
|
@@ -11215,37 +11226,6 @@ function applyWarpAwareSelectionBorders(selection) {
|
|
|
11215
11226
|
selection.setCoords();
|
|
11216
11227
|
selection.dirty = true;
|
|
11217
11228
|
selection.__pixldocsAlignedAngle = targetAngle;
|
|
11218
|
-
try {
|
|
11219
|
-
const payload = {
|
|
11220
|
-
targetAngle,
|
|
11221
|
-
selection: {
|
|
11222
|
-
left: selection.left,
|
|
11223
|
-
top: selection.top,
|
|
11224
|
-
angle: selection.angle,
|
|
11225
|
-
scaleX: selection.scaleX,
|
|
11226
|
-
scaleY: selection.scaleY,
|
|
11227
|
-
width: selection.width,
|
|
11228
|
-
height: selection.height,
|
|
11229
|
-
originX: selection.originX,
|
|
11230
|
-
originY: selection.originY
|
|
11231
|
-
},
|
|
11232
|
-
kids: kids.map((c) => ({
|
|
11233
|
-
id: c.id ?? c.__pixldocsId,
|
|
11234
|
-
type: c.type,
|
|
11235
|
-
left: c.left,
|
|
11236
|
-
top: c.top,
|
|
11237
|
-
angle: c.angle,
|
|
11238
|
-
scaleX: c.scaleX,
|
|
11239
|
-
scaleY: c.scaleY,
|
|
11240
|
-
originX: c.originX,
|
|
11241
|
-
originY: c.originY,
|
|
11242
|
-
width: c.width,
|
|
11243
|
-
height: c.height
|
|
11244
|
-
}))
|
|
11245
|
-
};
|
|
11246
|
-
console.info("[Pixldocs][rot-group-image-drift] aligned-on-select " + JSON.stringify(payload));
|
|
11247
|
-
} catch {
|
|
11248
|
-
}
|
|
11249
11229
|
}
|
|
11250
11230
|
}
|
|
11251
11231
|
}
|
|
@@ -14259,40 +14239,6 @@ const PageCanvas = forwardRef(
|
|
|
14259
14239
|
markSimpleTransform(e);
|
|
14260
14240
|
didTransformRef.current = true;
|
|
14261
14241
|
const tr = e.target;
|
|
14262
|
-
try {
|
|
14263
|
-
const t = tr;
|
|
14264
|
-
if (t) {
|
|
14265
|
-
const payload = {
|
|
14266
|
-
targetType: t.type,
|
|
14267
|
-
isAS: t instanceof fabric.ActiveSelection,
|
|
14268
|
-
left: t.left,
|
|
14269
|
-
top: t.top,
|
|
14270
|
-
angle: t.angle,
|
|
14271
|
-
scaleX: t.scaleX,
|
|
14272
|
-
scaleY: t.scaleY,
|
|
14273
|
-
width: t.width,
|
|
14274
|
-
height: t.height,
|
|
14275
|
-
originX: t.originX,
|
|
14276
|
-
originY: t.originY,
|
|
14277
|
-
childCount: (t._objects ?? []).length,
|
|
14278
|
-
children: (t._objects ?? []).map((c) => ({
|
|
14279
|
-
id: getObjectId(c),
|
|
14280
|
-
type: c.type,
|
|
14281
|
-
left: c.left,
|
|
14282
|
-
top: c.top,
|
|
14283
|
-
angle: c.angle,
|
|
14284
|
-
scaleX: c.scaleX,
|
|
14285
|
-
scaleY: c.scaleY,
|
|
14286
|
-
originX: c.originX,
|
|
14287
|
-
originY: c.originY,
|
|
14288
|
-
width: c.width,
|
|
14289
|
-
height: c.height
|
|
14290
|
-
}))
|
|
14291
|
-
};
|
|
14292
|
-
console.info("[Pixldocs][rot-group-image-drift] rotating " + JSON.stringify(payload));
|
|
14293
|
-
}
|
|
14294
|
-
} catch {
|
|
14295
|
-
}
|
|
14296
14242
|
try {
|
|
14297
14243
|
const getCursor = fabricCanvas.__pixldocsGetRotateCursor;
|
|
14298
14244
|
const upper = fabricCanvas.upperCanvasEl;
|
|
@@ -14325,40 +14271,6 @@ const PageCanvas = forwardRef(
|
|
|
14325
14271
|
prepareGroupSelectionTransformStart(e.target);
|
|
14326
14272
|
markTransforming(e.target);
|
|
14327
14273
|
didTransformRef.current = true;
|
|
14328
|
-
try {
|
|
14329
|
-
const t = e.target;
|
|
14330
|
-
if (t && (t.angle ?? 0) !== 0) {
|
|
14331
|
-
const payload = {
|
|
14332
|
-
targetType: t.type,
|
|
14333
|
-
isAS: t instanceof fabric.ActiveSelection,
|
|
14334
|
-
left: t.left,
|
|
14335
|
-
top: t.top,
|
|
14336
|
-
angle: t.angle,
|
|
14337
|
-
scaleX: t.scaleX,
|
|
14338
|
-
scaleY: t.scaleY,
|
|
14339
|
-
width: t.width,
|
|
14340
|
-
height: t.height,
|
|
14341
|
-
originX: t.originX,
|
|
14342
|
-
originY: t.originY,
|
|
14343
|
-
childCount: (t._objects ?? []).length,
|
|
14344
|
-
children: (t._objects ?? []).map((c) => ({
|
|
14345
|
-
id: getObjectId(c),
|
|
14346
|
-
type: c.type,
|
|
14347
|
-
left: c.left,
|
|
14348
|
-
top: c.top,
|
|
14349
|
-
angle: c.angle,
|
|
14350
|
-
scaleX: c.scaleX,
|
|
14351
|
-
scaleY: c.scaleY,
|
|
14352
|
-
originX: c.originX,
|
|
14353
|
-
originY: c.originY,
|
|
14354
|
-
width: c.width,
|
|
14355
|
-
height: c.height
|
|
14356
|
-
}))
|
|
14357
|
-
};
|
|
14358
|
-
console.info("[Pixldocs][rot-group-image-drift] moving " + JSON.stringify(payload));
|
|
14359
|
-
}
|
|
14360
|
-
} catch {
|
|
14361
|
-
}
|
|
14362
14274
|
const activeDuringMove = fabricCanvas.getActiveObject();
|
|
14363
14275
|
const movingLogicalGroupId = activeDuringMove instanceof fabric.ActiveSelection ? activeDuringMove.__pixldocsGroupSelection : void 0;
|
|
14364
14276
|
const pendingMoveDrill = pendingGroupDrillInRef.current;
|
|
@@ -16784,7 +16696,7 @@ const PageCanvas = forwardRef(
|
|
|
16784
16696
|
const isFlatGroupSelection = toSelect.length > 1 && toSelect.every((o) => !(o instanceof fabric.Group));
|
|
16785
16697
|
const active = fc.getActiveObject();
|
|
16786
16698
|
const sameSelection = active instanceof fabric.ActiveSelection && active.getObjects().length === toSelect.length && toSelect.every((obj) => active.getObjects().includes(obj));
|
|
16787
|
-
if (sameSelection && isFlatGroupSelection) {
|
|
16699
|
+
if (sameSelection && (isFlatGroupSelection || isPureSingleGroupSelection)) {
|
|
16788
16700
|
if (selectedGroupSelectionId && active instanceof fabric.ActiveSelection) {
|
|
16789
16701
|
if (isPureSingleGroupSelection) {
|
|
16790
16702
|
active.__pixldocsGroupSelection = selectedGroupSelectionId;
|
|
@@ -16816,8 +16728,10 @@ const PageCanvas = forwardRef(
|
|
|
16816
16728
|
});
|
|
16817
16729
|
if (isPureSingleGroupSelection) {
|
|
16818
16730
|
active.hasBorders = true;
|
|
16819
|
-
active.
|
|
16820
|
-
|
|
16731
|
+
if (active.__pixldocsAlignedAngle == null) {
|
|
16732
|
+
active.setCoords();
|
|
16733
|
+
applyWarpAwareSelectionBorders(active);
|
|
16734
|
+
}
|
|
16821
16735
|
}
|
|
16822
16736
|
}
|
|
16823
16737
|
fc.requestRenderAll();
|
|
@@ -24463,9 +24377,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
24463
24377
|
}
|
|
24464
24378
|
return svgString;
|
|
24465
24379
|
}
|
|
24466
|
-
const resolvedPackageVersion = "0.5.
|
|
24380
|
+
const resolvedPackageVersion = "0.5.359";
|
|
24467
24381
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
24468
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
24382
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.359";
|
|
24469
24383
|
const roundParityValue = (value) => {
|
|
24470
24384
|
if (typeof value !== "number") return value;
|
|
24471
24385
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -25279,7 +25193,7 @@ class PixldocsRenderer {
|
|
|
25279
25193
|
await this.waitForCanvasScene(container, cloned, i);
|
|
25280
25194
|
}
|
|
25281
25195
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
25282
|
-
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-
|
|
25196
|
+
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-CaEmOpLs.js");
|
|
25283
25197
|
const prepared = preparePagesForExport(
|
|
25284
25198
|
cloned.pages,
|
|
25285
25199
|
canvasWidth,
|
|
@@ -27599,7 +27513,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
27599
27513
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
27600
27514
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
27601
27515
|
try {
|
|
27602
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-
|
|
27516
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-CaEmOpLs.js");
|
|
27603
27517
|
try {
|
|
27604
27518
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
27605
27519
|
} catch {
|
|
@@ -27999,4 +27913,4 @@ export {
|
|
|
27999
27913
|
buildTeaserBlurFlatKeys as y,
|
|
28000
27914
|
collectFontDescriptorsFromConfig as z
|
|
28001
27915
|
};
|
|
28002
|
-
//# sourceMappingURL=index-
|
|
27916
|
+
//# sourceMappingURL=index-lU7E8PIC.js.map
|