@signiphi/page-assembly 0.2.0-beta.5 → 0.2.0-beta.7

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
@@ -1656,6 +1656,7 @@ var FileCard = ({
1656
1656
  const [newName, setNewName] = useState(file.name);
1657
1657
  const fileSelectedPages = file.pages.filter((p) => selectedPageIds.includes(p.id));
1658
1658
  const allPagesSelected = file.pages.length > 0 && fileSelectedPages.length === file.pages.length;
1659
+ const pendingDropdownAction = useRef(null);
1659
1660
  const [{ isDraggingFile }, dragFile] = useDrag({
1660
1661
  type: DND_TYPES.FILE,
1661
1662
  item: () => {
@@ -1760,23 +1761,38 @@ var FileCard = ({
1760
1761
  ] }) }),
1761
1762
  /* @__PURE__ */ jsxs(DropdownMenu, { children: [
1762
1763
  /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Button, { type: "button", variant: "ghost", size: "sm", className: "hover:bg-gray-100 rounded-lg", children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" }) }) }),
1763
- /* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", className: "w-52", children: [
1764
- /* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: () => setIsRenaming(true), children: [
1765
- /* @__PURE__ */ jsx("svg", { className: "h-4 w-4 mr-2", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" }) }),
1766
- "Rename File"
1767
- ] }),
1768
- /* @__PURE__ */ jsxs(
1769
- DropdownMenuItem,
1770
- {
1771
- onClick: () => onRemoveFile(file.id),
1772
- className: "text-red-600 hover:text-red-700 hover:bg-red-50 focus:text-red-700 focus:bg-red-50",
1773
- children: [
1774
- /* @__PURE__ */ jsx(Trash2, { className: "h-4 w-4 mr-2" }),
1775
- "Remove File"
1776
- ]
1777
- }
1778
- )
1779
- ] })
1764
+ /* @__PURE__ */ jsxs(
1765
+ DropdownMenuContent,
1766
+ {
1767
+ align: "end",
1768
+ className: "w-52",
1769
+ onCloseAutoFocus: () => {
1770
+ pendingDropdownAction.current?.();
1771
+ pendingDropdownAction.current = null;
1772
+ },
1773
+ children: [
1774
+ /* @__PURE__ */ jsxs(DropdownMenuItem, { onSelect: () => {
1775
+ pendingDropdownAction.current = () => setIsRenaming(true);
1776
+ }, children: [
1777
+ /* @__PURE__ */ jsx("svg", { className: "h-4 w-4 mr-2", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" }) }),
1778
+ "Rename File"
1779
+ ] }),
1780
+ /* @__PURE__ */ jsxs(
1781
+ DropdownMenuItem,
1782
+ {
1783
+ onSelect: () => {
1784
+ pendingDropdownAction.current = () => onRemoveFile(file.id);
1785
+ },
1786
+ className: "text-red-600 hover:text-red-700 hover:bg-red-50 focus:text-red-700 focus:bg-red-50",
1787
+ children: [
1788
+ /* @__PURE__ */ jsx(Trash2, { className: "h-4 w-4 mr-2" }),
1789
+ "Remove File"
1790
+ ]
1791
+ }
1792
+ )
1793
+ ]
1794
+ }
1795
+ )
1780
1796
  ] })
1781
1797
  ] })
1782
1798
  ] }) }),