@pixldocs/canvas-renderer 0.5.336 → 0.5.337

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.
@@ -14451,7 +14451,7 @@ const PageCanvas = react.forwardRef(
14451
14451
  });
14452
14452
  let cropGroupSaveTimer = null;
14453
14453
  fabricCanvas.on("object:modified", (e) => {
14454
- var _a2, _b2, _c, _d, _e, _f, _g, _h, _i;
14454
+ var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j;
14455
14455
  try {
14456
14456
  dragStarted = false;
14457
14457
  setGuides([]);
@@ -14459,6 +14459,33 @@ const PageCanvas = react.forwardRef(
14459
14459
  objectResizeActiveSnapRef.current = null;
14460
14460
  groupResizeActiveSnapRef.current = null;
14461
14461
  onDragEnd == null ? void 0 : onDragEnd();
14462
+ try {
14463
+ const mt = e.target;
14464
+ const children = mt instanceof fabric__namespace.Group || mt instanceof fabric__namespace.ActiveSelection ? mt.getObjects() : [];
14465
+ logGroupImageResizeDebug("modified-entry", {
14466
+ time: Math.round(performance.now()),
14467
+ didTransform: didTransformRef.current,
14468
+ targetType: mt == null ? void 0 : mt.type,
14469
+ targetCtor: (_a2 = mt == null ? void 0 : mt.constructor) == null ? void 0 : _a2.name,
14470
+ isActiveSelection: mt instanceof fabric__namespace.ActiveSelection,
14471
+ isGroup: mt instanceof fabric__namespace.Group,
14472
+ angle: mt == null ? void 0 : mt.angle,
14473
+ childCount: children.length,
14474
+ childTypes: children.map((c) => c == null ? void 0 : c.type),
14475
+ hasImageChild: children.some((c) => isGroupResizeImageLikeObject(c)),
14476
+ target: mt ? summarizeFabricObjectForResizeDebug(mt) : null,
14477
+ children: children.map((c) => {
14478
+ var _a3;
14479
+ return {
14480
+ type: c == null ? void 0 : c.type,
14481
+ ctor: (_a3 = c == null ? void 0 : c.constructor) == null ? void 0 : _a3.name,
14482
+ summary: summarizeFabricObjectForResizeDebug(c)
14483
+ };
14484
+ })
14485
+ });
14486
+ } catch (err) {
14487
+ console.warn("[Pixldocs][group-image-side-resize] modified-entry log failed", err);
14488
+ }
14462
14489
  try {
14463
14490
  const t = e.target;
14464
14491
  if (t instanceof fabric__namespace.ActiveSelection) {
@@ -14496,7 +14523,7 @@ const PageCanvas = react.forwardRef(
14496
14523
  const active = fabricCanvas.getActiveObject();
14497
14524
  const activeId = active ? getObjectId(active) : null;
14498
14525
  if (active && activeId && activeId !== "__background__" && !(active instanceof fabric__namespace.Group)) {
14499
- const pageChildrenForParent = ((_a2 = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _a2.children) ?? [];
14526
+ const pageChildrenForParent = ((_b2 = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _b2.children) ?? [];
14500
14527
  const parentGroup = findParentGroup(pageChildrenForParent, activeId);
14501
14528
  if (parentGroup && isGroup(parentGroup) && parentGroup.backgroundColor) {
14502
14529
  let fabricSectionGroup = active.group && active.group instanceof fabric__namespace.Group ? active.group : null;
@@ -14578,7 +14605,7 @@ const PageCanvas = react.forwardRef(
14578
14605
  useEditorStore.getState().reflowStackGroupInPage(pageId, groupId);
14579
14606
  }
14580
14607
  const stateAfter = useEditorStore.getState();
14581
- const pageAfter = ((_b2 = stateAfter.canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _b2.children) ?? [];
14608
+ const pageAfter = ((_c = stateAfter.canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _c.children) ?? [];
14582
14609
  const groupNodeAfter = findNodeById(pageAfter, groupId);
14583
14610
  if (groupNodeAfter) {
14584
14611
  const abs = getAbsoluteBounds(groupNodeAfter, pageAfter);
@@ -14641,7 +14668,7 @@ const PageCanvas = react.forwardRef(
14641
14668
  }
14642
14669
  if (active && active instanceof fabric__namespace.Group && active.__docuforgeSectionGroup && getObjectId(active)) {
14643
14670
  const groupId = getObjectId(active);
14644
- const pageChildrenSec = ((_c = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _c.children) ?? [];
14671
+ const pageChildrenSec = ((_d = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _d.children) ?? [];
14645
14672
  const modifiedTarget2 = e == null ? void 0 : e.target;
14646
14673
  const resizeScaleTarget = lastResizeScaleTargetRef.current;
14647
14674
  lastResizeScaleTargetRef.current = null;
@@ -14672,7 +14699,7 @@ const PageCanvas = react.forwardRef(
14672
14699
  const node = findNodeById(pageChildrenSec, groupId);
14673
14700
  if (isChildModified && node && !groupMoved) {
14674
14701
  const stateAfter = useEditorStore.getState();
14675
- const pageAfter = ((_d = stateAfter.canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _d.children) ?? [];
14702
+ const pageAfter = ((_e = stateAfter.canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _e.children) ?? [];
14676
14703
  const groupNodeAfter = findNodeById(pageAfter, groupId);
14677
14704
  if (groupNodeAfter) {
14678
14705
  const abs = getAbsoluteBounds(groupNodeAfter, pageAfter);
@@ -14688,7 +14715,7 @@ const PageCanvas = react.forwardRef(
14688
14715
  }
14689
14716
  if (active && active instanceof fabric__namespace.Group && !(active instanceof fabric__namespace.ActiveSelection) && getObjectId(active)) {
14690
14717
  const groupId = getObjectId(active);
14691
- const pageChildren3 = ((_e = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _e.children) ?? [];
14718
+ const pageChildren3 = ((_f = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _f.children) ?? [];
14692
14719
  const w = (active.width ?? 0) * (active.scaleX ?? 1);
14693
14720
  const h = (active.height ?? 0) * (active.scaleY ?? 1);
14694
14721
  const centerX = active.left ?? 0;
@@ -14710,7 +14737,7 @@ const PageCanvas = react.forwardRef(
14710
14737
  }
14711
14738
  const activeObj = fabricCanvas.getActiveObject();
14712
14739
  let activeObjects = fabricCanvas.getActiveObjects();
14713
- const activeSelectionMoveStart = activeObj instanceof fabric__namespace.ActiveSelection && ((_f = activeSelectionMoveStartRef.current) == null ? void 0 : _f.selection) === activeObj ? activeSelectionMoveStartRef.current : null;
14740
+ const activeSelectionMoveStart = activeObj instanceof fabric__namespace.ActiveSelection && ((_g = activeSelectionMoveStartRef.current) == null ? void 0 : _g.selection) === activeObj ? activeSelectionMoveStartRef.current : null;
14714
14741
  const activeSelectionDelta = activeObj instanceof fabric__namespace.ActiveSelection && activeSelectionMoveStart ? (() => {
14715
14742
  const rect = activeObj.getBoundingRect();
14716
14743
  return {
@@ -15129,7 +15156,7 @@ const PageCanvas = react.forwardRef(
15129
15156
  const localScaleX = 1 / sx;
15130
15157
  const localScaleY = 1 / sy;
15131
15158
  obj.set({ scaleX: localScaleX, scaleY: localScaleY });
15132
- const selectionMatrix = (_g = activeObj == null ? void 0 : activeObj.calcTransformMatrix) == null ? void 0 : _g.call(activeObj);
15159
+ const selectionMatrix = (_h = activeObj == null ? void 0 : activeObj.calcTransformMatrix) == null ? void 0 : _h.call(activeObj);
15133
15160
  const localCenter = selectionMatrix ? fabric__namespace.util.transformPoint(preBakeCenter, fabric__namespace.util.invertTransform(selectionMatrix)) : preBakeCenter;
15134
15161
  obj.setPositionByOrigin(localCenter, "center", "center");
15135
15162
  }
@@ -15280,7 +15307,7 @@ const PageCanvas = react.forwardRef(
15280
15307
  const localScaleX = 1 / sx;
15281
15308
  const localScaleY = 1 / sy;
15282
15309
  obj.set({ scaleX: localScaleX, scaleY: localScaleY });
15283
- const selectionMatrix = (_h = activeObj == null ? void 0 : activeObj.calcTransformMatrix) == null ? void 0 : _h.call(activeObj);
15310
+ const selectionMatrix = (_i = activeObj == null ? void 0 : activeObj.calcTransformMatrix) == null ? void 0 : _i.call(activeObj);
15284
15311
  const localCenter = selectionMatrix ? fabric__namespace.util.transformPoint(preBakeCenter, fabric__namespace.util.invertTransform(selectionMatrix)) : preBakeCenter;
15285
15312
  obj.setPositionByOrigin(localCenter, "center", "center");
15286
15313
  } else {
@@ -15428,7 +15455,7 @@ const PageCanvas = react.forwardRef(
15428
15455
  updateElement(objId, elementUpdate, { recordHistory: false, skipLayoutRecalc: true });
15429
15456
  obj.setCoords();
15430
15457
  }
15431
- const pageChildrenForReflow = ((_i = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _i.children) ?? [];
15458
+ const pageChildrenForReflow = ((_j = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _j.children) ?? [];
15432
15459
  const stackGroupsToReflow = /* @__PURE__ */ new Set();
15433
15460
  for (const id of modifiedIdsThisRound) {
15434
15461
  const parent = findParentGroup(pageChildrenForReflow, id);
@@ -24568,9 +24595,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
24568
24595
  }
24569
24596
  return svgString;
24570
24597
  }
24571
- const resolvedPackageVersion = "0.5.336";
24598
+ const resolvedPackageVersion = "0.5.337";
24572
24599
  const PACKAGE_VERSION = resolvedPackageVersion;
24573
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.336";
24600
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.337";
24574
24601
  const roundParityValue = (value) => {
24575
24602
  if (typeof value !== "number") return value;
24576
24603
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -25384,7 +25411,7 @@ class PixldocsRenderer {
25384
25411
  await this.waitForCanvasScene(container, cloned, i);
25385
25412
  }
25386
25413
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
25387
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-BgFbzhxa.cjs"));
25414
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-11EJIk-M.cjs"));
25388
25415
  const prepared = preparePagesForExport(
25389
25416
  cloned.pages,
25390
25417
  canvasWidth,
@@ -27704,7 +27731,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
27704
27731
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
27705
27732
  sanitizeSvgTreeForPdf(svgToDraw);
27706
27733
  try {
27707
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-BgFbzhxa.cjs"));
27734
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-11EJIk-M.cjs"));
27708
27735
  try {
27709
27736
  await logTextMeasurementDiagnostic(svgToDraw);
27710
27737
  } catch {
@@ -28101,4 +28128,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
28101
28128
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
28102
28129
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
28103
28130
  exports.warmTemplateFromForm = warmTemplateFromForm;
28104
- //# sourceMappingURL=index-BUYwGfVW.cjs.map
28131
+ //# sourceMappingURL=index-Ze4pswgN.cjs.map