@embedpdf/models 2.2.0 → 2.3.0

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.js CHANGED
@@ -218,6 +218,7 @@ function restoreOffset(offset, rotation, scaleFactor) {
218
218
  y: offsetY
219
219
  };
220
220
  }
221
+ const EMPTY_RECT = { origin: { x: 0, y: 0 }, size: { width: 0, height: 0 } };
221
222
  function boundingRect(rects) {
222
223
  if (rects.length === 0) return null;
223
224
  let minX = rects[0].origin.x, minY = rects[0].origin.y, maxX = rects[0].origin.x + rects[0].size.width, maxY = rects[0].origin.y + rects[0].size.height;
@@ -238,6 +239,9 @@ function boundingRect(rects) {
238
239
  }
239
240
  };
240
241
  }
242
+ function boundingRectOrEmpty(rects) {
243
+ return boundingRect(rects) ?? EMPTY_RECT;
244
+ }
241
245
  function buildUserToDeviceMatrix(rect, rotation, outW, outH) {
242
246
  const L = rect.origin.x;
243
247
  const B = rect.origin.y;
@@ -1088,6 +1092,12 @@ var PdfAnnotationLineEnding = /* @__PURE__ */ ((PdfAnnotationLineEnding2) => {
1088
1092
  PdfAnnotationLineEnding2[PdfAnnotationLineEnding2["Unknown"] = 10] = "Unknown";
1089
1093
  return PdfAnnotationLineEnding2;
1090
1094
  })(PdfAnnotationLineEnding || {});
1095
+ var PdfAnnotationReplyType = /* @__PURE__ */ ((PdfAnnotationReplyType2) => {
1096
+ PdfAnnotationReplyType2[PdfAnnotationReplyType2["Unknown"] = 0] = "Unknown";
1097
+ PdfAnnotationReplyType2[PdfAnnotationReplyType2["Reply"] = 1] = "Reply";
1098
+ PdfAnnotationReplyType2[PdfAnnotationReplyType2["Group"] = 2] = "Group";
1099
+ return PdfAnnotationReplyType2;
1100
+ })(PdfAnnotationReplyType || {});
1091
1101
  var PDF_FORM_FIELD_TYPE = /* @__PURE__ */ ((PDF_FORM_FIELD_TYPE2) => {
1092
1102
  PDF_FORM_FIELD_TYPE2[PDF_FORM_FIELD_TYPE2["UNKNOWN"] = 0] = "UNKNOWN";
1093
1103
  PDF_FORM_FIELD_TYPE2[PDF_FORM_FIELD_TYPE2["PUSHBUTTON"] = 1] = "PUSHBUTTON";
@@ -2029,6 +2039,7 @@ export {
2029
2039
  PdfAnnotationIcon,
2030
2040
  PdfAnnotationLineEnding,
2031
2041
  PdfAnnotationObjectStatus,
2042
+ PdfAnnotationReplyType,
2032
2043
  PdfAnnotationState,
2033
2044
  PdfAnnotationStateModel,
2034
2045
  PdfAnnotationSubtype,
@@ -2071,6 +2082,7 @@ export {
2071
2082
  blendModeToCss,
2072
2083
  blendModeValues,
2073
2084
  boundingRect,
2085
+ boundingRectOrEmpty,
2074
2086
  buildPermissions,
2075
2087
  buildUserToDeviceMatrix,
2076
2088
  calculateAngle,