react-x11 2.11.0 → 2.12.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 +278 -129
- package/package.json +10 -3
- package/src/Reconciler.js +15 -17
- package/src/a11y.js +2 -2
- package/src/anchor.js +7 -5
- package/src/bootstrap.js +14 -0
- package/src/clientmessage.js +1 -1
- package/src/cocoa/app.js +292 -49
- package/src/cocoa/bezels.js +175 -30
- package/src/cocoa/dnd.js +27 -13
- package/src/cocoa/fonts.js +3 -3
- package/src/cocoa/glarea.js +20 -3
- package/src/cocoa/main.d.ts +8 -0
- package/src/cocoa/main.js +43 -0
- package/src/cocoa/panehost.js +15 -5
- package/src/cocoa/presenter.js +13 -9
- package/src/cocoa/promotion.js +4 -7
- package/src/cocoa/relaunch.js +207 -0
- package/src/cocoa/threaded.js +246 -0
- package/src/cocoa/window.js +256 -42
- package/src/components/Select.js +2 -2
- package/src/components/anchor.js +3 -3
- package/src/components/native.js +12 -7
- package/src/components/theme.js +2 -2
- package/src/debug.js +1 -1
- package/src/decorations.js +1 -1
- package/src/editmenu.js +2 -2
- package/src/errors.js +46 -0
- package/src/events.js +6 -6
- package/src/foreignnodes.js +3 -2
- package/src/frames.js +2 -2
- package/src/glnodes.js +1 -1
- package/src/grid.js +1653 -0
- package/src/host.d.ts +230 -0
- package/src/host.js +11 -3
- package/src/imagesource.js +1 -1
- package/src/index.d.ts +21 -4
- package/src/index.js +9 -1
- package/src/layouts.js +721 -0
- package/src/node.d.ts +4 -2
- package/src/node.js +19 -21
- package/src/nodes/animation.js +644 -0
- package/src/nodes/box.js +21 -0
- package/src/nodes/boxpaint.js +473 -0
- package/src/nodes/canvas.js +269 -0
- package/src/nodes/cascade.js +600 -0
- package/src/nodes/damage.js +183 -0
- package/src/nodes/edithistory.js +124 -0
- package/src/nodes/editmenupopup.js +260 -0
- package/src/nodes/hittest.js +185 -0
- package/src/nodes/image.js +266 -0
- package/src/nodes/install.js +75 -0
- package/src/nodes/invalidate.js +465 -0
- package/src/nodes/kinds.js +31 -0
- package/src/nodes/layout.js +439 -0
- package/src/nodes/layouthost.js +949 -0
- package/src/nodes/node.js +868 -0
- package/src/nodes/paint.js +466 -0
- package/src/nodes/position.js +366 -0
- package/src/nodes/preedit.js +127 -0
- package/src/nodes/queries.js +330 -0
- package/src/nodes/rects.js +102 -0
- package/src/nodes/scrollable.js +891 -0
- package/src/nodes/scrollbars.js +138 -0
- package/src/nodes/scrollblit.js +1034 -0
- package/src/nodes/selectable.js +142 -0
- package/src/nodes/styling.js +225 -0
- package/src/nodes/text.js +649 -0
- package/src/nodes/textarea.js +391 -0
- package/src/nodes/textinput.js +1146 -0
- package/src/nodes/util.js +17 -0
- package/src/nodes/window/anchoring.js +161 -0
- package/src/nodes/window/capabilities.js +190 -0
- package/src/nodes/window/debugpaint.js +83 -0
- package/src/nodes/window/droptarget.js +145 -0
- package/src/nodes/window/floors.js +577 -0
- package/src/nodes/window/flush.js +334 -0
- package/src/nodes/window/hints.js +482 -0
- package/src/nodes/window/listeners.js +222 -0
- package/src/nodes/window/popup.js +71 -0
- package/src/nodes/window/size.js +591 -0
- package/src/nodes/window/window.js +945 -0
- package/src/palette.js +1 -1
- package/src/registry.js +7 -3
- package/src/styles.js +137 -15
- package/src/svgnodes.js +2 -1
- package/src/testing/harness.js +2 -2
- package/src/textselection.js +5 -3
- package/src/trace-registry.js +1 -1
- package/src/types/components.d.ts +38 -6
- package/src/types/elements.d.ts +11 -1
- package/src/types/nodes.d.ts +17 -2
- package/src/types/style.d.ts +94 -3
- package/src/windowstate.js +1 -1
- package/src/yoga.js +1 -1
- package/src/nodes.js +0 -13120
package/src/events.js
CHANGED
|
@@ -42,7 +42,7 @@ const WHEEL_BUTTONS = new Set([4, 5, 6, 7]);
|
|
|
42
42
|
* every registered element that answers the wheel), so the conversion happens
|
|
43
43
|
* here, once, and `deltaX`/`deltaY` mean pixels wherever they are read.
|
|
44
44
|
*
|
|
45
|
-
* The same step an arrow key takes (`SCROLL_KEY_STEP`, nodes.js), so a notch
|
|
45
|
+
* The same step an arrow key takes (`SCROLL_KEY_STEP`, nodes/scrollable.js), so a notch
|
|
46
46
|
* and an arrow press move a list by the same amount.
|
|
47
47
|
*/
|
|
48
48
|
export const WHEEL_NOTCH_PX = 48;
|
|
@@ -301,7 +301,7 @@ export function discrete(fn) {
|
|
|
301
301
|
* One function, because there is more than one way to ask for it and they
|
|
302
302
|
* must not drift: an AT's `DoAction("activate")` (atspi.js) and the
|
|
303
303
|
* keyboard's Space/Enter on a focused control (`Node.defaultKeyDown`,
|
|
304
|
-
* nodes.js) both land here, so a control that acts on the *press* — `Select`
|
|
304
|
+
* nodes/node.js) both land here, so a control that acts on the *press* — `Select`
|
|
305
305
|
* and `MenuBar` drop their menus on mousedown, the way real menus do — is
|
|
306
306
|
* reached by either, and neither can be the one input route a widget forgot.
|
|
307
307
|
*
|
|
@@ -621,7 +621,7 @@ export class EventManager {
|
|
|
621
621
|
if (!changed) return;
|
|
622
622
|
// …and the things that keep a window of their own open on the strength
|
|
623
623
|
// of this one having focus — a menu, a dropdown — which the focused node
|
|
624
|
-
// keeping its focus would otherwise never tell (`WindowNode`, nodes.js)
|
|
624
|
+
// keeping its focus would otherwise never tell (`WindowNode`, nodes/window/window.js)
|
|
625
625
|
this.node._notifyWindowFocus?.(focused);
|
|
626
626
|
a11yHooks.windowFocus?.(this.node, focused);
|
|
627
627
|
runWithPriority(DiscreteEventPriority, () => {
|
|
@@ -755,7 +755,7 @@ export class EventManager {
|
|
|
755
755
|
// The first wheel is what says this window wants smooth scrolling. It was
|
|
756
756
|
// created on core events — an XI2 selection costs four times as many
|
|
757
757
|
// bytes per *pointer move*, which a window that is never scrolled would
|
|
758
|
-
// pay for nothing — and takes the selection here, once (nodes.js,
|
|
758
|
+
// pay for nothing — and takes the selection here, once (nodes/window/window.js,
|
|
759
759
|
// `upgradeToXI2`). Ahead of the dismiss check, because a scroll this
|
|
760
760
|
// window heard is a scroll this window heard whatever it does with it.
|
|
761
761
|
this.node.upgradeToXI2?.();
|
|
@@ -802,7 +802,7 @@ export class EventManager {
|
|
|
802
802
|
// **The default action moves whole pixels and keeps the change.** A
|
|
803
803
|
// scroll offset that is not an integer costs the scroll blit — the
|
|
804
804
|
// server-side copy that makes a scroll cheap can only shift by whole
|
|
805
|
-
// pixels, so `_applyScrollBlits` (nodes.js) declines a fractional one
|
|
805
|
+
// pixels, so `_applyScrollBlits` (nodes/scrollblit.js) declines a fractional one
|
|
806
806
|
// and repaints the viewport instead. A touchpad reporting a third of a
|
|
807
807
|
// notch would therefore turn every frame of the smoothest gesture the
|
|
808
808
|
// renderer has into a full repaint, which is the opposite of the
|
|
@@ -1695,7 +1695,7 @@ export class EventManager {
|
|
|
1695
1695
|
* focusable, and still on screen.
|
|
1696
1696
|
*
|
|
1697
1697
|
* Three callers ask it — a focus scope closing, an edit menu closing
|
|
1698
|
-
* (`closeEditMenu`, nodes.js) and a subtree coming out of hiding — and the
|
|
1698
|
+
* (`closeEditMenu`, nodes/editmenupopup.js) and a subtree coming out of hiding — and the
|
|
1699
1699
|
* third is why the question includes visibility. Whatever a modal was
|
|
1700
1700
|
* opened from may have suspended while it was up, and handing the keyboard
|
|
1701
1701
|
* back to it would put keys on an invisible control by the other route.
|
package/src/foreignnodes.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// render that is then thrown away has moved somebody else's window for
|
|
16
16
|
// real. So this node holds no socket until the owning `WindowNode`
|
|
17
17
|
// realizes it in the commit phase, exactly as `<glarea>` is realized
|
|
18
|
-
// (`_realizeChildWindows`, nodes.js).
|
|
18
|
+
// (`_realizeChildWindows`, nodes/window/window.js).
|
|
19
19
|
//
|
|
20
20
|
// 2. **Where the rect comes from.** Yoga, like any other child. Every
|
|
21
21
|
// change is a ConfigureWindow on the client plus the synthetic
|
|
@@ -34,7 +34,8 @@ import { XEMBED, XEmbedSocket } from 'ntk';
|
|
|
34
34
|
|
|
35
35
|
import { isFocusable } from './a11y.js';
|
|
36
36
|
import { lastInputTime } from './inputtime.js';
|
|
37
|
-
import { Node
|
|
37
|
+
import { Node } from './nodes/node.js';
|
|
38
|
+
import { pixelFor } from './nodes/window/capabilities.js';
|
|
38
39
|
|
|
39
40
|
const px = (v) => Math.max(1, Math.round(v || 0));
|
|
40
41
|
|
package/src/frames.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Which windows owe a frame.
|
|
2
2
|
//
|
|
3
|
-
// Shared between the paint root (
|
|
3
|
+
// Shared between the paint root (`WindowNode` — it records the debt in
|
|
4
4
|
// `invalidate()` and pays it in `flush()`) and the event dispatcher
|
|
5
5
|
// (events.js — it pays early, for discrete input). Its own module because
|
|
6
|
-
// nodes
|
|
6
|
+
// src/nodes/ already imports events.js, and the dispatcher cannot import the
|
|
7
7
|
// node back without a cycle.
|
|
8
8
|
//
|
|
9
9
|
// The set answers "which windows have unpainted damage" in O(1) at event
|
package/src/glnodes.js
CHANGED
|
@@ -10,7 +10,7 @@ import { cssColorStraight } from 'ntk';
|
|
|
10
10
|
// re-exported so the GL element layer stays one import for consumers
|
|
11
11
|
export { directGLFailure, hasDirectGL } from './glbackend.js';
|
|
12
12
|
|
|
13
|
-
import { Node } from './nodes.js';
|
|
13
|
+
import { Node } from './nodes/node.js';
|
|
14
14
|
import { FramePacer, resolveFrameRate } from './pacing.js';
|
|
15
15
|
|
|
16
16
|
// One visual query per (app, spec): GetFBConfigs is a round trip and every
|