@pixldocs/canvas-renderer 0.5.267 → 0.5.269
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-BDPFvAqK.js → index-CrV6Qgb-.js} +69 -39
- package/dist/index-CrV6Qgb-.js.map +1 -0
- package/dist/{index-C_tX_wMV.cjs → index-V3Oyi5GA.cjs} +69 -39
- package/dist/index-V3Oyi5GA.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-ByDlpq77.js → vectorPdfExport-BrPmmgsF.js} +4 -4
- package/dist/{vectorPdfExport-ByDlpq77.js.map → vectorPdfExport-BrPmmgsF.js.map} +1 -1
- package/dist/{vectorPdfExport-vH_Qgwx6.cjs → vectorPdfExport-xlycX5wM.cjs} +4 -4
- package/dist/{vectorPdfExport-vH_Qgwx6.cjs.map → vectorPdfExport-xlycX5wM.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/index-BDPFvAqK.js.map +0 -1
- package/dist/index-C_tX_wMV.cjs.map +0 -1
|
@@ -12041,6 +12041,9 @@ const PageCanvas = react.forwardRef(
|
|
|
12041
12041
|
selectionLeft: rect.left,
|
|
12042
12042
|
selectionTop: rect.top
|
|
12043
12043
|
};
|
|
12044
|
+
if (active.__pixldocsGroupSelection) {
|
|
12045
|
+
prepareGroupSelectionTransformStart(active);
|
|
12046
|
+
}
|
|
12044
12047
|
}
|
|
12045
12048
|
if (fabricCanvas._currentTransform) {
|
|
12046
12049
|
fabricCanvas.__isUserTransforming = true;
|
|
@@ -12906,6 +12909,9 @@ const PageCanvas = react.forwardRef(
|
|
|
12906
12909
|
fabricCanvas.on("mouse:down:before", (opt) => {
|
|
12907
12910
|
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
12908
12911
|
const activeBeforeMouseDown = fabricCanvas.getActiveObject();
|
|
12912
|
+
if (activeBeforeMouseDown instanceof fabric__namespace.ActiveSelection && activeBeforeMouseDown.__pixldocsGroupSelection) {
|
|
12913
|
+
prepareGroupSelectionTransformStart(activeBeforeMouseDown);
|
|
12914
|
+
}
|
|
12909
12915
|
if (editLockRef.current) {
|
|
12910
12916
|
const active = fabricCanvas.getActiveObject();
|
|
12911
12917
|
if (active && (((_a2 = active._ct) == null ? void 0 : _a2.isCropGroup) || active.__cropGroup)) {
|
|
@@ -14250,7 +14256,10 @@ const PageCanvas = react.forwardRef(
|
|
|
14250
14256
|
const groupAbs = getAbsoluteBounds(groupToMove, pageChildren2);
|
|
14251
14257
|
let movedGroupLeft = groupAbs.left;
|
|
14252
14258
|
let movedGroupTop = groupAbs.top;
|
|
14253
|
-
if (activeObj instanceof fabric__namespace.ActiveSelection &&
|
|
14259
|
+
if (activeObj instanceof fabric__namespace.ActiveSelection && activeSelectionDelta) {
|
|
14260
|
+
movedGroupLeft = groupAbs.left + activeSelectionDelta.x;
|
|
14261
|
+
movedGroupTop = groupAbs.top + activeSelectionDelta.y;
|
|
14262
|
+
} else if (activeObj instanceof fabric__namespace.ActiveSelection && (transformStart == null ? void 0 : transformStart.groupId) === groupToMove.id) {
|
|
14254
14263
|
const selectionRect = activeObj.getBoundingRect();
|
|
14255
14264
|
movedGroupLeft = transformStart.groupLeft + (selectionRect.left - transformStart.selectionLeft);
|
|
14256
14265
|
movedGroupTop = transformStart.groupTop + (selectionRect.top - transformStart.selectionTop);
|
|
@@ -14310,9 +14319,21 @@ const PageCanvas = react.forwardRef(
|
|
|
14310
14319
|
const groupSelectionId = (isActiveSelection && activeObj instanceof fabric__namespace.ActiveSelection ? activeObj.__pixldocsGroupSelection : void 0) ?? groupToMove.id;
|
|
14311
14320
|
const targetObjects = isActiveSelection && activeObj instanceof fabric__namespace.ActiveSelection ? activeObj.getObjects() : activeObjects;
|
|
14312
14321
|
if (groupSelectionId && activeObj instanceof fabric__namespace.ActiveSelection) {
|
|
14313
|
-
|
|
14314
|
-
|
|
14315
|
-
|
|
14322
|
+
try {
|
|
14323
|
+
skipSelectionClearOnDiscardRef.current = true;
|
|
14324
|
+
skipActiveSelectionBakeOnClearRef.current = true;
|
|
14325
|
+
try {
|
|
14326
|
+
fabricCanvas.discardActiveObject();
|
|
14327
|
+
} finally {
|
|
14328
|
+
skipActiveSelectionBakeOnClearRef.current = false;
|
|
14329
|
+
skipSelectionClearOnDiscardRef.current = false;
|
|
14330
|
+
}
|
|
14331
|
+
} catch {
|
|
14332
|
+
}
|
|
14333
|
+
const bakedSelection = targetObjects.length > 1 ? new fabric__namespace.ActiveSelection(targetObjects, { canvas: fabricCanvas }) : activeObj;
|
|
14334
|
+
restoreGroupSelectionVisualState(bakedSelection, groupSelectionId);
|
|
14335
|
+
fabricCanvas.setActiveObject(bakedSelection);
|
|
14336
|
+
bakedSelection.setCoords();
|
|
14316
14337
|
}
|
|
14317
14338
|
selectElements([groupSelectionId], false, false);
|
|
14318
14339
|
fabricCanvas.requestRenderAll();
|
|
@@ -14908,13 +14929,14 @@ const PageCanvas = react.forwardRef(
|
|
|
14908
14929
|
visibilityUpdateInProgressRef.current = false;
|
|
14909
14930
|
}
|
|
14910
14931
|
doSyncRef.current = () => {
|
|
14911
|
-
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i
|
|
14932
|
+
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i;
|
|
14912
14933
|
const shouldSkipUpdates2 = syncLockedRef.current || editLockRef.current;
|
|
14913
14934
|
const state = useEditorStore.getState();
|
|
14914
|
-
const
|
|
14935
|
+
const storePage = state.canvas.pages.find((p) => p.id === pageId);
|
|
14936
|
+
const pageTree = isPreviewMode && (pageChildren == null ? void 0 : pageChildren.length) ? pageChildren ?? [] : (storePage == null ? void 0 : storePage.children) ?? [];
|
|
14937
|
+
const elementsToSync = isPreviewMode ? elements : pageTree.length ? flattenChildren(pageTree) : elements;
|
|
14915
14938
|
elementsRef.current = elementsToSync;
|
|
14916
|
-
const
|
|
14917
|
-
const selectedIdsFromStore = new Set(((_b2 = state.canvas) == null ? void 0 : _b2.selectedIds) ?? []);
|
|
14939
|
+
const selectedIdsFromStore = new Set(((_a2 = state.canvas) == null ? void 0 : _a2.selectedIds) ?? []);
|
|
14918
14940
|
isRebuildingRef.current = true;
|
|
14919
14941
|
const allElementIds = new Set(elementsToSync.map((el) => el.id));
|
|
14920
14942
|
const sectionGroups = pageTree.filter(
|
|
@@ -14942,7 +14964,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14942
14964
|
const activeObjId = activeObj ? getObjectId(activeObj) : null;
|
|
14943
14965
|
const isTextBeingEdited = activeObjId && editingTextIdRef.current === activeObjId;
|
|
14944
14966
|
const isMultiSelect = activeObj instanceof fabric__namespace.ActiveSelection;
|
|
14945
|
-
if (activeObj && isMultiSelect && !(((
|
|
14967
|
+
if (activeObj && isMultiSelect && !(((_b2 = activeObj._ct) == null ? void 0 : _b2.isCropGroup) || activeObj.__cropGroup) && !isTextBeingEdited) {
|
|
14946
14968
|
fc.discardActiveObject();
|
|
14947
14969
|
}
|
|
14948
14970
|
}
|
|
@@ -14979,7 +15001,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14979
15001
|
fc.requestRenderAll();
|
|
14980
15002
|
}
|
|
14981
15003
|
} else if (!skipRestoreSelection && restoreTarget && !isActiveTextBeingEdited) {
|
|
14982
|
-
const isCropGroup2 = ((
|
|
15004
|
+
const isCropGroup2 = ((_c = restoreTarget._ct) == null ? void 0 : _c.isCropGroup) || restoreTarget.__cropGroup;
|
|
14983
15005
|
const isSectionGroup = activeId && sectionGroupIds.has(activeId);
|
|
14984
15006
|
if ((isCropGroup2 || !shouldSkipUpdates2) && !isSectionGroup) {
|
|
14985
15007
|
fc.setActiveObject(restoreTarget);
|
|
@@ -15107,7 +15129,7 @@ const PageCanvas = react.forwardRef(
|
|
|
15107
15129
|
const sourceUrlChanged = currentUrlNormalized !== storedUrlNormalized;
|
|
15108
15130
|
const newFadeKey = edgeFadeKey(element);
|
|
15109
15131
|
const oldFadeKey = isCropGroup2 ? existingObj.__edgeFadeInputKey || "" : existingObj.__edgeFadeKey || "";
|
|
15110
|
-
const innerImg = (
|
|
15132
|
+
const innerImg = (_d = existingObj == null ? void 0 : existingObj.__cropData) == null ? void 0 : _d._img;
|
|
15111
15133
|
const innerOldKey = isCropGroup2 ? oldFadeKey : innerImg ? innerImg.__edgeFadeKey || "" : oldFadeKey;
|
|
15112
15134
|
const cropFadeRendererMissing = isCropGroup2 && Boolean(newFadeKey) && !existingObj.__edgeFadeRenderConfig;
|
|
15113
15135
|
const fadeKeyChanged = newFadeKey !== oldFadeKey || newFadeKey !== innerOldKey || cropFadeRendererMissing;
|
|
@@ -15115,14 +15137,14 @@ const PageCanvas = react.forwardRef(
|
|
|
15115
15137
|
const needsCropGroupFadeUpdate = isCropGroup2 && fadeKeyChanged;
|
|
15116
15138
|
const hadUrlBefore = storedImageUrl && String(storedImageUrl).trim() !== "";
|
|
15117
15139
|
if (!hasUrl && hadUrlBefore) {
|
|
15118
|
-
const resolvedSizeImg =
|
|
15140
|
+
const resolvedSizeImg = pageTree.length ? getNodeBounds(element, pageTree) : { width: typeof element.width === "number" ? element.width : 200, height: typeof element.height === "number" ? element.height : 50 };
|
|
15119
15141
|
const hasExplicitSize = typeof element.width === "number" && Number.isFinite(element.width) && element.width > 0 && typeof element.height === "number" && Number.isFinite(element.height) && element.height > 0;
|
|
15120
15142
|
const minVisiblePlaceholder = hasExplicitSize ? 1 : 20;
|
|
15121
15143
|
const nextWidth = Math.max(minVisiblePlaceholder, Number(resolvedSizeImg.width) || 200);
|
|
15122
15144
|
const nextHeight = Math.max(minVisiblePlaceholder, Number(resolvedSizeImg.height) || 50);
|
|
15123
|
-
const storePosImg =
|
|
15124
|
-
const node = findNodeById(
|
|
15125
|
-
return node ? getAbsoluteBounds(node,
|
|
15145
|
+
const storePosImg = pageTree.length ? (() => {
|
|
15146
|
+
const node = findNodeById(pageTree, element.id);
|
|
15147
|
+
return node ? getAbsoluteBounds(node, pageTree) : { left: element.left ?? 0, top: element.top ?? 0 };
|
|
15126
15148
|
})() : { left: element.left ?? 0, top: element.top ?? 0 };
|
|
15127
15149
|
const elementForPlaceholder = { ...element, width: nextWidth, height: nextHeight };
|
|
15128
15150
|
const placeholder = isCropGroup2 ? createImagePlaceholderForGroup(elementForPlaceholder) : createImagePlaceholder(elementForPlaceholder);
|
|
@@ -15145,8 +15167,8 @@ const PageCanvas = react.forwardRef(
|
|
|
15145
15167
|
fc.requestRenderAll();
|
|
15146
15168
|
continue;
|
|
15147
15169
|
}
|
|
15148
|
-
const imageFitForReplace = element.imageFit || ((
|
|
15149
|
-
const clipShapeForReplace = element.clipShape ?? ((
|
|
15170
|
+
const imageFitForReplace = element.imageFit || ((_e = element.style) == null ? void 0 : _e.imageFit) || "cover";
|
|
15171
|
+
const clipShapeForReplace = element.clipShape ?? ((_f = element.style) == null ? void 0 : _f.imageFrameShape) ?? (isPreviewMode ? "rectangle" : "none");
|
|
15150
15172
|
const needCropGroupForElement = imageFitForReplace !== "fill" || clipShapeForReplace && clipShapeForReplace !== "none";
|
|
15151
15173
|
const plainImageNeedsCropGroup = hasUrl && !isCropGroup2 && existingObj instanceof fabric__namespace.FabricImage && needCropGroupForElement;
|
|
15152
15174
|
if (hasUrl && (needsReload || isPlaceholder || plainImageNeedsCropGroup || needsCropGroupFadeUpdate)) {
|
|
@@ -15183,9 +15205,9 @@ const PageCanvas = react.forwardRef(
|
|
|
15183
15205
|
}
|
|
15184
15206
|
ct.rx = rxRatio;
|
|
15185
15207
|
}
|
|
15186
|
-
const cropPos =
|
|
15187
|
-
const node = findNodeById(
|
|
15188
|
-
return node ? getAbsoluteBounds(node,
|
|
15208
|
+
const cropPos = pageTree.length ? (() => {
|
|
15209
|
+
const node = findNodeById(pageTree, element.id);
|
|
15210
|
+
return node ? getAbsoluteBounds(node, pageTree) : { left: element.left ?? 0, top: element.top ?? 0 };
|
|
15189
15211
|
})() : { left: element.left ?? 0, top: element.top ?? 0 };
|
|
15190
15212
|
const cropCenterX = cropPos.left + (ct.frameW ?? 0) / 2;
|
|
15191
15213
|
const cropCenterY = cropPos.top + (ct.frameH ?? 0) / 2;
|
|
@@ -15282,7 +15304,7 @@ const PageCanvas = react.forwardRef(
|
|
|
15282
15304
|
continue;
|
|
15283
15305
|
}
|
|
15284
15306
|
} else if (!hasUrl && !isPlaceholder) {
|
|
15285
|
-
const resolvedSizeImg =
|
|
15307
|
+
const resolvedSizeImg = pageTree.length ? getNodeBounds(element, pageTree) : { width: typeof element.width === "number" ? element.width : 200, height: typeof element.height === "number" ? element.height : 50 };
|
|
15286
15308
|
const hasExplicitSize = typeof element.width === "number" && Number.isFinite(element.width) && element.width > 0 && typeof element.height === "number" && Number.isFinite(element.height) && element.height > 0;
|
|
15287
15309
|
const minVisiblePlaceholder = hasExplicitSize ? 1 : 20;
|
|
15288
15310
|
const elementForPlaceholder = {
|
|
@@ -15312,11 +15334,11 @@ const PageCanvas = react.forwardRef(
|
|
|
15312
15334
|
placeholder.__imageSrc = void 0;
|
|
15313
15335
|
} else if (!isBeingTransformed && !isBeingTextEdited && !shouldSkipUpdates2) {
|
|
15314
15336
|
if (isPlaceholderGroup) {
|
|
15315
|
-
const storePosImg =
|
|
15316
|
-
const node = findNodeById(
|
|
15317
|
-
return node ? getAbsoluteBounds(node,
|
|
15337
|
+
const storePosImg = pageTree.length ? (() => {
|
|
15338
|
+
const node = findNodeById(pageTree, element.id);
|
|
15339
|
+
return node ? getAbsoluteBounds(node, pageTree) : { left: element.left ?? 0, top: element.top ?? 0 };
|
|
15318
15340
|
})() : { left: element.left ?? 0, top: element.top ?? 0 };
|
|
15319
|
-
const resolvedSizeImg =
|
|
15341
|
+
const resolvedSizeImg = pageTree.length ? getNodeBounds(element, pageTree) : { width: typeof element.width === "number" ? element.width : 200, height: typeof element.height === "number" ? element.height : 50 };
|
|
15320
15342
|
const hasExplicitSize = typeof element.width === "number" && Number.isFinite(element.width) && element.width > 0 && typeof element.height === "number" && Number.isFinite(element.height) && element.height > 0;
|
|
15321
15343
|
const minVisiblePlaceholder = hasExplicitSize ? 1 : 20;
|
|
15322
15344
|
const nextWidth = Math.max(minVisiblePlaceholder, Number(resolvedSizeImg.width) || 200);
|
|
@@ -15376,9 +15398,9 @@ const PageCanvas = react.forwardRef(
|
|
|
15376
15398
|
const previousVisible = previousVisibilityRef.current.get(element.id) ?? true;
|
|
15377
15399
|
const currentVisible = element.visible !== false;
|
|
15378
15400
|
const visibilityChanged = previousVisible !== currentVisible;
|
|
15379
|
-
const storePosForImg =
|
|
15380
|
-
const node = findNodeById(
|
|
15381
|
-
return node ? getAbsoluteBounds(node,
|
|
15401
|
+
const storePosForImg = pageTree.length ? (() => {
|
|
15402
|
+
const node = findNodeById(pageTree, element.id);
|
|
15403
|
+
return node ? getAbsoluteBounds(node, pageTree) : { left: element.left ?? 0, top: element.top ?? 0 };
|
|
15382
15404
|
})() : { left: element.left ?? 0, top: element.top ?? 0 };
|
|
15383
15405
|
const positionChanged = Math.abs((existingObj.left ?? 0) - storePosForImg.left) > 0.1 || Math.abs((existingObj.top ?? 0) - storePosForImg.top) > 0.1;
|
|
15384
15406
|
if (visibilityChanged && !positionChanged || visibilityUpdateInProgressRef.current) {
|
|
@@ -15576,7 +15598,7 @@ const PageCanvas = react.forwardRef(
|
|
|
15576
15598
|
fc.add(placeholder);
|
|
15577
15599
|
fc.bringObjectToFront(placeholder);
|
|
15578
15600
|
const activeObj = fc.getActiveObject();
|
|
15579
|
-
if (activeObj && (((
|
|
15601
|
+
if (activeObj && (((_g = activeObj._ct) == null ? void 0 : _g.isCropGroup) || activeObj.__cropGroup)) {
|
|
15580
15602
|
fc.setActiveObject(activeObj);
|
|
15581
15603
|
}
|
|
15582
15604
|
placeholder.dirty = true;
|
|
@@ -15616,7 +15638,7 @@ const PageCanvas = react.forwardRef(
|
|
|
15616
15638
|
fc.add(obj);
|
|
15617
15639
|
fc.bringObjectToFront(obj);
|
|
15618
15640
|
const activeObj = fc.getActiveObject();
|
|
15619
|
-
if (activeObj && (((
|
|
15641
|
+
if (activeObj && (((_h = activeObj._ct) == null ? void 0 : _h.isCropGroup) || activeObj.__cropGroup)) {
|
|
15620
15642
|
fc.setActiveObject(activeObj);
|
|
15621
15643
|
}
|
|
15622
15644
|
obj.dirty = true;
|
|
@@ -15646,10 +15668,18 @@ const PageCanvas = react.forwardRef(
|
|
|
15646
15668
|
});
|
|
15647
15669
|
allFabricObjects.forEach((obj) => fc.bringObjectToFront(obj));
|
|
15648
15670
|
}
|
|
15671
|
+
const activeAfterObjectSync = fc.getActiveObject();
|
|
15672
|
+
if (activeAfterObjectSync instanceof fabric__namespace.ActiveSelection) {
|
|
15673
|
+
const groupSelectionId = activeAfterObjectSync.__pixldocsGroupSelection;
|
|
15674
|
+
if (groupSelectionId) {
|
|
15675
|
+
applyLogicalGroupSelectionVisualState(activeAfterObjectSync, groupSelectionId);
|
|
15676
|
+
activeAfterObjectSync.setCoords();
|
|
15677
|
+
}
|
|
15678
|
+
}
|
|
15649
15679
|
isRebuildingRef.current = false;
|
|
15650
15680
|
fc.requestRenderAll();
|
|
15651
15681
|
if (activeBeforeSync && fc.getObjects().includes(activeBeforeSync)) {
|
|
15652
|
-
const isCropGroup2 = ((
|
|
15682
|
+
const isCropGroup2 = ((_i = activeBeforeSync._ct) == null ? void 0 : _i.isCropGroup) || activeBeforeSync.__cropGroup;
|
|
15653
15683
|
if (isCropGroup2) {
|
|
15654
15684
|
fc.setActiveObject(activeBeforeSync);
|
|
15655
15685
|
fc.requestRenderAll();
|
|
@@ -17143,7 +17173,7 @@ const PageCanvas = react.forwardRef(
|
|
|
17143
17173
|
if (imageFit === "fill" && !needCropGroup2) {
|
|
17144
17174
|
const finalScaleX = baseScaleX * (element.scaleX ?? 1);
|
|
17145
17175
|
const finalScaleY = baseScaleY * (element.scaleY ?? 1);
|
|
17146
|
-
const pageTreeForCreate = ((pageChildren == null ? void 0 : pageChildren.length) ? pageChildren : (_f = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _f.children) ?? [];
|
|
17176
|
+
const pageTreeForCreate = ((isPreviewMode || isExportMode) && (pageChildren == null ? void 0 : pageChildren.length) ? pageChildren : (_f = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _f.children) ?? [];
|
|
17147
17177
|
const createPos = pageTreeForCreate.length > 0 ? (() => {
|
|
17148
17178
|
const node = findNodeById(pageTreeForCreate, element.id);
|
|
17149
17179
|
return node ? getAbsoluteBounds(node, pageTreeForCreate) : { left: element.left ?? 0, top: element.top ?? 0 };
|
|
@@ -17193,7 +17223,7 @@ const PageCanvas = react.forwardRef(
|
|
|
17193
17223
|
const needCropGroup = imageFitFinal !== "fill" || clipShapeFinal && clipShapeFinal !== "none";
|
|
17194
17224
|
let finalObject = img;
|
|
17195
17225
|
if (needCropGroup) {
|
|
17196
|
-
const pageTreeForCropResolve = ((pageChildren == null ? void 0 : pageChildren.length) ? pageChildren : (_i = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _i.children) ?? [];
|
|
17226
|
+
const pageTreeForCropResolve = ((isPreviewMode || isExportMode) && (pageChildren == null ? void 0 : pageChildren.length) ? pageChildren : (_i = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _i.children) ?? [];
|
|
17197
17227
|
const nodeForSize = pageTreeForCropResolve.length ? findNodeById(pageTreeForCropResolve, element.id) : null;
|
|
17198
17228
|
const w = nodeForSize && isElement(nodeForSize) ? nodeForSize.width : element.width;
|
|
17199
17229
|
const h = nodeForSize && isElement(nodeForSize) ? nodeForSize.height : element.height;
|
|
@@ -17237,7 +17267,7 @@ const PageCanvas = react.forwardRef(
|
|
|
17237
17267
|
}
|
|
17238
17268
|
const isDynamicField = dynamicFieldIds.includes(element.id);
|
|
17239
17269
|
const canBeEvented = isEditorMode || isPreviewMode && isDynamicField;
|
|
17240
|
-
const pageTreeForCrop = ((pageChildren == null ? void 0 : pageChildren.length) ? pageChildren : (_n = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _n.children) ?? [];
|
|
17270
|
+
const pageTreeForCrop = ((isPreviewMode || isExportMode) && (pageChildren == null ? void 0 : pageChildren.length) ? pageChildren : (_n = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _n.children) ?? [];
|
|
17241
17271
|
const createPosForCrop = pageTreeForCrop.length > 0 ? (() => {
|
|
17242
17272
|
const node = findNodeById(pageTreeForCrop, element.id);
|
|
17243
17273
|
return node ? getAbsoluteBounds(node, pageTreeForCrop) : { left: element.left ?? 0, top: element.top ?? 0 };
|
|
@@ -23653,9 +23683,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
23653
23683
|
}
|
|
23654
23684
|
return svgString;
|
|
23655
23685
|
}
|
|
23656
|
-
const resolvedPackageVersion = "0.5.
|
|
23686
|
+
const resolvedPackageVersion = "0.5.269";
|
|
23657
23687
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
23658
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
23688
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.269";
|
|
23659
23689
|
const roundParityValue = (value) => {
|
|
23660
23690
|
if (typeof value !== "number") return value;
|
|
23661
23691
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -24469,7 +24499,7 @@ class PixldocsRenderer {
|
|
|
24469
24499
|
await this.waitForCanvasScene(container, cloned, i);
|
|
24470
24500
|
}
|
|
24471
24501
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
24472
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
24502
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-xlycX5wM.cjs"));
|
|
24473
24503
|
const prepared = preparePagesForExport(
|
|
24474
24504
|
cloned.pages,
|
|
24475
24505
|
canvasWidth,
|
|
@@ -26789,7 +26819,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
26789
26819
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
26790
26820
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
26791
26821
|
try {
|
|
26792
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
26822
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-xlycX5wM.cjs"));
|
|
26793
26823
|
try {
|
|
26794
26824
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
26795
26825
|
} catch {
|
|
@@ -27186,4 +27216,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
27186
27216
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
27187
27217
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
27188
27218
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
27189
|
-
//# sourceMappingURL=index-
|
|
27219
|
+
//# sourceMappingURL=index-V3Oyi5GA.cjs.map
|