@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.js CHANGED
@@ -1683,6 +1683,7 @@ var FileCard = ({
1683
1683
  const [newName, setNewName] = React7.useState(file.name);
1684
1684
  const fileSelectedPages = file.pages.filter((p) => selectedPageIds.includes(p.id));
1685
1685
  const allPagesSelected = file.pages.length > 0 && fileSelectedPages.length === file.pages.length;
1686
+ const pendingDropdownAction = React7.useRef(null);
1686
1687
  const [{ isDraggingFile }, dragFile] = reactDnd.useDrag({
1687
1688
  type: DND_TYPES.FILE,
1688
1689
  item: () => {
@@ -1787,23 +1788,38 @@ var FileCard = ({
1787
1788
  ] }) }),
1788
1789
  /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu, { children: [
1789
1790
  /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "ghost", size: "sm", className: "hover:bg-gray-100 rounded-lg", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontal, { className: "h-4 w-4" }) }) }),
1790
- /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuContent, { align: "end", className: "w-52", children: [
1791
- /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuItem, { onClick: () => setIsRenaming(true), children: [
1792
- /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "h-4 w-4 mr-2", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntime.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" }) }),
1793
- "Rename File"
1794
- ] }),
1795
- /* @__PURE__ */ jsxRuntime.jsxs(
1796
- DropdownMenuItem,
1797
- {
1798
- onClick: () => onRemoveFile(file.id),
1799
- className: "text-red-600 hover:text-red-700 hover:bg-red-50 focus:text-red-700 focus:bg-red-50",
1800
- children: [
1801
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "h-4 w-4 mr-2" }),
1802
- "Remove File"
1803
- ]
1804
- }
1805
- )
1806
- ] })
1791
+ /* @__PURE__ */ jsxRuntime.jsxs(
1792
+ DropdownMenuContent,
1793
+ {
1794
+ align: "end",
1795
+ className: "w-52",
1796
+ onCloseAutoFocus: () => {
1797
+ pendingDropdownAction.current?.();
1798
+ pendingDropdownAction.current = null;
1799
+ },
1800
+ children: [
1801
+ /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuItem, { onSelect: () => {
1802
+ pendingDropdownAction.current = () => setIsRenaming(true);
1803
+ }, children: [
1804
+ /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "h-4 w-4 mr-2", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntime.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" }) }),
1805
+ "Rename File"
1806
+ ] }),
1807
+ /* @__PURE__ */ jsxRuntime.jsxs(
1808
+ DropdownMenuItem,
1809
+ {
1810
+ onSelect: () => {
1811
+ pendingDropdownAction.current = () => onRemoveFile(file.id);
1812
+ },
1813
+ className: "text-red-600 hover:text-red-700 hover:bg-red-50 focus:text-red-700 focus:bg-red-50",
1814
+ children: [
1815
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "h-4 w-4 mr-2" }),
1816
+ "Remove File"
1817
+ ]
1818
+ }
1819
+ )
1820
+ ]
1821
+ }
1822
+ )
1807
1823
  ] })
1808
1824
  ] })
1809
1825
  ] }) }),