react-x11 1.2.0 → 2.0.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.
- package/README.md +330 -81
- package/package.json +132 -14
- package/src/ClickToComponent.js +9 -2
- package/src/DevToolsIntegration.js +440 -32
- package/src/Reconciler.js +463 -165
- package/src/a11y.js +1299 -0
- package/src/acceleratorhooks.js +86 -0
- package/src/accelerators.js +128 -0
- package/src/activate.js +168 -0
- package/src/anchor.js +360 -0
- package/src/appcontext.js +161 -0
- package/src/appearance.js +748 -0
- package/src/appearancehooks.js +96 -0
- package/src/apphooks.js +73 -0
- package/src/application.js +748 -0
- package/src/atspi.js +1953 -0
- package/src/bus.js +545 -0
- package/src/bushooks.js +136 -0
- package/src/clientmessage.js +140 -0
- package/src/clipboard.js +121 -0
- package/src/components/Button.js +148 -33
- package/src/components/Checkbox.js +66 -32
- package/src/components/Dialog.js +96 -29
- package/src/components/FileDialog.js +491 -0
- package/src/components/Icon.js +329 -0
- package/src/components/Menu.js +797 -133
- package/src/components/PasswordInput.js +434 -0
- package/src/components/ProgressBar.js +91 -12
- package/src/components/Radio.js +78 -35
- package/src/components/Select.js +255 -65
- package/src/components/Slider.js +102 -41
- package/src/components/SplitPane.js +206 -0
- package/src/components/Switch.js +100 -22
- package/src/components/Table.js +529 -0
- package/src/components/Tabs.js +211 -0
- package/src/components/Tooltip.js +528 -54
- package/src/components/anchor.js +154 -107
- package/src/components/change.js +34 -0
- package/src/components/dnd.js +103 -0
- package/src/components/index.js +16 -3
- package/src/components/keys.js +17 -20
- package/src/components/scribble.js +247 -0
- package/src/components/theme.js +350 -42
- package/src/components/typeahead.js +12 -2
- package/src/compose.js +868 -0
- package/src/compositing.js +224 -0
- package/src/dbusmenu.js +384 -0
- package/src/debug.d.ts +63 -0
- package/src/debug.js +642 -0
- package/src/decorations.js +486 -0
- package/src/desktopsettings.js +209 -0
- package/src/desktopsettingshooks.js +62 -0
- package/src/dnd.js +1725 -0
- package/src/editmenu.js +272 -0
- package/src/errors.js +98 -0
- package/src/events.js +1406 -162
- package/src/extensions.js +45 -0
- package/src/filedialog.js +375 -0
- package/src/filedialoghooks.js +132 -0
- package/src/fonthooks.js +64 -0
- package/src/fonts.js +301 -0
- package/src/foreignnodes.js +519 -0
- package/src/frame/child.js +33 -0
- package/src/frame/childmain.js +274 -0
- package/src/frame/env.js +140 -0
- package/src/frame/index.js +444 -0
- package/src/frame/lifecycle.js +67 -0
- package/src/frame/protocol.js +179 -0
- package/src/frames.js +73 -0
- package/src/glbackend.js +114 -0
- package/src/glnodes.js +125 -67
- package/src/globalmenu.js +683 -0
- package/src/host.d.ts +88 -0
- package/src/host.js +42 -0
- package/src/idle.js +490 -0
- package/src/idlehooks.js +100 -0
- package/src/imagesource.js +349 -0
- package/src/index.d.ts +475 -0
- package/src/index.js +83 -9
- package/src/inputtime.js +206 -0
- package/src/jsx-dev-runtime.d.ts +21 -0
- package/src/jsx-dev-runtime.js +2 -0
- package/src/jsx-runtime.d.ts +39 -0
- package/src/jsx-runtime.js +6 -0
- package/src/keyboard.js +256 -0
- package/src/keyboardstate.js +278 -0
- package/src/keyboardstatehooks.js +58 -0
- package/src/keysyms.d.ts +149 -0
- package/src/keysyms.js +270 -0
- package/src/locale.js +170 -0
- package/src/localehooks.js +47 -0
- package/src/menuitem.js +223 -0
- package/src/node.d.ts +597 -0
- package/src/node.js +44 -0
- package/src/nodes.js +9546 -690
- package/src/ntk.d.ts +44 -0
- package/src/ntk.js +25 -0
- package/src/paintcache.js +366 -0
- package/src/palette.js +380 -0
- package/src/pastestate.js +66 -0
- package/src/portal.js +461 -0
- package/src/priority.js +26 -0
- package/src/refresh/index.d.ts +40 -0
- package/src/refresh/index.js +122 -0
- package/src/refresh/loader.d.ts +37 -0
- package/src/refresh/loader.js +401 -0
- package/src/refresh/register.d.ts +5 -0
- package/src/refresh/register.js +13 -0
- package/src/registry.js +232 -0
- package/src/scale.js +626 -0
- package/src/scalehooks.js +27 -0
- package/src/screencolor.js +640 -0
- package/src/screencolorhooks.js +101 -0
- package/src/screens.js +754 -0
- package/src/screenshooks.js +137 -0
- package/src/startup.js +302 -0
- package/src/style.d.ts +126 -0
- package/src/style.js +33 -0
- package/src/styles.js +1482 -6
- package/src/svgnodes.js +306 -0
- package/src/testing/a11y.js +484 -0
- package/src/testing/components.js +414 -0
- package/src/testing/events.js +407 -0
- package/src/testing/harness.js +455 -0
- package/src/testing/index.d.ts +558 -0
- package/src/testing/index.js +85 -0
- package/src/testing/mock-app.js +463 -0
- package/src/testing/pixels.js +152 -0
- package/src/testing/queries.js +224 -0
- package/src/textrange.js +83 -0
- package/src/textselection.js +439 -0
- package/src/trace-registry.js +63 -0
- package/src/transfer.js +93 -0
- package/src/types/appearance.d.ts +84 -0
- package/src/types/application.d.ts +173 -0
- package/src/types/components.d.ts +820 -0
- package/src/types/dbus.d.ts +177 -0
- package/src/types/elements.d.ts +897 -0
- package/src/types/events.d.ts +549 -0
- package/src/types/filedialog.d.ts +260 -0
- package/src/types/fonts.d.ts +124 -0
- package/src/types/frame.d.ts +146 -0
- package/src/types/globalmenu.d.ts +42 -0
- package/src/types/nodes.d.ts +199 -0
- package/src/types/screencolor.d.ts +84 -0
- package/src/types/style.d.ts +434 -0
- package/src/types/system.d.ts +287 -0
- package/src/windowid.js +151 -0
- package/src/windowstate.js +393 -0
- package/src/xsettings.js +336 -0
- package/src/yoga.d.ts +55 -0
- package/src/yoga.js +135 -0
- package/src/components/Canvas3D.js +0 -28
- package/src/geometry3d.js +0 -223
- package/src/pointer3d.js +0 -158
- package/src/raycast3d.js +0 -146
- package/src/richnodes.js +0 -436
- package/src/scene3d.js +0 -683
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The D-Bus floor — `useSessionBus()`, `sessionBus()` and what they hand back.
|
|
3
|
+
* See docs/dbus.md.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/** Which bus. Session is the user's; system is hardware, networking, logind. */
|
|
7
|
+
export type BusKind = 'session' | 'system';
|
|
8
|
+
|
|
9
|
+
/** What a {@link BusHandle} is doing. See {@link useSessionBus}. */
|
|
10
|
+
export type BusStatus = 'connecting' | 'ready' | 'unavailable' | 'closed';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The connection, as `dbus-native` presents it — **structurally**, so that
|
|
14
|
+
* these declarations type-check on an install where the package is not there.
|
|
15
|
+
*
|
|
16
|
+
* That is not a hypothetical: `dbus-native` is an `optionalDependency` and
|
|
17
|
+
* declares `engines: ">=22.12.0"`, so npm skips it on Node 20 and a
|
|
18
|
+
* `import type { MessageBus } from 'dbus-native'` here would fail to resolve
|
|
19
|
+
* for anyone type-checking with `skipLibCheck: false`. Nothing in react-x11's
|
|
20
|
+
* declarations names the package for that reason.
|
|
21
|
+
*
|
|
22
|
+
* The members below are the ones this layer documents. **The index signature
|
|
23
|
+
* is not a shrug** — the whole `dbus-native` surface is genuinely on this
|
|
24
|
+
* object and reaching for one of the rest is the supported thing to do. Code
|
|
25
|
+
* that wants the package's own checked types can import them on its side and
|
|
26
|
+
* cast; the object is the same object.
|
|
27
|
+
*/
|
|
28
|
+
export interface MessageBus {
|
|
29
|
+
/** This connection's unique name, once `Hello` has been answered. */
|
|
30
|
+
name?: string;
|
|
31
|
+
/** Signals, keyed by `mangle(path, interface, member)`. */
|
|
32
|
+
signals?: unknown;
|
|
33
|
+
/** The transport underneath. Reaching into it is not this layer's contract. */
|
|
34
|
+
connection?: unknown;
|
|
35
|
+
|
|
36
|
+
/** A remote object with its members resolved by introspection. */
|
|
37
|
+
proxy(service: string, path: string, options?: unknown): PromiseLike<any>;
|
|
38
|
+
getService(name: string): any;
|
|
39
|
+
getObject(service: string, path: string): PromiseLike<any>;
|
|
40
|
+
getInterface(
|
|
41
|
+
service: string,
|
|
42
|
+
path: string,
|
|
43
|
+
interfaceName: string,
|
|
44
|
+
): PromiseLike<any>;
|
|
45
|
+
invoke(message: unknown, options?: unknown): PromiseLike<any>;
|
|
46
|
+
|
|
47
|
+
listNames(): PromiseLike<string[]>;
|
|
48
|
+
listActivatableNames(): PromiseLike<string[]>;
|
|
49
|
+
getNameOwner(name: string): PromiseLike<string>;
|
|
50
|
+
nameHasOwner(name: string): PromiseLike<boolean>;
|
|
51
|
+
requestName(name: string, flags: number): PromiseLike<number>;
|
|
52
|
+
releaseName(name: string): PromiseLike<number>;
|
|
53
|
+
addMatch(rule: string): PromiseLike<void>;
|
|
54
|
+
removeMatch(rule: string): PromiseLike<void>;
|
|
55
|
+
mangle(path: string, interfaceName?: string, member?: string): string;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* **Do not call this on a shared bus.** It tears the connection out from
|
|
59
|
+
* under every other consumer — the tray, the menu, the app's own exported
|
|
60
|
+
* service. {@link closeBus} is the app-level decision; `release()` is the
|
|
61
|
+
* only lifecycle verb a ref holder has.
|
|
62
|
+
*/
|
|
63
|
+
close(): Promise<void>;
|
|
64
|
+
|
|
65
|
+
[member: string]: any;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* There is no bus to be had, and this is why.
|
|
70
|
+
*
|
|
71
|
+
* `cause` carries the real reason — no address, `ECONNREFUSED`, an auth
|
|
72
|
+
* rejection, the transport not being installed. There is deliberately no
|
|
73
|
+
* second failure taxonomy on top of it: an enum would have to stay true
|
|
74
|
+
* across platforms, npm layouts and `dbus-native` versions, and in practice
|
|
75
|
+
* the reason gets logged far more often than it gets branched on.
|
|
76
|
+
*/
|
|
77
|
+
export declare class BusUnavailableError extends Error {
|
|
78
|
+
constructor(kind: BusKind, cause?: unknown);
|
|
79
|
+
/** Which bus was asked for. */
|
|
80
|
+
readonly kind: BusKind;
|
|
81
|
+
readonly cause?: unknown;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* One consumer's claim on the shared connection.
|
|
86
|
+
*
|
|
87
|
+
* `release()` drops the claim; it never closes anything. The connection stays
|
|
88
|
+
* up for the life of the process — see docs/dbus.md — because every reconnect
|
|
89
|
+
* is a new unique name, and a dialog that mounts and unmounts must not cost
|
|
90
|
+
* the app its identity on the desktop.
|
|
91
|
+
*/
|
|
92
|
+
export interface BusRef {
|
|
93
|
+
/** The full `dbus-native` surface, shared with every other ref. */
|
|
94
|
+
readonly bus: MessageBus;
|
|
95
|
+
/** This connection's unique name, e.g. `':1.42'`. Always a string. */
|
|
96
|
+
readonly uniqueName: string;
|
|
97
|
+
/** Drop this consumer's reference. Idempotent per ref. */
|
|
98
|
+
release(): Promise<void>;
|
|
99
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface AcquireOptions {
|
|
103
|
+
/**
|
|
104
|
+
* Reject with a {@link BusUnavailableError} instead of answering `null`.
|
|
105
|
+
*
|
|
106
|
+
* The escape hatch for an app whose purpose *is* the bus: `null` is right
|
|
107
|
+
* for feature-probing plumbing and hides why from a service author. The
|
|
108
|
+
* default stays never-rejecting.
|
|
109
|
+
*/
|
|
110
|
+
required?: boolean;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* A shared session bus, or `null` when there is not one.
|
|
115
|
+
*
|
|
116
|
+
* ```js
|
|
117
|
+
* const ref = await sessionBus();
|
|
118
|
+
* if (!ref) return; // no bus here; turn the feature off
|
|
119
|
+
* const portal = await ref.bus.proxy('org.freedesktop.portal.Desktop', '/org/freedesktop/portal/desktop');
|
|
120
|
+
* await ref.release();
|
|
121
|
+
* ```
|
|
122
|
+
*
|
|
123
|
+
* Lazy — nothing is dialled until the first call — and shared: every consumer
|
|
124
|
+
* in the process gets the same socket and the same unique name, so the app's
|
|
125
|
+
* exported service, its menu and its tray are visibly one application.
|
|
126
|
+
*/
|
|
127
|
+
export declare function sessionBus(
|
|
128
|
+
options?: AcquireOptions & { required?: false },
|
|
129
|
+
): Promise<BusRef | null>;
|
|
130
|
+
export declare function sessionBus(
|
|
131
|
+
options: AcquireOptions & { required: true },
|
|
132
|
+
): Promise<BusRef>;
|
|
133
|
+
|
|
134
|
+
/** A shared system bus, or `null`. Same contract as {@link sessionBus}. */
|
|
135
|
+
export declare function systemBus(
|
|
136
|
+
options?: AcquireOptions & { required?: false },
|
|
137
|
+
): Promise<BusRef | null>;
|
|
138
|
+
export declare function systemBus(
|
|
139
|
+
options: AcquireOptions & { required: true },
|
|
140
|
+
): Promise<BusRef>;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Close the shared connection outright. Rare, explicit, never automatic —
|
|
144
|
+
* and never something a consumer does on behalf of its siblings.
|
|
145
|
+
*/
|
|
146
|
+
export declare function closeBus(kind: BusKind): Promise<void>;
|
|
147
|
+
|
|
148
|
+
/** What {@link useSessionBus} and {@link useSystemBus} return. */
|
|
149
|
+
export interface BusHandle {
|
|
150
|
+
/** The connection, or `null` unless `status === 'ready'`. */
|
|
151
|
+
readonly bus: MessageBus | null;
|
|
152
|
+
readonly uniqueName: string | null;
|
|
153
|
+
readonly status: BusStatus;
|
|
154
|
+
/** Why there is no bus. Set when `status === 'unavailable'`. */
|
|
155
|
+
readonly cause?: BusUnavailableError;
|
|
156
|
+
/** Dial again after `'closed'`. Not automatic — see docs/dbus.md. */
|
|
157
|
+
retry(): void;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* The session bus, as rendering state. Works in any tree with **nothing to
|
|
162
|
+
* wrap** — a D-Bus connection is process identity, so there is no provider
|
|
163
|
+
* and nothing for an app author to install.
|
|
164
|
+
*
|
|
165
|
+
* ```tsx
|
|
166
|
+
* const { bus } = useSessionBus();
|
|
167
|
+
* if (!bus) return null; // correct on its own; status is for detail
|
|
168
|
+
* ```
|
|
169
|
+
*
|
|
170
|
+
* `'unavailable'` is a snapshot, not a verdict: failure is not cached, so a
|
|
171
|
+
* bus that appears later will be found. Do not permanently disable a feature
|
|
172
|
+
* on seeing it.
|
|
173
|
+
*/
|
|
174
|
+
export declare function useSessionBus(): BusHandle;
|
|
175
|
+
|
|
176
|
+
/** The system bus, as rendering state. Same shape as {@link useSessionBus}. */
|
|
177
|
+
export declare function useSystemBus(): BusHandle;
|