@react-x11/components 0.11.0 → 0.13.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/dist/flow/node.d.ts +14 -6
- package/dist/flow/node.d.ts.map +1 -1
- package/dist/flow/node.js +82 -64
- package/dist/flow/node.js.map +1 -1
- package/dist/html/controls.d.ts +38 -10
- package/dist/html/controls.d.ts.map +1 -1
- package/dist/html/controls.js +43 -58
- package/dist/html/controls.js.map +1 -1
- package/dist/html/css/cascade.d.ts +134 -20
- package/dist/html/css/cascade.d.ts.map +1 -1
- package/dist/html/css/cascade.js +538 -128
- package/dist/html/css/cascade.js.map +1 -1
- package/dist/html/css/color.d.ts +19 -0
- package/dist/html/css/color.d.ts.map +1 -1
- package/dist/html/css/color.js +86 -0
- package/dist/html/css/color.js.map +1 -1
- package/dist/html/css/parse.d.ts +40 -2
- package/dist/html/css/parse.d.ts.map +1 -1
- package/dist/html/css/parse.js +391 -13
- package/dist/html/css/parse.js.map +1 -1
- package/dist/html/css/style.d.ts +52 -1
- package/dist/html/css/style.d.ts.map +1 -1
- package/dist/html/css/style.js +328 -11
- package/dist/html/css/style.js.map +1 -1
- package/dist/html/css/ua.d.ts +11 -1
- package/dist/html/css/ua.d.ts.map +1 -1
- package/dist/html/css/ua.js +73 -7
- package/dist/html/css/ua.js.map +1 -1
- package/dist/html/css/values.d.ts +10 -1
- package/dist/html/css/values.d.ts.map +1 -1
- package/dist/html/css/values.js +27 -2
- package/dist/html/css/values.js.map +1 -1
- package/dist/html/css/vars.d.ts +5 -0
- package/dist/html/css/vars.d.ts.map +1 -1
- package/dist/html/css/vars.js +2 -2
- package/dist/html/css/vars.js.map +1 -1
- package/dist/html/dom.d.ts.map +1 -1
- package/dist/html/dom.js +38 -3
- package/dist/html/dom.js.map +1 -1
- package/dist/html/fonts.d.ts +25 -1
- package/dist/html/fonts.d.ts.map +1 -1
- package/dist/html/fonts.js +99 -6
- package/dist/html/fonts.js.map +1 -1
- package/dist/html/form.d.ts +200 -0
- package/dist/html/form.d.ts.map +1 -0
- package/dist/html/form.js +801 -0
- package/dist/html/form.js.map +1 -0
- package/dist/html/index.d.ts +12 -0
- package/dist/html/index.d.ts.map +1 -1
- package/dist/html/index.js +30 -264
- package/dist/html/index.js.map +1 -1
- package/dist/html/layout/block.d.ts +11 -2
- package/dist/html/layout/block.d.ts.map +1 -1
- package/dist/html/layout/block.js +186 -19
- package/dist/html/layout/block.js.map +1 -1
- package/dist/html/layout/boxes.d.ts +65 -7
- package/dist/html/layout/boxes.d.ts.map +1 -1
- package/dist/html/layout/boxes.js +87 -22
- package/dist/html/layout/boxes.js.map +1 -1
- package/dist/html/layout/cache.d.ts +2 -2
- package/dist/html/layout/cache.d.ts.map +1 -1
- package/dist/html/layout/cache.js +8 -3
- package/dist/html/layout/cache.js.map +1 -1
- package/dist/html/layout/flex.js +4 -1
- package/dist/html/layout/flex.js.map +1 -1
- package/dist/html/layout/floats.d.ts +4 -0
- package/dist/html/layout/floats.d.ts.map +1 -1
- package/dist/html/layout/floats.js +26 -0
- package/dist/html/layout/floats.js.map +1 -1
- package/dist/html/layout/inline.d.ts +26 -2
- package/dist/html/layout/inline.d.ts.map +1 -1
- package/dist/html/layout/inline.js +1232 -115
- package/dist/html/layout/inline.js.map +1 -1
- package/dist/html/node.d.ts +120 -15
- package/dist/html/node.d.ts.map +1 -1
- package/dist/html/node.js +993 -174
- package/dist/html/node.js.map +1 -1
- package/dist/html/paint.d.ts +75 -2
- package/dist/html/paint.d.ts.map +1 -1
- package/dist/html/paint.js +836 -200
- package/dist/html/paint.js.map +1 -1
- package/dist/html/surfaces.d.ts +7 -2
- package/dist/html/surfaces.d.ts.map +1 -1
- package/dist/html/surfaces.js +16 -0
- package/dist/html/surfaces.js.map +1 -1
- package/dist/html/widgets.d.ts +29 -0
- package/dist/html/widgets.d.ts.map +1 -0
- package/dist/html/widgets.js +620 -0
- package/dist/html/widgets.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/window.d.ts +22 -0
- package/dist/internal/window.d.ts.map +1 -1
- package/dist/internal/window.js +35 -8
- package/dist/internal/window.js.map +1 -1
- package/dist/richtext/node.d.ts +7 -0
- package/dist/richtext/node.d.ts.map +1 -1
- package/dist/richtext/node.js.map +1 -1
- package/package.json +6 -4
- package/src/flow/node.ts +80 -64
- package/src/html/controls.ts +79 -58
- package/src/html/css/cascade.ts +610 -146
- package/src/html/css/color.ts +87 -0
- package/src/html/css/parse.ts +431 -13
- package/src/html/css/style.ts +367 -11
- package/src/html/css/ua.ts +76 -8
- package/src/html/css/values.ts +31 -3
- package/src/html/css/vars.ts +2 -2
- package/src/html/dom.ts +41 -3
- package/src/html/fonts.ts +116 -6
- package/src/html/form.ts +962 -0
- package/src/html/index.ts +49 -300
- package/src/html/layout/block.ts +231 -16
- package/src/html/layout/boxes.ts +133 -32
- package/src/html/layout/cache.ts +8 -3
- package/src/html/layout/flex.ts +4 -1
- package/src/html/layout/floats.ts +24 -0
- package/src/html/layout/inline.ts +1445 -108
- package/src/html/node.ts +1010 -166
- package/src/html/paint.ts +980 -270
- package/src/html/surfaces.ts +21 -1
- package/src/html/widgets.ts +735 -0
- package/src/index.ts +1 -0
- package/src/internal/window.ts +36 -8
- package/src/richtext/node.ts +7 -0
package/src/index.ts
CHANGED
package/src/internal/window.ts
CHANGED
|
@@ -99,6 +99,34 @@ const VEL_GAP_MS = 250;
|
|
|
99
99
|
* settle. */
|
|
100
100
|
const FAST_V = 1.5;
|
|
101
101
|
|
|
102
|
+
/**
|
|
103
|
+
* The window's time and its timer: what a scroll's speed is measured with,
|
|
104
|
+
* and what decides it has stopped (`IDLE_MS`) and paces the band's growth
|
|
105
|
+
* after it (`GROW_MS`). A test holds both (`holdClock` in
|
|
106
|
+
* test/held-clock.ts). On the real clock a runner that spends longer than
|
|
107
|
+
* `IDLE_MS` over one step of a flick ends the flick there, and the settle
|
|
108
|
+
* that follows measures the rows and moves the scroll by what they
|
|
109
|
+
* measured — outside the `act` the step ran in, so a look at the rows finds
|
|
110
|
+
* the new offset against the layout before it, every row a few pixels off.
|
|
111
|
+
* A test of a flick cannot tell that from rows that moved.
|
|
112
|
+
*
|
|
113
|
+
* Not the catch-up's clock: `catchupSince` is epoch milliseconds, which a
|
|
114
|
+
* scroll hint is handed as `since`. The shape of the map's `glideClock`,
|
|
115
|
+
* and exported from this module only, which has no subpath: this is for
|
|
116
|
+
* the tests.
|
|
117
|
+
*/
|
|
118
|
+
export const windowClock = {
|
|
119
|
+
now(): number {
|
|
120
|
+
return Date.now();
|
|
121
|
+
},
|
|
122
|
+
arm(step: () => void, ms: number): DelayTick {
|
|
123
|
+
return later(step, ms);
|
|
124
|
+
},
|
|
125
|
+
disarm(handle: DelayTick): void {
|
|
126
|
+
cancelLater(handle);
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
|
|
102
130
|
/** More rows than this entering the window in one render is a flood — a
|
|
103
131
|
* teleport or a hard flick — and floods build skeletons first. An ordinary
|
|
104
132
|
* notch brings in a handful and never trips this. */
|
|
@@ -302,7 +330,7 @@ export function useVirtualWindow(inputs: VirtualWindowInputs): VirtualWindow {
|
|
|
302
330
|
// estimate adaptation) runs on.
|
|
303
331
|
bump((n) => n + 1);
|
|
304
332
|
if (wantsGrowth.current) {
|
|
305
|
-
idleTimer.current =
|
|
333
|
+
idleTimer.current = windowClock.arm(tick, GROW_MS);
|
|
306
334
|
}
|
|
307
335
|
}, []);
|
|
308
336
|
|
|
@@ -312,7 +340,7 @@ export function useVirtualWindow(inputs: VirtualWindowInputs): VirtualWindow {
|
|
|
312
340
|
// one has no slice to rebuild, and re-rendering it on a scroll it
|
|
313
341
|
// already drew would be work for nothing.
|
|
314
342
|
if (!inp.current.virtualizing) return;
|
|
315
|
-
const now =
|
|
343
|
+
const now = windowClock.now();
|
|
316
344
|
const s = vel.current;
|
|
317
345
|
const dt = now - s.t;
|
|
318
346
|
if (dt > 0 && dt < VEL_GAP_MS) {
|
|
@@ -325,8 +353,8 @@ export function useVirtualWindow(inputs: VirtualWindowInputs): VirtualWindow {
|
|
|
325
353
|
s.t = now;
|
|
326
354
|
s.top = top;
|
|
327
355
|
active.current = true;
|
|
328
|
-
|
|
329
|
-
idleTimer.current =
|
|
356
|
+
windowClock.disarm(idleTimer.current);
|
|
357
|
+
idleTimer.current = windowClock.arm(tick, IDLE_MS);
|
|
330
358
|
setView((prev) => (prev.top === top ? prev : { ...prev, top }));
|
|
331
359
|
},
|
|
332
360
|
[tick],
|
|
@@ -365,13 +393,13 @@ export function useVirtualWindow(inputs: VirtualWindowInputs): VirtualWindow {
|
|
|
365
393
|
// idle delay to fill them in would be a visible pause.
|
|
366
394
|
useEffect(() => {
|
|
367
395
|
if (hasSkeletons.current) {
|
|
368
|
-
|
|
369
|
-
idleTimer.current =
|
|
396
|
+
windowClock.disarm(idleTimer.current);
|
|
397
|
+
idleTimer.current = windowClock.arm(tick, GROW_MS);
|
|
370
398
|
} else if (wantsGrowth.current && idleTimer.current === null) {
|
|
371
|
-
idleTimer.current =
|
|
399
|
+
idleTimer.current = windowClock.arm(tick, IDLE_MS);
|
|
372
400
|
}
|
|
373
401
|
});
|
|
374
|
-
useEffect(() => () =>
|
|
402
|
+
useEffect(() => () => windowClock.disarm(idleTimer.current), []);
|
|
375
403
|
|
|
376
404
|
const {
|
|
377
405
|
heights,
|
package/src/richtext/node.ts
CHANGED
|
@@ -129,6 +129,13 @@ export interface TextRun {
|
|
|
129
129
|
* either side of an inline box's margin, border or padding. ntk's, from
|
|
130
130
|
* 8.14.2. */
|
|
131
131
|
shapeApart?: boolean;
|
|
132
|
+
/** Kerned with the runs either side of it though its letter spacing is
|
|
133
|
+
* not theirs: the spacing a justified line or `word-spacing` gives a
|
|
134
|
+
* space is in addition to kerning and no element's (CSS Text 3, 7.2,
|
|
135
|
+
* 7.3), where a run of an element's own letter spacing is shaped apart,
|
|
136
|
+
* as a browser shapes it. ntk's, from 8.15.0; CoreText takes a spaced
|
|
137
|
+
* glyph's spacing in place of its pairs either way. */
|
|
138
|
+
kernAcross?: boolean;
|
|
132
139
|
}
|
|
133
140
|
|
|
134
141
|
/** The props `<richtext>` takes. */
|