@pixldocs/canvas-renderer 0.5.408 → 0.5.410
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-D_anatnh.js → index-CS_cFpCL.js} +234 -144
- package/dist/index-CS_cFpCL.js.map +1 -0
- package/dist/{index-vGjobYro.cjs → index-xCnkRHXB.cjs} +234 -144
- package/dist/index-xCnkRHXB.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-DSZH7267.cjs → vectorPdfExport-BnnUwU40.cjs} +4 -4
- package/dist/{vectorPdfExport-DSZH7267.cjs.map → vectorPdfExport-BnnUwU40.cjs.map} +1 -1
- package/dist/{vectorPdfExport-PXI2Nd-d.js → vectorPdfExport-DE2UhH5g.js} +4 -4
- package/dist/{vectorPdfExport-PXI2Nd-d.js.map → vectorPdfExport-DE2UhH5g.js.map} +1 -1
- package/package.json +1 -1
- package/dist/index-D_anatnh.js.map +0 -1
- package/dist/index-vGjobYro.cjs.map +0 -1
|
@@ -4722,6 +4722,104 @@ const svgMaskApply = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.define
|
|
|
4722
4722
|
syncSvgMaskClipPath
|
|
4723
4723
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4724
4724
|
const SELECTION_BORDER_SCALE$1 = 2;
|
|
4725
|
+
const ROTATED_GROUP_IMAGE_RESIZE_DEBUG_PREFIX = "[Pixldocs][rotated-group-image-resize]";
|
|
4726
|
+
const ROTATED_GROUP_IMAGE_RESIZE_DEBUG_MAX_ENTRIES = 400;
|
|
4727
|
+
function isInsideRotatedActiveSelection(obj) {
|
|
4728
|
+
const parent = obj.group;
|
|
4729
|
+
if (!(parent instanceof fabric__namespace.ActiveSelection)) return false;
|
|
4730
|
+
const angle = Math.abs(((parent.angle ?? 0) % 360 + 360) % 360);
|
|
4731
|
+
return Math.min(angle, 360 - angle) > 0.5;
|
|
4732
|
+
}
|
|
4733
|
+
function summarizeResizeObject(obj) {
|
|
4734
|
+
var _a2, _b2, _c2, _d;
|
|
4735
|
+
if (!obj) return null;
|
|
4736
|
+
try {
|
|
4737
|
+
const matrix = (_a2 = obj.calcTransformMatrix) == null ? void 0 : _a2.call(obj);
|
|
4738
|
+
const decomp = matrix ? fabric__namespace.util.qrDecompose(matrix) : null;
|
|
4739
|
+
const rect = (_b2 = obj.getBoundingRect) == null ? void 0 : _b2.call(obj);
|
|
4740
|
+
const center = (_c2 = obj.getCenterPoint) == null ? void 0 : _c2.call(obj);
|
|
4741
|
+
return {
|
|
4742
|
+
type: obj.type ?? ((_d = obj.constructor) == null ? void 0 : _d.name),
|
|
4743
|
+
left: obj.left,
|
|
4744
|
+
top: obj.top,
|
|
4745
|
+
width: obj.width,
|
|
4746
|
+
height: obj.height,
|
|
4747
|
+
scaleX: obj.scaleX,
|
|
4748
|
+
scaleY: obj.scaleY,
|
|
4749
|
+
angle: obj.angle,
|
|
4750
|
+
originX: obj.originX,
|
|
4751
|
+
originY: obj.originY,
|
|
4752
|
+
centerX: center == null ? void 0 : center.x,
|
|
4753
|
+
centerY: center == null ? void 0 : center.y,
|
|
4754
|
+
brLeft: rect == null ? void 0 : rect.left,
|
|
4755
|
+
brTop: rect == null ? void 0 : rect.top,
|
|
4756
|
+
brWidth: rect == null ? void 0 : rect.width,
|
|
4757
|
+
brHeight: rect == null ? void 0 : rect.height,
|
|
4758
|
+
worldX: decomp == null ? void 0 : decomp.translateX,
|
|
4759
|
+
worldY: decomp == null ? void 0 : decomp.translateY,
|
|
4760
|
+
worldAngle: decomp == null ? void 0 : decomp.angle,
|
|
4761
|
+
worldScaleX: decomp == null ? void 0 : decomp.scaleX,
|
|
4762
|
+
worldScaleY: decomp == null ? void 0 : decomp.scaleY
|
|
4763
|
+
};
|
|
4764
|
+
} catch (error) {
|
|
4765
|
+
return { type: obj == null ? void 0 : obj.type, error: String(error) };
|
|
4766
|
+
}
|
|
4767
|
+
}
|
|
4768
|
+
function logRotatedGroupImageResize(phase, target, payload = {}) {
|
|
4769
|
+
if (typeof console === "undefined" || !isInsideRotatedActiveSelection(target)) return;
|
|
4770
|
+
try {
|
|
4771
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
4772
|
+
const normalize = (value) => {
|
|
4773
|
+
if (value == null) return value;
|
|
4774
|
+
if (typeof value === "number") return Number.isFinite(value) ? Math.round(value * 1e3) / 1e3 : String(value);
|
|
4775
|
+
if (typeof value === "string" || typeof value === "boolean") return value;
|
|
4776
|
+
if (Array.isArray(value)) return value.map(normalize);
|
|
4777
|
+
if (typeof value === "object") {
|
|
4778
|
+
if (seen.has(value)) return "[Circular]";
|
|
4779
|
+
seen.add(value);
|
|
4780
|
+
if (value instanceof fabric__namespace.FabricObject) return normalize(summarizeResizeObject(value));
|
|
4781
|
+
const out = {};
|
|
4782
|
+
Object.entries(value).forEach(([key, entry]) => {
|
|
4783
|
+
out[key] = normalize(entry);
|
|
4784
|
+
});
|
|
4785
|
+
return out;
|
|
4786
|
+
}
|
|
4787
|
+
return String(value);
|
|
4788
|
+
};
|
|
4789
|
+
const debugTarget = target;
|
|
4790
|
+
const parent = debugTarget.group;
|
|
4791
|
+
const ct = debugTarget.__cropData;
|
|
4792
|
+
const start = debugTarget.__cornerResizeStart;
|
|
4793
|
+
const safeStart = start ? {
|
|
4794
|
+
corner: start.corner,
|
|
4795
|
+
angle: start.angle,
|
|
4796
|
+
baseW: start.baseW,
|
|
4797
|
+
baseH: start.baseH,
|
|
4798
|
+
anchorX: start.anchorX,
|
|
4799
|
+
anchorY: start.anchorY,
|
|
4800
|
+
signX: start.signX,
|
|
4801
|
+
signY: start.signY
|
|
4802
|
+
} : void 0;
|
|
4803
|
+
const line = `${ROTATED_GROUP_IMAGE_RESIZE_DEBUG_PREFIX} ${phase} ${JSON.stringify(normalize({
|
|
4804
|
+
...payload,
|
|
4805
|
+
target: summarizeResizeObject(target),
|
|
4806
|
+
parent: summarizeResizeObject(parent),
|
|
4807
|
+
frameW: ct == null ? void 0 : ct.frameW,
|
|
4808
|
+
frameH: ct == null ? void 0 : ct.frameH,
|
|
4809
|
+
img: summarizeResizeObject(ct == null ? void 0 : ct._img),
|
|
4810
|
+
snapshot: safeStart,
|
|
4811
|
+
lastPointer: debugTarget.__lastPointerForCrop
|
|
4812
|
+
}))}`;
|
|
4813
|
+
if (typeof window !== "undefined") {
|
|
4814
|
+
const debugWindow = window;
|
|
4815
|
+
debugWindow.__pixldocsRotatedGroupImageResizeLogs = Array.isArray(debugWindow.__pixldocsRotatedGroupImageResizeLogs) ? debugWindow.__pixldocsRotatedGroupImageResizeLogs.slice(-ROTATED_GROUP_IMAGE_RESIZE_DEBUG_MAX_ENTRIES + 1) : [];
|
|
4816
|
+
debugWindow.__pixldocsRotatedGroupImageResizeLogs.push(line);
|
|
4817
|
+
}
|
|
4818
|
+
console.log(line);
|
|
4819
|
+
} catch {
|
|
4820
|
+
console.log(ROTATED_GROUP_IMAGE_RESIZE_DEBUG_PREFIX, phase, payload);
|
|
4821
|
+
}
|
|
4822
|
+
}
|
|
4725
4823
|
function clamp$1(v, min, max) {
|
|
4726
4824
|
return Math.max(min, Math.min(max, v));
|
|
4727
4825
|
}
|
|
@@ -4965,12 +5063,23 @@ function getLocalDeltaStable(target, eventData) {
|
|
|
4965
5063
|
target.__lastPointerForCrop = p;
|
|
4966
5064
|
const dx = p.x - last.x;
|
|
4967
5065
|
const dy = p.y - last.y;
|
|
4968
|
-
const angle = fabric__namespace.util.degreesToRadians(target
|
|
5066
|
+
const angle = fabric__namespace.util.degreesToRadians(getWorldAngleDeg(target));
|
|
4969
5067
|
const cos = Math.cos(-angle);
|
|
4970
5068
|
const sin = Math.sin(-angle);
|
|
5069
|
+
const localDx = dx * cos - dy * sin;
|
|
5070
|
+
const localDy = dx * sin + dy * cos;
|
|
5071
|
+
logRotatedGroupImageResize("side-delta", target, {
|
|
5072
|
+
pointer: p,
|
|
5073
|
+
previousPointer: last,
|
|
5074
|
+
canvasDx: dx,
|
|
5075
|
+
canvasDy: dy,
|
|
5076
|
+
worldAngle: getWorldAngleDeg(target),
|
|
5077
|
+
localDx,
|
|
5078
|
+
localDy
|
|
5079
|
+
});
|
|
4971
5080
|
return {
|
|
4972
|
-
localDx
|
|
4973
|
-
localDy
|
|
5081
|
+
localDx,
|
|
5082
|
+
localDy
|
|
4974
5083
|
};
|
|
4975
5084
|
}
|
|
4976
5085
|
function worldDeltaToLocal(dx, dy, angleDeg) {
|
|
@@ -4991,8 +5100,40 @@ function localDeltaToWorld(dx, dy, angleDeg) {
|
|
|
4991
5100
|
y: dx * sin + dy * cos
|
|
4992
5101
|
};
|
|
4993
5102
|
}
|
|
4994
|
-
function
|
|
4995
|
-
|
|
5103
|
+
function getWorldAngleDeg(obj) {
|
|
5104
|
+
var _a2;
|
|
5105
|
+
try {
|
|
5106
|
+
if (typeof obj.getTotalAngle === "function") return obj.getTotalAngle() || 0;
|
|
5107
|
+
const matrix = (_a2 = obj.calcTransformMatrix) == null ? void 0 : _a2.call(obj);
|
|
5108
|
+
return matrix ? fabric__namespace.util.qrDecompose(matrix).angle || 0 : obj.angle || 0;
|
|
5109
|
+
} catch {
|
|
5110
|
+
return obj.angle || 0;
|
|
5111
|
+
}
|
|
5112
|
+
}
|
|
5113
|
+
function getWorldCenter(obj) {
|
|
5114
|
+
var _a2;
|
|
5115
|
+
try {
|
|
5116
|
+
const matrix = (_a2 = obj.calcTransformMatrix) == null ? void 0 : _a2.call(obj);
|
|
5117
|
+
if (matrix) {
|
|
5118
|
+
const decomposed = fabric__namespace.util.qrDecompose(matrix);
|
|
5119
|
+
return { x: decomposed.translateX || 0, y: decomposed.translateY || 0 };
|
|
5120
|
+
}
|
|
5121
|
+
} catch {
|
|
5122
|
+
}
|
|
5123
|
+
return { x: obj.left || 0, y: obj.top || 0 };
|
|
5124
|
+
}
|
|
5125
|
+
function setCenterFromWorld(obj, worldX, worldY) {
|
|
5126
|
+
const parent = obj.group;
|
|
5127
|
+
if (parent && typeof parent.calcTransformMatrix === "function") {
|
|
5128
|
+
try {
|
|
5129
|
+
const invParent = fabric__namespace.util.invertTransform(parent.calcTransformMatrix());
|
|
5130
|
+
const parentPoint = fabric__namespace.util.transformPoint({ x: worldX, y: worldY }, invParent);
|
|
5131
|
+
obj.set({ left: parentPoint.x, top: parentPoint.y, originX: "center", originY: "center" });
|
|
5132
|
+
return;
|
|
5133
|
+
} catch {
|
|
5134
|
+
}
|
|
5135
|
+
}
|
|
5136
|
+
obj.set({ left: worldX, top: worldY, originX: "center", originY: "center" });
|
|
4996
5137
|
}
|
|
4997
5138
|
function getCornerDefaultSigns(corner) {
|
|
4998
5139
|
switch (corner) {
|
|
@@ -5036,45 +5177,78 @@ function resizeFrameFromCornerUniform(eventData, transform, _x, _y) {
|
|
|
5036
5177
|
if (!canvas) return false;
|
|
5037
5178
|
const e = getDomEvent(eventData);
|
|
5038
5179
|
if (!e) return false;
|
|
5039
|
-
const pointer = canvas.getPointer(e);
|
|
5040
|
-
g.setCoords();
|
|
5041
|
-
const a = g.aCoords;
|
|
5042
|
-
if (!a) return false;
|
|
5043
5180
|
const corner = transform.corner;
|
|
5044
|
-
const anchor = getOppositeAnchor(a, corner);
|
|
5045
5181
|
const defaultSigns = getCornerDefaultSigns(corner);
|
|
5046
5182
|
const MIN_SIZE = 20;
|
|
5047
|
-
const
|
|
5048
|
-
const
|
|
5049
|
-
const
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5183
|
+
const pointer = canvas.getPointer(e);
|
|
5184
|
+
const angle = getWorldAngleDeg(g);
|
|
5185
|
+
const snapshot = g.__cornerResizeStart && g.__cornerResizeStart.corner === corner && g.__cornerResizeStart.transform === transform ? g.__cornerResizeStart : (() => {
|
|
5186
|
+
const center = getWorldCenter(g);
|
|
5187
|
+
const baseW = Math.max(MIN_SIZE, ct.frameW || g.width || 1);
|
|
5188
|
+
const baseH = Math.max(MIN_SIZE, ct.frameH || g.height || 1);
|
|
5189
|
+
const anchorLocal = { x: -defaultSigns.x * baseW / 2, y: -defaultSigns.y * baseH / 2 };
|
|
5190
|
+
const anchorWorld = localDeltaToWorld(anchorLocal.x, anchorLocal.y, angle);
|
|
5191
|
+
const snap = {
|
|
5192
|
+
corner,
|
|
5193
|
+
transform,
|
|
5194
|
+
angle,
|
|
5195
|
+
baseW,
|
|
5196
|
+
baseH,
|
|
5197
|
+
anchorX: center.x + anchorWorld.x,
|
|
5198
|
+
anchorY: center.y + anchorWorld.y,
|
|
5199
|
+
signX: defaultSigns.x,
|
|
5200
|
+
signY: defaultSigns.y
|
|
5201
|
+
};
|
|
5202
|
+
g.__cornerResizeStart = snap;
|
|
5203
|
+
logRotatedGroupImageResize("corner-start", g, {
|
|
5204
|
+
corner,
|
|
5205
|
+
pointer,
|
|
5206
|
+
center,
|
|
5207
|
+
anchorLocal,
|
|
5208
|
+
anchorWorld,
|
|
5209
|
+
snapshot: snap
|
|
5210
|
+
});
|
|
5211
|
+
return snap;
|
|
5212
|
+
})();
|
|
5213
|
+
const localDelta = worldDeltaToLocal(pointer.x - snapshot.anchorX, pointer.y - snapshot.anchorY, snapshot.angle);
|
|
5214
|
+
const signX = snapshot.signX;
|
|
5215
|
+
const signY = snapshot.signY;
|
|
5055
5216
|
const rawW = Math.max(MIN_SIZE, Math.abs(localDelta.x));
|
|
5056
5217
|
const rawH = Math.max(MIN_SIZE, Math.abs(localDelta.y));
|
|
5057
|
-
const scaleFromW = rawW / baseW;
|
|
5058
|
-
const scaleFromH = rawH / baseH;
|
|
5218
|
+
const scaleFromW = rawW / snapshot.baseW;
|
|
5219
|
+
const scaleFromH = rawH / snapshot.baseH;
|
|
5059
5220
|
const s = Math.min(scaleFromW, scaleFromH);
|
|
5060
|
-
const newW = Math.max(MIN_SIZE, baseW * s);
|
|
5061
|
-
const newH = Math.max(MIN_SIZE, baseH * s);
|
|
5221
|
+
const newW = Math.max(MIN_SIZE, snapshot.baseW * s);
|
|
5222
|
+
const newH = Math.max(MIN_SIZE, snapshot.baseH * s);
|
|
5223
|
+
logRotatedGroupImageResize("corner-tick-before-apply", g, {
|
|
5224
|
+
corner,
|
|
5225
|
+
pointer,
|
|
5226
|
+
angle,
|
|
5227
|
+
localDelta,
|
|
5228
|
+
rawW,
|
|
5229
|
+
rawH,
|
|
5230
|
+
scaleFromW,
|
|
5231
|
+
scaleFromH,
|
|
5232
|
+
uniformScale: s,
|
|
5233
|
+
newW,
|
|
5234
|
+
newH
|
|
5235
|
+
});
|
|
5062
5236
|
ct.frameW = newW;
|
|
5063
5237
|
ct.frameH = newH;
|
|
5064
5238
|
const centerLocal = {
|
|
5065
5239
|
x: signX * (newW / 2),
|
|
5066
5240
|
y: signY * (newH / 2)
|
|
5067
5241
|
};
|
|
5068
|
-
const centerWorld = localDeltaToWorld(centerLocal.x, centerLocal.y, angle);
|
|
5069
|
-
g.
|
|
5070
|
-
|
|
5071
|
-
top: anchor.y + centerWorld.y,
|
|
5072
|
-
originX: "center",
|
|
5073
|
-
originY: "center",
|
|
5074
|
-
width: newW,
|
|
5075
|
-
height: newH
|
|
5076
|
-
});
|
|
5242
|
+
const centerWorld = localDeltaToWorld(centerLocal.x, centerLocal.y, snapshot.angle);
|
|
5243
|
+
setCenterFromWorld(g, snapshot.anchorX + centerWorld.x, snapshot.anchorY + centerWorld.y);
|
|
5244
|
+
g.set({ width: newW, height: newH });
|
|
5077
5245
|
updateCoverLayout(g);
|
|
5246
|
+
logRotatedGroupImageResize("corner-tick-after-layout", g, {
|
|
5247
|
+
corner,
|
|
5248
|
+
centerLocal,
|
|
5249
|
+
centerWorld,
|
|
5250
|
+
targetWorldCenter: { x: snapshot.anchorX + centerWorld.x, y: snapshot.anchorY + centerWorld.y }
|
|
5251
|
+
});
|
|
5078
5252
|
canvas.requestRenderAll();
|
|
5079
5253
|
return true;
|
|
5080
5254
|
}
|
|
@@ -5083,8 +5257,9 @@ function resizeFrameFromSide(g, side, localDx, localDy) {
|
|
|
5083
5257
|
if (!ct) return;
|
|
5084
5258
|
const minSize = 30;
|
|
5085
5259
|
const moveCenterAlongLocalAxis = (obj, localX, localY) => {
|
|
5086
|
-
const
|
|
5087
|
-
|
|
5260
|
+
const center = getWorldCenter(obj);
|
|
5261
|
+
const worldDelta = localDeltaToWorld(localX, localY, getWorldAngleDeg(obj));
|
|
5262
|
+
setCenterFromWorld(obj, center.x + worldDelta.x, center.y + worldDelta.y);
|
|
5088
5263
|
};
|
|
5089
5264
|
if (side === "mr") {
|
|
5090
5265
|
ct.frameW = Math.max(minSize, ct.frameW + localDx);
|
|
@@ -5102,7 +5277,9 @@ function resizeFrameFromSide(g, side, localDx, localDy) {
|
|
|
5102
5277
|
ct.frameH = Math.max(minSize, ct.frameH - localDy);
|
|
5103
5278
|
moveCenterAlongLocalAxis(g, 0, localDy / 2);
|
|
5104
5279
|
}
|
|
5280
|
+
logRotatedGroupImageResize("side-before-layout", g, { side, localDx, localDy });
|
|
5105
5281
|
updateCoverLayout(g);
|
|
5282
|
+
logRotatedGroupImageResize("side-after-layout", g, { side, localDx, localDy });
|
|
5106
5283
|
}
|
|
5107
5284
|
function installCanvaMaskControls(g) {
|
|
5108
5285
|
const ct = g.__cropData;
|
|
@@ -5119,8 +5296,16 @@ function installCanvaMaskControls(g) {
|
|
|
5119
5296
|
};
|
|
5120
5297
|
g.set(controlStyle);
|
|
5121
5298
|
const notifyResizeSnap = (target, corner) => {
|
|
5299
|
+
if (target.group instanceof fabric__namespace.ActiveSelection) {
|
|
5300
|
+
logRotatedGroupImageResize("snap-skipped-active-selection-child", target, { corner });
|
|
5301
|
+
return;
|
|
5302
|
+
}
|
|
5122
5303
|
const handler = target.__resizeSnapHandler;
|
|
5123
|
-
if (typeof handler === "function")
|
|
5304
|
+
if (typeof handler === "function") {
|
|
5305
|
+
logRotatedGroupImageResize("snap-before", target, { corner });
|
|
5306
|
+
handler(target, corner);
|
|
5307
|
+
logRotatedGroupImageResize("snap-after", target, { corner });
|
|
5308
|
+
}
|
|
5124
5309
|
};
|
|
5125
5310
|
g.setControlsVisibility({
|
|
5126
5311
|
mt: true,
|
|
@@ -11183,8 +11368,6 @@ const scaleUpdateNumber = (updates, source, key, factor) => {
|
|
|
11183
11368
|
const value = Number(source == null ? void 0 : source[key]);
|
|
11184
11369
|
if (Number.isFinite(value)) updates[key] = value * factor;
|
|
11185
11370
|
};
|
|
11186
|
-
const GROUP_TEXT_RESIZE_DEBUG_PREFIX = "[Pixldocs][group-text-corner-resize]";
|
|
11187
|
-
const GROUP_TEXT_RESIZE_DEBUG_MAX_ENTRIES = 200;
|
|
11188
11371
|
const isCornerResizeHandle = (handle) => handle === "tl" || handle === "tr" || handle === "bl" || handle === "br";
|
|
11189
11372
|
const summarizeFabricObjectForResizeDebug = (obj) => {
|
|
11190
11373
|
var _a2;
|
|
@@ -11215,66 +11398,12 @@ const summarizeFabricObjectForResizeDebug = (obj) => {
|
|
|
11215
11398
|
}
|
|
11216
11399
|
};
|
|
11217
11400
|
const logGroupTextResizeDebug = (phase, payload) => {
|
|
11218
|
-
|
|
11219
|
-
try {
|
|
11220
|
-
const seen = /* @__PURE__ */ new WeakSet();
|
|
11221
|
-
const normalize = (value) => {
|
|
11222
|
-
if (value == null) return value;
|
|
11223
|
-
const valueType = typeof value;
|
|
11224
|
-
if (valueType === "number") return Number.isFinite(value) ? Math.round(value * 1e3) / 1e3 : String(value);
|
|
11225
|
-
if (valueType === "string" || valueType === "boolean") return value;
|
|
11226
|
-
if (valueType === "function") return `[Function ${value.name || "anonymous"}]`;
|
|
11227
|
-
if (Array.isArray(value)) return value.map((entry) => normalize(entry));
|
|
11228
|
-
if (valueType === "object") {
|
|
11229
|
-
if (seen.has(value)) return "[Circular]";
|
|
11230
|
-
seen.add(value);
|
|
11231
|
-
if (value instanceof fabric__namespace.FabricObject) return normalize(summarizeFabricObjectForResizeDebug(value));
|
|
11232
|
-
const output = {};
|
|
11233
|
-
Object.entries(value).forEach(([key, entry]) => {
|
|
11234
|
-
output[key] = normalize(entry);
|
|
11235
|
-
});
|
|
11236
|
-
return output;
|
|
11237
|
-
}
|
|
11238
|
-
return String(value);
|
|
11239
|
-
};
|
|
11240
|
-
const normalizedPayload = normalize(payload);
|
|
11241
|
-
const line = `${GROUP_TEXT_RESIZE_DEBUG_PREFIX} ${phase} ${JSON.stringify(normalizedPayload)}`;
|
|
11242
|
-
const debugWindow = window;
|
|
11243
|
-
debugWindow.__pixldocsGroupTextResizeLogs = Array.isArray(debugWindow.__pixldocsGroupTextResizeLogs) ? debugWindow.__pixldocsGroupTextResizeLogs.slice(-GROUP_TEXT_RESIZE_DEBUG_MAX_ENTRIES + 1) : [];
|
|
11244
|
-
debugWindow.__pixldocsGroupTextResizeLogs.push(line);
|
|
11245
|
-
console.log(line);
|
|
11246
|
-
} catch {
|
|
11247
|
-
console.log(GROUP_TEXT_RESIZE_DEBUG_PREFIX, phase, payload);
|
|
11248
|
-
}
|
|
11401
|
+
return;
|
|
11249
11402
|
};
|
|
11250
|
-
const ROT_GROUP_IMAGE_DRIFT_DEBUG_PREFIX = "[Pixldocs][rot-group-image-drift]";
|
|
11251
|
-
const ROT_GROUP_IMAGE_DRIFT_DEBUG_MAX_ENTRIES = 500;
|
|
11252
11403
|
const roundRotDriftNumber = (value) => {
|
|
11253
11404
|
if (typeof value !== "number") return value;
|
|
11254
11405
|
return Number.isFinite(value) ? Math.round(value * 1e3) / 1e3 : String(value);
|
|
11255
11406
|
};
|
|
11256
|
-
const normalizeRotDriftPayload = (value) => {
|
|
11257
|
-
const seen = /* @__PURE__ */ new WeakSet();
|
|
11258
|
-
const normalize = (entry) => {
|
|
11259
|
-
if (entry == null) return entry;
|
|
11260
|
-
const valueType = typeof entry;
|
|
11261
|
-
if (valueType === "number") return roundRotDriftNumber(entry);
|
|
11262
|
-
if (valueType === "string" || valueType === "boolean") return entry;
|
|
11263
|
-
if (Array.isArray(entry)) return entry.map((item) => normalize(item));
|
|
11264
|
-
if (valueType === "object") {
|
|
11265
|
-
if (seen.has(entry)) return "[Circular]";
|
|
11266
|
-
seen.add(entry);
|
|
11267
|
-
if (entry instanceof fabric__namespace.FabricObject) return normalize(summarizeRotDriftObject(entry));
|
|
11268
|
-
const output = {};
|
|
11269
|
-
Object.entries(entry).forEach(([key, item]) => {
|
|
11270
|
-
output[key] = normalize(item);
|
|
11271
|
-
});
|
|
11272
|
-
return output;
|
|
11273
|
-
}
|
|
11274
|
-
return String(entry);
|
|
11275
|
-
};
|
|
11276
|
-
return normalize(value);
|
|
11277
|
-
};
|
|
11278
11407
|
const matrixForRotDriftLog = (matrix) => {
|
|
11279
11408
|
if (!matrix) return void 0;
|
|
11280
11409
|
return matrix.map((entry) => roundRotDriftNumber(entry));
|
|
@@ -11330,52 +11459,13 @@ const summarizeRotDriftObject = (obj, worldMatrix) => {
|
|
|
11330
11459
|
}
|
|
11331
11460
|
};
|
|
11332
11461
|
const logRotGroupImageDrift = (phase, payload) => {
|
|
11333
|
-
|
|
11334
|
-
try {
|
|
11335
|
-
const line = `${ROT_GROUP_IMAGE_DRIFT_DEBUG_PREFIX} ${phase} ${JSON.stringify(normalizeRotDriftPayload(payload))}`;
|
|
11336
|
-
if (typeof window !== "undefined") {
|
|
11337
|
-
const debugWindow = window;
|
|
11338
|
-
debugWindow.__pixldocsRotGroupImageDriftLogs = Array.isArray(debugWindow.__pixldocsRotGroupImageDriftLogs) ? debugWindow.__pixldocsRotGroupImageDriftLogs.slice(-ROT_GROUP_IMAGE_DRIFT_DEBUG_MAX_ENTRIES + 1) : [];
|
|
11339
|
-
debugWindow.__pixldocsRotGroupImageDriftLogs.push(line);
|
|
11340
|
-
}
|
|
11341
|
-
console.log(line);
|
|
11342
|
-
} catch {
|
|
11343
|
-
console.log(ROT_GROUP_IMAGE_DRIFT_DEBUG_PREFIX, phase, payload);
|
|
11344
|
-
}
|
|
11462
|
+
return;
|
|
11345
11463
|
};
|
|
11346
11464
|
const shouldLogRotDriftLiveTick = (target, phase) => {
|
|
11347
|
-
|
|
11348
|
-
const anyTarget = target;
|
|
11349
|
-
const key = `__pixldocsRotDrift_${phase}_count`;
|
|
11350
|
-
const count = (anyTarget[key] ?? 0) + 1;
|
|
11351
|
-
anyTarget[key] = count;
|
|
11352
|
-
return count <= 3 || count % 8 === 0;
|
|
11465
|
+
return false;
|
|
11353
11466
|
};
|
|
11354
11467
|
const logRotDriftSelectionSnapshot = (phase, target, extra = {}) => {
|
|
11355
|
-
|
|
11356
|
-
const anyTarget = target;
|
|
11357
|
-
const kids = typeof anyTarget.getObjects === "function" ? anyTarget.getObjects() : [];
|
|
11358
|
-
const selectionMatrix = target instanceof fabric__namespace.ActiveSelection ? target.calcTransformMatrix() : null;
|
|
11359
|
-
logRotGroupImageDrift(phase, {
|
|
11360
|
-
...extra,
|
|
11361
|
-
target: summarizeRotDriftObject(target),
|
|
11362
|
-
childCount: kids.length,
|
|
11363
|
-
groupSelectionId: anyTarget.__pixldocsGroupSelection,
|
|
11364
|
-
alignedAngle: anyTarget.__pixldocsAlignedAngle
|
|
11365
|
-
});
|
|
11366
|
-
kids.forEach((kid, childIndex) => {
|
|
11367
|
-
var _a2, _b2;
|
|
11368
|
-
const childWorldMatrix = selectionMatrix ? fabric__namespace.util.multiplyTransformMatrices(
|
|
11369
|
-
selectionMatrix,
|
|
11370
|
-
kid.calcOwnMatrix()
|
|
11371
|
-
) : (_a2 = kid.calcTransformMatrix) == null ? void 0 : _a2.call(kid);
|
|
11372
|
-
logRotGroupImageDrift(`${phase}-child`, {
|
|
11373
|
-
...extra,
|
|
11374
|
-
childIndex,
|
|
11375
|
-
parentType: anyTarget.type ?? ((_b2 = target.constructor) == null ? void 0 : _b2.name),
|
|
11376
|
-
child: summarizeRotDriftObject(kid, childWorldMatrix ?? null)
|
|
11377
|
-
});
|
|
11378
|
-
});
|
|
11468
|
+
return;
|
|
11379
11469
|
};
|
|
11380
11470
|
const bakeTextboxScaleIntoTypography = (obj, sourceElement) => {
|
|
11381
11471
|
const sx = Math.abs(obj.scaleX ?? 1) || 1;
|
|
@@ -13310,9 +13400,6 @@ const PageCanvas = react.forwardRef(
|
|
|
13310
13400
|
};
|
|
13311
13401
|
logRotDriftSelectionSnapshot("transform-start", active, {
|
|
13312
13402
|
time: Math.round(performance.now()),
|
|
13313
|
-
groupId,
|
|
13314
|
-
groupAbs,
|
|
13315
|
-
selectionRect: rect,
|
|
13316
13403
|
transformStart: groupSelectionTransformStartRef.current,
|
|
13317
13404
|
selectedStoreIds: useEditorStore.getState().canvas.selectedIds
|
|
13318
13405
|
});
|
|
@@ -14121,6 +14208,9 @@ const PageCanvas = react.forwardRef(
|
|
|
14121
14208
|
if (activeObj.__lastPointerForCrop) {
|
|
14122
14209
|
delete activeObj.__lastPointerForCrop;
|
|
14123
14210
|
}
|
|
14211
|
+
if (activeObj.__cornerResizeStart) {
|
|
14212
|
+
delete activeObj.__cornerResizeStart;
|
|
14213
|
+
}
|
|
14124
14214
|
}
|
|
14125
14215
|
if (!didTransformRef.current) {
|
|
14126
14216
|
editLockRef.current = false;
|
|
@@ -14216,7 +14306,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14216
14306
|
prepareGroupSelectionTransformStart(t);
|
|
14217
14307
|
markTransforming(t);
|
|
14218
14308
|
didTransformRef.current = true;
|
|
14219
|
-
if (shouldLogRotDriftLiveTick(
|
|
14309
|
+
if (shouldLogRotDriftLiveTick()) {
|
|
14220
14310
|
logRotDriftSelectionSnapshot("scaling", t, {
|
|
14221
14311
|
time: Math.round(performance.now()),
|
|
14222
14312
|
corner: t == null ? void 0 : t.__corner,
|
|
@@ -14866,7 +14956,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14866
14956
|
didTransformRef.current = true;
|
|
14867
14957
|
const tr = e.target;
|
|
14868
14958
|
prepareGroupSelectionTransformStart(tr);
|
|
14869
|
-
if (shouldLogRotDriftLiveTick(
|
|
14959
|
+
if (shouldLogRotDriftLiveTick()) {
|
|
14870
14960
|
logRotDriftSelectionSnapshot("rotating", tr, {
|
|
14871
14961
|
time: Math.round(performance.now()),
|
|
14872
14962
|
transformAction: (_a2 = fabricCanvas._currentTransform) == null ? void 0 : _a2.action,
|
|
@@ -14907,7 +14997,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14907
14997
|
prepareGroupSelectionTransformStart(e.target);
|
|
14908
14998
|
markTransforming(e.target);
|
|
14909
14999
|
didTransformRef.current = true;
|
|
14910
|
-
if (shouldLogRotDriftLiveTick(e.target
|
|
15000
|
+
if (shouldLogRotDriftLiveTick(e.target)) {
|
|
14911
15001
|
logRotDriftSelectionSnapshot("moving", e.target, {
|
|
14912
15002
|
time: Math.round(performance.now()),
|
|
14913
15003
|
transformAction: (_a2 = fabricCanvas._currentTransform) == null ? void 0 : _a2.action,
|
|
@@ -25179,9 +25269,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
25179
25269
|
}
|
|
25180
25270
|
return svgString;
|
|
25181
25271
|
}
|
|
25182
|
-
const resolvedPackageVersion = "0.5.
|
|
25272
|
+
const resolvedPackageVersion = "0.5.410";
|
|
25183
25273
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
25184
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
25274
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.410";
|
|
25185
25275
|
const roundParityValue = (value) => {
|
|
25186
25276
|
if (typeof value !== "number") return value;
|
|
25187
25277
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -25995,7 +26085,7 @@ class PixldocsRenderer {
|
|
|
25995
26085
|
await this.waitForCanvasScene(container, cloned, i);
|
|
25996
26086
|
}
|
|
25997
26087
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
25998
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
26088
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-BnnUwU40.cjs"));
|
|
25999
26089
|
const prepared = preparePagesForExport(
|
|
26000
26090
|
cloned.pages,
|
|
26001
26091
|
canvasWidth,
|
|
@@ -28315,7 +28405,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
28315
28405
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
28316
28406
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
28317
28407
|
try {
|
|
28318
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
28408
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-BnnUwU40.cjs"));
|
|
28319
28409
|
try {
|
|
28320
28410
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
28321
28411
|
} catch {
|
|
@@ -28712,4 +28802,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
28712
28802
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
28713
28803
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
28714
28804
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
28715
|
-
//# sourceMappingURL=index-
|
|
28805
|
+
//# sourceMappingURL=index-xCnkRHXB.cjs.map
|