@pixldocs/canvas-renderer 0.5.309 → 0.5.311

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.
@@ -11179,12 +11179,35 @@ const bakeTextboxScaleIntoTypography = (obj, sourceElement) => {
11179
11179
  return updates;
11180
11180
  };
11181
11181
  function applyWarpAwareSelectionBorders(selection) {
11182
+ var _a2;
11182
11183
  if (selection.__pixldocsOrigASHasBorders !== void 0) {
11183
11184
  selection.hasBorders = selection.__pixldocsOrigASHasBorders;
11184
11185
  delete selection.__pixldocsOrigASHasBorders;
11185
11186
  }
11186
11187
  selection.hasBorders = true;
11187
11188
  selection.hasControls = true;
11189
+ try {
11190
+ const kids = selection.getObjects();
11191
+ let allSameNonZero = kids.length > 0;
11192
+ const first = ((((_a2 = kids[0]) == null ? void 0 : _a2.angle) ?? 0) % 360 + 360) % 360;
11193
+ if (Math.abs(first) < 0.5 || Math.abs(first - 360) < 0.5) allSameNonZero = false;
11194
+ if (allSameNonZero) {
11195
+ for (const k of kids) {
11196
+ const a = ((k.angle ?? 0) % 360 + 360) % 360;
11197
+ if (Math.abs(a - first) > 0.5) {
11198
+ allSameNonZero = false;
11199
+ break;
11200
+ }
11201
+ }
11202
+ }
11203
+ selection.setControlsVisibility({
11204
+ ml: !allSameNonZero,
11205
+ mr: !allSameNonZero,
11206
+ mt: !allSameNonZero,
11207
+ mb: !allSameNonZero
11208
+ });
11209
+ } catch {
11210
+ }
11188
11211
  }
11189
11212
  const PageCanvas = react.forwardRef(
11190
11213
  ({
@@ -14643,47 +14666,6 @@ const PageCanvas = react.forwardRef(
14643
14666
  unlockEditsSoon();
14644
14667
  return;
14645
14668
  }
14646
- if (hadRotation && !hadScale && isActiveSelection && activeObj instanceof fabric__namespace.ActiveSelection && !isStackLayoutMode(groupToMove.layoutMode)) {
14647
- const groupSelectionId = activeObj.__pixldocsGroupSelection ?? groupToMove.id;
14648
- const newAngle = ((activeObj.angle ?? 0) % 360 + 360) % 360;
14649
- const { updateNode: updateNodeStore, commitHistory: commitHistoryStore, getCurrentElements } = useEditorStore.getState();
14650
- const rotPatch = { angle: newAngle === 0 ? void 0 : newAngle };
14651
- if (Math.abs(deltaX) > 0.1) rotPatch.left = (groupToMove.left ?? 0) + deltaX;
14652
- if (Math.abs(deltaY) > 0.1) rotPatch.top = (groupToMove.top ?? 0) + deltaY;
14653
- updateNodeStore(groupToMove.id, rotPatch, { recordHistory: false, skipLayoutRecalc: true });
14654
- commitHistoryStore();
14655
- pendingGroupDrillInRef.current = null;
14656
- fabricCanvas.__activeEditingGroupId = null;
14657
- setDrilledGroupBounds(null);
14658
- drilledGroupIdRef.current = null;
14659
- if (groupSelectionId) {
14660
- restoreGroupSelectionVisualState(activeObj, groupSelectionId);
14661
- fabricCanvas.setActiveObject(activeObj);
14662
- activeObj.setCoords();
14663
- }
14664
- selectElements([groupSelectionId], false, false);
14665
- fabricCanvas.requestRenderAll();
14666
- elementsRef.current = getCurrentElements();
14667
- const rotTargets = activeObj.getObjects();
14668
- for (const o of rotTargets) {
14669
- const oid = getObjectId(o);
14670
- if (oid && oid !== "__background__") {
14671
- justModifiedIdsRef.current.add(oid);
14672
- modifiedIdsThisRound.add(oid);
14673
- }
14674
- }
14675
- setTimeout(() => modifiedIdsThisRound.forEach((id) => justModifiedIdsRef.current.delete(id)), 150);
14676
- groupSelectionTransformStartRef.current = null;
14677
- const rotSnapshot = {
14678
- memberIds: rotTargets.map((o) => getObjectId(o)).filter((id) => !!id && id !== "__background__"),
14679
- groupSelectionId,
14680
- expiresAt: Date.now() + 1200
14681
- };
14682
- recentGroupSelectionRestoreRef.current = rotSnapshot;
14683
- restorePreservedGroupSelectionSoon(rotSnapshot);
14684
- unlockEditsSoon();
14685
- return;
14686
- }
14687
14669
  }
14688
14670
  }
14689
14671
  const pendingCropGroupFrameBakes = [];
@@ -24269,9 +24251,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
24269
24251
  }
24270
24252
  return svgString;
24271
24253
  }
24272
- const resolvedPackageVersion = "0.5.309";
24254
+ const resolvedPackageVersion = "0.5.311";
24273
24255
  const PACKAGE_VERSION = resolvedPackageVersion;
24274
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.309";
24256
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.311";
24275
24257
  const roundParityValue = (value) => {
24276
24258
  if (typeof value !== "number") return value;
24277
24259
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -25085,7 +25067,7 @@ class PixldocsRenderer {
25085
25067
  await this.waitForCanvasScene(container, cloned, i);
25086
25068
  }
25087
25069
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
25088
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-D4oH9a3h.cjs"));
25070
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-CgqBRltR.cjs"));
25089
25071
  const prepared = preparePagesForExport(
25090
25072
  cloned.pages,
25091
25073
  canvasWidth,
@@ -27405,7 +27387,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
27405
27387
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
27406
27388
  sanitizeSvgTreeForPdf(svgToDraw);
27407
27389
  try {
27408
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-D4oH9a3h.cjs"));
27390
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-CgqBRltR.cjs"));
27409
27391
  try {
27410
27392
  await logTextMeasurementDiagnostic(svgToDraw);
27411
27393
  } catch {
@@ -27802,4 +27784,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
27802
27784
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
27803
27785
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
27804
27786
  exports.warmTemplateFromForm = warmTemplateFromForm;
27805
- //# sourceMappingURL=index-B5XKQ7rz.cjs.map
27787
+ //# sourceMappingURL=index-C7ZK-TLB.cjs.map