@deepseek-ai/dsh-client-ui-primitives 0.1.0-rc.3 → 0.1.0-rc.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/lib/index.js CHANGED
@@ -1744,6 +1744,34 @@ function useAnchoredMaxHeight(ref, cap, signal) {
1744
1744
  return maxHeight;
1745
1745
  }
1746
1746
  //#endregion
1747
+ //#region lib/types/useDismissOnOutsidePointer.js
1748
+ /**
1749
+ * Outside-pointer dismissal for trigger-owned popovers (jobs list, Cordis
1750
+ * panel): while the surface is open, a pointerdown outside the root closes it.
1751
+ */
1752
+ /**
1753
+ * Close an open popover when a pointerdown lands outside its root element.
1754
+ * @param root - element containing both the trigger and the open surface.
1755
+ * @param open - whether the surface is showing; false detaches the listener.
1756
+ * @param setOpen - state setter invoked with false on an outside pointerdown.
1757
+ */
1758
+ function useDismissOnOutsidePointer(root, open, setOpen) {
1759
+ useEffect(() => {
1760
+ if (!open) return;
1761
+ const closeOutside = (event) => {
1762
+ if (event.target instanceof Node && !root.current?.contains(event.target)) setOpen(false);
1763
+ };
1764
+ document.addEventListener("pointerdown", closeOutside);
1765
+ return () => {
1766
+ document.removeEventListener("pointerdown", closeOutside);
1767
+ };
1768
+ }, [
1769
+ root,
1770
+ open,
1771
+ setOpen
1772
+ ]);
1773
+ }
1774
+ //#endregion
1747
1775
  //#region lib/types/clipboard.js
1748
1776
  /**
1749
1777
  * Write text to the host clipboard, preferring the async Clipboard API and
@@ -5852,4 +5880,4 @@ function extractMarkdownPlainText(markdown, options = {}) {
5852
5880
  }
5853
5881
  }
5854
5882
  //#endregion
5855
- export { BrandWordmark, Button, CodeBlock, ConnectionBanner, DEFAULT_DIFF_MAX_LINES, DEFAULT_READ_MAX_LINES, DEFAULT_SEARCH_MAX_LINES, DEFAULT_TERMINAL_MAX_LINES, DiffBlock, DisclosureRow, FishLogo, HoverCard, IconAgentPresetOutline16, IconApiOutline14, IconArchiveOutline20, IconBranchOutline16, IconBrowseOutline16, IconCheckOutline14, IconCheckOutline16, IconChecklistOutline14, IconChevronDownOutline14, IconChevronLeftOutline14, IconChevronRightOutline14, IconChevronUpOutline14, IconCloseFill14, IconCloseOutline16, IconCodeOutline16, IconCopyOutline16, IconCordisPluginOutline14, IconDarkOutline16, IconDataOutline16, IconDislikeFill16, IconDislikeOutline16, IconDownloadOutline16, IconEditOutline16, IconEllipsisOutline16, IconEnhanceOutline16, IconFolderClose16, IconFolderOpen16, IconFolderOpenOutline16, IconFollowsystemOutline16, IconFullscreenOutline16, IconGlobeOutline14, IconGoalOutline16, IconInspectOutline12, IconLightOutline16, IconLikeFill16, IconLikeOutline16, IconLinkOutline14, IconLinkOutline16, IconListPenOutline16, IconLoadingOutline16, IconNewChatOutline16, IconPanelLeftOutline16, IconPaperclipOutline16, IconPauseOutline16, IconPersonalizationOutline16, IconPlayOutline16, IconPlusOutline16, IconProjectAddOutline16, IconQuestionOutline14, IconQueueOutline14, IconRefreshOutline14, IconRefreshOutline16, IconRightUpOutline14, IconRightUpOutline16, IconSearchOutline16, IconSendOutline14, IconSendOutline16, IconSettingsOutline14, IconSettingsOutline16, IconShareOutline16, IconSkillOutline16, IconSparkle16, IconStopFill16, IconThinkOutline14, IconThinkOutline16, IconTrashOutline16, IconTreeCorner8x10, IconTriangleRightFill14, IconUserOutline16, IconWarningOutline16, Input, JsonBlock, JsonTree, MarkdownText, Menu, MessageText, Modal, OnboardingSurface, Pill, ReadBlock, RiskConfirmation, SearchBlock, StateDot, TerminalBlock, Toast, Tooltip, WebBlock, extractMarkdownPlainText, useAnchoredMaxHeight, writeClipboard };
5883
+ export { BrandWordmark, Button, CodeBlock, ConnectionBanner, DEFAULT_DIFF_MAX_LINES, DEFAULT_READ_MAX_LINES, DEFAULT_SEARCH_MAX_LINES, DEFAULT_TERMINAL_MAX_LINES, DiffBlock, DisclosureRow, FishLogo, HoverCard, IconAgentPresetOutline16, IconApiOutline14, IconArchiveOutline20, IconBranchOutline16, IconBrowseOutline16, IconCheckOutline14, IconCheckOutline16, IconChecklistOutline14, IconChevronDownOutline14, IconChevronLeftOutline14, IconChevronRightOutline14, IconChevronUpOutline14, IconCloseFill14, IconCloseOutline16, IconCodeOutline16, IconCopyOutline16, IconCordisPluginOutline14, IconDarkOutline16, IconDataOutline16, IconDislikeFill16, IconDislikeOutline16, IconDownloadOutline16, IconEditOutline16, IconEllipsisOutline16, IconEnhanceOutline16, IconFolderClose16, IconFolderOpen16, IconFolderOpenOutline16, IconFollowsystemOutline16, IconFullscreenOutline16, IconGlobeOutline14, IconGoalOutline16, IconInspectOutline12, IconLightOutline16, IconLikeFill16, IconLikeOutline16, IconLinkOutline14, IconLinkOutline16, IconListPenOutline16, IconLoadingOutline16, IconNewChatOutline16, IconPanelLeftOutline16, IconPaperclipOutline16, IconPauseOutline16, IconPersonalizationOutline16, IconPlayOutline16, IconPlusOutline16, IconProjectAddOutline16, IconQuestionOutline14, IconQueueOutline14, IconRefreshOutline14, IconRefreshOutline16, IconRightUpOutline14, IconRightUpOutline16, IconSearchOutline16, IconSendOutline14, IconSendOutline16, IconSettingsOutline14, IconSettingsOutline16, IconShareOutline16, IconSkillOutline16, IconSparkle16, IconStopFill16, IconThinkOutline14, IconThinkOutline16, IconTrashOutline16, IconTreeCorner8x10, IconTriangleRightFill14, IconUserOutline16, IconWarningOutline16, Input, JsonBlock, JsonTree, MarkdownText, Menu, MessageText, Modal, OnboardingSurface, Pill, ReadBlock, RiskConfirmation, SearchBlock, StateDot, TerminalBlock, Toast, Tooltip, WebBlock, extractMarkdownPlainText, useAnchoredMaxHeight, useDismissOnOutsidePointer, writeClipboard };
@@ -12,6 +12,7 @@ export { Input } from './Input.tsx';
12
12
  export { Menu } from './Menu.tsx';
13
13
  export type { MenuEntry, MenuItem, MenuSeparator, MenuLabel } from './Menu.tsx';
14
14
  export { useAnchoredMaxHeight } from './useAnchoredMaxHeight.ts';
15
+ export { useDismissOnOutsidePointer } from './useDismissOnOutsidePointer.ts';
15
16
  export { HoverCard } from './HoverCard.tsx';
16
17
  export { Modal } from './Modal.tsx';
17
18
  export { OnboardingSurface } from './OnboardingSurface.tsx';
@@ -0,0 +1,9 @@
1
+ import type { RefObject } from 'react';
2
+ /**
3
+ * Close an open popover when a pointerdown lands outside its root element.
4
+ * @param root - element containing both the trigger and the open surface.
5
+ * @param open - whether the surface is showing; false detaches the listener.
6
+ * @param setOpen - state setter invoked with false on an outside pointerdown.
7
+ */
8
+ export declare function useDismissOnOutsidePointer(root: RefObject<HTMLElement | null>, open: boolean, setOpen: (open: boolean) => void): void;
9
+ //# sourceMappingURL=useDismissOnOutsidePointer.d.ts.map
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-client-ui-primitives",
3
3
  "description": "Pure React atoms for the dsh web UI: controls, icons, markdown, and JSON inspectors (zero cordis)",
4
- "version": "0.1.0-rc.3",
4
+ "version": "0.1.0-rc.7",
5
5
  "publishConfig": {
6
- "access": "restricted"
6
+ "access": "public"
7
7
  },
8
8
  "repository": {
9
9
  "type": "git",
@@ -51,8 +51,8 @@
51
51
  "devDependencies": {
52
52
  "@types/react": "~18.3.1",
53
53
  "@types/react-dom": "~18.3.0",
54
- "@deepseek-ai/dsh-invariants": "^0.1.0-rc.3",
55
- "@deepseek-ai/cordis": "^4.0.1"
54
+ "@deepseek-ai/cordis": "^4.0.1",
55
+ "@deepseek-ai/dsh-invariants": "^0.1.0-rc.7"
56
56
  },
57
57
  "files": [
58
58
  "lib/index.js",
@@ -60,7 +60,7 @@
60
60
  "lib/types/**/*.d.ts"
61
61
  ],
62
62
  "peerDependencies": {
63
- "@deepseek-ai/dsh-invariants": "^0.1.0-rc.3",
63
+ "@deepseek-ai/dsh-invariants": "^0.1.0-rc.7",
64
64
  "@deepseek-ai/cordis": "^4.0.1"
65
65
  }
66
66
  }