@signiphi/page-assembly 0.2.0-beta.1 → 0.2.0-beta.2

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
@@ -1595,7 +1595,7 @@ var PageAssembler = forwardRef(
1595
1595
  const fileMap = /* @__PURE__ */ new Map();
1596
1596
  for (const file of state.files) {
1597
1597
  fileMap.set(file.id, file);
1598
- if (file.type === "pdf" && file.originalBytes) {
1598
+ if (file.type === "pdf" && file.originalBytes && file.originalBytes.length > 0) {
1599
1599
  try {
1600
1600
  const sourcePdf = await PDFDocument2.load(file.originalBytes);
1601
1601
  loadedPdfs.set(file.id, sourcePdf);
@@ -1643,7 +1643,8 @@ var PageAssembler = forwardRef(
1643
1643
  }
1644
1644
  }
1645
1645
  const pdfBytes = await combinedDoc.save();
1646
- const blob = new Blob([pdfBytes.buffer], { type: "application/pdf" });
1646
+ const arrayBuffer = pdfBytes.buffer.slice(pdfBytes.byteOffset, pdfBytes.byteOffset + pdfBytes.byteLength);
1647
+ const blob = new Blob([arrayBuffer], { type: "application/pdf" });
1647
1648
  return blob;
1648
1649
  } catch (error) {
1649
1650
  console.error("Error assembling PDF:", error);
@@ -1657,7 +1658,7 @@ var PageAssembler = forwardRef(
1657
1658
  isBusy: () => isLoading,
1658
1659
  getState: () => state
1659
1660
  }), [state, summary, isLoading]);
1660
- return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx(DndProvider, { backend: HTML5Backend, children: /* @__PURE__ */ jsxs("div", { className: cn("space-y-6 pb-6", className), children: [
1661
+ return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx(DndProvider, { backend: HTML5Backend, children: /* @__PURE__ */ jsxs("div", { className: cn("space-y-3", className), children: [
1661
1662
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
1662
1663
  /* @__PURE__ */ jsxs("div", { children: [
1663
1664
  /* @__PURE__ */ jsx("h3", { className: "text-lg font-medium", children: "Page Assembly" }),
@@ -1748,9 +1749,9 @@ var PageAssembler = forwardRef(
1748
1749
  ]
1749
1750
  }
1750
1751
  ) : !disableFileUpload && /* @__PURE__ */ jsx(
1751
- Card,
1752
+ "div",
1752
1753
  {
1753
- className: "p-12 border-dashed border-2 border-gray-300 hover:border-gray-400 transition-colors cursor-pointer",
1754
+ className: "p-12 rounded-lg bg-card text-card-foreground cursor-pointer transition-all border-2 border-dashed border-border hover:border-primary/60 hover:bg-primary/10",
1754
1755
  onClick: handleFileUpload,
1755
1756
  onDrop: handleDrop,
1756
1757
  onDragOver: handleDragOver,