gpui-bridge 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.
Files changed (2) hide show
  1. package/dist/protocol.d.ts +26 -1
  2. package/package.json +4 -4
@@ -136,7 +136,7 @@ export type HostMessage = {
136
136
  type: "event";
137
137
  id: NodeId;
138
138
  event: string;
139
- value?: string | number | null | string[] | TableSort | DiffSelection | CanvasPoint | SettingsChange | QuestionnaireAnswer | QuestionnaireAnswer[];
139
+ value?: string | number | null | string[] | TableSort | DiffSelection | CanvasPoint | DragPoint | NodeDrop | SettingsChange | QuestionnaireAnswer | QuestionnaireAnswer[];
140
140
  checked?: boolean;
141
141
  paths?: string[];
142
142
  } | {
@@ -245,6 +245,25 @@ export interface DivProps {
245
245
  contextMenu?: MenuItem[];
246
246
  /** Shown when the pointer rests on the div. */
247
247
  tooltip?: string;
248
+ /** With the `absolute` class: the user moves it inside its parent; `dragEnd` gives where it was left (PROTOCOL.md section 8). */
249
+ drag?: boolean;
250
+ /** Snaps a `drag` div to its parent's edges and its `drag` siblings within this many px (`true` = 8). */
251
+ magnetic?: boolean | number;
252
+ /** The user can carry the div to a `dropTarget`, which gets this string in `dropNode`. */
253
+ dragData?: string;
254
+ /** Takes divs with `dragData`; its `drag-over:` classes apply while one is carried over it. */
255
+ dropTarget?: boolean;
256
+ }
257
+ /** Where the user left a `drag` div: whole px inside its parent's border (`left-`/`top-`). */
258
+ export interface DragPoint {
259
+ x: number;
260
+ y: number;
261
+ }
262
+ /** A `dragData` div left on a `dropTarget`: its data and where its copy's corner was left, inside the zone. */
263
+ export interface NodeDrop {
264
+ data: string;
265
+ x: number;
266
+ y: number;
248
267
  }
249
268
  export interface TextProps {
250
269
  content?: string;
@@ -1278,6 +1297,12 @@ export interface NodeEvents {
1278
1297
  drop: {
1279
1298
  paths: string[];
1280
1299
  };
1300
+ dragEnd: {
1301
+ value: DragPoint;
1302
+ };
1303
+ dropNode: {
1304
+ value: NodeDrop;
1305
+ };
1281
1306
  };
1282
1307
  text: {};
1283
1308
  Button: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gpui-bridge",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Node.js client for the gpui-bridge native UI host",
5
5
  "license": "MIT",
6
6
  "author": "gpui-bridge contributors",
@@ -29,9 +29,9 @@
29
29
  "node": ">=22.6"
30
30
  },
31
31
  "optionalDependencies": {
32
- "@indios/gpui-bridge-darwin-arm64": "0.3.0",
33
- "@indios/gpui-bridge-linux-x64": "0.3.0",
34
- "@indios/gpui-bridge-win32-x64": "0.3.0"
32
+ "@indios/gpui-bridge-darwin-arm64": "0.4.0",
33
+ "@indios/gpui-bridge-linux-x64": "0.4.0",
34
+ "@indios/gpui-bridge-win32-x64": "0.4.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "^26.6.5",