@pixldocs/canvas-renderer 0.5.409 → 0.5.411
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-DaL8UMXJ.cjs → index-BzO7hSG5.cjs} +262 -93
- package/dist/index-BzO7hSG5.cjs.map +1 -0
- package/dist/{index-DAOxGNQt.js → index-DIx3vAjy.js} +262 -93
- package/dist/index-DIx3vAjy.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-CI2YBgI3.cjs → vectorPdfExport-DUaCeIGH.cjs} +4 -4
- package/dist/{vectorPdfExport-CI2YBgI3.cjs.map → vectorPdfExport-DUaCeIGH.cjs.map} +1 -1
- package/dist/{vectorPdfExport-BZbppXw8.js → vectorPdfExport-DgFZfNsT.js} +4 -4
- package/dist/{vectorPdfExport-BZbppXw8.js.map → vectorPdfExport-DgFZfNsT.js.map} +1 -1
- package/package.json +1 -1
- package/dist/index-DAOxGNQt.js.map +0 -1
- package/dist/index-DaL8UMXJ.cjs.map +0 -1
|
@@ -4722,6 +4722,117 @@ 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$1 = "[Pixldocs][rotated-group-image-resize]";
|
|
4726
|
+
const ROTATED_GROUP_IMAGE_RESIZE_DEBUG_MAX_ENTRIES$1 = 400;
|
|
4727
|
+
function isInsideRotatedActiveSelection(obj) {
|
|
4728
|
+
var _a2;
|
|
4729
|
+
const debugObj = obj;
|
|
4730
|
+
const ownAngle = Math.abs(((obj.angle ?? 0) % 360 + 360) % 360);
|
|
4731
|
+
if ((debugObj.__cropData || debugObj.__cropGroup || ((_a2 = debugObj._ct) == null ? void 0 : _a2.isCropGroup)) && Math.min(ownAngle, 360 - ownAngle) > 0.5) return true;
|
|
4732
|
+
const logicalParentAngle = Math.abs(((debugObj.__pixldocsParentGroupAngle ?? 0) % 360 + 360) % 360);
|
|
4733
|
+
if (debugObj.__pixldocsParentGroupId && Math.min(logicalParentAngle, 360 - logicalParentAngle) > 0.5) return true;
|
|
4734
|
+
const parent = debugObj.group;
|
|
4735
|
+
if (!parent) return false;
|
|
4736
|
+
const pType = parent.type;
|
|
4737
|
+
if (pType !== "activeSelection" && pType !== "group") return false;
|
|
4738
|
+
const angle = Math.abs(((parent.angle ?? 0) % 360 + 360) % 360);
|
|
4739
|
+
return Math.min(angle, 360 - angle) > 0.5;
|
|
4740
|
+
}
|
|
4741
|
+
function summarizeResizeObject(obj) {
|
|
4742
|
+
var _a2, _b2, _c2, _d;
|
|
4743
|
+
if (!obj) return null;
|
|
4744
|
+
try {
|
|
4745
|
+
const matrix = (_a2 = obj.calcTransformMatrix) == null ? void 0 : _a2.call(obj);
|
|
4746
|
+
const decomp = matrix ? fabric__namespace.util.qrDecompose(matrix) : null;
|
|
4747
|
+
const rect = (_b2 = obj.getBoundingRect) == null ? void 0 : _b2.call(obj);
|
|
4748
|
+
const center = (_c2 = obj.getCenterPoint) == null ? void 0 : _c2.call(obj);
|
|
4749
|
+
return {
|
|
4750
|
+
type: obj.type ?? ((_d = obj.constructor) == null ? void 0 : _d.name),
|
|
4751
|
+
left: obj.left,
|
|
4752
|
+
top: obj.top,
|
|
4753
|
+
width: obj.width,
|
|
4754
|
+
height: obj.height,
|
|
4755
|
+
scaleX: obj.scaleX,
|
|
4756
|
+
scaleY: obj.scaleY,
|
|
4757
|
+
angle: obj.angle,
|
|
4758
|
+
originX: obj.originX,
|
|
4759
|
+
originY: obj.originY,
|
|
4760
|
+
centerX: center == null ? void 0 : center.x,
|
|
4761
|
+
centerY: center == null ? void 0 : center.y,
|
|
4762
|
+
brLeft: rect == null ? void 0 : rect.left,
|
|
4763
|
+
brTop: rect == null ? void 0 : rect.top,
|
|
4764
|
+
brWidth: rect == null ? void 0 : rect.width,
|
|
4765
|
+
brHeight: rect == null ? void 0 : rect.height,
|
|
4766
|
+
worldX: decomp == null ? void 0 : decomp.translateX,
|
|
4767
|
+
worldY: decomp == null ? void 0 : decomp.translateY,
|
|
4768
|
+
worldAngle: decomp == null ? void 0 : decomp.angle,
|
|
4769
|
+
worldScaleX: decomp == null ? void 0 : decomp.scaleX,
|
|
4770
|
+
worldScaleY: decomp == null ? void 0 : decomp.scaleY
|
|
4771
|
+
};
|
|
4772
|
+
} catch (error) {
|
|
4773
|
+
return { type: obj == null ? void 0 : obj.type, error: String(error) };
|
|
4774
|
+
}
|
|
4775
|
+
}
|
|
4776
|
+
function logRotatedGroupImageResize(phase, target, payload = {}) {
|
|
4777
|
+
if (typeof console === "undefined" || !isInsideRotatedActiveSelection(target)) return;
|
|
4778
|
+
try {
|
|
4779
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
4780
|
+
const normalize = (value) => {
|
|
4781
|
+
if (value == null) return value;
|
|
4782
|
+
if (typeof value === "number") return Number.isFinite(value) ? Math.round(value * 1e3) / 1e3 : String(value);
|
|
4783
|
+
if (typeof value === "string" || typeof value === "boolean") return value;
|
|
4784
|
+
if (Array.isArray(value)) return value.map(normalize);
|
|
4785
|
+
if (typeof value === "object") {
|
|
4786
|
+
if (seen.has(value)) return "[Circular]";
|
|
4787
|
+
seen.add(value);
|
|
4788
|
+
if (value instanceof fabric__namespace.FabricObject) return normalize(summarizeResizeObject(value));
|
|
4789
|
+
const out = {};
|
|
4790
|
+
Object.entries(value).forEach(([key, entry]) => {
|
|
4791
|
+
out[key] = normalize(entry);
|
|
4792
|
+
});
|
|
4793
|
+
return out;
|
|
4794
|
+
}
|
|
4795
|
+
return String(value);
|
|
4796
|
+
};
|
|
4797
|
+
const debugTarget = target;
|
|
4798
|
+
const parent = debugTarget.group;
|
|
4799
|
+
const ct = debugTarget.__cropData;
|
|
4800
|
+
const start = debugTarget.__cornerResizeStart;
|
|
4801
|
+
const safeStart = start ? {
|
|
4802
|
+
corner: start.corner,
|
|
4803
|
+
angle: start.angle,
|
|
4804
|
+
baseW: start.baseW,
|
|
4805
|
+
baseH: start.baseH,
|
|
4806
|
+
anchorX: start.anchorX,
|
|
4807
|
+
anchorY: start.anchorY,
|
|
4808
|
+
signX: start.signX,
|
|
4809
|
+
signY: start.signY
|
|
4810
|
+
} : void 0;
|
|
4811
|
+
const line = `${ROTATED_GROUP_IMAGE_RESIZE_DEBUG_PREFIX$1} ${phase} ${JSON.stringify(normalize({
|
|
4812
|
+
...payload,
|
|
4813
|
+
target: summarizeResizeObject(target),
|
|
4814
|
+
parent: summarizeResizeObject(parent),
|
|
4815
|
+
logicalParent: debugTarget.__pixldocsParentGroupId ? {
|
|
4816
|
+
id: debugTarget.__pixldocsParentGroupId,
|
|
4817
|
+
type: debugTarget.__pixldocsParentGroupType,
|
|
4818
|
+
angle: debugTarget.__pixldocsParentGroupAngle
|
|
4819
|
+
} : void 0,
|
|
4820
|
+
frameW: ct == null ? void 0 : ct.frameW,
|
|
4821
|
+
frameH: ct == null ? void 0 : ct.frameH,
|
|
4822
|
+
img: summarizeResizeObject(ct == null ? void 0 : ct._img),
|
|
4823
|
+
snapshot: safeStart,
|
|
4824
|
+
lastPointer: debugTarget.__lastPointerForCrop
|
|
4825
|
+
}))}`;
|
|
4826
|
+
if (typeof window !== "undefined") {
|
|
4827
|
+
const debugWindow = window;
|
|
4828
|
+
debugWindow.__pixldocsRotatedGroupImageResizeLogs = Array.isArray(debugWindow.__pixldocsRotatedGroupImageResizeLogs) ? debugWindow.__pixldocsRotatedGroupImageResizeLogs.slice(-ROTATED_GROUP_IMAGE_RESIZE_DEBUG_MAX_ENTRIES$1 + 1) : [];
|
|
4829
|
+
debugWindow.__pixldocsRotatedGroupImageResizeLogs.push(line);
|
|
4830
|
+
}
|
|
4831
|
+
console.log(line);
|
|
4832
|
+
} catch {
|
|
4833
|
+
console.log(ROTATED_GROUP_IMAGE_RESIZE_DEBUG_PREFIX$1, phase, payload);
|
|
4834
|
+
}
|
|
4835
|
+
}
|
|
4725
4836
|
function clamp$1(v, min, max) {
|
|
4726
4837
|
return Math.max(min, Math.min(max, v));
|
|
4727
4838
|
}
|
|
@@ -4968,9 +5079,20 @@ function getLocalDeltaStable(target, eventData) {
|
|
|
4968
5079
|
const angle = fabric__namespace.util.degreesToRadians(getWorldAngleDeg(target));
|
|
4969
5080
|
const cos = Math.cos(-angle);
|
|
4970
5081
|
const sin = Math.sin(-angle);
|
|
5082
|
+
const localDx = dx * cos - dy * sin;
|
|
5083
|
+
const localDy = dx * sin + dy * cos;
|
|
5084
|
+
logRotatedGroupImageResize("side-delta", target, {
|
|
5085
|
+
pointer: p,
|
|
5086
|
+
previousPointer: last,
|
|
5087
|
+
canvasDx: dx,
|
|
5088
|
+
canvasDy: dy,
|
|
5089
|
+
worldAngle: getWorldAngleDeg(target),
|
|
5090
|
+
localDx,
|
|
5091
|
+
localDy
|
|
5092
|
+
});
|
|
4971
5093
|
return {
|
|
4972
|
-
localDx
|
|
4973
|
-
localDy
|
|
5094
|
+
localDx,
|
|
5095
|
+
localDy
|
|
4974
5096
|
};
|
|
4975
5097
|
}
|
|
4976
5098
|
function worldDeltaToLocal(dx, dy, angleDeg) {
|
|
@@ -5091,6 +5213,14 @@ function resizeFrameFromCornerUniform(eventData, transform, _x, _y) {
|
|
|
5091
5213
|
signY: defaultSigns.y
|
|
5092
5214
|
};
|
|
5093
5215
|
g.__cornerResizeStart = snap;
|
|
5216
|
+
logRotatedGroupImageResize("corner-start", g, {
|
|
5217
|
+
corner,
|
|
5218
|
+
pointer,
|
|
5219
|
+
center,
|
|
5220
|
+
anchorLocal,
|
|
5221
|
+
anchorWorld,
|
|
5222
|
+
snapshot: snap
|
|
5223
|
+
});
|
|
5094
5224
|
return snap;
|
|
5095
5225
|
})();
|
|
5096
5226
|
const localDelta = worldDeltaToLocal(pointer.x - snapshot.anchorX, pointer.y - snapshot.anchorY, snapshot.angle);
|
|
@@ -5103,6 +5233,19 @@ function resizeFrameFromCornerUniform(eventData, transform, _x, _y) {
|
|
|
5103
5233
|
const s = Math.min(scaleFromW, scaleFromH);
|
|
5104
5234
|
const newW = Math.max(MIN_SIZE, snapshot.baseW * s);
|
|
5105
5235
|
const newH = Math.max(MIN_SIZE, snapshot.baseH * s);
|
|
5236
|
+
logRotatedGroupImageResize("corner-tick-before-apply", g, {
|
|
5237
|
+
corner,
|
|
5238
|
+
pointer,
|
|
5239
|
+
angle,
|
|
5240
|
+
localDelta,
|
|
5241
|
+
rawW,
|
|
5242
|
+
rawH,
|
|
5243
|
+
scaleFromW,
|
|
5244
|
+
scaleFromH,
|
|
5245
|
+
uniformScale: s,
|
|
5246
|
+
newW,
|
|
5247
|
+
newH
|
|
5248
|
+
});
|
|
5106
5249
|
ct.frameW = newW;
|
|
5107
5250
|
ct.frameH = newH;
|
|
5108
5251
|
const centerLocal = {
|
|
@@ -5113,6 +5256,12 @@ function resizeFrameFromCornerUniform(eventData, transform, _x, _y) {
|
|
|
5113
5256
|
setCenterFromWorld(g, snapshot.anchorX + centerWorld.x, snapshot.anchorY + centerWorld.y);
|
|
5114
5257
|
g.set({ width: newW, height: newH });
|
|
5115
5258
|
updateCoverLayout(g);
|
|
5259
|
+
logRotatedGroupImageResize("corner-tick-after-layout", g, {
|
|
5260
|
+
corner,
|
|
5261
|
+
centerLocal,
|
|
5262
|
+
centerWorld,
|
|
5263
|
+
targetWorldCenter: { x: snapshot.anchorX + centerWorld.x, y: snapshot.anchorY + centerWorld.y }
|
|
5264
|
+
});
|
|
5116
5265
|
canvas.requestRenderAll();
|
|
5117
5266
|
return true;
|
|
5118
5267
|
}
|
|
@@ -5141,7 +5290,9 @@ function resizeFrameFromSide(g, side, localDx, localDy) {
|
|
|
5141
5290
|
ct.frameH = Math.max(minSize, ct.frameH - localDy);
|
|
5142
5291
|
moveCenterAlongLocalAxis(g, 0, localDy / 2);
|
|
5143
5292
|
}
|
|
5293
|
+
logRotatedGroupImageResize("side-before-layout", g, { side, localDx, localDy });
|
|
5144
5294
|
updateCoverLayout(g);
|
|
5295
|
+
logRotatedGroupImageResize("side-after-layout", g, { side, localDx, localDy });
|
|
5145
5296
|
}
|
|
5146
5297
|
function installCanvaMaskControls(g) {
|
|
5147
5298
|
const ct = g.__cropData;
|
|
@@ -5158,9 +5309,22 @@ function installCanvaMaskControls(g) {
|
|
|
5158
5309
|
};
|
|
5159
5310
|
g.set(controlStyle);
|
|
5160
5311
|
const notifyResizeSnap = (target, corner) => {
|
|
5161
|
-
if (target.group instanceof fabric__namespace.ActiveSelection)
|
|
5312
|
+
if (target.group instanceof fabric__namespace.ActiveSelection) {
|
|
5313
|
+
logRotatedGroupImageResize("snap-skipped-active-selection-child", target, { corner });
|
|
5314
|
+
return;
|
|
5315
|
+
}
|
|
5316
|
+
const ownAngle = Math.abs(((target.angle ?? 0) % 360 + 360) % 360);
|
|
5317
|
+
const parentAngle = Math.abs(((target.__pixldocsParentGroupAngle ?? 0) % 360 + 360) % 360);
|
|
5318
|
+
if (Math.min(ownAngle, 360 - ownAngle) > 0.5 || Math.min(parentAngle, 360 - parentAngle) > 0.5) {
|
|
5319
|
+
logRotatedGroupImageResize("snap-skipped-rotated-image", target, { corner, ownAngle, parentAngle });
|
|
5320
|
+
return;
|
|
5321
|
+
}
|
|
5162
5322
|
const handler = target.__resizeSnapHandler;
|
|
5163
|
-
if (typeof handler === "function")
|
|
5323
|
+
if (typeof handler === "function") {
|
|
5324
|
+
logRotatedGroupImageResize("snap-before", target, { corner });
|
|
5325
|
+
handler(target, corner);
|
|
5326
|
+
logRotatedGroupImageResize("snap-after", target, { corner });
|
|
5327
|
+
}
|
|
5164
5328
|
};
|
|
5165
5329
|
g.setControlsVisibility({
|
|
5166
5330
|
mt: true,
|
|
@@ -11223,8 +11387,6 @@ const scaleUpdateNumber = (updates, source, key, factor) => {
|
|
|
11223
11387
|
const value = Number(source == null ? void 0 : source[key]);
|
|
11224
11388
|
if (Number.isFinite(value)) updates[key] = value * factor;
|
|
11225
11389
|
};
|
|
11226
|
-
const GROUP_TEXT_RESIZE_DEBUG_PREFIX = "[Pixldocs][group-text-corner-resize]";
|
|
11227
|
-
const GROUP_TEXT_RESIZE_DEBUG_MAX_ENTRIES = 200;
|
|
11228
11390
|
const isCornerResizeHandle = (handle) => handle === "tl" || handle === "tr" || handle === "bl" || handle === "br";
|
|
11229
11391
|
const summarizeFabricObjectForResizeDebug = (obj) => {
|
|
11230
11392
|
var _a2;
|
|
@@ -11255,40 +11417,10 @@ const summarizeFabricObjectForResizeDebug = (obj) => {
|
|
|
11255
11417
|
}
|
|
11256
11418
|
};
|
|
11257
11419
|
const logGroupTextResizeDebug = (phase, payload) => {
|
|
11258
|
-
|
|
11259
|
-
try {
|
|
11260
|
-
const seen = /* @__PURE__ */ new WeakSet();
|
|
11261
|
-
const normalize = (value) => {
|
|
11262
|
-
if (value == null) return value;
|
|
11263
|
-
const valueType = typeof value;
|
|
11264
|
-
if (valueType === "number") return Number.isFinite(value) ? Math.round(value * 1e3) / 1e3 : String(value);
|
|
11265
|
-
if (valueType === "string" || valueType === "boolean") return value;
|
|
11266
|
-
if (valueType === "function") return `[Function ${value.name || "anonymous"}]`;
|
|
11267
|
-
if (Array.isArray(value)) return value.map((entry) => normalize(entry));
|
|
11268
|
-
if (valueType === "object") {
|
|
11269
|
-
if (seen.has(value)) return "[Circular]";
|
|
11270
|
-
seen.add(value);
|
|
11271
|
-
if (value instanceof fabric__namespace.FabricObject) return normalize(summarizeFabricObjectForResizeDebug(value));
|
|
11272
|
-
const output = {};
|
|
11273
|
-
Object.entries(value).forEach(([key, entry]) => {
|
|
11274
|
-
output[key] = normalize(entry);
|
|
11275
|
-
});
|
|
11276
|
-
return output;
|
|
11277
|
-
}
|
|
11278
|
-
return String(value);
|
|
11279
|
-
};
|
|
11280
|
-
const normalizedPayload = normalize(payload);
|
|
11281
|
-
const line = `${GROUP_TEXT_RESIZE_DEBUG_PREFIX} ${phase} ${JSON.stringify(normalizedPayload)}`;
|
|
11282
|
-
const debugWindow = window;
|
|
11283
|
-
debugWindow.__pixldocsGroupTextResizeLogs = Array.isArray(debugWindow.__pixldocsGroupTextResizeLogs) ? debugWindow.__pixldocsGroupTextResizeLogs.slice(-GROUP_TEXT_RESIZE_DEBUG_MAX_ENTRIES + 1) : [];
|
|
11284
|
-
debugWindow.__pixldocsGroupTextResizeLogs.push(line);
|
|
11285
|
-
console.log(line);
|
|
11286
|
-
} catch {
|
|
11287
|
-
console.log(GROUP_TEXT_RESIZE_DEBUG_PREFIX, phase, payload);
|
|
11288
|
-
}
|
|
11420
|
+
return;
|
|
11289
11421
|
};
|
|
11290
|
-
const
|
|
11291
|
-
const
|
|
11422
|
+
const ROTATED_GROUP_IMAGE_RESIZE_DEBUG_PREFIX = "[Pixldocs][rotated-group-image-resize]";
|
|
11423
|
+
const ROTATED_GROUP_IMAGE_RESIZE_DEBUG_MAX_ENTRIES = 400;
|
|
11292
11424
|
const roundRotDriftNumber = (value) => {
|
|
11293
11425
|
if (typeof value !== "number") return value;
|
|
11294
11426
|
return Number.isFinite(value) ? Math.round(value * 1e3) / 1e3 : String(value);
|
|
@@ -11370,52 +11502,27 @@ const summarizeRotDriftObject = (obj, worldMatrix) => {
|
|
|
11370
11502
|
}
|
|
11371
11503
|
};
|
|
11372
11504
|
const logRotGroupImageDrift = (phase, payload) => {
|
|
11505
|
+
return;
|
|
11506
|
+
};
|
|
11507
|
+
const logRotatedGroupImageResizeDebug = (phase, payload) => {
|
|
11373
11508
|
if (typeof console === "undefined") return;
|
|
11374
11509
|
try {
|
|
11375
|
-
const line = `${
|
|
11510
|
+
const line = `${ROTATED_GROUP_IMAGE_RESIZE_DEBUG_PREFIX} ${phase} ${JSON.stringify(normalizeRotDriftPayload(payload))}`;
|
|
11376
11511
|
if (typeof window !== "undefined") {
|
|
11377
11512
|
const debugWindow = window;
|
|
11378
|
-
debugWindow.
|
|
11379
|
-
debugWindow.
|
|
11513
|
+
debugWindow.__pixldocsRotatedGroupImageResizeLogs = Array.isArray(debugWindow.__pixldocsRotatedGroupImageResizeLogs) ? debugWindow.__pixldocsRotatedGroupImageResizeLogs.slice(-ROTATED_GROUP_IMAGE_RESIZE_DEBUG_MAX_ENTRIES + 1) : [];
|
|
11514
|
+
debugWindow.__pixldocsRotatedGroupImageResizeLogs.push(line);
|
|
11380
11515
|
}
|
|
11381
11516
|
console.log(line);
|
|
11382
11517
|
} catch {
|
|
11383
|
-
console.log(
|
|
11518
|
+
console.log(ROTATED_GROUP_IMAGE_RESIZE_DEBUG_PREFIX, phase, payload);
|
|
11384
11519
|
}
|
|
11385
11520
|
};
|
|
11386
11521
|
const shouldLogRotDriftLiveTick = (target, phase) => {
|
|
11387
|
-
|
|
11388
|
-
const anyTarget = target;
|
|
11389
|
-
const key = `__pixldocsRotDrift_${phase}_count`;
|
|
11390
|
-
const count = (anyTarget[key] ?? 0) + 1;
|
|
11391
|
-
anyTarget[key] = count;
|
|
11392
|
-
return count <= 3 || count % 8 === 0;
|
|
11522
|
+
return false;
|
|
11393
11523
|
};
|
|
11394
11524
|
const logRotDriftSelectionSnapshot = (phase, target, extra = {}) => {
|
|
11395
|
-
|
|
11396
|
-
const anyTarget = target;
|
|
11397
|
-
const kids = typeof anyTarget.getObjects === "function" ? anyTarget.getObjects() : [];
|
|
11398
|
-
const selectionMatrix = target instanceof fabric__namespace.ActiveSelection ? target.calcTransformMatrix() : null;
|
|
11399
|
-
logRotGroupImageDrift(phase, {
|
|
11400
|
-
...extra,
|
|
11401
|
-
target: summarizeRotDriftObject(target),
|
|
11402
|
-
childCount: kids.length,
|
|
11403
|
-
groupSelectionId: anyTarget.__pixldocsGroupSelection,
|
|
11404
|
-
alignedAngle: anyTarget.__pixldocsAlignedAngle
|
|
11405
|
-
});
|
|
11406
|
-
kids.forEach((kid, childIndex) => {
|
|
11407
|
-
var _a2, _b2;
|
|
11408
|
-
const childWorldMatrix = selectionMatrix ? fabric__namespace.util.multiplyTransformMatrices(
|
|
11409
|
-
selectionMatrix,
|
|
11410
|
-
kid.calcOwnMatrix()
|
|
11411
|
-
) : (_a2 = kid.calcTransformMatrix) == null ? void 0 : _a2.call(kid);
|
|
11412
|
-
logRotGroupImageDrift(`${phase}-child`, {
|
|
11413
|
-
...extra,
|
|
11414
|
-
childIndex,
|
|
11415
|
-
parentType: anyTarget.type ?? ((_b2 = target.constructor) == null ? void 0 : _b2.name),
|
|
11416
|
-
child: summarizeRotDriftObject(kid, childWorldMatrix ?? null)
|
|
11417
|
-
});
|
|
11418
|
-
});
|
|
11525
|
+
return;
|
|
11419
11526
|
};
|
|
11420
11527
|
const bakeTextboxScaleIntoTypography = (obj, sourceElement) => {
|
|
11421
11528
|
const sx = Math.abs(obj.scaleX ?? 1) || 1;
|
|
@@ -12216,6 +12323,22 @@ const PageCanvas = react.forwardRef(
|
|
|
12216
12323
|
[canvasWidth, canvasHeight, getLogicalGroupSnapBoundsCallback, getResizeExcludeIdsCallback]
|
|
12217
12324
|
);
|
|
12218
12325
|
const installImageResizeControlsWithSnap = react.useCallback((group) => {
|
|
12326
|
+
var _a2;
|
|
12327
|
+
try {
|
|
12328
|
+
const groupId = getObjectId(group);
|
|
12329
|
+
const pageChildrenNow = ((_a2 = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _a2.children) ?? [];
|
|
12330
|
+
const parent = groupId ? findParentGroup(pageChildrenNow, groupId) : null;
|
|
12331
|
+
if (parent) {
|
|
12332
|
+
group.__pixldocsParentGroupId = parent.id;
|
|
12333
|
+
group.__pixldocsParentGroupAngle = parent.angle ?? 0;
|
|
12334
|
+
group.__pixldocsParentGroupType = "logical-group";
|
|
12335
|
+
} else {
|
|
12336
|
+
delete group.__pixldocsParentGroupId;
|
|
12337
|
+
delete group.__pixldocsParentGroupAngle;
|
|
12338
|
+
delete group.__pixldocsParentGroupType;
|
|
12339
|
+
}
|
|
12340
|
+
} catch {
|
|
12341
|
+
}
|
|
12219
12342
|
group.__resizeSnapHandler = (target, corner) => {
|
|
12220
12343
|
const fc = fabricRef.current ?? target.canvas;
|
|
12221
12344
|
if (!fc || !isActiveRef.current || !corner) return;
|
|
@@ -13350,9 +13473,6 @@ const PageCanvas = react.forwardRef(
|
|
|
13350
13473
|
};
|
|
13351
13474
|
logRotDriftSelectionSnapshot("transform-start", active, {
|
|
13352
13475
|
time: Math.round(performance.now()),
|
|
13353
|
-
groupId,
|
|
13354
|
-
groupAbs,
|
|
13355
|
-
selectionRect: rect,
|
|
13356
13476
|
transformStart: groupSelectionTransformStartRef.current,
|
|
13357
13477
|
selectedStoreIds: useEditorStore.getState().canvas.selectedIds
|
|
13358
13478
|
});
|
|
@@ -14252,14 +14372,14 @@ const PageCanvas = react.forwardRef(
|
|
|
14252
14372
|
fabricCanvas.on("selection:cleared", () => {
|
|
14253
14373
|
});
|
|
14254
14374
|
fabricCanvas.on("object:scaling", (e) => {
|
|
14255
|
-
var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j;
|
|
14375
|
+
var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
14256
14376
|
if (!isActiveRef.current) return;
|
|
14257
14377
|
const t = e.target;
|
|
14258
14378
|
if (t) lastResizeScaleTargetRef.current = t;
|
|
14259
14379
|
prepareGroupSelectionTransformStart(t);
|
|
14260
14380
|
markTransforming(t);
|
|
14261
14381
|
didTransformRef.current = true;
|
|
14262
|
-
if (shouldLogRotDriftLiveTick(
|
|
14382
|
+
if (shouldLogRotDriftLiveTick()) {
|
|
14263
14383
|
logRotDriftSelectionSnapshot("scaling", t, {
|
|
14264
14384
|
time: Math.round(performance.now()),
|
|
14265
14385
|
corner: t == null ? void 0 : t.__corner,
|
|
@@ -14423,12 +14543,61 @@ const PageCanvas = react.forwardRef(
|
|
|
14423
14543
|
const corner = (transform == null ? void 0 : transform.corner) || "";
|
|
14424
14544
|
if (obj instanceof fabric__namespace.ActiveSelection && corner) {
|
|
14425
14545
|
activeSelectionResizeHandleRef.current = corner;
|
|
14546
|
+
const imageChildrenForResizeDebug = obj.getObjects().filter(
|
|
14547
|
+
(child) => {
|
|
14548
|
+
var _a3;
|
|
14549
|
+
return child instanceof fabric__namespace.FabricImage || child instanceof fabric__namespace.Group && (child.__cropGroup || ((_a3 = child._ct) == null ? void 0 : _a3.isCropGroup));
|
|
14550
|
+
}
|
|
14551
|
+
);
|
|
14552
|
+
const normalizedSelectionAngle = ((obj.angle ?? 0) % 360 + 360) % 360;
|
|
14553
|
+
const activeLogicalGroupId = obj.__pixldocsGroupSelection;
|
|
14554
|
+
const transformStartForDebug = activeLogicalGroupId && ((_c2 = groupSelectionTransformStartRef.current) == null ? void 0 : _c2.groupId) === activeLogicalGroupId ? groupSelectionTransformStartRef.current : null;
|
|
14555
|
+
const logicalGroupAngle = (transformStartForDebug == null ? void 0 : transformStartForDebug.groupAngle) ?? obj.__pixldocsFrozenGroupAngle ?? 0;
|
|
14556
|
+
const normalizedLogicalGroupAngle = (logicalGroupAngle % 360 + 360) % 360;
|
|
14557
|
+
const isRotatedImageSelection = imageChildrenForResizeDebug.length > 0 && (Math.min(normalizedSelectionAngle, 360 - normalizedSelectionAngle) > 0.5 || Math.min(normalizedLogicalGroupAngle, 360 - normalizedLogicalGroupAngle) > 0.5);
|
|
14558
|
+
if (isRotatedImageSelection) {
|
|
14559
|
+
const countKey = "__pixldocsRotatedImageResizeScaleTickCount";
|
|
14560
|
+
const count = (obj[countKey] ?? 0) + 1;
|
|
14561
|
+
obj[countKey] = count;
|
|
14562
|
+
if (count <= 5 || count % 8 === 0) {
|
|
14563
|
+
logRotatedGroupImageResizeDebug("active-selection-scaling", {
|
|
14564
|
+
time: Math.round(performance.now()),
|
|
14565
|
+
tick: count,
|
|
14566
|
+
handle: corner,
|
|
14567
|
+
groupSelectionId: activeLogicalGroupId,
|
|
14568
|
+
selectedStoreIds: useEditorStore.getState().canvas.selectedIds,
|
|
14569
|
+
route: typeof window !== "undefined" ? window.location.pathname : void 0,
|
|
14570
|
+
transformAction: (_d = fabricCanvas._currentTransform) == null ? void 0 : _d.action,
|
|
14571
|
+
transformCorner: (_e = fabricCanvas._currentTransform) == null ? void 0 : _e.corner,
|
|
14572
|
+
transformOriginal: (() => {
|
|
14573
|
+
var _a3;
|
|
14574
|
+
const original = (_a3 = fabricCanvas._currentTransform) == null ? void 0 : _a3.original;
|
|
14575
|
+
return original ? {
|
|
14576
|
+
left: original.left,
|
|
14577
|
+
top: original.top,
|
|
14578
|
+
width: original.width,
|
|
14579
|
+
height: original.height,
|
|
14580
|
+
scaleX: original.scaleX,
|
|
14581
|
+
scaleY: original.scaleY,
|
|
14582
|
+
angle: original.angle
|
|
14583
|
+
} : null;
|
|
14584
|
+
})(),
|
|
14585
|
+
transformStart: transformStartForDebug,
|
|
14586
|
+
selection: summarizeRotDriftObject(obj),
|
|
14587
|
+
imageChildren: imageChildrenForResizeDebug.map((child, childIndex) => ({
|
|
14588
|
+
childIndex,
|
|
14589
|
+
id: getObjectId(child),
|
|
14590
|
+
object: summarizeRotDriftObject(child)
|
|
14591
|
+
}))
|
|
14592
|
+
});
|
|
14593
|
+
}
|
|
14594
|
+
}
|
|
14426
14595
|
if (isCornerResizeHandle(corner) && obj.getObjects().some((child) => child instanceof fabric__namespace.Textbox)) {
|
|
14427
14596
|
obj.__pixldocsLastGroupTextScaleDebug = {
|
|
14428
14597
|
time: Math.round(performance.now()),
|
|
14429
14598
|
corner,
|
|
14430
14599
|
groupSelectionId: obj.__pixldocsGroupSelection,
|
|
14431
|
-
currentTransformAction: (
|
|
14600
|
+
currentTransformAction: (_f = fabricCanvas._currentTransform) == null ? void 0 : _f.action,
|
|
14432
14601
|
selection: summarizeFabricObjectForResizeDebug(obj),
|
|
14433
14602
|
textChildren: obj.getObjects().filter((child) => child instanceof fabric__namespace.Textbox).map((child) => summarizeFabricObjectForResizeDebug(child))
|
|
14434
14603
|
};
|
|
@@ -14437,17 +14606,17 @@ const PageCanvas = react.forwardRef(
|
|
|
14437
14606
|
if (obj instanceof fabric__namespace.ActiveSelection && (corner === "ml" || corner === "mr" || corner === "mt" || corner === "mb")) {
|
|
14438
14607
|
const isXSide = corner === "ml" || corner === "mr";
|
|
14439
14608
|
const _cur = fabricCanvas._currentTransform;
|
|
14440
|
-
const startSx = Math.abs(Number(((
|
|
14441
|
-
const startSy = Math.abs(Number(((
|
|
14609
|
+
const startSx = Math.abs(Number(((_g = _cur == null ? void 0 : _cur.original) == null ? void 0 : _g.scaleX) ?? 1)) || 1;
|
|
14610
|
+
const startSy = Math.abs(Number(((_h = _cur == null ? void 0 : _cur.original) == null ? void 0 : _h.scaleY) ?? 1)) || 1;
|
|
14442
14611
|
const sAxis = isXSide ? Math.abs((obj.scaleX ?? 1) / startSx) : Math.abs((obj.scaleY ?? 1) / startSy);
|
|
14443
14612
|
if (sAxis > 1e-3) {
|
|
14444
|
-
if (isXSide && ((
|
|
14613
|
+
if (isXSide && ((_i = groupShiftReflowSnapshotRef.current) == null ? void 0 : _i.selection) !== obj) {
|
|
14445
14614
|
groupShiftReflowSnapshotRef.current = null;
|
|
14446
14615
|
const logicalGroupId = obj.__pixldocsGroupSelection;
|
|
14447
14616
|
if (logicalGroupId) {
|
|
14448
14617
|
try {
|
|
14449
14618
|
const state = useEditorStore.getState();
|
|
14450
|
-
const pageChildren2 = ((
|
|
14619
|
+
const pageChildren2 = ((_j = state.canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _j.children) ?? [];
|
|
14451
14620
|
const groupNode = findNodeById(pageChildren2, logicalGroupId);
|
|
14452
14621
|
if (groupNode && isGroup(groupNode) && !isStackLayoutMode(groupNode.layoutMode)) {
|
|
14453
14622
|
const entries = obj.getObjects().map((c) => ({
|
|
@@ -14485,7 +14654,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14485
14654
|
}
|
|
14486
14655
|
continue;
|
|
14487
14656
|
}
|
|
14488
|
-
if (child instanceof fabric__namespace.Group && (child.__cropGroup || ((
|
|
14657
|
+
if (child instanceof fabric__namespace.Group && (child.__cropGroup || ((_k = child._ct) == null ? void 0 : _k.isCropGroup))) {
|
|
14489
14658
|
const ct = child.__cropData;
|
|
14490
14659
|
if (!ct) continue;
|
|
14491
14660
|
if (child.__asLiveOrigAngle == null) {
|
|
@@ -14652,7 +14821,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14652
14821
|
child.dirty = true;
|
|
14653
14822
|
didReflowTextChild = true;
|
|
14654
14823
|
}
|
|
14655
|
-
if (isXSide && ((
|
|
14824
|
+
if (isXSide && ((_l = groupShiftReflowSnapshotRef.current) == null ? void 0 : _l.selection) === obj) {
|
|
14656
14825
|
const snap = groupShiftReflowSnapshotRef.current;
|
|
14657
14826
|
const anchorEntry = snap.children[0];
|
|
14658
14827
|
const anchorTopLive = anchorEntry.obj.top ?? 0;
|
|
@@ -14813,7 +14982,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14813
14982
|
setGuides(gridGuidesForScale.length ? [...scaleGuides, ...gridGuidesForScale] : scaleGuides);
|
|
14814
14983
|
if (drilledGroupIdRef.current) {
|
|
14815
14984
|
try {
|
|
14816
|
-
(
|
|
14985
|
+
(_m = fabricCanvas.__updateDrilledGroupOutline) == null ? void 0 : _m.call(fabricCanvas);
|
|
14817
14986
|
} catch {
|
|
14818
14987
|
}
|
|
14819
14988
|
}
|
|
@@ -14909,7 +15078,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14909
15078
|
didTransformRef.current = true;
|
|
14910
15079
|
const tr = e.target;
|
|
14911
15080
|
prepareGroupSelectionTransformStart(tr);
|
|
14912
|
-
if (shouldLogRotDriftLiveTick(
|
|
15081
|
+
if (shouldLogRotDriftLiveTick()) {
|
|
14913
15082
|
logRotDriftSelectionSnapshot("rotating", tr, {
|
|
14914
15083
|
time: Math.round(performance.now()),
|
|
14915
15084
|
transformAction: (_a2 = fabricCanvas._currentTransform) == null ? void 0 : _a2.action,
|
|
@@ -14950,7 +15119,7 @@ const PageCanvas = react.forwardRef(
|
|
|
14950
15119
|
prepareGroupSelectionTransformStart(e.target);
|
|
14951
15120
|
markTransforming(e.target);
|
|
14952
15121
|
didTransformRef.current = true;
|
|
14953
|
-
if (shouldLogRotDriftLiveTick(e.target
|
|
15122
|
+
if (shouldLogRotDriftLiveTick(e.target)) {
|
|
14954
15123
|
logRotDriftSelectionSnapshot("moving", e.target, {
|
|
14955
15124
|
time: Math.round(performance.now()),
|
|
14956
15125
|
transformAction: (_a2 = fabricCanvas._currentTransform) == null ? void 0 : _a2.action,
|
|
@@ -25222,9 +25391,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
25222
25391
|
}
|
|
25223
25392
|
return svgString;
|
|
25224
25393
|
}
|
|
25225
|
-
const resolvedPackageVersion = "0.5.
|
|
25394
|
+
const resolvedPackageVersion = "0.5.411";
|
|
25226
25395
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
25227
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
25396
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.411";
|
|
25228
25397
|
const roundParityValue = (value) => {
|
|
25229
25398
|
if (typeof value !== "number") return value;
|
|
25230
25399
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -26038,7 +26207,7 @@ class PixldocsRenderer {
|
|
|
26038
26207
|
await this.waitForCanvasScene(container, cloned, i);
|
|
26039
26208
|
}
|
|
26040
26209
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
26041
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
26210
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-DUaCeIGH.cjs"));
|
|
26042
26211
|
const prepared = preparePagesForExport(
|
|
26043
26212
|
cloned.pages,
|
|
26044
26213
|
canvasWidth,
|
|
@@ -28358,7 +28527,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
28358
28527
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
28359
28528
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
28360
28529
|
try {
|
|
28361
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
28530
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-DUaCeIGH.cjs"));
|
|
28362
28531
|
try {
|
|
28363
28532
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
28364
28533
|
} catch {
|
|
@@ -28755,4 +28924,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
28755
28924
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
28756
28925
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
28757
28926
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
28758
|
-
//# sourceMappingURL=index-
|
|
28927
|
+
//# sourceMappingURL=index-BzO7hSG5.cjs.map
|