react-x11 2.10.2 → 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 +304 -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/screencolor.js +62 -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/screencolor.js +212 -38
- package/src/screencolorhooks.js +6 -2
- 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 +33 -5
- package/src/types/screencolor.d.ts +20 -14
- 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/types/style.d.ts
CHANGED
|
@@ -37,8 +37,39 @@ export type Align =
|
|
|
37
37
|
| 'space-around';
|
|
38
38
|
|
|
39
39
|
export type FlexWrap = 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
40
|
-
export type PositionType = 'static' | 'relative' | 'absolute';
|
|
41
|
-
|
|
40
|
+
export type PositionType = 'static' | 'relative' | 'absolute' | 'sticky';
|
|
41
|
+
/** `'grid'` lays the box's children out as a CSS grid — see docs/styling.md,
|
|
42
|
+
* "Grid"; `'none'` hides the box and everything in it. */
|
|
43
|
+
export type Display = 'flex' | 'grid' | 'none';
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* A grid line, as CSS's `grid-column` / `grid-row` write it: a number
|
|
47
|
+
* counting from 1 at the start or from -1 at the end, `'span 2'`, or a
|
|
48
|
+
* start and an end — `'2 / 4'`, `'1 / -1'`, `'2 / span 3'`.
|
|
49
|
+
*/
|
|
50
|
+
export type GridLine =
|
|
51
|
+
| number
|
|
52
|
+
| 'auto'
|
|
53
|
+
| `span ${number}`
|
|
54
|
+
| `${number} / ${number}`
|
|
55
|
+
| `${number}/${number}`
|
|
56
|
+
| `${number} / span ${number}`
|
|
57
|
+
| `span ${number} / ${number}`
|
|
58
|
+
| `${number} / auto`
|
|
59
|
+
| `auto / ${number}`
|
|
60
|
+
| `auto / span ${number}`;
|
|
61
|
+
|
|
62
|
+
export type GridAutoFlow =
|
|
63
|
+
| 'row'
|
|
64
|
+
| 'column'
|
|
65
|
+
| 'dense'
|
|
66
|
+
| 'row dense'
|
|
67
|
+
| 'column dense'
|
|
68
|
+
| 'dense row'
|
|
69
|
+
| 'dense column';
|
|
70
|
+
|
|
71
|
+
export type JustifyItems = 'flex-start' | 'center' | 'flex-end' | 'stretch';
|
|
72
|
+
export type JustifySelf = 'auto' | JustifyItems;
|
|
42
73
|
export type Overflow = 'visible' | 'hidden' | 'scroll';
|
|
43
74
|
export type BorderStyle = 'solid' | 'dashed';
|
|
44
75
|
export type PointerEvents = 'auto' | 'none';
|
|
@@ -108,7 +139,67 @@ export interface LayoutStyle {
|
|
|
108
139
|
* say `minWidth: 0` (or an `overflow` that clips) for that. */
|
|
109
140
|
flexShrink?: number;
|
|
110
141
|
flexBasis?: Dimension;
|
|
111
|
-
|
|
142
|
+
/**
|
|
143
|
+
* `'relative'` (the default) and `'absolute'` move the box by its insets.
|
|
144
|
+
* `'sticky'` lays it out in flow like `'relative'`, then holds it inside
|
|
145
|
+
* the nearest scroll pane's edges by its insets — `top: 0` keeps a header
|
|
146
|
+
* at the top of the pane until its parent scrolls away and takes it
|
|
147
|
+
* along. A position registered with `registerPosition` (react-x11/host)
|
|
148
|
+
* is written the same way, by name or with its options, and also lays the
|
|
149
|
+
* box out in flow and then moves it. Either paints over its siblings of
|
|
150
|
+
* the same `zIndex`. See docs/styling.md, "Sticky positioning" and
|
|
151
|
+
* "Custom positions".
|
|
152
|
+
*/
|
|
153
|
+
position?: import('../host.js').PositionValue;
|
|
154
|
+
/**
|
|
155
|
+
* A layout algorithm arranging this box's children in place of flexbox,
|
|
156
|
+
* by name or written with its options — `'equal-row'`,
|
|
157
|
+
* `{ name: 'masonry', columns: 3 }`. It runs inside the layout pass; the
|
|
158
|
+
* box's own `gap`, `justifyContent` and `alignItems` are what it spaces
|
|
159
|
+
* and aligns by. See docs/styling.md, "Custom layouts".
|
|
160
|
+
*/
|
|
161
|
+
layout?: import('../host.js').LayoutValue;
|
|
162
|
+
/** What this box tells the layout arranging it — `masonry`'s `span`. */
|
|
163
|
+
layoutItem?: import('../host.js').CustomLayoutItem;
|
|
164
|
+
/**
|
|
165
|
+
* A `display: 'grid'` box's columns: a CSS track list — `'200px 1fr'`,
|
|
166
|
+
* `'auto 1fr'`, `'repeat(auto-fill, minmax(200px, 1fr))'` — with lengths
|
|
167
|
+
* in logical pixels written `px`, `%` of the grid and `fr` shares; or a
|
|
168
|
+
* number, that many equal columns (`repeat(n, minmax(0, 1fr))`). A list
|
|
169
|
+
* that would not lay out is an error naming it. See docs/styling.md,
|
|
170
|
+
* "Grid".
|
|
171
|
+
*/
|
|
172
|
+
gridTemplateColumns?: number | string;
|
|
173
|
+
/** …its rows, the same way. */
|
|
174
|
+
gridTemplateRows?: number | string;
|
|
175
|
+
/** Named areas: one quoted string per row, as CSS writes them —
|
|
176
|
+
* `'"head head" "side main"'` — or an array of the rows. */
|
|
177
|
+
gridTemplateAreas?: string | readonly string[];
|
|
178
|
+
/** The size of a column the grid adds for an item placed past its
|
|
179
|
+
* template: a track list taken in turn, or a number — a length, here. */
|
|
180
|
+
gridAutoColumns?: number | string;
|
|
181
|
+
/** …and of a row, the same way. */
|
|
182
|
+
gridAutoRows?: number | string;
|
|
183
|
+
/** How a child with no place of its own is placed: along the rows (the
|
|
184
|
+
* default) or the columns — and `dense` to back-fill a hole. */
|
|
185
|
+
gridAutoFlow?: GridAutoFlow;
|
|
186
|
+
/** Where each child sits across its area when it is narrower than the
|
|
187
|
+
* area; `alignItems` is the other axis. */
|
|
188
|
+
justifyItems?: JustifyItems;
|
|
189
|
+
/** A grid child's columns: `2`, `'span 2'`, `'1 / -1'`. */
|
|
190
|
+
gridColumn?: GridLine;
|
|
191
|
+
/** …and its rows. */
|
|
192
|
+
gridRow?: GridLine;
|
|
193
|
+
/** The name of an area in the grid's `gridTemplateAreas`, or CSS's four
|
|
194
|
+
* lines; `gridColumn` and `gridRow` beside it win for their axis. */
|
|
195
|
+
gridArea?: string | number;
|
|
196
|
+
/** Where this child sits across its area; `'auto'` is the grid's
|
|
197
|
+
* `justifyItems`. */
|
|
198
|
+
justifySelf?: JustifySelf;
|
|
199
|
+
/** An offset from the edge — or, under sticky or a registered position,
|
|
200
|
+
* the scheme's to read: how close to the scroll pane's edge the box may
|
|
201
|
+
* come, for sticky, where a percentage is of the pane's size. The same
|
|
202
|
+
* holds for the other five. */
|
|
112
203
|
top?: Length;
|
|
113
204
|
right?: Length;
|
|
114
205
|
bottom?: Length;
|
package/src/windowstate.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
// A `<window>` asks for `fullscreen` or `maximized` and the window manager
|
|
5
5
|
// decides — and it decides on its own account too, when the user hits a
|
|
6
|
-
// hotkey or the titlebar button. `nodes.js` sends the requests; this is the
|
|
6
|
+
// hotkey or the titlebar button. `nodes/window/hints.js` sends the requests; this is the
|
|
7
7
|
// half that reads back what actually happened, plus the two things an app
|
|
8
8
|
// needs that are not states at all: whether it has the keyboard, and whether
|
|
9
9
|
// anyone can see it.
|
package/src/yoga.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// The layout engine, without a top-level await.
|
|
2
2
|
//
|
|
3
|
-
// Every drawn node owns one yoga node (`nodes
|
|
3
|
+
// Every drawn node owns one yoga node (`src/nodes/`), and `styles.js` is the
|
|
4
4
|
// translation from style props to yoga setters. This module is where the
|
|
5
5
|
// engine itself comes from.
|
|
6
6
|
//
|