react-x11 2.15.3 → 2.16.1
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 +37 -0
- package/package.json +3 -3
- package/src/Reconciler.js +85 -22
- package/src/acceleratorhooks.js +40 -6
- package/src/anchor.js +79 -19
- package/src/capabilities.js +29 -4
- package/src/cocoa/app.js +211 -11
- package/src/cocoa/context2d.js +23 -0
- package/src/cocoa/fonts.js +78 -0
- package/src/cocoa/presenter.js +17 -0
- package/src/cocoa/promotion.js +20 -0
- package/src/cocoa/relaunch.js +8 -3
- package/src/cocoa/symbols.js +64 -0
- package/src/cocoa/threaded.js +24 -4
- package/src/cocoa/window.js +362 -139
- package/src/components/ProgressBar.js +1 -1
- package/src/components/Slider.js +72 -39
- package/src/components/anchor.js +7 -2
- package/src/components/index.js +1 -0
- package/src/components/theme.js +32 -28
- package/src/desktopcapabilityhooks.js +29 -6
- package/src/filedialoghooks.js +3 -5
- package/src/frame/childmain.js +8 -20
- package/src/frame/env.js +2 -10
- package/src/icontheme.js +240 -0
- package/src/imagesource.js +83 -1
- package/src/index.d.ts +10 -1
- package/src/index.js +3 -0
- package/src/keysymchars.js +47 -0
- package/src/keysyms.d.ts +19 -1
- package/src/keysyms.js +107 -8
- package/src/node.d.ts +7 -0
- package/src/nodes/animation.js +17 -47
- package/src/nodes/cascade.js +17 -2
- package/src/nodes/image.js +63 -1
- package/src/nodes/kinds.js +12 -0
- package/src/nodes/layout.js +5 -1
- package/src/nodes/node.js +17 -3
- package/src/nodes/paint.js +117 -0
- package/src/nodes/scope.js +259 -0
- package/src/nodes/scrollable.js +53 -6
- package/src/nodes/text.js +2 -0
- package/src/nodes/textarea.js +1 -1
- package/src/nodes/textinput.js +1 -1
- package/src/nodes/window/anchoring.js +45 -18
- package/src/nodes/window/flush.js +6 -5
- package/src/nodes/window/popup.js +10 -0
- package/src/nodes/window/size.js +40 -2
- package/src/nodes/window/window.js +41 -14
- package/src/registry.js +2 -1
- package/src/screens.js +159 -24
- package/src/settings.js +332 -0
- package/src/statusnotifier.js +164 -17
- package/src/styles.js +212 -8
- package/src/symbols.js +200 -0
- package/src/testing/mock-app.js +10 -0
- package/src/trayhooks.js +21 -5
- package/src/types/capabilities.d.ts +13 -1
- package/src/types/components.d.ts +33 -0
- package/src/types/elements.d.ts +57 -6
- package/src/types/events.d.ts +5 -0
- package/src/types/filedialog.d.ts +3 -1
- package/src/types/style.d.ts +57 -0
- package/src/types/system.d.ts +104 -0
- package/src/types/tray.d.ts +14 -2
- package/src/wayland/xkb.js +170 -59
- package/src/windowid.js +62 -20
package/src/cocoa/threaded.js
CHANGED
|
@@ -188,10 +188,23 @@ export function fdStream(fd, write = fs.writeSync) {
|
|
|
188
188
|
/**
|
|
189
189
|
* Stdout and stderr on fds 1 and 2, and a console over them — the console
|
|
190
190
|
* too, because Bun's writes past `process.stdout` altogether.
|
|
191
|
+
*
|
|
192
|
+
* A `Console` is only the writing half of the runtime's console. Node adds
|
|
193
|
+
* the inspector's methods on top — `timeStamp`, `profile`, `profileEnd`,
|
|
194
|
+
* `context`, `createTask` — and `console.Console`, so the new console takes
|
|
195
|
+
* whatever it lacks from the one it replaces, as it is. Code that loaded
|
|
196
|
+
* before this saw them: React's development reconciler asks once, as it
|
|
197
|
+
* loads, whether `console.timeStamp` is a function, and calls it on every
|
|
198
|
+
* render after, so a script importing `react-x11/test` ahead of `react-x11`
|
|
199
|
+
* threw `console.timeStamp is not a function` on its first render.
|
|
191
200
|
*/
|
|
192
|
-
export function installStdio(
|
|
193
|
-
|
|
194
|
-
|
|
201
|
+
export function installStdio(
|
|
202
|
+
proc = process,
|
|
203
|
+
global = globalThis,
|
|
204
|
+
write = fs.writeSync,
|
|
205
|
+
) {
|
|
206
|
+
const stdout = fdStream(1, write);
|
|
207
|
+
const stderr = fdStream(2, write);
|
|
195
208
|
Object.defineProperty(proc, 'stdout', {
|
|
196
209
|
configurable: true,
|
|
197
210
|
get: () => stdout,
|
|
@@ -200,10 +213,17 @@ export function installStdio(proc = process, global = globalThis) {
|
|
|
200
213
|
configurable: true,
|
|
201
214
|
get: () => stderr,
|
|
202
215
|
});
|
|
216
|
+
const runtime = global.console;
|
|
217
|
+
const ours = new Console({ stdout, stderr });
|
|
218
|
+
for (const key of Reflect.ownKeys(runtime)) {
|
|
219
|
+
if (key in ours) continue;
|
|
220
|
+
const desc = Object.getOwnPropertyDescriptor(runtime, key);
|
|
221
|
+
Object.defineProperty(ours, key, desc);
|
|
222
|
+
}
|
|
203
223
|
Object.defineProperty(global, 'console', {
|
|
204
224
|
configurable: true,
|
|
205
225
|
writable: true,
|
|
206
|
-
value:
|
|
226
|
+
value: ours,
|
|
207
227
|
});
|
|
208
228
|
}
|
|
209
229
|
|