@lucablockltd/ultimate-packaging 1.5.0 → 1.5.1

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.mjs CHANGED
@@ -1086,6 +1086,203 @@ async function exportDimensionPdf(params) {
1086
1086
  const arrayBuffer = doc.output("arraybuffer");
1087
1087
  return new Blob([arrayBuffer], { type: "application/pdf" });
1088
1088
  }
1089
+
1090
+ // src/utils/readyToPrint.ts
1091
+ var DIM_PADDING2 = 15;
1092
+ var FOOTER_H2 = 40;
1093
+ var MARGIN2 = 5;
1094
+ function camelToCapitalize2(str) {
1095
+ return str.replace(/([A-Z])/g, " $1").replace(/^./, (s) => s.toUpperCase());
1096
+ }
1097
+ function hexToRgb2(hex) {
1098
+ return {
1099
+ r: parseInt(hex.slice(1, 3), 16),
1100
+ g: parseInt(hex.slice(3, 5), 16),
1101
+ b: parseInt(hex.slice(5, 7), 16)
1102
+ };
1103
+ }
1104
+ function drawPath(doc, d, ox, oy) {
1105
+ const commands = parseSvgPath(d);
1106
+ let startX = 0;
1107
+ let startY = 0;
1108
+ let curX = 0;
1109
+ let curY = 0;
1110
+ for (const cmd of commands) {
1111
+ switch (cmd.type) {
1112
+ case "M":
1113
+ curX = cmd.x + ox;
1114
+ curY = cmd.y + oy;
1115
+ startX = curX;
1116
+ startY = curY;
1117
+ break;
1118
+ case "L": {
1119
+ const nx = cmd.x + ox;
1120
+ const ny = cmd.y + oy;
1121
+ doc.line(curX, curY, nx, ny);
1122
+ curX = nx;
1123
+ curY = ny;
1124
+ break;
1125
+ }
1126
+ case "C": {
1127
+ const x0 = curX;
1128
+ const y0 = curY;
1129
+ const x1 = cmd.x1 + ox;
1130
+ const y1 = cmd.y1 + oy;
1131
+ const x2 = cmd.x2 + ox;
1132
+ const y2 = cmd.y2 + oy;
1133
+ const x3 = cmd.x + ox;
1134
+ const y3 = cmd.y + oy;
1135
+ const steps = 20;
1136
+ let prevX = x0;
1137
+ let prevY = y0;
1138
+ for (let si = 1; si <= steps; si++) {
1139
+ const t = si / steps;
1140
+ const mt = 1 - t;
1141
+ const nx = mt * mt * mt * x0 + 3 * mt * mt * t * x1 + 3 * mt * t * t * x2 + t * t * t * x3;
1142
+ const ny = mt * mt * mt * y0 + 3 * mt * mt * t * y1 + 3 * mt * t * t * y2 + t * t * t * y3;
1143
+ doc.line(prevX, prevY, nx, ny);
1144
+ prevX = nx;
1145
+ prevY = ny;
1146
+ }
1147
+ curX = x3;
1148
+ curY = y3;
1149
+ break;
1150
+ }
1151
+ case "Q": {
1152
+ const qx0 = curX;
1153
+ const qy0 = curY;
1154
+ const qx1 = cmd.x1 + ox;
1155
+ const qy1 = cmd.y1 + oy;
1156
+ const qx2 = cmd.x + ox;
1157
+ const qy2 = cmd.y + oy;
1158
+ const qSteps = 16;
1159
+ let qPrevX = qx0;
1160
+ let qPrevY = qy0;
1161
+ for (let si = 1; si <= qSteps; si++) {
1162
+ const t = si / qSteps;
1163
+ const mt = 1 - t;
1164
+ const nx = mt * mt * qx0 + 2 * mt * t * qx1 + t * t * qx2;
1165
+ const ny = mt * mt * qy0 + 2 * mt * t * qy1 + t * t * qy2;
1166
+ doc.line(qPrevX, qPrevY, nx, ny);
1167
+ qPrevX = nx;
1168
+ qPrevY = ny;
1169
+ }
1170
+ curX = qx2;
1171
+ curY = qy2;
1172
+ break;
1173
+ }
1174
+ case "Z":
1175
+ doc.line(curX, curY, startX, startY);
1176
+ curX = startX;
1177
+ curY = startY;
1178
+ break;
1179
+ }
1180
+ }
1181
+ }
1182
+ async function readyToPrintPdf(params) {
1183
+ const { modelId, dieline, dimensions, attributes, unit, factor, theme } = params;
1184
+ const { width: vw, height: vh } = dieline.viewBox;
1185
+ const contentW = vw + DIM_PADDING2 * 2;
1186
+ const contentH = vh + DIM_PADDING2 * 2;
1187
+ const pageW = contentW + MARGIN2 * 2;
1188
+ const pageH = contentH + MARGIN2 * 2 + FOOTER_H2;
1189
+ const { jsPDF } = await import('jspdf');
1190
+ const doc = new jsPDF({
1191
+ orientation: pageW > pageH ? "landscape" : "portrait",
1192
+ unit: "mm",
1193
+ format: [pageW, pageH]
1194
+ });
1195
+ const ox = MARGIN2 + DIM_PADDING2;
1196
+ const oy = MARGIN2 + DIM_PADDING2;
1197
+ const creaseRgb = hexToRgb2(theme.colorFoldLine);
1198
+ doc.setDrawColor(creaseRgb.r, creaseRgb.g, creaseRgb.b);
1199
+ doc.setLineWidth(0.3);
1200
+ for (const d of dieline.crease) {
1201
+ drawPath(doc, d, ox, oy);
1202
+ }
1203
+ const cutRgb = hexToRgb2(theme.colorDieLine);
1204
+ doc.setDrawColor(cutRgb.r, cutRgb.g, cutRgb.b);
1205
+ doc.setLineWidth(0.3);
1206
+ for (const d of dieline.cut) {
1207
+ drawPath(doc, d, ox, oy);
1208
+ }
1209
+ const tick = 1.5;
1210
+ for (const dim of dimensions) {
1211
+ if (dim.orientation === "horizontal") {
1212
+ const y = dim.y1 + dim.offset + oy;
1213
+ const x1 = dim.x1 + ox;
1214
+ const x2 = dim.x2 + ox;
1215
+ doc.setDrawColor(0, 0, 0);
1216
+ doc.setLineWidth(0.2);
1217
+ doc.line(x1, y, x2, y);
1218
+ doc.setLineWidth(0.3);
1219
+ doc.line(x1, y - tick, x1, y + tick);
1220
+ doc.line(x2, y - tick, x2, y + tick);
1221
+ const midX = (x1 + x2) / 2;
1222
+ doc.setFontSize(3.5 * 2.83);
1223
+ doc.setTextColor(0, 0, 0);
1224
+ doc.text(dim.label, midX, y - 1.5, { align: "center" });
1225
+ } else {
1226
+ const x = dim.x1 + dim.offset + ox;
1227
+ const y1 = dim.y1 + oy;
1228
+ const y2 = dim.y2 + oy;
1229
+ doc.setDrawColor(0, 0, 0);
1230
+ doc.setLineWidth(0.2);
1231
+ doc.line(x, y1, x, y2);
1232
+ doc.setLineWidth(0.3);
1233
+ doc.line(x - tick, y1, x + tick, y1);
1234
+ doc.line(x - tick, y2, x + tick, y2);
1235
+ const midY = (y1 + y2) / 2;
1236
+ doc.setFontSize(3.5 * 2.83);
1237
+ doc.setTextColor(0, 0, 0);
1238
+ const textX = x - 1.5;
1239
+ const tw = doc.getTextWidth(dim.label);
1240
+ doc.text(dim.label, textX, midY + tw / 2, { angle: 90 });
1241
+ }
1242
+ }
1243
+ const footerY = pageH - FOOTER_H2;
1244
+ const halfW = (pageW - MARGIN2 * 2) / 2;
1245
+ const centerX = MARGIN2 + halfW;
1246
+ doc.setDrawColor(180, 180, 180);
1247
+ doc.setLineWidth(0.3);
1248
+ doc.line(MARGIN2, footerY, pageW - MARGIN2, footerY);
1249
+ doc.line(centerX, footerY, centerX, pageH - MARGIN2);
1250
+ doc.setTextColor(0, 0, 0);
1251
+ doc.setFontSize(9);
1252
+ doc.text("Luca Block Co.,Ltd.", MARGIN2 + 3, footerY + 6);
1253
+ doc.text(
1254
+ `Cartons-Tuck end boxes-${modelId}`,
1255
+ pageW - MARGIN2 - 3,
1256
+ footerY + 6,
1257
+ { align: "right" }
1258
+ );
1259
+ const attrEntries = Object.entries(attributes);
1260
+ const col1X = MARGIN2 + 3;
1261
+ const col2X = MARGIN2 + 3 + halfW / 2;
1262
+ const attrStartY = footerY + 14;
1263
+ const lineH = 5;
1264
+ doc.setFontSize(7);
1265
+ const half = Math.ceil(attrEntries.length / 2);
1266
+ for (let i = 0; i < half; i++) {
1267
+ const [key, val] = attrEntries[i];
1268
+ doc.text(
1269
+ `${camelToCapitalize2(key)}: ${(val * factor).toFixed(1)} ${unit}`,
1270
+ col1X,
1271
+ attrStartY + i * lineH
1272
+ );
1273
+ const j = i + half;
1274
+ if (j < attrEntries.length) {
1275
+ const [key2, val2] = attrEntries[j];
1276
+ doc.text(
1277
+ `${camelToCapitalize2(key2)}: ${(val2 * factor).toFixed(1)} ${unit}`,
1278
+ col2X,
1279
+ attrStartY + i * lineH
1280
+ );
1281
+ }
1282
+ }
1283
+ const arrayBuffer = doc.output("arraybuffer");
1284
+ return new Blob([arrayBuffer], { type: "application/pdf" });
1285
+ }
1089
1286
  function DebugOverlay({ data, fontSize }) {
1090
1287
  const ptR = fontSize * 0.3;
1091
1288
  return /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -1301,6 +1498,18 @@ var DIE_LINE_BECF_1010A = forwardRef(
1301
1498
  factor,
1302
1499
  theme
1303
1500
  });
1501
+ },
1502
+ readyToPrint: async () => {
1503
+ const dimData = generateDimensions(attributes, unit);
1504
+ return readyToPrintPdf({
1505
+ modelId: MODEL_ID,
1506
+ dieline,
1507
+ dimensions: dimData,
1508
+ attributes,
1509
+ unit,
1510
+ factor,
1511
+ theme
1512
+ });
1304
1513
  }
1305
1514
  }),
1306
1515
  [attributes, dieline, factor, unit, serializeSvg, theme]
@@ -1401,6 +1610,7 @@ var CANVAS_BECF_1010A = forwardRef(
1401
1610
  });
1402
1611
  },
1403
1612
  exportDimension: () => dieLineRef.current.exportDimension(),
1613
+ readyToPrint: () => dieLineRef.current.readyToPrint(),
1404
1614
  resetView: () => canvasRef.current?.resetView(),
1405
1615
  fitView: () => canvasRef.current?.fitView()
1406
1616
  }), [serializeCanvasSvg, dieline.viewBox.width, dieline.viewBox.height]);
@@ -1994,6 +2204,18 @@ var DIE_LINE_BECF_1030A = forwardRef(
1994
2204
  factor,
1995
2205
  theme
1996
2206
  });
2207
+ },
2208
+ readyToPrint: async () => {
2209
+ const dimData = generateDimensions2(attributes, unit);
2210
+ return readyToPrintPdf({
2211
+ modelId: MODEL_ID2,
2212
+ dieline,
2213
+ dimensions: dimData,
2214
+ attributes,
2215
+ unit,
2216
+ factor,
2217
+ theme
2218
+ });
1997
2219
  }
1998
2220
  }),
1999
2221
  [attributes, dieline, factor, unit, serializeSvg, theme]
@@ -2094,6 +2316,7 @@ var CANVAS_BECF_1030A = forwardRef(
2094
2316
  });
2095
2317
  },
2096
2318
  exportDimension: () => dieLineRef.current.exportDimension(),
2319
+ readyToPrint: () => dieLineRef.current.readyToPrint(),
2097
2320
  resetView: () => canvasRef.current?.resetView(),
2098
2321
  fitView: () => canvasRef.current?.fitView()
2099
2322
  }), [serializeCanvasSvg, dieline.viewBox.width, dieline.viewBox.height]);
@@ -2689,6 +2912,18 @@ var DIE_LINE_BECF_1040A = forwardRef(
2689
2912
  factor,
2690
2913
  theme
2691
2914
  });
2915
+ },
2916
+ readyToPrint: async () => {
2917
+ const dimData = generateDimensions3(attributes, unit);
2918
+ return readyToPrintPdf({
2919
+ modelId: MODEL_ID3,
2920
+ dieline,
2921
+ dimensions: dimData,
2922
+ attributes,
2923
+ unit,
2924
+ factor,
2925
+ theme
2926
+ });
2692
2927
  }
2693
2928
  }),
2694
2929
  [attributes, dieline, factor, unit, serializeSvg, theme]
@@ -2789,6 +3024,7 @@ var CANVAS_BECF_1040A = forwardRef(
2789
3024
  });
2790
3025
  },
2791
3026
  exportDimension: () => dieLineRef.current.exportDimension(),
3027
+ readyToPrint: () => dieLineRef.current.readyToPrint(),
2792
3028
  resetView: () => canvasRef.current?.resetView(),
2793
3029
  fitView: () => canvasRef.current?.fitView()
2794
3030
  }), [serializeCanvasSvg, dieline.viewBox.width, dieline.viewBox.height]);
@@ -3404,6 +3640,18 @@ var DIE_LINE_BECF_11D01 = forwardRef(
3404
3640
  factor,
3405
3641
  theme
3406
3642
  });
3643
+ },
3644
+ readyToPrint: async () => {
3645
+ const dimData = generateDimensions4(attributes, unit);
3646
+ return readyToPrintPdf({
3647
+ modelId: MODEL_ID4,
3648
+ dieline,
3649
+ dimensions: dimData,
3650
+ attributes,
3651
+ unit,
3652
+ factor,
3653
+ theme
3654
+ });
3407
3655
  }
3408
3656
  }),
3409
3657
  [attributes, dieline, factor, unit, serializeSvg, theme]
@@ -3500,6 +3748,7 @@ var CANVAS_BECF_11D01 = forwardRef(
3500
3748
  });
3501
3749
  },
3502
3750
  exportDimension: () => dieLineRef.current.exportDimension(),
3751
+ readyToPrint: () => dieLineRef.current.readyToPrint(),
3503
3752
  resetView: () => canvasRef.current?.resetView(),
3504
3753
  fitView: () => canvasRef.current?.fitView()
3505
3754
  }), [serializeCanvasSvg, dieline.viewBox.width, dieline.viewBox.height]);
@@ -3535,9 +3784,10 @@ var MODEL_BECF_11D01 = forwardRef(
3535
3784
  var DIP = 15;
3536
3785
  var ROPE_R = 3;
3537
3786
  var ROPE_Y = 20;
3538
- var D_MAX = 40;
3539
- function calcD(c, b) {
3540
- return Math.min(c - 2 - b / 2, D_MAX);
3787
+ var D_SMALL = 30;
3788
+ var D_LARGE = 40;
3789
+ function calcD(c) {
3790
+ return c < 300 ? D_SMALL : D_LARGE;
3541
3791
  }
3542
3792
  function calcKulak(b) {
3543
3793
  if (b <= 13) return b - 1;
@@ -3551,7 +3801,7 @@ function calcX(a) {
3551
3801
  }
3552
3802
  function getAutoCalcValues(attr) {
3553
3803
  const { length: A, width: B, height: C, glueArea } = attr;
3554
- const D = calcD(C, B);
3804
+ const D = calcD(C);
3555
3805
  const kulak = glueArea ?? calcKulak(B);
3556
3806
  const X = calcX(A);
3557
3807
  return { d: D, kulak, dip: DIP, ropeR: ROPE_R, ropeY: ROPE_Y, ropeX: X };
@@ -3564,7 +3814,7 @@ function circlePath(cx, cy, r) {
3564
3814
  }
3565
3815
  function generateBecf12101(attr) {
3566
3816
  const { length: A, width: B, height: C, glueArea } = attr;
3567
- const D = calcD(C, B);
3817
+ const D = calcD(C);
3568
3818
  const kulak = glueArea ?? calcKulak(B);
3569
3819
  const X = calcX(A);
3570
3820
  const xFront = kulak;
@@ -3621,7 +3871,7 @@ function generateBecf12101(attr) {
3621
3871
  }
3622
3872
  function generateBecf12101DebugSections(attr) {
3623
3873
  const { length: A, width: B, height: C, glueArea } = attr;
3624
- const D = calcD(C, B);
3874
+ const D = calcD(C);
3625
3875
  const kulak = glueArea ?? calcKulak(B);
3626
3876
  const X = calcX(A);
3627
3877
  const xFront = kulak;
@@ -3704,7 +3954,7 @@ function generateBecf12101DebugSections(attr) {
3704
3954
  }
3705
3955
  function generateOuterContour5(attr) {
3706
3956
  const { length: A, width: B, height: C, glueArea } = attr;
3707
- const D = calcD(C, B);
3957
+ const D = calcD(C);
3708
3958
  const kulak = glueArea ?? calcKulak(B);
3709
3959
  const totalWidth = kulak + 2 * A + 2 * B - 2;
3710
3960
  const totalHeight = D + C + B / 2 + DIP;
@@ -3762,7 +4012,7 @@ function contourToPath5(points) {
3762
4012
  }
3763
4013
  function generateDimensions5(attr, unit) {
3764
4014
  const { length: A, width: B, height: C, glueArea } = attr;
3765
- const D = calcD(C, B);
4015
+ const D = calcD(C);
3766
4016
  const kulak = glueArea ?? calcKulak(B);
3767
4017
  const factor = unit === "cm" ? 0.1 : unit === "in" ? 1 / 25.4 : 1;
3768
4018
  const suffix = unit;
@@ -3771,11 +4021,12 @@ function generateDimensions5(attr, unit) {
3771
4021
  const xSide1 = kulak + A;
3772
4022
  const xBack = kulak + A + B;
3773
4023
  const yFoldTop = D;
4024
+ const yFoldBottomStart = D + C - B / 2;
3774
4025
  const yFoldBottom = D + C;
4026
+ const yBottomFlap = D + C + B / 2;
3775
4027
  const yEnd = D + C + B / 2 + DIP;
3776
4028
  const totalWidth = kulak + 2 * A + 2 * B - 2;
3777
4029
  const totalHeight = yEnd;
3778
- const bottomSection = B / 2 + DIP;
3779
4030
  return [
3780
4031
  // Overall dimensions (outside)
3781
4032
  {
@@ -3796,7 +4047,17 @@ function generateDimensions5(attr, unit) {
3796
4047
  orientation: "vertical",
3797
4048
  offset: -12
3798
4049
  },
3799
- // Height (C) — body area (centered on back panel)
4050
+ // Top flap (D)
4051
+ {
4052
+ x1: xBack + A * 0.6,
4053
+ y1: 0,
4054
+ x2: xBack + A * 0.6,
4055
+ y2: yFoldTop,
4056
+ label: fmt(D),
4057
+ orientation: "vertical",
4058
+ offset: -10
4059
+ },
4060
+ // Body height (h = C)
3800
4061
  {
3801
4062
  x1: xBack + A * 0.6,
3802
4063
  y1: yFoldTop,
@@ -3806,23 +4067,33 @@ function generateDimensions5(attr, unit) {
3806
4067
  orientation: "vertical",
3807
4068
  offset: -10
3808
4069
  },
3809
- // Top flap (D) (centered on back panel)
4070
+ // W-fold upper (B/2) yFoldBottomStart to yFoldBottom
3810
4071
  {
3811
4072
  x1: xBack + A * 0.6,
3812
- y1: 0,
4073
+ y1: yFoldBottomStart,
3813
4074
  x2: xBack + A * 0.6,
3814
- y2: yFoldTop,
3815
- label: fmt(D),
4075
+ y2: yFoldBottom,
4076
+ label: fmt(B / 2),
3816
4077
  orientation: "vertical",
3817
4078
  offset: -10
3818
4079
  },
3819
- // Bottom section (B/2 + _dip) (centered on back panel)
4080
+ // W-fold lower (B/2) yFoldBottom to yBottomFlap
3820
4081
  {
3821
4082
  x1: xBack + A * 0.6,
3822
4083
  y1: yFoldBottom,
3823
4084
  x2: xBack + A * 0.6,
4085
+ y2: yBottomFlap,
4086
+ label: fmt(B / 2),
4087
+ orientation: "vertical",
4088
+ offset: -10
4089
+ },
4090
+ // DIP — bottom glue tab
4091
+ {
4092
+ x1: xBack + A * 0.6,
4093
+ y1: yBottomFlap,
4094
+ x2: xBack + A * 0.6,
3824
4095
  y2: yEnd,
3825
- label: fmt(bottomSection),
4096
+ label: fmt(DIP),
3826
4097
  orientation: "vertical",
3827
4098
  offset: -10
3828
4099
  },
@@ -4010,6 +4281,18 @@ var DIE_LINE_BECF_12101 = forwardRef(
4010
4281
  factor,
4011
4282
  theme
4012
4283
  });
4284
+ },
4285
+ readyToPrint: async () => {
4286
+ const dimData = generateDimensions5(attributes, unit);
4287
+ return readyToPrintPdf({
4288
+ modelId: MODEL_ID5,
4289
+ dieline,
4290
+ dimensions: dimData,
4291
+ attributes,
4292
+ unit,
4293
+ factor,
4294
+ theme
4295
+ });
4013
4296
  }
4014
4297
  };
4015
4298
  },
@@ -4107,6 +4390,7 @@ var CANVAS_BECF_12101 = forwardRef(
4107
4390
  });
4108
4391
  },
4109
4392
  exportDimension: () => dieLineRef.current.exportDimension(),
4393
+ readyToPrint: () => dieLineRef.current.readyToPrint(),
4110
4394
  resetView: () => canvasRef.current?.resetView(),
4111
4395
  fitView: () => canvasRef.current?.fitView()
4112
4396
  }), [serializeCanvasSvg, dieline.viewBox.width, dieline.viewBox.height]);
@@ -4139,14 +4423,15 @@ var MODEL_BECF_12101 = forwardRef(
4139
4423
  );
4140
4424
 
4141
4425
  // src/components/dieline/bags-pillows/becf-12109/generate.ts
4142
- var DIP2 = 13;
4426
+ var DIP2 = 15;
4143
4427
  var ROPE_R2 = 3;
4144
4428
  var ROPE_Y2 = 20;
4145
- var D_MAX2 = 40;
4429
+ var D_SMALL2 = 30;
4430
+ var D_LARGE2 = 40;
4146
4431
  var NOTCH_X = 3;
4147
4432
  var NOTCH_Y = 5;
4148
- function calcD2(c, b) {
4149
- return Math.min(c - 2 - b / 2, D_MAX2);
4433
+ function calcD2(c) {
4434
+ return c < 300 ? D_SMALL2 : D_LARGE2;
4150
4435
  }
4151
4436
  function calcKulak2(b) {
4152
4437
  if (b <= 13) return b - 1;
@@ -4160,7 +4445,7 @@ function calcX2(a) {
4160
4445
  }
4161
4446
  function getAutoCalcValues2(attr) {
4162
4447
  const { length: A, width: B, height: C, glueArea } = attr;
4163
- const D = calcD2(C, B);
4448
+ const D = calcD2(C);
4164
4449
  const kulak = glueArea ?? calcKulak2(B);
4165
4450
  const X = calcX2(A);
4166
4451
  return { d: D, kulak, dip: DIP2, ropeR: ROPE_R2, ropeY: ROPE_Y2, ropeX: X };
@@ -4173,7 +4458,7 @@ function circlePath2(cx, cy, r) {
4173
4458
  }
4174
4459
  function generateBecf12109(attr) {
4175
4460
  const { length: A, width: B, height: C, glueArea } = attr;
4176
- const D = calcD2(C, B);
4461
+ const D = calcD2(C);
4177
4462
  const kulak = glueArea ?? calcKulak2(B);
4178
4463
  const X = calcX2(A);
4179
4464
  const xFront = kulak;
@@ -4243,7 +4528,7 @@ function generateBecf12109(attr) {
4243
4528
  }
4244
4529
  function generateBecf12109DebugSections(attr) {
4245
4530
  const { length: A, width: B, height: C, glueArea } = attr;
4246
- const D = calcD2(C, B);
4531
+ const D = calcD2(C);
4247
4532
  const kulak = glueArea ?? calcKulak2(B);
4248
4533
  const X = calcX2(A);
4249
4534
  const xFront = kulak;
@@ -4351,7 +4636,7 @@ function generateBecf12109DebugSections(attr) {
4351
4636
  }
4352
4637
  function generateOuterContour6(attr) {
4353
4638
  const { length: A, width: B, height: C, glueArea } = attr;
4354
- const D = calcD2(C, B);
4639
+ const D = calcD2(C);
4355
4640
  const kulak = glueArea ?? calcKulak2(B);
4356
4641
  const xFront = kulak;
4357
4642
  const xSide1 = kulak + A;
@@ -4444,7 +4729,7 @@ function contourToPath6(points) {
4444
4729
  }
4445
4730
  function generateDimensions6(attr, unit) {
4446
4731
  const { length: A, width: B, height: C, glueArea } = attr;
4447
- const D = calcD2(C, B);
4732
+ const D = calcD2(C);
4448
4733
  const kulak = glueArea ?? calcKulak2(B);
4449
4734
  const factor = unit === "cm" ? 0.1 : unit === "in" ? 1 / 25.4 : 1;
4450
4735
  const suffix = unit;
@@ -4453,11 +4738,12 @@ function generateDimensions6(attr, unit) {
4453
4738
  const xSide1 = kulak + A;
4454
4739
  const xBack = kulak + A + B;
4455
4740
  const yFoldTop = D;
4741
+ const yFoldBottomStart = D + C - B / 2;
4456
4742
  const yFoldBottom = D + C;
4743
+ const yBottomFlap = D + C + B / 2;
4457
4744
  const yEnd = D + C + B / 2 + DIP2;
4458
4745
  const totalWidth = kulak + 2 * A + 2 * B - 2;
4459
4746
  const totalHeight = yEnd;
4460
- const bottomSection = B / 2 + DIP2;
4461
4747
  return [
4462
4748
  // Overall dimensions (outside)
4463
4749
  {
@@ -4478,7 +4764,17 @@ function generateDimensions6(attr, unit) {
4478
4764
  orientation: "vertical",
4479
4765
  offset: -12
4480
4766
  },
4481
- // Height (C) — body area (centered on back panel)
4767
+ // Top flap (D)
4768
+ {
4769
+ x1: xBack + A * 0.6,
4770
+ y1: 0,
4771
+ x2: xBack + A * 0.6,
4772
+ y2: yFoldTop,
4773
+ label: fmt(D),
4774
+ orientation: "vertical",
4775
+ offset: -10
4776
+ },
4777
+ // Body height (h = C)
4482
4778
  {
4483
4779
  x1: xBack + A * 0.6,
4484
4780
  y1: yFoldTop,
@@ -4488,23 +4784,33 @@ function generateDimensions6(attr, unit) {
4488
4784
  orientation: "vertical",
4489
4785
  offset: -10
4490
4786
  },
4491
- // Top flap (D) (centered on back panel)
4787
+ // W-fold upper (B/2) yFoldBottomStart to yFoldBottom
4492
4788
  {
4493
4789
  x1: xBack + A * 0.6,
4494
- y1: 0,
4790
+ y1: yFoldBottomStart,
4495
4791
  x2: xBack + A * 0.6,
4496
- y2: yFoldTop,
4497
- label: fmt(D),
4792
+ y2: yFoldBottom,
4793
+ label: fmt(B / 2),
4498
4794
  orientation: "vertical",
4499
4795
  offset: -10
4500
4796
  },
4501
- // Bottom section (B/2 + _dip) (centered on back panel)
4797
+ // W-fold lower (B/2) yFoldBottom to yBottomFlap
4502
4798
  {
4503
4799
  x1: xBack + A * 0.6,
4504
4800
  y1: yFoldBottom,
4505
4801
  x2: xBack + A * 0.6,
4802
+ y2: yBottomFlap,
4803
+ label: fmt(B / 2),
4804
+ orientation: "vertical",
4805
+ offset: -10
4806
+ },
4807
+ // DIP — bottom glue tab
4808
+ {
4809
+ x1: xBack + A * 0.6,
4810
+ y1: yBottomFlap,
4811
+ x2: xBack + A * 0.6,
4506
4812
  y2: yEnd,
4507
- label: fmt(bottomSection),
4813
+ label: fmt(DIP2),
4508
4814
  orientation: "vertical",
4509
4815
  offset: -10
4510
4816
  },
@@ -4692,6 +4998,18 @@ var DIE_LINE_BECF_12109 = forwardRef(
4692
4998
  factor,
4693
4999
  theme
4694
5000
  });
5001
+ },
5002
+ readyToPrint: async () => {
5003
+ const dimData = generateDimensions6(attributes, unit);
5004
+ return readyToPrintPdf({
5005
+ modelId: MODEL_ID6,
5006
+ dieline,
5007
+ dimensions: dimData,
5008
+ attributes,
5009
+ unit,
5010
+ factor,
5011
+ theme
5012
+ });
4695
5013
  }
4696
5014
  };
4697
5015
  },
@@ -4789,6 +5107,7 @@ var CANVAS_BECF_12109 = forwardRef(
4789
5107
  });
4790
5108
  },
4791
5109
  exportDimension: () => dieLineRef.current.exportDimension(),
5110
+ readyToPrint: () => dieLineRef.current.readyToPrint(),
4792
5111
  resetView: () => canvasRef.current?.resetView(),
4793
5112
  fitView: () => canvasRef.current?.fitView()
4794
5113
  }), [serializeCanvasSvg, dieline.viewBox.width, dieline.viewBox.height]);
@@ -4825,9 +5144,9 @@ var DIP3 = 15;
4825
5144
  var RIBBON_HALF_W = 9;
4826
5145
  var RIBBON_DX = 2;
4827
5146
  var RIBBON_DY = 2;
4828
- var D_MAX3 = 40;
5147
+ var D_MAX = 40;
4829
5148
  function calcD3(c, b) {
4830
- return Math.min(c - 2 - b / 2, D_MAX3);
5149
+ return Math.min(c - 2 - b / 2, D_MAX);
4831
5150
  }
4832
5151
  function calcKulak3(b) {
4833
5152
  if (b <= 13) return b - 1;
@@ -5302,6 +5621,18 @@ var DIE_LINE_BECF_C_12101 = forwardRef(
5302
5621
  factor,
5303
5622
  theme
5304
5623
  });
5624
+ },
5625
+ readyToPrint: async () => {
5626
+ const dimData = generateDimensions7(attributes, unit);
5627
+ return readyToPrintPdf({
5628
+ modelId: MODEL_ID7,
5629
+ dieline,
5630
+ dimensions: dimData,
5631
+ attributes,
5632
+ unit,
5633
+ factor,
5634
+ theme
5635
+ });
5305
5636
  }
5306
5637
  };
5307
5638
  },
@@ -5399,6 +5730,7 @@ var CANVAS_BECF_C_12101 = forwardRef(
5399
5730
  });
5400
5731
  },
5401
5732
  exportDimension: () => dieLineRef.current.exportDimension(),
5733
+ readyToPrint: () => dieLineRef.current.readyToPrint(),
5402
5734
  resetView: () => canvasRef.current?.resetView(),
5403
5735
  fitView: () => canvasRef.current?.fitView()
5404
5736
  }), [serializeCanvasSvg, dieline.viewBox.width, dieline.viewBox.height]);
@@ -5435,11 +5767,11 @@ var DIP4 = 13;
5435
5767
  var RIBBON_HALF_W2 = 9;
5436
5768
  var RIBBON_DX2 = 2;
5437
5769
  var RIBBON_DY2 = 2;
5438
- var D_MAX4 = 40;
5770
+ var D_MAX2 = 40;
5439
5771
  var NOTCH_X2 = 3;
5440
5772
  var NOTCH_Y2 = 5;
5441
5773
  function calcD4(c, b) {
5442
- return Math.min(c - 2 - b / 2, D_MAX4);
5774
+ return Math.min(c - 2 - b / 2, D_MAX2);
5443
5775
  }
5444
5776
  function calcKulak4(b) {
5445
5777
  if (b <= 13) return b - 1;
@@ -6002,6 +6334,18 @@ var DIE_LINE_BECF_C_12109 = forwardRef(
6002
6334
  factor,
6003
6335
  theme
6004
6336
  });
6337
+ },
6338
+ readyToPrint: async () => {
6339
+ const dimData = generateDimensions8(attributes, unit);
6340
+ return readyToPrintPdf({
6341
+ modelId: MODEL_ID8,
6342
+ dieline,
6343
+ dimensions: dimData,
6344
+ attributes,
6345
+ unit,
6346
+ factor,
6347
+ theme
6348
+ });
6005
6349
  }
6006
6350
  };
6007
6351
  },
@@ -6099,6 +6443,7 @@ var CANVAS_BECF_C_12109 = forwardRef(
6099
6443
  });
6100
6444
  },
6101
6445
  exportDimension: () => dieLineRef.current.exportDimension(),
6446
+ readyToPrint: () => dieLineRef.current.readyToPrint(),
6102
6447
  resetView: () => canvasRef.current?.resetView(),
6103
6448
  fitView: () => canvasRef.current?.fitView()
6104
6449
  }), [serializeCanvasSvg, dieline.viewBox.width, dieline.viewBox.height]);
@@ -6478,6 +6823,10 @@ var DIE_LINE_BECF_B_12101 = forwardRef(
6478
6823
  exportDimension: async () => {
6479
6824
  const dimData = generateDimensions9(attributes, unit);
6480
6825
  return exportDimensionPdf({ modelId: MODEL_ID9, dieline, dimensions: dimData, attributes, unit, factor, theme });
6826
+ },
6827
+ readyToPrint: async () => {
6828
+ const dimData = generateDimensions9(attributes, unit);
6829
+ return readyToPrintPdf({ modelId: MODEL_ID9, dieline, dimensions: dimData, attributes, unit, factor, theme });
6481
6830
  }
6482
6831
  };
6483
6832
  }, [attributes, dieline, factor, unit, serializeSvg, theme]);
@@ -6544,6 +6893,7 @@ var CANVAS_BECF_B_12101 = forwardRef(
6544
6893
  });
6545
6894
  },
6546
6895
  exportDimension: () => dieLineRef.current.exportDimension(),
6896
+ readyToPrint: () => dieLineRef.current.readyToPrint(),
6547
6897
  resetView: () => canvasRef.current?.resetView(),
6548
6898
  fitView: () => canvasRef.current?.fitView()
6549
6899
  }), [serializeCanvasSvg, dieline.viewBox.width, dieline.viewBox.height]);
@@ -7003,6 +7353,10 @@ var DIE_LINE_BECF_B_12109 = forwardRef(
7003
7353
  exportDimension: async () => {
7004
7354
  const dimData = generateDimensions10(attributes, unit);
7005
7355
  return exportDimensionPdf({ modelId: MODEL_ID10, dieline, dimensions: dimData, attributes, unit, factor, theme });
7356
+ },
7357
+ readyToPrint: async () => {
7358
+ const dimData = generateDimensions10(attributes, unit);
7359
+ return readyToPrintPdf({ modelId: MODEL_ID10, dieline, dimensions: dimData, attributes, unit, factor, theme });
7006
7360
  }
7007
7361
  };
7008
7362
  }, [attributes, dieline, factor, unit, serializeSvg, theme]);
@@ -7069,6 +7423,7 @@ var CANVAS_BECF_B_12109 = forwardRef(
7069
7423
  });
7070
7424
  },
7071
7425
  exportDimension: () => dieLineRef.current.exportDimension(),
7426
+ readyToPrint: () => dieLineRef.current.readyToPrint(),
7072
7427
  resetView: () => canvasRef.current?.resetView(),
7073
7428
  fitView: () => canvasRef.current?.fitView()
7074
7429
  }), [serializeCanvasSvg, dieline.viewBox.width, dieline.viewBox.height]);
@@ -7751,6 +8106,18 @@ var DIE_LINE_BECF_10A0A = forwardRef(
7751
8106
  factor,
7752
8107
  theme
7753
8108
  });
8109
+ },
8110
+ readyToPrint: async () => {
8111
+ const dimData = generateDimensions11(attributes, unit);
8112
+ return readyToPrintPdf({
8113
+ modelId: MODEL_ID11,
8114
+ dieline,
8115
+ dimensions: dimData,
8116
+ attributes,
8117
+ unit,
8118
+ factor,
8119
+ theme
8120
+ });
7754
8121
  }
7755
8122
  };
7756
8123
  }, [attributes, dieline, factor, unit, serializeSvg, theme]);
@@ -7919,6 +8286,7 @@ var CANVAS_BECF_10A0A = forwardRef((props, ref) => {
7919
8286
  });
7920
8287
  },
7921
8288
  exportDimension: () => dieLineRef.current.exportDimension(),
8289
+ readyToPrint: () => dieLineRef.current.readyToPrint(),
7922
8290
  resetView: () => canvasRef.current?.resetView(),
7923
8291
  fitView: () => canvasRef.current?.fitView()
7924
8292
  }),
@@ -11273,12 +11641,12 @@ var AUTO_LAYOUT = forwardRef(
11273
11641
  });
11274
11642
  }
11275
11643
  if (pdfGriper > 0) {
11276
- const hexToRgb2 = (hex) => ({
11644
+ const hexToRgb3 = (hex) => ({
11277
11645
  r: parseInt(hex.slice(1, 3), 16),
11278
11646
  g: parseInt(hex.slice(3, 5), 16),
11279
11647
  b: parseInt(hex.slice(5, 7), 16)
11280
11648
  });
11281
- const gc = hexToRgb2(theme.colorGriper);
11649
+ const gc = hexToRgb3(theme.colorGriper);
11282
11650
  doc.setFillColor(gc.r, gc.g, gc.b);
11283
11651
  const depth = pdfGriper;
11284
11652
  switch (gripperSide) {
@@ -11301,7 +11669,7 @@ var AUTO_LAYOUT = forwardRef(
11301
11669
  const totalMarks = (ARROW_COLORS_HEX.length - 1) * ARROW_SPACING2;
11302
11670
  const isHoriz = gripperSide === "top" || gripperSide === "bottom";
11303
11671
  ARROW_COLORS_HEX.forEach((hex, idx) => {
11304
- const ac = hexToRgb2(hex);
11672
+ const ac = hexToRgb3(hex);
11305
11673
  doc.setFillColor(ac.r, ac.g, ac.b);
11306
11674
  if (isHoriz) {
11307
11675
  const cx = (pw - totalMarks) / 2 + idx * ARROW_SPACING2;
@@ -11769,7 +12137,7 @@ var BECF_12101_DEFAULT_ATTRIBUTES = {
11769
12137
  length: 100,
11770
12138
  width: 50,
11771
12139
  height: 150,
11772
- glueArea: 13
12140
+ glueArea: 15
11773
12141
  };
11774
12142
 
11775
12143
  // src/statics/bags-pillows/becf-12109/DEFAULT_ATTRIBUTES.ts
@@ -11777,7 +12145,7 @@ var BECF_12109_DEFAULT_ATTRIBUTES = {
11777
12145
  length: 100,
11778
12146
  width: 50,
11779
12147
  height: 150,
11780
- glueArea: 13
12148
+ glueArea: 15
11781
12149
  };
11782
12150
 
11783
12151
  // src/statics/bags-pillows/becf-c-12101/DEFAULT_ATTRIBUTES.ts
@@ -11785,7 +12153,7 @@ var BECF_C_12101_DEFAULT_ATTRIBUTES = {
11785
12153
  length: 100,
11786
12154
  width: 50,
11787
12155
  height: 150,
11788
- glueArea: 13
12156
+ glueArea: 15
11789
12157
  };
11790
12158
 
11791
12159
  // src/statics/bags-pillows/becf-c-12109/DEFAULT_ATTRIBUTES.ts
@@ -11793,7 +12161,7 @@ var BECF_C_12109_DEFAULT_ATTRIBUTES = {
11793
12161
  length: 100,
11794
12162
  width: 50,
11795
12163
  height: 150,
11796
- glueArea: 13
12164
+ glueArea: 15
11797
12165
  };
11798
12166
 
11799
12167
  // src/statics/bags-pillows/becf-b-12101/DEFAULT_ATTRIBUTES.ts
@@ -11801,7 +12169,7 @@ var BECF_B_12101_DEFAULT_ATTRIBUTES = {
11801
12169
  length: 100,
11802
12170
  width: 50,
11803
12171
  height: 150,
11804
- glueArea: 13
12172
+ glueArea: 15
11805
12173
  };
11806
12174
 
11807
12175
  // src/statics/bags-pillows/becf-b-12109/DEFAULT_ATTRIBUTES.ts
@@ -11809,7 +12177,7 @@ var BECF_B_12109_DEFAULT_ATTRIBUTES = {
11809
12177
  length: 100,
11810
12178
  width: 50,
11811
12179
  height: 150,
11812
- glueArea: 13
12180
+ glueArea: 15
11813
12181
  };
11814
12182
 
11815
12183
  // src/statics/snap-lock-boxes/becf-10a0a/DEFAULT_ATTRIBUTES.ts
@@ -11817,7 +12185,7 @@ var BECF_10A0A_DEFAULT_ATTRIBUTES = {
11817
12185
  length: 100,
11818
12186
  width: 50,
11819
12187
  height: 150,
11820
- glueArea: 13
12188
+ glueArea: 15
11821
12189
  };
11822
12190
 
11823
12191
  // src/statics/modelList.ts