rita-workspace 0.5.44 → 0.5.45

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
@@ -1767,6 +1767,20 @@ var DrawingsDialog = ({
1767
1767
  newFolderInputRef.current.focus();
1768
1768
  }
1769
1769
  }, [creatingFolder]);
1770
+ (0, import_react5.useEffect)(() => {
1771
+ if (!open) return;
1772
+ const handler = (e) => {
1773
+ if (e.key !== "Escape") return;
1774
+ const active = document.activeElement;
1775
+ const tag = active?.tagName;
1776
+ if (tag === "INPUT" || tag === "TEXTAREA" || active?.isContentEditable) {
1777
+ return;
1778
+ }
1779
+ onClose();
1780
+ };
1781
+ document.addEventListener("keydown", handler);
1782
+ return () => document.removeEventListener("keydown", handler);
1783
+ }, [open, onClose]);
1770
1784
  const handleMouseDown = (0, import_react5.useCallback)((e) => {
1771
1785
  if (e.target.closest("button")) return;
1772
1786
  if (e.target.closest("input")) return;
package/dist/index.mjs CHANGED
@@ -1695,6 +1695,20 @@ var DrawingsDialog = ({
1695
1695
  newFolderInputRef.current.focus();
1696
1696
  }
1697
1697
  }, [creatingFolder]);
1698
+ useEffect3(() => {
1699
+ if (!open) return;
1700
+ const handler = (e) => {
1701
+ if (e.key !== "Escape") return;
1702
+ const active = document.activeElement;
1703
+ const tag = active?.tagName;
1704
+ if (tag === "INPUT" || tag === "TEXTAREA" || active?.isContentEditable) {
1705
+ return;
1706
+ }
1707
+ onClose();
1708
+ };
1709
+ document.addEventListener("keydown", handler);
1710
+ return () => document.removeEventListener("keydown", handler);
1711
+ }, [open, onClose]);
1698
1712
  const handleMouseDown = useCallback2((e) => {
1699
1713
  if (e.target.closest("button")) return;
1700
1714
  if (e.target.closest("input")) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rita-workspace",
3
- "version": "0.5.44",
3
+ "version": "0.5.45",
4
4
  "description": "Multi-drawing workspace feature for Rita (Excalidraw fork)",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",