paintcannon-react 0.0.45 → 0.0.47
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 +41 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -147,8 +147,15 @@ All host components accept these event props:
|
|
|
147
147
|
- `onTransitionEnd`
|
|
148
148
|
- `onScroll`
|
|
149
149
|
|
|
150
|
-
`onPaste` receives the same `PaintClipboardEvent` as core, including
|
|
151
|
-
|
|
150
|
+
`onPaste` receives the same `PaintClipboardEvent` as core, including image files through
|
|
151
|
+
`event.clipboardData.files`. This also handles images copied from browsers or screenshot tools
|
|
152
|
+
without a backing file on terminals supporting Kitty's rich-paste protocol. Image pastes have
|
|
153
|
+
empty text data; no React-specific handling is needed.
|
|
154
|
+
Use `await paintCannon.supportsRichPaste()` on the core instance to detect copied-image paste
|
|
155
|
+
support before offering it in your UI.
|
|
156
|
+
Inside tmux, core uses DCS passthrough only after confirming `focus-events` is on, so rich-paste
|
|
157
|
+
mode can be released when switching away from the app's pane. Otherwise `supportsRichPaste()`
|
|
158
|
+
returns `false`, leaving ordinary text and file-path paste available.
|
|
152
159
|
|
|
153
160
|
`style` accepts the following CSS property names. Kebab-case and camelCase are
|
|
154
161
|
both supported:
|
|
@@ -256,6 +263,38 @@ both supported:
|
|
|
256
263
|
- `useAnimation()` for requestAnimationFrame-driven animations that share a
|
|
257
264
|
single render cycle.
|
|
258
265
|
|
|
266
|
+
## Desktop Notifications
|
|
267
|
+
|
|
268
|
+
Use the core API through `useApp().paintCannon`; no notification-specific React
|
|
269
|
+
wrapper is needed:
|
|
270
|
+
|
|
271
|
+
```tsx
|
|
272
|
+
function NotifyButton() {
|
|
273
|
+
const { paintCannon } = useApp();
|
|
274
|
+
return (
|
|
275
|
+
<Button
|
|
276
|
+
onClick={() => {
|
|
277
|
+
new paintCannon.Notification("Build complete", { body: "All tests passed." });
|
|
278
|
+
}}
|
|
279
|
+
>
|
|
280
|
+
Notify
|
|
281
|
+
</Button>
|
|
282
|
+
);
|
|
283
|
+
}
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
`requestPermission()` automatically grants when a backend is available, or returns
|
|
287
|
+
`"denied"` otherwise, without a prompt. Rust selects OSC 99/777/9 or a local macOS/Linux command fallback;
|
|
288
|
+
it never invokes a remote desktop fallback over SSH. Notification lifecycle
|
|
289
|
+
feedback varies by backend. See [the core notification API](../paintcannon/README.md#desktop-notifications)
|
|
290
|
+
for options, events, replacement, and dismissal limitations.
|
|
291
|
+
|
|
292
|
+
Use `await paintCannon.Notification.supportsClose()` to decide whether to render a
|
|
293
|
+
dismiss button. Permission to deliver notifications does not imply dismissal
|
|
294
|
+
support. OSC 99 features, including dismissal, are queried from the terminal at
|
|
295
|
+
runtime. OSC 9/777 and the macOS command fallback cannot dismiss notifications
|
|
296
|
+
programmatically; Otty's current acknowledgement also does not advertise dismissal.
|
|
297
|
+
|
|
259
298
|
## Core Runtime
|
|
260
299
|
|
|
261
300
|
This package depends on `paintcannon`, which provides the NAPI-RS native
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "paintcannon-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.47",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"scheduler": "^0.25.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"paintcannon": "^0.0.
|
|
40
|
+
"paintcannon": "^0.0.47",
|
|
41
41
|
"react": "^19.0.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|