@pixldocs/canvas-renderer 0.5.275 → 0.5.276
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-CRmR2BYr.cjs → index-AzU8Pmse.cjs} +44 -14
- package/dist/index-AzU8Pmse.cjs.map +1 -0
- package/dist/{index-Cs7F2355.js → index-CszEZlZ7.js} +44 -14
- package/dist/index-CszEZlZ7.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-CZa1TypE.js → vectorPdfExport-C9akdCtS.js} +4 -4
- package/dist/{vectorPdfExport-CZa1TypE.js.map → vectorPdfExport-C9akdCtS.js.map} +1 -1
- package/dist/{vectorPdfExport-2pqCA90u.cjs → vectorPdfExport-CvLitjuI.cjs} +4 -4
- package/dist/{vectorPdfExport-2pqCA90u.cjs.map → vectorPdfExport-CvLitjuI.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/index-CRmR2BYr.cjs.map +0 -1
- package/dist/index-Cs7F2355.js.map +0 -1
|
@@ -13908,9 +13908,23 @@ const PageCanvas = react.forwardRef(
|
|
|
13908
13908
|
});
|
|
13909
13909
|
let cropGroupSaveTimer = null;
|
|
13910
13910
|
fabricCanvas.on("object:modified", (e) => {
|
|
13911
|
-
var _a2, _b2, _c, _d, _e, _f, _g, _h;
|
|
13911
|
+
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i;
|
|
13912
13912
|
try {
|
|
13913
13913
|
dragStarted = false;
|
|
13914
|
+
if (typeof window !== "undefined" && window.__pixldocsDebugGroupMove) {
|
|
13915
|
+
const t = e.target;
|
|
13916
|
+
console.log("[GRP-MOVE] object:modified fired", {
|
|
13917
|
+
targetType: (_a2 = t == null ? void 0 : t.constructor) == null ? void 0 : _a2.name,
|
|
13918
|
+
isActiveSelection: t instanceof fabric__namespace.ActiveSelection,
|
|
13919
|
+
groupSelectionId: t ? t.__pixldocsGroupSelection : null,
|
|
13920
|
+
memberIds: t instanceof fabric__namespace.ActiveSelection ? t.getObjects().map((o) => getObjectId(o)) : [getObjectId(t)],
|
|
13921
|
+
targetLeft: t == null ? void 0 : t.left,
|
|
13922
|
+
targetTop: t == null ? void 0 : t.top,
|
|
13923
|
+
scaleX: t == null ? void 0 : t.scaleX,
|
|
13924
|
+
scaleY: t == null ? void 0 : t.scaleY,
|
|
13925
|
+
angle: t == null ? void 0 : t.angle
|
|
13926
|
+
});
|
|
13927
|
+
}
|
|
13914
13928
|
setGuides([]);
|
|
13915
13929
|
setGroupOverlayLiveBoundsRef.current(null);
|
|
13916
13930
|
objectResizeActiveSnapRef.current = null;
|
|
@@ -13952,7 +13966,7 @@ const PageCanvas = react.forwardRef(
|
|
|
13952
13966
|
const active = fabricCanvas.getActiveObject();
|
|
13953
13967
|
const activeId = active ? getObjectId(active) : null;
|
|
13954
13968
|
if (active && activeId && activeId !== "__background__" && !(active instanceof fabric__namespace.Group)) {
|
|
13955
|
-
const pageChildrenForParent = ((
|
|
13969
|
+
const pageChildrenForParent = ((_b2 = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _b2.children) ?? [];
|
|
13956
13970
|
const parentGroup = findParentGroup(pageChildrenForParent, activeId);
|
|
13957
13971
|
if (parentGroup && isGroup(parentGroup) && parentGroup.backgroundColor) {
|
|
13958
13972
|
let fabricSectionGroup = active.group && active.group instanceof fabric__namespace.Group ? active.group : null;
|
|
@@ -14034,7 +14048,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14034
14048
|
useEditorStore.getState().reflowStackGroupInPage(pageId, groupId);
|
|
14035
14049
|
}
|
|
14036
14050
|
const stateAfter = useEditorStore.getState();
|
|
14037
|
-
const pageAfter = ((
|
|
14051
|
+
const pageAfter = ((_c = stateAfter.canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _c.children) ?? [];
|
|
14038
14052
|
const groupNodeAfter = findNodeById(pageAfter, groupId);
|
|
14039
14053
|
if (groupNodeAfter) {
|
|
14040
14054
|
const abs = getAbsoluteBounds(groupNodeAfter, pageAfter);
|
|
@@ -14096,7 +14110,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14096
14110
|
}
|
|
14097
14111
|
if (active && active instanceof fabric__namespace.Group && active.__docuforgeSectionGroup && getObjectId(active)) {
|
|
14098
14112
|
const groupId = getObjectId(active);
|
|
14099
|
-
const pageChildrenSec = ((
|
|
14113
|
+
const pageChildrenSec = ((_d = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _d.children) ?? [];
|
|
14100
14114
|
const modifiedTarget2 = e == null ? void 0 : e.target;
|
|
14101
14115
|
const resizeScaleTarget = lastResizeScaleTargetRef.current;
|
|
14102
14116
|
lastResizeScaleTargetRef.current = null;
|
|
@@ -14127,7 +14141,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14127
14141
|
const node = findNodeById(pageChildrenSec, groupId);
|
|
14128
14142
|
if (isChildModified && node && !groupMoved) {
|
|
14129
14143
|
const stateAfter = useEditorStore.getState();
|
|
14130
|
-
const pageAfter = ((
|
|
14144
|
+
const pageAfter = ((_e = stateAfter.canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _e.children) ?? [];
|
|
14131
14145
|
const groupNodeAfter = findNodeById(pageAfter, groupId);
|
|
14132
14146
|
if (groupNodeAfter) {
|
|
14133
14147
|
const abs = getAbsoluteBounds(groupNodeAfter, pageAfter);
|
|
@@ -14143,7 +14157,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14143
14157
|
}
|
|
14144
14158
|
if (active && active instanceof fabric__namespace.Group && !(active instanceof fabric__namespace.ActiveSelection) && getObjectId(active)) {
|
|
14145
14159
|
const groupId = getObjectId(active);
|
|
14146
|
-
const pageChildren3 = ((
|
|
14160
|
+
const pageChildren3 = ((_f = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _f.children) ?? [];
|
|
14147
14161
|
const w = (active.width ?? 0) * (active.scaleX ?? 1);
|
|
14148
14162
|
const h = (active.height ?? 0) * (active.scaleY ?? 1);
|
|
14149
14163
|
const centerX = active.left ?? 0;
|
|
@@ -14165,7 +14179,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14165
14179
|
}
|
|
14166
14180
|
const activeObj = fabricCanvas.getActiveObject();
|
|
14167
14181
|
let activeObjects = fabricCanvas.getActiveObjects();
|
|
14168
|
-
const activeSelectionMoveStart = activeObj instanceof fabric__namespace.ActiveSelection && ((
|
|
14182
|
+
const activeSelectionMoveStart = activeObj instanceof fabric__namespace.ActiveSelection && ((_g = activeSelectionMoveStartRef.current) == null ? void 0 : _g.selection) === activeObj ? activeSelectionMoveStartRef.current : null;
|
|
14169
14183
|
const activeSelectionDelta = activeObj instanceof fabric__namespace.ActiveSelection && activeSelectionMoveStart ? (() => {
|
|
14170
14184
|
const rect = activeObj.getBoundingRect();
|
|
14171
14185
|
return {
|
|
@@ -14256,6 +14270,22 @@ const PageCanvas = react.forwardRef(
|
|
|
14256
14270
|
return memberIds.every((mid) => selectedSet.has(mid));
|
|
14257
14271
|
})();
|
|
14258
14272
|
const groupToMove = candidateIsStack || allMembersSelected ? candidateGroup : null;
|
|
14273
|
+
if (typeof window !== "undefined" && window.__pixldocsDebugGroupMove) {
|
|
14274
|
+
console.log("[GRP-MOVE] entry", {
|
|
14275
|
+
selectedElementIds,
|
|
14276
|
+
isActiveSelection,
|
|
14277
|
+
activeSelectionGroupId: activeObj instanceof fabric__namespace.ActiveSelection ? activeObj.__pixldocsGroupSelection : null,
|
|
14278
|
+
parentGroupIds: parentGroups.map((g) => g.id),
|
|
14279
|
+
sameDirectParent,
|
|
14280
|
+
commonAncestorId: commonAncestor == null ? void 0 : commonAncestor.id,
|
|
14281
|
+
candidateGroupId: candidateGroup == null ? void 0 : candidateGroup.id,
|
|
14282
|
+
candidateIsStack,
|
|
14283
|
+
allMembersSelected,
|
|
14284
|
+
groupToMoveId: (groupToMove == null ? void 0 : groupToMove.id) ?? null,
|
|
14285
|
+
activeSelectionHadTransform,
|
|
14286
|
+
selectedLogicalGroupIds
|
|
14287
|
+
});
|
|
14288
|
+
}
|
|
14259
14289
|
if (groupToMove) {
|
|
14260
14290
|
const activeGroupSelectionId = activeObj instanceof fabric__namespace.ActiveSelection ? activeObj.__pixldocsGroupSelection : void 0;
|
|
14261
14291
|
const transformStart = activeGroupSelectionId === groupToMove.id ? groupSelectionTransformStartRef.current : null;
|
|
@@ -14349,7 +14379,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14349
14379
|
}
|
|
14350
14380
|
} catch {
|
|
14351
14381
|
}
|
|
14352
|
-
const pageAfterMove = ((
|
|
14382
|
+
const pageAfterMove = ((_h = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _h.children) ?? [];
|
|
14353
14383
|
const groupAfterMove = findNodeById(pageAfterMove, groupToMove.id);
|
|
14354
14384
|
const memberIdsAfterMove = groupAfterMove && isGroup(groupAfterMove) ? getAllElementIds(groupAfterMove.children ?? []) : targetObjects.map((obj) => getObjectId(obj)).filter((id) => !!id && id !== "__background__");
|
|
14355
14385
|
preservedGroupMemberIds = memberIdsAfterMove;
|
|
@@ -14664,7 +14694,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14664
14694
|
updateElement(objId, elementUpdate, { recordHistory: false, skipLayoutRecalc: true });
|
|
14665
14695
|
obj.setCoords();
|
|
14666
14696
|
}
|
|
14667
|
-
const pageChildrenForReflow = ((
|
|
14697
|
+
const pageChildrenForReflow = ((_i = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _i.children) ?? [];
|
|
14668
14698
|
const stackGroupsToReflow = /* @__PURE__ */ new Set();
|
|
14669
14699
|
for (const id of modifiedIdsThisRound) {
|
|
14670
14700
|
const parent = findParentGroup(pageChildrenForReflow, id);
|
|
@@ -23825,9 +23855,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
23825
23855
|
}
|
|
23826
23856
|
return svgString;
|
|
23827
23857
|
}
|
|
23828
|
-
const resolvedPackageVersion = "0.5.
|
|
23858
|
+
const resolvedPackageVersion = "0.5.276";
|
|
23829
23859
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
23830
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
23860
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.276";
|
|
23831
23861
|
const roundParityValue = (value) => {
|
|
23832
23862
|
if (typeof value !== "number") return value;
|
|
23833
23863
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -24641,7 +24671,7 @@ class PixldocsRenderer {
|
|
|
24641
24671
|
await this.waitForCanvasScene(container, cloned, i);
|
|
24642
24672
|
}
|
|
24643
24673
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
24644
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
24674
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-CvLitjuI.cjs"));
|
|
24645
24675
|
const prepared = preparePagesForExport(
|
|
24646
24676
|
cloned.pages,
|
|
24647
24677
|
canvasWidth,
|
|
@@ -26961,7 +26991,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
26961
26991
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
26962
26992
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
26963
26993
|
try {
|
|
26964
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
26994
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-CvLitjuI.cjs"));
|
|
26965
26995
|
try {
|
|
26966
26996
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
26967
26997
|
} catch {
|
|
@@ -27358,4 +27388,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
27358
27388
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
27359
27389
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
27360
27390
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
27361
|
-
//# sourceMappingURL=index-
|
|
27391
|
+
//# sourceMappingURL=index-AzU8Pmse.cjs.map
|