@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.
@@ -11241,35 +11241,10 @@ const PageCanvas = forwardRef(
11241
11241
  const [ready, setReady] = useState(false);
11242
11242
  const [unlockRequestId, setUnlockRequestId] = useState(0);
11243
11243
  const applyLogicalGroupSelectionVisualState = useCallback((selection, groupId) => {
11244
- var _a2, _b2;
11244
+ var _a2;
11245
11245
  selection.__pixldocsGroupSelection = groupId;
11246
11246
  delete selection.__pixldocsLogicalGroupIds;
11247
11247
  selection.hasBorders = true;
11248
- try {
11249
- const state = useEditorStore.getState();
11250
- const pages = ((_a2 = state.canvas) == null ? void 0 : _a2.pages) ?? [];
11251
- let groupNode = null;
11252
- for (const page of pages) {
11253
- const found = findNodeById(page.children ?? [], groupId);
11254
- if (found && isGroup(found)) {
11255
- groupNode = found;
11256
- break;
11257
- }
11258
- }
11259
- if (groupNode && !isStackLayoutMode(groupNode.layoutMode) && typeof groupNode.angle === "number" && Math.abs(groupNode.angle) > 0.01) {
11260
- const currentAngle = ((selection.angle ?? 0) % 360 + 360) % 360;
11261
- const targetAngle = ((groupNode.angle ?? 0) % 360 + 360) % 360;
11262
- try {
11263
- console.log("[ROT-DBG] restore AS angle", { groupId, currentAngle, targetAngle, childCount: selection.getObjects().length });
11264
- } catch {
11265
- }
11266
- if (Math.abs(currentAngle - targetAngle) > 0.01) {
11267
- selection.rotate(targetAngle);
11268
- selection.setCoords();
11269
- }
11270
- }
11271
- } catch {
11272
- }
11273
11248
  const members = selection.getObjects();
11274
11249
  for (const prev of suppressGroupMemberBordersRef.current) {
11275
11250
  if (members.includes(prev)) continue;
@@ -11293,7 +11268,7 @@ const PageCanvas = forwardRef(
11293
11268
  if (m.__pixldocsOrigHasControls === void 0) m.__pixldocsOrigHasControls = m.hasControls;
11294
11269
  m.hasBorders = false;
11295
11270
  m.hasControls = false;
11296
- if (m.__cropGroup || ((_b2 = m._ct) == null ? void 0 : _b2.isCropGroup)) {
11271
+ if (m.__cropGroup || ((_a2 = m._ct) == null ? void 0 : _a2.isCropGroup)) {
11297
11272
  if (m.__pixldocsOrigLockScalingX === void 0) {
11298
11273
  m.__pixldocsOrigLockScalingX = m.lockScalingX;
11299
11274
  m.__pixldocsOrigLockScalingY = m.lockScalingY;
@@ -14611,27 +14586,6 @@ const PageCanvas = forwardRef(
14611
14586
  360 - Math.abs(currentSelAngle - startSelAngle)
14612
14587
  );
14613
14588
  const hadRotation = isActiveSelection && activeObj && angleDelta > 0.01;
14614
- try {
14615
- console.log("[ROT-DBG] object:modified", {
14616
- isActiveSelection,
14617
- isAS: activeObj instanceof fabric.ActiveSelection,
14618
- groupToMoveId: groupToMove == null ? void 0 : groupToMove.id,
14619
- groupToMoveLayout: groupToMove == null ? void 0 : groupToMove.layoutMode,
14620
- groupSelMarker: activeObj == null ? void 0 : activeObj.__pixldocsGroupSelection,
14621
- startSelAngle,
14622
- currentSelAngle,
14623
- angleDelta,
14624
- hadRotation,
14625
- hadScale,
14626
- deltaX,
14627
- deltaY,
14628
- asScaleX: activeObj == null ? void 0 : activeObj.scaleX,
14629
- asScaleY: activeObj == null ? void 0 : activeObj.scaleY,
14630
- childCount: activeObj instanceof fabric.ActiveSelection ? activeObj.getObjects().length : 0,
14631
- childAngles: activeObj instanceof fabric.ActiveSelection ? activeObj.getObjects().map((o) => Math.round(((o.angle ?? 0) + Number.EPSILON) * 100) / 100) : []
14632
- });
14633
- } catch {
14634
- }
14635
14589
  if (!hadScale && !hadRotation && (Math.abs(deltaX) > 0.1 || Math.abs(deltaY) > 0.1)) {
14636
14590
  const { updateNode: updateNodeStore, commitHistory: commitHistoryStore, getCurrentElements } = useEditorStore.getState();
14637
14591
  const newLeft = (groupToMove.left ?? 0) + deltaX;
@@ -14671,51 +14625,6 @@ const PageCanvas = forwardRef(
14671
14625
  unlockEditsSoon();
14672
14626
  return;
14673
14627
  }
14674
- if (hadRotation && !hadScale && isActiveSelection && activeObj instanceof fabric.ActiveSelection && !isStackLayoutMode(groupToMove.layoutMode)) {
14675
- const groupSelectionId = activeObj.__pixldocsGroupSelection ?? groupToMove.id;
14676
- const newAngle = ((activeObj.angle ?? 0) % 360 + 360) % 360;
14677
- try {
14678
- console.log("[ROT-DBG] persist group.angle", { groupId: groupToMove.id, newAngle, groupSelectionId });
14679
- } catch {
14680
- }
14681
- const { updateNode: updateNodeStore, commitHistory: commitHistoryStore, getCurrentElements } = useEditorStore.getState();
14682
- const rotPatch = { angle: newAngle === 0 ? void 0 : newAngle };
14683
- if (Math.abs(deltaX) > 0.1) rotPatch.left = (groupToMove.left ?? 0) + deltaX;
14684
- if (Math.abs(deltaY) > 0.1) rotPatch.top = (groupToMove.top ?? 0) + deltaY;
14685
- updateNodeStore(groupToMove.id, rotPatch, { recordHistory: false, skipLayoutRecalc: true });
14686
- commitHistoryStore();
14687
- pendingGroupDrillInRef.current = null;
14688
- fabricCanvas.__activeEditingGroupId = null;
14689
- setDrilledGroupBounds(null);
14690
- drilledGroupIdRef.current = null;
14691
- if (groupSelectionId) {
14692
- restoreGroupSelectionVisualState(activeObj, groupSelectionId);
14693
- fabricCanvas.setActiveObject(activeObj);
14694
- activeObj.setCoords();
14695
- }
14696
- selectElements([groupSelectionId], false, false);
14697
- fabricCanvas.requestRenderAll();
14698
- elementsRef.current = getCurrentElements();
14699
- const rotTargets = activeObj.getObjects();
14700
- for (const o of rotTargets) {
14701
- const oid = getObjectId(o);
14702
- if (oid && oid !== "__background__") {
14703
- justModifiedIdsRef.current.add(oid);
14704
- modifiedIdsThisRound.add(oid);
14705
- }
14706
- }
14707
- setTimeout(() => modifiedIdsThisRound.forEach((id) => justModifiedIdsRef.current.delete(id)), 150);
14708
- groupSelectionTransformStartRef.current = null;
14709
- const rotSnapshot = {
14710
- memberIds: rotTargets.map((o) => getObjectId(o)).filter((id) => !!id && id !== "__background__"),
14711
- groupSelectionId,
14712
- expiresAt: Date.now() + 1200
14713
- };
14714
- recentGroupSelectionRestoreRef.current = rotSnapshot;
14715
- restorePreservedGroupSelectionSoon(rotSnapshot);
14716
- unlockEditsSoon();
14717
- return;
14718
- }
14719
14628
  }
14720
14629
  }
14721
14630
  const pendingCropGroupFrameBakes = [];
@@ -24301,9 +24210,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
24301
24210
  }
24302
24211
  return svgString;
24303
24212
  }
24304
- const resolvedPackageVersion = "0.5.308";
24213
+ const resolvedPackageVersion = "0.5.310";
24305
24214
  const PACKAGE_VERSION = resolvedPackageVersion;
24306
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.308";
24215
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.310";
24307
24216
  const roundParityValue = (value) => {
24308
24217
  if (typeof value !== "number") return value;
24309
24218
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -25117,7 +25026,7 @@ class PixldocsRenderer {
25117
25026
  await this.waitForCanvasScene(container, cloned, i);
25118
25027
  }
25119
25028
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
25120
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-D_Bu2WUi.js");
25029
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-iBVh67qr.js");
25121
25030
  const prepared = preparePagesForExport(
25122
25031
  cloned.pages,
25123
25032
  canvasWidth,
@@ -27437,7 +27346,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
27437
27346
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
27438
27347
  sanitizeSvgTreeForPdf(svgToDraw);
27439
27348
  try {
27440
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-D_Bu2WUi.js");
27349
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-iBVh67qr.js");
27441
27350
  try {
27442
27351
  await logTextMeasurementDiagnostic(svgToDraw);
27443
27352
  } catch {
@@ -27837,4 +27746,4 @@ export {
27837
27746
  buildTeaserBlurFlatKeys as y,
27838
27747
  collectFontDescriptorsFromConfig as z
27839
27748
  };
27840
- //# sourceMappingURL=index-C56kkT1g.js.map
27749
+ //# sourceMappingURL=index-DiALQM5h.js.map