gpui-bridge-react 0.3.0 → 0.4.0

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.
@@ -22,6 +22,25 @@ export interface DivProps extends SharedProps {
22
22
  tooltip?: string;
23
23
  /** Files dropped on the div. */
24
24
  onDrop?: (paths: string[]) => void;
25
+ /** With the `absolute` class: the user moves it inside its parent; `dragEnd` gives where it was left (PROTOCOL.md section 8). */
26
+ drag?: boolean;
27
+ /** Snaps a `drag` div to its parent's edges and its `drag` siblings within this many px (`true` = 8). */
28
+ magnetic?: boolean | number;
29
+ /** The user can carry the div to a `dropTarget`, which gets this string in `dropNode`. */
30
+ dragData?: string;
31
+ /** Takes divs with `dragData`; its `drag-over:` classes apply while one is carried over it. */
32
+ dropTarget?: boolean;
33
+ /** Where the user left a `drag` div. */
34
+ onDragEnd?: (point: {
35
+ x: number;
36
+ y: number;
37
+ }) => void;
38
+ /** A `dragData` div left on this `dropTarget`. */
39
+ onDropNode?: (drop: {
40
+ data: string;
41
+ x: number;
42
+ y: number;
43
+ }) => void;
25
44
  /** Makes the div focusable; called with keys such as `escape` or `ctrl-enter`. */
26
45
  onKeyDown?: (key: string) => void;
27
46
  children?: ReactNode;
@@ -114,6 +114,8 @@ const EVENT_PROPS = {
114
114
  onMenu: "menu",
115
115
  onKeyDown: "keyDown",
116
116
  onDrop: "drop",
117
+ onDragEnd: "dragEnd",
118
+ onDropNode: "dropNode",
117
119
  onOk: "ok",
118
120
  onCancel: "cancel",
119
121
  onClose: "close",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gpui-bridge-react",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "React renderer for gpui-bridge native UIs",
5
5
  "license": "MIT",
6
6
  "author": "gpui-bridge contributors",
@@ -29,14 +29,14 @@
29
29
  "node": ">=22.6"
30
30
  },
31
31
  "peerDependencies": {
32
- "gpui-bridge": "^0.3.0",
32
+ "gpui-bridge": "^0.4.0",
33
33
  "react": "^19.3.0"
34
34
  },
35
35
  "dependencies": {
36
36
  "react-reconciler": "0.34.0"
37
37
  },
38
38
  "devDependencies": {
39
- "gpui-bridge": "0.3.0",
39
+ "gpui-bridge": "0.4.0",
40
40
  "@types/node": "^26.6.5",
41
41
  "@types/react": "19.3.0",
42
42
  "@types/react-reconciler": "^0.34.0",