react-x11 2.52.0 → 2.53.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 (112) hide show
  1. package/README.md +10 -10
  2. package/docs/README.md +160 -314
  3. package/docs/accessibility.md +176 -229
  4. package/docs/appearance.md +77 -176
  5. package/docs/click-to-component.md +18 -51
  6. package/docs/clipboard.md +40 -59
  7. package/docs/components.md +518 -1036
  8. package/docs/dbus.md +61 -133
  9. package/docs/debugging.md +152 -245
  10. package/docs/desktop-calendar.md +51 -88
  11. package/docs/desktop.md +222 -347
  12. package/docs/devtools.md +50 -167
  13. package/docs/drag-and-drop.md +126 -204
  14. package/docs/ecosystem/animation.md +91 -125
  15. package/docs/ecosystem/data-fetching.md +38 -53
  16. package/docs/ecosystem/dev-tooling.md +159 -202
  17. package/docs/ecosystem/forms.md +61 -97
  18. package/docs/ecosystem/headless.md +64 -89
  19. package/docs/ecosystem/i18n.md +18 -21
  20. package/docs/ecosystem/icons.md +93 -126
  21. package/docs/ecosystem/layout.md +42 -52
  22. package/docs/ecosystem/routing.md +18 -29
  23. package/docs/ecosystem/state.md +71 -88
  24. package/docs/ecosystem/testing.md +131 -157
  25. package/docs/ecosystem/theming.md +119 -165
  26. package/docs/ecosystem.md +145 -179
  27. package/docs/elements.md +1091 -1774
  28. package/docs/embedding.md +83 -132
  29. package/docs/events.md +412 -695
  30. package/docs/extending.md +784 -1326
  31. package/docs/eyedropper.md +63 -122
  32. package/docs/filedialog.md +71 -107
  33. package/docs/frame.md +195 -339
  34. package/docs/gl.md +65 -62
  35. package/docs/globalmenu.md +63 -146
  36. package/docs/macos.md +531 -3234
  37. package/docs/notifications.md +33 -47
  38. package/docs/packaging.md +166 -309
  39. package/docs/permissions.md +9 -14
  40. package/docs/react-features.md +81 -106
  41. package/docs/remote.md +32 -76
  42. package/docs/scale.md +72 -186
  43. package/docs/styling.md +329 -547
  44. package/docs/system.md +200 -280
  45. package/docs/testing.md +63 -83
  46. package/docs/typescript.md +6 -48
  47. package/docs/uri-schemes.md +67 -107
  48. package/docs/wayland-backend.md +200 -459
  49. package/docs/windows-integrations.md +75 -131
  50. package/docs/windows.md +343 -1367
  51. package/package.json +3 -2
  52. package/src/Reconciler.js +2 -2
  53. package/src/a11y.js +1 -1
  54. package/src/backend/context2d.js +3 -3
  55. package/src/bootstrap.js +1 -1
  56. package/src/cocoa/app.js +6 -6
  57. package/src/cocoa/bezels.js +1 -1
  58. package/src/cocoa/fonts.js +1 -1
  59. package/src/cocoa/globalmenu.js +1 -1
  60. package/src/cocoa/keymap.js +1 -1
  61. package/src/cocoa/panewindow.js +1 -1
  62. package/src/cocoa/player.js +1 -1
  63. package/src/cocoa/presenter.js +2 -2
  64. package/src/cocoa/promotion.js +1 -1
  65. package/src/cocoa/relaunch.js +1 -1
  66. package/src/cocoa/threaded.js +1 -1
  67. package/src/cocoa/video.js +1 -1
  68. package/src/cocoa/window.js +4 -4
  69. package/src/components/Menu.js +7 -2
  70. package/src/components/Switch.js +1 -1
  71. package/src/components/native.js +1 -1
  72. package/src/dnd.js +2 -2
  73. package/src/glnodes.js +1 -1
  74. package/src/grid.js +1 -1
  75. package/src/layouts.js +1 -1
  76. package/src/nodes/animation.js +1 -1
  77. package/src/nodes/invalidate.js +1 -1
  78. package/src/nodes/layouthost.js +1 -1
  79. package/src/nodes/video.js +19 -8
  80. package/src/nodes/window/droptarget.js +1 -1
  81. package/src/pacing.js +1 -1
  82. package/src/refresh/index.js +2 -1
  83. package/src/types/video.d.ts +5 -2
  84. package/src/videobackend.js +28 -0
  85. package/src/videoframes.js +29 -16
  86. package/src/wayland/app.js +27 -0
  87. package/src/wayland/video.js +376 -0
  88. package/src/win32/a11y.js +1 -1
  89. package/src/win32/app.js +2 -2
  90. package/src/win32/fonts.js +1 -1
  91. package/src/win32/glarea.js +4 -4
  92. package/src/win32/overlay.js +1 -1
  93. package/src/win32/panewindow.js +3 -3
  94. package/src/win32/shell.js +1 -1
  95. package/src/win32/window.js +2 -2
  96. package/src/windowid.js +1 -1
  97. package/src/xvideo.js +189 -0
  98. package/docs/architecture/accessibility.md +0 -470
  99. package/docs/architecture/animation.md +0 -707
  100. package/docs/architecture/container-queries.md +0 -525
  101. package/docs/architecture/custom-layout.md +0 -334
  102. package/docs/architecture/drag-and-drop.md +0 -941
  103. package/docs/architecture/element-layer-contents.md +0 -622
  104. package/docs/architecture/frame-pacing.md +0 -255
  105. package/docs/architecture/grid-layout.md +0 -358
  106. package/docs/architecture/protocol-efficiency.md +0 -357
  107. package/docs/architecture/video.md +0 -1149
  108. package/docs/architecture/windowed-regions.md +0 -854
  109. package/docs/glx.md +0 -137
  110. package/docs/wayland.md +0 -545
  111. package/docs/windows-embedding.md +0 -271
  112. package/docs/windows-gl.md +0 -221
@@ -23,12 +23,11 @@ function Exporter() {
23
23
  }
24
24
  ```
25
25
 
26
- An in-app toast is deliberately **not** this. That is layout, and it belongs
27
- to whoever wants it; this page is about the desktop's own banners.
26
+ An in-app toast is **not** this; this page is about the desktop's own banners.
28
27
 
29
28
  ## The ladder
30
29
 
31
- The [file dialog](filedialog.md)'s shape again, four rungs:
30
+ Like the [file dialog](filedialog.md)'s, four rungs, chosen for you:
32
31
 
33
32
  | | | |
34
33
  | --- | ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -42,10 +41,6 @@ posting anything. Where none answers, `notify()` rejects with a **typed**
42
41
  `NoNotificationServiceError` — the signal to fall back to your own UI, not a
43
42
  crash — and `useNotifier().available` is that branch as render state.
44
43
 
45
- The top rung is never chosen by naming a backend: `notify()` asks the
46
- connection the tree renders through whether it has a centre, and whether that
47
- centre can deliver.
48
-
49
44
  ## `notify()` and the handle
50
45
 
51
46
  ```ts
@@ -63,12 +58,11 @@ await banner.update({ body }); // in place, where the rung can
63
58
  await banner.close(); // take it down, where the rung can
64
59
  ```
65
60
 
66
- **The daemon's vocabulary is the API's.** `urgency` is
61
+ **The vocabulary is freedesktop's on every rung.** `urgency` is
67
62
  `low | normal | critical`, an action is `{ key, label }`, a click on the
68
63
  banner itself is the action keyed `'default'`, and a banner that went away
69
- reports `'expired' | 'dismissed' | 'closed' | 'unknown'` — the freedesktop
70
- words, because it is a published protocol with many daemons and this is one
71
- of many clients. The cocoa rung translates into them.
64
+ reports `'expired' | 'dismissed' | 'closed' | 'unknown'`. The cocoa rung
65
+ translates into them.
72
66
 
73
67
  **Attribution is filled in for you.** On Linux the `desktop-entry` hint is
74
68
  the `appId` [`registerApplication()`](uri-schemes.md) established, which is
@@ -86,51 +80,41 @@ is nothing to pass.
86
80
  | `osascript` | posts anew | nothing | no | nothing |
87
81
  | `notify-send` | with an id, yes | nothing | no | nothing |
88
82
 
89
- `win32` sits with the shell-out rungs on everything but where it is shown:
90
- a `Shell_NotifyIcon` balloon is a real toast in a real action centre, and
91
- also a fire-and-forget one. Buttons, replies and a lifetime the app controls
92
- want the Windows App SDK's notification manager, which will not show anything
93
- at all until the system knows an AppUserModelID for the process — a
94
- Start-menu shortcut carrying one, or a registry registration. That is a
95
- packaging question ([windows.md](windows.md) §"Packaging and identity"), and
96
- a balloon is what can be shown without asking the user to install anything.
97
-
98
- The shell-out rungs are the crude floor: they show a banner and know nothing
99
- afterwards. `handle.backend` says which rung answered, so an app that cares
83
+ On `win32` the banner is a real toast in the action centre, but
84
+ fire-and-forget: buttons, replies and update-in-place would need an
85
+ AppUserModelID for the process, which is a packaging question
86
+ ([windows.md](windows.md) §"Packaging and identity").
87
+
88
+ The shell-out rungs show a banner and know nothing afterwards. `handle.backend` says which rung answered, so an app that cares
100
89
  can say "open the app to see it" there rather than promise a button it
101
90
  cannot deliver.
102
91
 
103
- **Actions on the bus are gated by the daemon.** Whether it can show buttons
104
- is one of its `GetCapabilities`, and an app that sends actions to a daemon
105
- without `actions` has silently produced a notification nobody can act on —
106
- so they are dropped with a development warning rather than sent blind.
107
- Capabilities are read once per bus session.
92
+ **Actions on the bus are gated by the daemon.** To a daemon that cannot show
93
+ buttons (no `actions` in its `GetCapabilities`, read once per bus session)
94
+ they are dropped with a development warning rather than sent blind.
108
95
 
109
96
  **A refusal is not fallen through.** On the cocoa backend the first post asks
110
- the system's authorization prompt, once per bundle. A user who declined the
111
- app's notifications has said something, and `notify()` rejects with the
112
- platform's error (`NotificationsDeniedError`) rather than posting through
113
- `osascript` by a side door.
114
-
115
- **A refusal is an answer; a prompt nobody saw is not.** The two look identical
116
- from the call — the authorization request comes back refused either way — so
117
- the rung reads the status again afterwards, because only a prompt moves it off
118
- `notDetermined`. A bundle macOS has not registered (an ad-hoc signature in a
119
- temp directory is the usual way to meet this) never gets the prompt, and
120
- reporting that as a denial would tell the user they declined something they
121
- were never shown. Nobody has turned anything off, so the ladder carries on to
122
- `osascript`; only `backend: 'cocoa'` turns it into an error, and that one says
123
- `notDetermined` rather than blaming the user.
124
-
125
- Which is why an app that counts progress should ask before it decides. `examples/notify.jsx` (`npm run examples:notify`) is a download manager built around exactly that: it posts one banner and updates it in place where the rung can, and on `osascript` or `notify-send` stays quiet and posts once at the end, because posting per step there would be four banners for one download.
97
+ the system's authorization prompt, once per bundle. If the user declined,
98
+ `notify()` rejects with `NotificationsDeniedError` rather than posting through
99
+ `osascript`.
100
+
101
+ **A prompt nobody saw is not a refusal.** A bundle macOS has not registered
102
+ (typically an ad-hoc signature in a temp directory) never gets the prompt and
103
+ stays `notDetermined`; the ladder then carries on to `osascript`. Only
104
+ `backend: 'cocoa'` turns that into an error, and it says `notDetermined`
105
+ rather than blaming the user.
106
+
107
+ So an app that reports progress should check `handle.backend` before it
108
+ decides how often to post. `examples/notify.jsx` (`npm run examples:notify`)
109
+ updates one banner in place where the rung can, and on `osascript` or
110
+ `notify-send` posts once at the end.
126
111
 
127
112
  ## The bundle, on macOS
128
113
 
129
114
  `UNUserNotificationCenter` attributes every banner to an app bundle — a
130
- `CFBundleIdentifier` Launch Services can see — and raises in a process that
131
- is none, which is what a bare `node` is. The bridge probes it once and
132
- reports `available: false`; `notify()` then takes the `osascript` rung, whose
133
- banners are Script Editor's. To get the real thing, run as a bundle: the
115
+ `CFBundleIdentifier` Launch Services can see — so a bare `node` process gets
116
+ `available: false` from the centre and `notify()` takes the `osascript` rung,
117
+ whose banners are Script Editor's. To get the real thing, run as a bundle: the
134
118
  executable in `Name.app/Contents/MacOS/`, an `Info.plist` that names it and
135
119
  carries `CFBundleIdentifier`, and a signature
136
120
  (`codesign --force --sign - Name.app` is enough locally). See
@@ -162,3 +146,5 @@ call win.
162
146
  The bus rung holds one session-bus reference while any banner is live and
163
147
  releases it when the last one closes, so an app that closed its banners on
164
148
  the way out is free to exit.
149
+
150
+ Design notes: [design/notifications.md](../design/notifications.md).