@pixldocs/canvas-renderer 0.5.308 → 0.5.310

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.
@@ -11259,35 +11259,10 @@ const PageCanvas = react.forwardRef(
11259
11259
  const [ready, setReady] = react.useState(false);
11260
11260
  const [unlockRequestId, setUnlockRequestId] = react.useState(0);
11261
11261
  const applyLogicalGroupSelectionVisualState = react.useCallback((selection, groupId) => {
11262
- var _a2, _b2;
11262
+ var _a2;
11263
11263
  selection.__pixldocsGroupSelection = groupId;
11264
11264
  delete selection.__pixldocsLogicalGroupIds;
11265
11265
  selection.hasBorders = true;
11266
- try {
11267
- const state = useEditorStore.getState();
11268
- const pages = ((_a2 = state.canvas) == null ? void 0 : _a2.pages) ?? [];
11269
- let groupNode = null;
11270
- for (const page of pages) {
11271
- const found = findNodeById(page.children ?? [], groupId);
11272
- if (found && isGroup(found)) {
11273
- groupNode = found;
11274
- break;
11275
- }
11276
- }
11277
- if (groupNode && !isStackLayoutMode(groupNode.layoutMode) && typeof groupNode.angle === "number" && Math.abs(groupNode.angle) > 0.01) {
11278
- const currentAngle = ((selection.angle ?? 0) % 360 + 360) % 360;
11279
- const targetAngle = ((groupNode.angle ?? 0) % 360 + 360) % 360;
11280
- try {
11281
- console.log("[ROT-DBG] restore AS angle", { groupId, currentAngle, targetAngle, childCount: selection.getObjects().length });
11282
- } catch {
11283
- }
11284
- if (Math.abs(currentAngle - targetAngle) > 0.01) {
11285
- selection.rotate(targetAngle);
11286
- selection.setCoords();
11287
- }
11288
- }
11289
- } catch {
11290
- }
11291
11266
  const members = selection.getObjects();
11292
11267
  for (const prev of suppressGroupMemberBordersRef.current) {
11293
11268
  if (members.includes(prev)) continue;
@@ -11311,7 +11286,7 @@ const PageCanvas = react.forwardRef(
11311
11286
  if (m.__pixldocsOrigHasControls === void 0) m.__pixldocsOrigHasControls = m.hasControls;
11312
11287
  m.hasBorders = false;
11313
11288
  m.hasControls = false;
11314
- if (m.__cropGroup || ((_b2 = m._ct) == null ? void 0 : _b2.isCropGroup)) {
11289
+ if (m.__cropGroup || ((_a2 = m._ct) == null ? void 0 : _a2.isCropGroup)) {
11315
11290
  if (m.__pixldocsOrigLockScalingX === void 0) {
11316
11291
  m.__pixldocsOrigLockScalingX = m.lockScalingX;
11317
11292
  m.__pixldocsOrigLockScalingY = m.lockScalingY;
@@ -14629,27 +14604,6 @@ const PageCanvas = react.forwardRef(
14629
14604
  360 - Math.abs(currentSelAngle - startSelAngle)
14630
14605
  );
14631
14606
  const hadRotation = isActiveSelection && activeObj && angleDelta > 0.01;
14632
- try {
14633
- console.log("[ROT-DBG] object:modified", {
14634
- isActiveSelection,
14635
- isAS: activeObj instanceof fabric__namespace.ActiveSelection,
14636
- groupToMoveId: groupToMove == null ? void 0 : groupToMove.id,
14637
- groupToMoveLayout: groupToMove == null ? void 0 : groupToMove.layoutMode,
14638
- groupSelMarker: activeObj == null ? void 0 : activeObj.__pixldocsGroupSelection,
14639
- startSelAngle,
14640
- currentSelAngle,
14641
- angleDelta,
14642
- hadRotation,
14643
- hadScale,
14644
- deltaX,
14645
- deltaY,
14646
- asScaleX: activeObj == null ? void 0 : activeObj.scaleX,
14647
- asScaleY: activeObj == null ? void 0 : activeObj.scaleY,
14648
- childCount: activeObj instanceof fabric__namespace.ActiveSelection ? activeObj.getObjects().length : 0,
14649
- childAngles: activeObj instanceof fabric__namespace.ActiveSelection ? activeObj.getObjects().map((o) => Math.round(((o.angle ?? 0) + Number.EPSILON) * 100) / 100) : []
14650
- });
14651
- } catch {
14652
- }
14653
14607
  if (!hadScale && !hadRotation && (Math.abs(deltaX) > 0.1 || Math.abs(deltaY) > 0.1)) {
14654
14608
  const { updateNode: updateNodeStore, commitHistory: commitHistoryStore, getCurrentElements } = useEditorStore.getState();
14655
14609
  const newLeft = (groupToMove.left ?? 0) + deltaX;
@@ -14689,51 +14643,6 @@ const PageCanvas = react.forwardRef(
14689
14643
  unlockEditsSoon();
14690
14644
  return;
14691
14645
  }
14692
- if (hadRotation && !hadScale && isActiveSelection && activeObj instanceof fabric__namespace.ActiveSelection && !isStackLayoutMode(groupToMove.layoutMode)) {
14693
- const groupSelectionId = activeObj.__pixldocsGroupSelection ?? groupToMove.id;
14694
- const newAngle = ((activeObj.angle ?? 0) % 360 + 360) % 360;
14695
- try {
14696
- console.log("[ROT-DBG] persist group.angle", { groupId: groupToMove.id, newAngle, groupSelectionId });
14697
- } catch {
14698
- }
14699
- const { updateNode: updateNodeStore, commitHistory: commitHistoryStore, getCurrentElements } = useEditorStore.getState();
14700
- const rotPatch = { angle: newAngle === 0 ? void 0 : newAngle };
14701
- if (Math.abs(deltaX) > 0.1) rotPatch.left = (groupToMove.left ?? 0) + deltaX;
14702
- if (Math.abs(deltaY) > 0.1) rotPatch.top = (groupToMove.top ?? 0) + deltaY;
14703
- updateNodeStore(groupToMove.id, rotPatch, { recordHistory: false, skipLayoutRecalc: true });
14704
- commitHistoryStore();
14705
- pendingGroupDrillInRef.current = null;
14706
- fabricCanvas.__activeEditingGroupId = null;
14707
- setDrilledGroupBounds(null);
14708
- drilledGroupIdRef.current = null;
14709
- if (groupSelectionId) {
14710
- restoreGroupSelectionVisualState(activeObj, groupSelectionId);
14711
- fabricCanvas.setActiveObject(activeObj);
14712
- activeObj.setCoords();
14713
- }
14714
- selectElements([groupSelectionId], false, false);
14715
- fabricCanvas.requestRenderAll();
14716
- elementsRef.current = getCurrentElements();
14717
- const rotTargets = activeObj.getObjects();
14718
- for (const o of rotTargets) {
14719
- const oid = getObjectId(o);
14720
- if (oid && oid !== "__background__") {
14721
- justModifiedIdsRef.current.add(oid);
14722
- modifiedIdsThisRound.add(oid);
14723
- }
14724
- }
14725
- setTimeout(() => modifiedIdsThisRound.forEach((id) => justModifiedIdsRef.current.delete(id)), 150);
14726
- groupSelectionTransformStartRef.current = null;
14727
- const rotSnapshot = {
14728
- memberIds: rotTargets.map((o) => getObjectId(o)).filter((id) => !!id && id !== "__background__"),
14729
- groupSelectionId,
14730
- expiresAt: Date.now() + 1200
14731
- };
14732
- recentGroupSelectionRestoreRef.current = rotSnapshot;
14733
- restorePreservedGroupSelectionSoon(rotSnapshot);
14734
- unlockEditsSoon();
14735
- return;
14736
- }
14737
14646
  }
14738
14647
  }
14739
14648
  const pendingCropGroupFrameBakes = [];
@@ -24319,9 +24228,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
24319
24228
  }
24320
24229
  return svgString;
24321
24230
  }
24322
- const resolvedPackageVersion = "0.5.308";
24231
+ const resolvedPackageVersion = "0.5.310";
24323
24232
  const PACKAGE_VERSION = resolvedPackageVersion;
24324
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.308";
24233
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.310";
24325
24234
  const roundParityValue = (value) => {
24326
24235
  if (typeof value !== "number") return value;
24327
24236
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -25135,7 +25044,7 @@ class PixldocsRenderer {
25135
25044
  await this.waitForCanvasScene(container, cloned, i);
25136
25045
  }
25137
25046
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
25138
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-CRUQe1BV.cjs"));
25047
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-BszCIDi_.cjs"));
25139
25048
  const prepared = preparePagesForExport(
25140
25049
  cloned.pages,
25141
25050
  canvasWidth,
@@ -27455,7 +27364,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
27455
27364
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
27456
27365
  sanitizeSvgTreeForPdf(svgToDraw);
27457
27366
  try {
27458
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-CRUQe1BV.cjs"));
27367
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-BszCIDi_.cjs"));
27459
27368
  try {
27460
27369
  await logTextMeasurementDiagnostic(svgToDraw);
27461
27370
  } catch {
@@ -27852,4 +27761,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
27852
27761
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
27853
27762
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
27854
27763
  exports.warmTemplateFromForm = warmTemplateFromForm;
27855
- //# sourceMappingURL=index-DvZ7xADZ.cjs.map
27764
+ //# sourceMappingURL=index-1lUaEm6d.cjs.map