@gtkx/react 0.3.0 → 0.3.2

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/README.md CHANGED
@@ -64,7 +64,6 @@ npm install -D @types/react typescript
64
64
  Create your first app:
65
65
 
66
66
  ```tsx
67
- // src/app.tsx
68
67
  import { useState } from "react";
69
68
  import * as Gtk from "@gtkx/ffi/gtk";
70
69
  import { ApplicationWindow, Box, Button, Label, quit } from "@gtkx/react";
@@ -98,7 +97,6 @@ export const appId = "org.example.MyApp";
98
97
  ```
99
98
 
100
99
  ```tsx
101
- // src/index.tsx
102
100
  import { render } from "@gtkx/react";
103
101
  import App, { appId } from "./app.js";
104
102
 
@@ -147,7 +145,6 @@ import { cleanup, render, screen, userEvent, fireEvent } from "@gtkx/testing";
147
145
  import { AccessibleRole } from "@gtkx/ffi/gtk";
148
146
  import { App } from "./app.js";
149
147
 
150
- // Clean up after each test
151
148
  afterEach(async () => {
152
149
  await cleanup();
153
150
  });
@@ -1,4 +1,4 @@
1
- import { getObject, getObjectAddr } from "@gtkx/ffi";
1
+ import { getObject, getObjectId } from "@gtkx/ffi";
2
2
  import * as GObject from "@gtkx/ffi/gobject";
3
3
  import * as Gtk from "@gtkx/ffi/gtk";
4
4
  import { scheduleFlush } from "../batch.js";
@@ -245,7 +245,7 @@ export class ColumnViewColumnNode extends Node {
245
245
  }
246
246
  factory.connect("setup", (_self, listItemObj) => {
247
247
  const listItem = getObject(listItemObj.id);
248
- const id = getObjectAddr(listItemObj.id);
248
+ const id = getObjectId(listItemObj.id);
249
249
  const box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
250
250
  listItem.setChild(box);
251
251
  const fiberRoot = createFiberRoot(box);
@@ -255,7 +255,7 @@ export class ColumnViewColumnNode extends Node {
255
255
  });
256
256
  factory.connect("bind", (_self, listItemObj) => {
257
257
  const listItem = getObject(listItemObj.id);
258
- const id = getObjectAddr(listItemObj.id);
258
+ const id = getObjectId(listItemObj.id);
259
259
  const info = this.state.listItemCache.get(id);
260
260
  if (!info)
261
261
  return;
@@ -268,14 +268,14 @@ export class ColumnViewColumnNode extends Node {
268
268
  }
269
269
  });
270
270
  factory.connect("unbind", (_self, listItemObj) => {
271
- const id = getObjectAddr(listItemObj.id);
271
+ const id = getObjectId(listItemObj.id);
272
272
  const info = this.state.listItemCache.get(id);
273
273
  if (!info)
274
274
  return;
275
275
  reconciler.getInstance().updateContainer(null, info.fiberRoot, null, () => { });
276
276
  });
277
277
  factory.connect("teardown", (_self, listItemObj) => {
278
- const id = getObjectAddr(listItemObj.id);
278
+ const id = getObjectId(listItemObj.id);
279
279
  const info = this.state.listItemCache.get(id);
280
280
  if (info) {
281
281
  reconciler.getInstance().updateContainer(null, info.fiberRoot, null, () => { });
@@ -1,4 +1,4 @@
1
- import { getObject, getObjectAddr } from "@gtkx/ffi";
1
+ import { getObject, getObjectId } from "@gtkx/ffi";
2
2
  import * as Gtk from "@gtkx/ffi/gtk";
3
3
  import { scheduleFlush } from "../batch.js";
4
4
  import { isItemContainer } from "../container-interfaces.js";
@@ -29,7 +29,7 @@ export class ListViewNode extends Node {
29
29
  this.state.factory = factory;
30
30
  factory.connect("setup", (_self, listItemObj) => {
31
31
  const listItem = getObject(listItemObj.id);
32
- const id = getObjectAddr(listItemObj.id);
32
+ const id = getObjectId(listItemObj.id);
33
33
  const box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
34
34
  listItem.setChild(box);
35
35
  const fiberRoot = createFiberRoot(box);
@@ -39,7 +39,7 @@ export class ListViewNode extends Node {
39
39
  });
40
40
  factory.connect("bind", (_self, listItemObj) => {
41
41
  const listItem = getObject(listItemObj.id);
42
- const id = getObjectAddr(listItemObj.id);
42
+ const id = getObjectId(listItemObj.id);
43
43
  const info = this.state.listItemCache.get(id);
44
44
  if (!info)
45
45
  return;
@@ -49,14 +49,14 @@ export class ListViewNode extends Node {
49
49
  reconciler.getInstance().updateContainer(element, info.fiberRoot, null, () => { });
50
50
  });
51
51
  factory.connect("unbind", (_self, listItemObj) => {
52
- const id = getObjectAddr(listItemObj.id);
52
+ const id = getObjectId(listItemObj.id);
53
53
  const info = this.state.listItemCache.get(id);
54
54
  if (!info)
55
55
  return;
56
56
  reconciler.getInstance().updateContainer(null, info.fiberRoot, null, () => { });
57
57
  });
58
58
  factory.connect("teardown", (_self, listItemObj) => {
59
- const id = getObjectAddr(listItemObj.id);
59
+ const id = getObjectId(listItemObj.id);
60
60
  const info = this.state.listItemCache.get(id);
61
61
  if (info) {
62
62
  reconciler.getInstance().updateContainer(null, info.fiberRoot, null, () => { });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gtkx/react",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Build GTK4 desktop applications with React and TypeScript",
5
5
  "keywords": [
6
6
  "gtk",
@@ -36,10 +36,10 @@
36
36
  ],
37
37
  "dependencies": {
38
38
  "react-reconciler": "0.33.0",
39
- "@gtkx/ffi": "0.3.0"
39
+ "@gtkx/ffi": "0.3.2"
40
40
  },
41
41
  "devDependencies": {
42
- "@gtkx/gir": "0.3.0"
42
+ "@gtkx/gir": "0.3.2"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "react": "^19"