react-native-gtkx 0.4.0-alpha.2 → 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 (63) hide show
  1. package/README.md +35 -96
  2. package/dist/adw/index.js +3 -2
  3. package/dist/adw/index.js.map +1 -1
  4. package/dist/apis/host.gtkx.js.map +1 -1
  5. package/dist/components/modal.d.ts +1 -1
  6. package/dist/components/modal.js +16 -8
  7. package/dist/components/modal.js.map +1 -1
  8. package/dist/dnd/gtk-controllers.js +1 -1
  9. package/dist/dnd/gtk-controllers.js.map +1 -1
  10. package/dist/gtk/index.js +4 -3
  11. package/dist/gtk/index.js.map +1 -1
  12. package/dist/gtkx/bridge/adw.js +1 -1
  13. package/dist/gtkx/bridge/adw.js.map +1 -1
  14. package/dist/gtkx/bridge/core.d.ts +1 -2
  15. package/dist/gtkx/bridge/core.js +2 -5
  16. package/dist/gtkx/bridge/core.js.map +1 -1
  17. package/dist/gtkx/bridge/geometry.js +1 -1
  18. package/dist/gtkx/bridge/geometry.js.map +1 -1
  19. package/dist/gtkx/bridge/layout-manager.js +18 -5
  20. package/dist/gtkx/bridge/layout-manager.js.map +1 -1
  21. package/dist/gtkx/bridge/slot-portal.js.map +1 -1
  22. package/dist/gtkx/bridge/svg-node.js +13 -6
  23. package/dist/gtkx/bridge/svg-node.js.map +1 -1
  24. package/dist/gtkx/bridge/view-box.js +19 -10
  25. package/dist/gtkx/bridge/view-box.js.map +1 -1
  26. package/dist/gtkx/bridge/widgets.generated.adw.js +1 -1
  27. package/dist/gtkx/bridge/widgets.generated.adw.js.map +1 -1
  28. package/dist/mcp/bin.js +1 -1
  29. package/dist/mcp/bin.js.map +1 -1
  30. package/dist/mcp/data/generated.d.ts +860 -531
  31. package/dist/mcp/data/generated.js +952 -538
  32. package/dist/mcp/data/generated.js.map +1 -1
  33. package/dist/mcp/resolve.d.ts +2 -2
  34. package/dist/mcp/resolve.js +2 -2
  35. package/dist/mcp/resolve.js.map +1 -1
  36. package/dist/mcp/server.js +2 -2
  37. package/dist/mcp/server.js.map +1 -1
  38. package/dist/runner/host-dev.js +5 -0
  39. package/dist/runner/host-dev.js.map +1 -1
  40. package/dist/runner/host.js +15 -0
  41. package/dist/runner/host.js.map +1 -1
  42. package/dist/runner/index.d.ts +27 -0
  43. package/dist/runner/index.js +206 -1
  44. package/dist/runner/index.js.map +1 -1
  45. package/dist/sea/assemble.d.ts +9 -0
  46. package/dist/sea/assemble.js +16 -3
  47. package/dist/sea/assemble.js.map +1 -1
  48. package/dist/sea/bundle.d.ts +37 -2
  49. package/dist/sea/bundle.js +77 -5
  50. package/dist/sea/bundle.js.map +1 -1
  51. package/dist/sea/native-shim.js +4 -3
  52. package/dist/sea/native-shim.js.map +1 -1
  53. package/dist/testing/index.js +28 -0
  54. package/dist/testing/index.js.map +1 -1
  55. package/dist/vite/index.js +3 -3
  56. package/dist/vite/index.js.map +1 -1
  57. package/dist/vitest/index.d.ts +2 -2
  58. package/dist/vitest/index.js +1 -1
  59. package/dist/vitest/index.js.map +1 -1
  60. package/package.json +9 -9
  61. package/dist/gtkx/bridge/use-signal.d.ts +0 -2
  62. package/dist/gtkx/bridge/use-signal.js +0 -41
  63. package/dist/gtkx/bridge/use-signal.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-gtkx",
3
- "version": "0.4.0-alpha.2",
3
+ "version": "0.4.0",
4
4
  "description": "React Native components and APIs for Linux desktop, rendered as native GTK4 widgets via gtkx",
5
5
  "license": "MIT",
6
6
  "author": "Anton Petrov <anton@itsmepetrov.com>",
@@ -126,14 +126,14 @@
126
126
  }
127
127
  },
128
128
  "dependencies": {
129
- "@gtkx/cli": "1.0.0-rc.4",
130
- "@gtkx/codegen": "1.0.0-rc.4",
131
- "@gtkx/config": "1.0.0-rc.4",
132
- "@gtkx/css": "1.0.0-rc.4",
133
- "@gtkx/react": "1.0.0-rc.4",
134
- "@gtkx/runtime": "1.0.0-rc.4",
135
- "@gtkx/testing": "1.0.0-rc.4",
136
- "@gtkx/vitest": "1.0.0-rc.4",
129
+ "@gtkx/cli": "1.2.2",
130
+ "@gtkx/codegen": "1.2.2",
131
+ "@gtkx/config": "1.2.2",
132
+ "@gtkx/css": "1.2.2",
133
+ "@gtkx/react": "1.2.2",
134
+ "@gtkx/runtime": "1.2.2",
135
+ "@gtkx/testing": "1.2.2",
136
+ "@gtkx/vitest": "1.2.2",
137
137
  "@modelcontextprotocol/sdk": "^1.30.0",
138
138
  "rolldown": "^1.1.5",
139
139
  "yoga-layout": "^3.2.1",
@@ -1,2 +0,0 @@
1
- import { useSignal as useGtkxSignal } from "@gtkx/react";
2
- export declare const useSignal: typeof useGtkxSignal;
@@ -1,41 +0,0 @@
1
- // RC4-WORKAROUND(use-signal-stale-handler): see docs/gtkx-rc4-notes.md
2
- // @gtkx/react's useSignal documents that "each emission runs the handler from
3
- // the latest render", and rc.1 delivered that by pinning the handler in a ref
4
- // of its own. rc.3 routes it through React's useEffectEvent instead, and
5
- // react-reconciler@0.33.0 only refreshes useEffectEvent in
6
- // commitBeforeMutationEffects for `case 0` (FunctionComponent) — `case 11`
7
- // (ForwardRef) and `case 15` (SimpleMemoComponent) fall through unrefreshed.
8
- // Any useEffectEvent inside a memo or forwardRef component is pinned to its
9
- // mount closure permanently; this has nothing to do with useSignal
10
- // specifically (confirmed upstream: gtkx-org/gtkx#467) — plain
11
- // useEffectEvent called from an Effect fails identically. It reproduced for
12
- // us because our ScrollView is a forwardRef (components/scroll-view.tsx) with
13
- // the useSignal calls inside it; tree depth was a coincidence, not the
14
- // trigger. The consequence is not subtle — the mount-time scroll handler
15
- // windows a VirtualizedList against the data it saw at mount, so a list
16
- // whose rows arrive from a fetch renders EMPTY as soon as it is scrolled.
17
- //
18
- // Restore the documented contract at the bridge: keep the latest handler in a
19
- // ref of our own and hand gtkx a stable wrapper (stable so the connection is
20
- // never re-established, which is what its useEffectEvent was for). The ref is
21
- // refreshed in an INSERTION effect — the earliest commit phase, ahead of every
22
- // layout effect, so a signal emitted from one (the list's own scroll
23
- // corrections) already sees the handler from the render being committed.
24
- // React fixed the refresh on the 19.3 line (moved into
25
- // commitMutationEffectsOnFiber, covering `case 0/11/14/15` ahead of child
26
- // traversal), but there is no stable 0.34.x gtkx release yet and the React
27
- // canaries pin an exact prerelease peer, so this wrapper stays until a
28
- // stable React 19.3 ships — not "when useSignal is fixed" (see gtkx#467).
29
- import { useSignal as useGtkxSignal } from "@gtkx/react";
30
- import { useCallback, useInsertionEffect, useRef } from "react";
31
- export const useSignal = (object, signal, handler, options) => {
32
- // The handler type is generic in the signal name; the wrapper only forwards
33
- // arguments, so it crosses that boundary as an untyped callable.
34
- const latest = useRef(() => undefined);
35
- useInsertionEffect(() => {
36
- latest.current = handler;
37
- });
38
- const stable = useCallback((...args) => latest.current(...args), []);
39
- useGtkxSignal(object, signal, stable, options);
40
- };
41
- //# sourceMappingURL=use-signal.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-signal.js","sourceRoot":"","sources":["../../../src/gtkx/bridge/use-signal.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,8EAA8E;AAC9E,8EAA8E;AAC9E,yEAAyE;AACzE,2DAA2D;AAC3D,2EAA2E;AAC3E,6EAA6E;AAC7E,4EAA4E;AAC5E,mEAAmE;AACnE,+DAA+D;AAC/D,4EAA4E;AAC5E,8EAA8E;AAC9E,uEAAuE;AACvE,yEAAyE;AACzE,wEAAwE;AACxE,0EAA0E;AAC1E,EAAE;AACF,8EAA8E;AAC9E,6EAA6E;AAC7E,8EAA8E;AAC9E,+EAA+E;AAC/E,qEAAqE;AACrE,yEAAyE;AACzE,uDAAuD;AACvD,0EAA0E;AAC1E,2EAA2E;AAC3E,uEAAuE;AACvE,0EAA0E;AAC1E,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAI/D,MAAM,CAAC,MAAM,SAAS,GAAyB,CAC7C,MAAM,EACN,MAAM,EACN,OAAO,EACP,OAAO,EACP,EAAE;IACF,4EAA4E;IAC5E,iEAAiE;IACjE,MAAM,MAAM,GAAG,MAAM,CAAa,GAAG,EAAE,CAAC,SAAS,CAAC,CAAA;IAClD,kBAAkB,CAAC,GAAG,EAAE;QACtB,MAAM,CAAC,OAAO,GAAG,OAAgC,CAAA;IACnD,CAAC,CAAC,CAAA;IACF,MAAM,MAAM,GAAG,WAAW,CACxB,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,EACpC,EAAE,CACH,CAAA;IACD,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAmC,EAAE,OAAO,CAAC,CAAA;AAC7E,CAAC,CAAA","sourcesContent":["// RC4-WORKAROUND(use-signal-stale-handler): see docs/gtkx-rc4-notes.md\n// @gtkx/react's useSignal documents that \"each emission runs the handler from\n// the latest render\", and rc.1 delivered that by pinning the handler in a ref\n// of its own. rc.3 routes it through React's useEffectEvent instead, and\n// react-reconciler@0.33.0 only refreshes useEffectEvent in\n// commitBeforeMutationEffects for `case 0` (FunctionComponent) — `case 11`\n// (ForwardRef) and `case 15` (SimpleMemoComponent) fall through unrefreshed.\n// Any useEffectEvent inside a memo or forwardRef component is pinned to its\n// mount closure permanently; this has nothing to do with useSignal\n// specifically (confirmed upstream: gtkx-org/gtkx#467) — plain\n// useEffectEvent called from an Effect fails identically. It reproduced for\n// us because our ScrollView is a forwardRef (components/scroll-view.tsx) with\n// the useSignal calls inside it; tree depth was a coincidence, not the\n// trigger. The consequence is not subtle — the mount-time scroll handler\n// windows a VirtualizedList against the data it saw at mount, so a list\n// whose rows arrive from a fetch renders EMPTY as soon as it is scrolled.\n//\n// Restore the documented contract at the bridge: keep the latest handler in a\n// ref of our own and hand gtkx a stable wrapper (stable so the connection is\n// never re-established, which is what its useEffectEvent was for). The ref is\n// refreshed in an INSERTION effect — the earliest commit phase, ahead of every\n// layout effect, so a signal emitted from one (the list's own scroll\n// corrections) already sees the handler from the render being committed.\n// React fixed the refresh on the 19.3 line (moved into\n// commitMutationEffectsOnFiber, covering `case 0/11/14/15` ahead of child\n// traversal), but there is no stable 0.34.x gtkx release yet and the React\n// canaries pin an exact prerelease peer, so this wrapper stays until a\n// stable React 19.3 ships — not \"when useSignal is fixed\" (see gtkx#467).\nimport { useSignal as useGtkxSignal } from \"@gtkx/react\"\nimport { useCallback, useInsertionEffect, useRef } from \"react\"\n\ntype AnyHandler = (...args: unknown[]) => unknown\n\nexport const useSignal: typeof useGtkxSignal = (\n object,\n signal,\n handler,\n options,\n) => {\n // The handler type is generic in the signal name; the wrapper only forwards\n // arguments, so it crosses that boundary as an untyped callable.\n const latest = useRef<AnyHandler>(() => undefined)\n useInsertionEffect(() => {\n latest.current = handler as unknown as AnyHandler\n })\n const stable = useCallback<AnyHandler>(\n (...args) => latest.current(...args),\n [],\n )\n useGtkxSignal(object, signal, stable as unknown as typeof handler, options)\n}\n"]}