@solidtv/solid 1.3.9 → 1.4.1-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 +4 -1
- package/dist/src/core/dom-renderer/domRenderer.js +16 -7
- package/dist/src/core/dom-renderer/domRenderer.js.map +1 -1
- package/dist/src/core/focusManager.d.ts +19 -1
- package/dist/src/core/focusManager.js +59 -2
- package/dist/src/core/focusManager.js.map +1 -1
- package/dist/src/core/lightningInit.d.ts +12 -0
- package/dist/src/core/lightningInit.js +76 -2
- package/dist/src/core/lightningInit.js.map +1 -1
- package/dist/src/mergeProps.d.ts +27 -0
- package/dist/src/mergeProps.js +41 -0
- package/dist/src/mergeProps.js.map +1 -0
- package/dist/src/primitives/useFocusManager.d.ts +1 -1
- package/dist/src/primitives/useFocusManager.js +1 -1
- package/dist/src/primitives/useFocusManager.js.map +1 -1
- package/dist/src/primitives/useHold.d.ts +41 -5
- package/dist/src/primitives/useHold.js +51 -11
- package/dist/src/primitives/useHold.js.map +1 -1
- package/dist/src/render.d.ts +2 -2
- package/dist/src/render.js +5 -1
- package/dist/src/render.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/core/dom-renderer/domRenderer.ts +18 -7
- package/src/core/focusManager.ts +71 -2
- package/src/core/lightningInit.ts +99 -2
- package/src/mergeProps.ts +48 -0
- package/src/primitives/useFocusManager.ts +2 -0
- package/src/primitives/useHold.ts +88 -15
- package/src/render.ts +5 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as lng from '@solidtv/renderer';
|
|
2
|
+
import { prefetchFont } from '@solidtv/renderer';
|
|
2
3
|
import { Config, DOM_RENDERING } from './config.js';
|
|
3
4
|
import { DOMRendererMain, loadFontToDom } from './dom-renderer/domRenderer.js';
|
|
4
5
|
// Global renderer instance: can be either the Lightning or DOM implementation
|
|
@@ -11,15 +12,21 @@ export function startLightningRenderer(options, rootId = 'app') {
|
|
|
11
12
|
renderer = enableDomRenderer
|
|
12
13
|
? new DOMRendererMain(options, rootId)
|
|
13
14
|
: new lng.RendererMain(options, rootId);
|
|
15
|
+
// A stage now exists, so any fonts requested before this point can finish.
|
|
16
|
+
flushPendingFonts();
|
|
14
17
|
return renderer;
|
|
15
18
|
}
|
|
16
|
-
|
|
19
|
+
const pendingFontLoads = [];
|
|
20
|
+
/**
|
|
21
|
+
* Hand fonts to the stage. Requires a renderer.
|
|
22
|
+
*/
|
|
23
|
+
function attachFonts(fonts) {
|
|
17
24
|
// Inlined so the loadFontToDom branch + import tree-shake in WebGL builds.
|
|
18
25
|
const enableDomRenderer = DOM_RENDERING && Config.domRendererEnabled;
|
|
19
26
|
const hasCanvas = !enableDomRenderer &&
|
|
20
27
|
'textRenderers' in renderer.stage &&
|
|
21
28
|
!!renderer.stage.textRenderers.canvas;
|
|
22
|
-
|
|
29
|
+
return Promise.all(fonts.map((font) => {
|
|
23
30
|
// WebGL — SDF
|
|
24
31
|
if (renderer.stage.renderer.mode === 'webgl' &&
|
|
25
32
|
'type' in font &&
|
|
@@ -37,4 +44,71 @@ export async function loadFonts(fonts) {
|
|
|
37
44
|
}
|
|
38
45
|
}));
|
|
39
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Whether the app will run an SDF text engine. Read from the renderer options
|
|
49
|
+
* rather than the stage, because this has to be answerable before the renderer
|
|
50
|
+
* is constructed. Unknown (no `fontEngines` configured yet) is treated as
|
|
51
|
+
* "maybe", matching the stage's own SDF-first preference order.
|
|
52
|
+
*/
|
|
53
|
+
function mayUseSdf() {
|
|
54
|
+
const engines = Config.rendererOptions
|
|
55
|
+
?.fontEngines;
|
|
56
|
+
if (engines === undefined || engines.length === 0) {
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
return engines.some((engine) => engine.type === 'sdf');
|
|
60
|
+
}
|
|
61
|
+
function flushPendingFonts() {
|
|
62
|
+
if (pendingFontLoads.length === 0) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const queued = pendingFontLoads.splice(0, pendingFontLoads.length);
|
|
66
|
+
for (let i = 0; i < queued.length; i++) {
|
|
67
|
+
const pending = queued[i];
|
|
68
|
+
attachFonts(pending.fonts).then(() => pending.resolve(), pending.reject);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Load fonts into the renderer.
|
|
73
|
+
*
|
|
74
|
+
* Can be called either side of `createRenderer()`. Calling it *first* is
|
|
75
|
+
* preferred: the downloads start immediately and overlap the renderer's boot
|
|
76
|
+
* (GL context, shaders, buffers) instead of queueing behind it. The fonts are
|
|
77
|
+
* then attached to the stage as soon as it exists.
|
|
78
|
+
*
|
|
79
|
+
* The returned promise resolves when the fonts are attached to the stage — so
|
|
80
|
+
* when called before `createRenderer()`, it cannot settle until
|
|
81
|
+
* `createRenderer()` has run. Do not `await` it before creating the renderer.
|
|
82
|
+
*/
|
|
83
|
+
export async function loadFonts(fonts) {
|
|
84
|
+
if (renderer !== undefined) {
|
|
85
|
+
await attachFonts(fonts);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
// Inlined so the loadFontToDom branch + import tree-shake in WebGL builds.
|
|
89
|
+
const enableDomRenderer = DOM_RENDERING && Config.domRendererEnabled;
|
|
90
|
+
const preferSdf = mayUseSdf();
|
|
91
|
+
const deferred = [];
|
|
92
|
+
for (let i = 0; i < fonts.length; i++) {
|
|
93
|
+
const font = fonts[i];
|
|
94
|
+
// The DOM path registers fonts with the document, never with a stage —
|
|
95
|
+
// there is nothing to wait for, so finish it here.
|
|
96
|
+
if (enableDomRenderer) {
|
|
97
|
+
if ('fontUrl' in font) {
|
|
98
|
+
loadFontToDom(font);
|
|
99
|
+
}
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
// Starts the download now; the stage-dependent half is owed until
|
|
103
|
+
// `createRenderer()` runs and `flushPendingFonts()` attaches it.
|
|
104
|
+
prefetchFont(preferSdf ? font : { ...font, type: 'canvas' });
|
|
105
|
+
deferred.push(font);
|
|
106
|
+
}
|
|
107
|
+
if (deferred.length === 0) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
await new Promise((resolve, reject) => {
|
|
111
|
+
pendingFontLoads.push({ fonts: deferred, resolve, reject });
|
|
112
|
+
});
|
|
113
|
+
}
|
|
40
114
|
//# sourceMappingURL=lightningInit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lightningInit.js","sourceRoot":"","sources":["../../../src/core/lightningInit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAK/E,8EAA8E;AAC9E,MAAM,CAAC,IAAI,QAA4C,CAAC;AAExD,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,QAAQ,CAAC;AAE1C,MAAM,UAAU,sBAAsB,CACpC,OAA2D,EAC3D,SAA+B,KAAK;IAEpC,4EAA4E;IAC5E,sEAAsE;IACtE,MAAM,iBAAiB,GAAG,aAAa,IAAI,MAAM,CAAC,kBAAkB,CAAC;IAErE,QAAQ,GAAG,iBAAiB;QAC1B,CAAC,CAAC,IAAI,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC;QACtC,CAAC,CAAC,IAAI,GAAG,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"lightningInit.js","sourceRoot":"","sources":["../../../src/core/lightningInit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,aAA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chrome < 49 — notably the
|
|
4
|
+
* Chrome 38 engine on LG webOS 3.x and older Tizen — does not, which changes how
|
|
5
|
+
* solid-js merges props (see {@link mergeProps}).
|
|
6
|
+
*/
|
|
7
|
+
export declare const SUPPORTS_PROXY: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Proxy-free-safe `mergeProps`, re-exported by the renderer so the JSX compiler
|
|
10
|
+
* (`moduleName: '@lightningtv/solid'`) routes every compiled spread through it.
|
|
11
|
+
*
|
|
12
|
+
* With `Proxy` this is solid-js's `mergeProps` unchanged. Without `Proxy`
|
|
13
|
+
* (Chrome 38 / webOS 3), solid-js falls back to a path that enumerates each
|
|
14
|
+
* source via `Object.getOwnPropertyNames`. A reactive spread — e.g.
|
|
15
|
+
* `<Comp {...someFn()} />`, which the compiler passes as a *function* — reaches
|
|
16
|
+
* that fallback as the function itself, so enumeration yields `['length','name']`
|
|
17
|
+
* (or throws on `caller`/`callee`/`arguments` for strict-mode functions) instead
|
|
18
|
+
* of the object's props, and every spread-provided prop is silently dropped.
|
|
19
|
+
*
|
|
20
|
+
* Resolving function sources to their objects first lets the fallback enumerate
|
|
21
|
+
* real props. Getters are preserved, so values stay reactive; only a source
|
|
22
|
+
* whose object *identity* changes over time won't re-track — an accepted limit
|
|
23
|
+
* of running without `Proxy`.
|
|
24
|
+
*
|
|
25
|
+
* @see https://github.com/solidjs/solid/issues/2282
|
|
26
|
+
*/
|
|
27
|
+
export declare const mergeProps: typeof solidMergeProps;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { mergeProps as solidMergeProps } from 'solid-js';
|
|
2
|
+
/**
|
|
3
|
+
* Whether the host engine implements ES2015 `Proxy`. Chrome < 49 — notably the
|
|
4
|
+
* Chrome 38 engine on LG webOS 3.x and older Tizen — does not, which changes how
|
|
5
|
+
* solid-js merges props (see {@link mergeProps}).
|
|
6
|
+
*/
|
|
7
|
+
export const SUPPORTS_PROXY = typeof Proxy === 'function';
|
|
8
|
+
/**
|
|
9
|
+
* Mirror of solid-js's internal `resolveSource`: a reactive spread source is
|
|
10
|
+
* handed to `mergeProps` as a thunk; calling it yields the object to merge.
|
|
11
|
+
*/
|
|
12
|
+
function resolveSource(source) {
|
|
13
|
+
const value = typeof source === 'function' ? source() : source;
|
|
14
|
+
return value == null ? {} : value;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Proxy-free-safe `mergeProps`, re-exported by the renderer so the JSX compiler
|
|
18
|
+
* (`moduleName: '@lightningtv/solid'`) routes every compiled spread through it.
|
|
19
|
+
*
|
|
20
|
+
* With `Proxy` this is solid-js's `mergeProps` unchanged. Without `Proxy`
|
|
21
|
+
* (Chrome 38 / webOS 3), solid-js falls back to a path that enumerates each
|
|
22
|
+
* source via `Object.getOwnPropertyNames`. A reactive spread — e.g.
|
|
23
|
+
* `<Comp {...someFn()} />`, which the compiler passes as a *function* — reaches
|
|
24
|
+
* that fallback as the function itself, so enumeration yields `['length','name']`
|
|
25
|
+
* (or throws on `caller`/`callee`/`arguments` for strict-mode functions) instead
|
|
26
|
+
* of the object's props, and every spread-provided prop is silently dropped.
|
|
27
|
+
*
|
|
28
|
+
* Resolving function sources to their objects first lets the fallback enumerate
|
|
29
|
+
* real props. Getters are preserved, so values stay reactive; only a source
|
|
30
|
+
* whose object *identity* changes over time won't re-track — an accepted limit
|
|
31
|
+
* of running without `Proxy`.
|
|
32
|
+
*
|
|
33
|
+
* @see https://github.com/solidjs/solid/issues/2282
|
|
34
|
+
*/
|
|
35
|
+
export const mergeProps = ((...sources) => {
|
|
36
|
+
if (SUPPORTS_PROXY) {
|
|
37
|
+
return solidMergeProps(...sources);
|
|
38
|
+
}
|
|
39
|
+
return solidMergeProps(...sources.map((source) => typeof source === 'function' ? resolveSource(source) : source));
|
|
40
|
+
});
|
|
41
|
+
//# sourceMappingURL=mergeProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergeProps.js","sourceRoot":"","sources":["../../src/mergeProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AAEzD;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,KAAK,KAAK,UAAU,CAAC;AAE1D;;;GAGG;AACH,SAAS,aAAa,CAAC,MAAe;IACpC,MAAM,KAAK,GACT,OAAO,MAAM,KAAK,UAAU,CAAC,CAAC,CAAE,MAAwB,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;IACtE,OAAO,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;AACpC,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,GAAG,OAAkB,EAAE,EAAE;IACnD,IAAI,cAAc,EAAE,CAAC;QACnB,OAAO,eAAe,CAAC,GAAI,OAA8C,CAAC,CAAC;IAC7E,CAAC;IACD,OAAO,eAAe,CACpB,GAAI,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CACzB,OAAO,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CACvB,CACzC,CAAC;AACJ,CAAC,CAA2B,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { focusPath, useFocusManager, setActiveElementCore, type KeyMap, type KeyHoldOptions, } from '../core/focusManager.js';
|
|
1
|
+
export { focusPath, useFocusManager, setActiveElementCore, suppressKeyUntilRelease, releaseKeySuppression, type KeyMap, type KeyHoldOptions, } from '../core/focusManager.js';
|
|
2
2
|
export { activeElement, setActiveElement } from '../core/activeElement.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { focusPath, useFocusManager, setActiveElementCore, } from '../core/focusManager.js';
|
|
1
|
+
export { focusPath, useFocusManager, setActiveElementCore, suppressKeyUntilRelease, releaseKeySuppression, } from '../core/focusManager.js';
|
|
2
2
|
export { activeElement, setActiveElement } from '../core/activeElement.js';
|
|
3
3
|
//# sourceMappingURL=useFocusManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFocusManager.js","sourceRoot":"","sources":["../../../src/primitives/useFocusManager.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,eAAe,EACf,oBAAoB,
|
|
1
|
+
{"version":3,"file":"useFocusManager.js","sourceRoot":"","sources":["../../../src/primitives/useFocusManager.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,eAAe,EACf,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,GAGtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -1,9 +1,28 @@
|
|
|
1
|
+
import type { ElementNode } from '../core/elementNode.js';
|
|
2
|
+
/**
|
|
3
|
+
* A hold callback. Receives the `KeyboardEvent` that began the press, the
|
|
4
|
+
* element whose handler was invoked, and the focused (leaf) element at that
|
|
5
|
+
* moment — the same arguments a `KeyHandler` gets. All three are `undefined`
|
|
6
|
+
* when `startHold` was called without them.
|
|
7
|
+
*/
|
|
8
|
+
export type HoldCallback = (e?: KeyboardEvent, target?: ElementNode, handlerElm?: ElementNode) => void;
|
|
9
|
+
export type HoldHandler = (e?: KeyboardEvent, target?: ElementNode, handlerElm?: ElementNode) => boolean;
|
|
1
10
|
export type UseHoldProps = {
|
|
2
|
-
onHold:
|
|
3
|
-
onEnter:
|
|
4
|
-
onRelease?:
|
|
11
|
+
onHold: HoldCallback;
|
|
12
|
+
onEnter: HoldCallback;
|
|
13
|
+
onRelease?: HoldCallback;
|
|
5
14
|
holdThreshold?: number;
|
|
6
15
|
performOnEnterImmediately?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Whether a hold must be confirmed by an auto-repeat key-down.
|
|
18
|
+
*
|
|
19
|
+
* `true` (default): a press with neither key-up nor auto-repeat by the
|
|
20
|
+
* threshold resolves as a tap. `false`: it resolves as a hold, matching the
|
|
21
|
+
* legacy `keyHoldOptions` behavior. Set this to `false` on platforms whose
|
|
22
|
+
* remote input layer delivers no auto-repeat, where a hold gesture would
|
|
23
|
+
* otherwise be unreachable.
|
|
24
|
+
*/
|
|
25
|
+
holdRequiresRepeat?: boolean;
|
|
7
26
|
};
|
|
8
27
|
/**
|
|
9
28
|
* Distinguishes a tap from a press-and-hold for a single key, without depending
|
|
@@ -20,10 +39,23 @@ export type UseHoldProps = {
|
|
|
20
39
|
* - if neither key-up nor auto-repeat arrives, the timer resolves to a tap →
|
|
21
40
|
* `onEnter` after `holdThreshold` ms. This is the key-up-independent path that
|
|
22
41
|
* keeps taps working on webOS, at the cost of ~`holdThreshold` ms latency.
|
|
42
|
+
* Set `holdRequiresRepeat: false` to resolve this ambiguous case as a hold
|
|
43
|
+
* instead, on platforms that deliver no auto-repeat at all.
|
|
44
|
+
*
|
|
45
|
+
* Once `onHold` fires the key is still physically down, so the focus manager
|
|
46
|
+
* drops its remaining auto-repeats until it is released. Without that, a hold
|
|
47
|
+
* that moves focus — the canonical case, opening a context menu — would have
|
|
48
|
+
* its trailing repeats fire whatever it just focused. The same latch delivers
|
|
49
|
+
* `onRelease` even though the key-up now propagates somewhere else entirely.
|
|
23
50
|
*
|
|
24
51
|
* `performOnEnterImmediately` keeps the legacy behavior of firing `onEnter` on
|
|
25
52
|
* key-down; a long-press then fires both `onEnter` and `onHold`.
|
|
26
53
|
*
|
|
54
|
+
* Note that `startHold` returns `true`, which ends the bubble phase: ancestor
|
|
55
|
+
* handlers for that key will not run, and whether the press was a tap isn't
|
|
56
|
+
* known until after propagation is over. If an ancestor performs navigation,
|
|
57
|
+
* invoke it from `onEnter` yourself. See the caveat in the docs.
|
|
58
|
+
*
|
|
27
59
|
* @example
|
|
28
60
|
* const [holdRight, releaseRight] = useHold({
|
|
29
61
|
* onHold: handleHoldRight,
|
|
@@ -37,8 +69,12 @@ export type UseHoldProps = {
|
|
|
37
69
|
* onRightRelease={releaseRight}
|
|
38
70
|
* />
|
|
39
71
|
*
|
|
72
|
+
* `startHold` reads `e.repeat` to detect a hold. Used directly as a `KeyHandler`
|
|
73
|
+
* (above) it gets the event; if you wrap it, forward all of the arguments, or
|
|
74
|
+
* hold detection silently never triggers.
|
|
75
|
+
*
|
|
40
76
|
* @param {UseHoldProps} props - The properties for configuring the hold behavior.
|
|
41
|
-
* @returns {[
|
|
77
|
+
* @returns {[HoldHandler, HoldHandler]} A tuple of `startHold` and `releaseHold`.
|
|
42
78
|
*/
|
|
43
|
-
export declare function useHold(props: UseHoldProps):
|
|
79
|
+
export declare function useHold(props: UseHoldProps): [HoldHandler, HoldHandler];
|
|
44
80
|
export default useHold;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createMemo } from 'solid-js';
|
|
2
|
+
import { suppressKeyUntilRelease } from '../core/focusManager.js';
|
|
2
3
|
/**
|
|
3
4
|
* Distinguishes a tap from a press-and-hold for a single key, without depending
|
|
4
5
|
* on the key-up event. This matters on TV platforms (notably LG webOS) where the
|
|
@@ -14,10 +15,23 @@ import { createMemo } from 'solid-js';
|
|
|
14
15
|
* - if neither key-up nor auto-repeat arrives, the timer resolves to a tap →
|
|
15
16
|
* `onEnter` after `holdThreshold` ms. This is the key-up-independent path that
|
|
16
17
|
* keeps taps working on webOS, at the cost of ~`holdThreshold` ms latency.
|
|
18
|
+
* Set `holdRequiresRepeat: false` to resolve this ambiguous case as a hold
|
|
19
|
+
* instead, on platforms that deliver no auto-repeat at all.
|
|
20
|
+
*
|
|
21
|
+
* Once `onHold` fires the key is still physically down, so the focus manager
|
|
22
|
+
* drops its remaining auto-repeats until it is released. Without that, a hold
|
|
23
|
+
* that moves focus — the canonical case, opening a context menu — would have
|
|
24
|
+
* its trailing repeats fire whatever it just focused. The same latch delivers
|
|
25
|
+
* `onRelease` even though the key-up now propagates somewhere else entirely.
|
|
17
26
|
*
|
|
18
27
|
* `performOnEnterImmediately` keeps the legacy behavior of firing `onEnter` on
|
|
19
28
|
* key-down; a long-press then fires both `onEnter` and `onHold`.
|
|
20
29
|
*
|
|
30
|
+
* Note that `startHold` returns `true`, which ends the bubble phase: ancestor
|
|
31
|
+
* handlers for that key will not run, and whether the press was a tap isn't
|
|
32
|
+
* known until after propagation is over. If an ancestor performs navigation,
|
|
33
|
+
* invoke it from `onEnter` yourself. See the caveat in the docs.
|
|
34
|
+
*
|
|
21
35
|
* @example
|
|
22
36
|
* const [holdRight, releaseRight] = useHold({
|
|
23
37
|
* onHold: handleHoldRight,
|
|
@@ -31,16 +45,25 @@ import { createMemo } from 'solid-js';
|
|
|
31
45
|
* onRightRelease={releaseRight}
|
|
32
46
|
* />
|
|
33
47
|
*
|
|
48
|
+
* `startHold` reads `e.repeat` to detect a hold. Used directly as a `KeyHandler`
|
|
49
|
+
* (above) it gets the event; if you wrap it, forward all of the arguments, or
|
|
50
|
+
* hold detection silently never triggers.
|
|
51
|
+
*
|
|
34
52
|
* @param {UseHoldProps} props - The properties for configuring the hold behavior.
|
|
35
|
-
* @returns {[
|
|
53
|
+
* @returns {[HoldHandler, HoldHandler]} A tuple of `startHold` and `releaseHold`.
|
|
36
54
|
*/
|
|
37
55
|
export function useHold(props) {
|
|
38
56
|
const holdThreshold = createMemo(() => props.holdThreshold ?? 500);
|
|
39
57
|
const performOnEnterImmediately = createMemo(() => props.performOnEnterImmediately ?? false);
|
|
58
|
+
const holdRequiresRepeat = createMemo(() => props.holdRequiresRepeat ?? true);
|
|
40
59
|
let holdTimeout = -1;
|
|
41
60
|
let enterFired = false; // onEnter already fired for this press
|
|
42
61
|
let holdFired = false; // onHold already fired for this press
|
|
43
62
|
let repeated = false; // an auto-repeat key-down was seen (key still held)
|
|
63
|
+
// Context from the key-down that began the press, replayed to whichever
|
|
64
|
+
// callback resolves it — the timer path has no event of its own, and after a
|
|
65
|
+
// focus-moving hold neither does the release.
|
|
66
|
+
let press = [];
|
|
44
67
|
const reset = () => {
|
|
45
68
|
if (holdTimeout !== -1) {
|
|
46
69
|
clearTimeout(holdTimeout);
|
|
@@ -49,8 +72,16 @@ export function useHold(props) {
|
|
|
49
72
|
enterFired = false;
|
|
50
73
|
holdFired = false;
|
|
51
74
|
repeated = false;
|
|
75
|
+
press = [];
|
|
52
76
|
};
|
|
53
|
-
const
|
|
77
|
+
const fireRelease = () => {
|
|
78
|
+
if (!holdFired)
|
|
79
|
+
return;
|
|
80
|
+
const args = press;
|
|
81
|
+
reset(); // before the callback, so a re-entrant press isn't clobbered
|
|
82
|
+
props.onRelease?.(...args);
|
|
83
|
+
};
|
|
84
|
+
const startHold = (e, target, handlerElm) => {
|
|
54
85
|
// Auto-repeat key-down: the key is still held. Record it so the timer
|
|
55
86
|
// resolves to a hold even if the key-up event never arrives (webOS).
|
|
56
87
|
if (e?.repeat) {
|
|
@@ -60,27 +91,33 @@ export function useHold(props) {
|
|
|
60
91
|
// Fresh key-down begins a new press. Reset first so a previous press whose
|
|
61
92
|
// key-up was never delivered doesn't leave us wedged for this one.
|
|
62
93
|
reset();
|
|
94
|
+
press = [e, target, handlerElm];
|
|
63
95
|
if (performOnEnterImmediately()) {
|
|
64
96
|
enterFired = true;
|
|
65
|
-
props.onEnter();
|
|
97
|
+
props.onEnter(...press);
|
|
66
98
|
}
|
|
67
99
|
holdTimeout = setTimeout(() => {
|
|
68
100
|
holdTimeout = -1;
|
|
69
|
-
if (repeated) {
|
|
101
|
+
if (repeated || !holdRequiresRepeat()) {
|
|
70
102
|
// Held past the threshold → hold gesture.
|
|
71
103
|
holdFired = true;
|
|
72
|
-
|
|
104
|
+
// The key is still down and will keep repeating. Drop those repeats so
|
|
105
|
+
// they can't reach whatever onHold focuses, and route the key-up back
|
|
106
|
+
// here even if this element is no longer in the focus path.
|
|
107
|
+
if (e)
|
|
108
|
+
suppressKeyUntilRelease(e, fireRelease);
|
|
109
|
+
props.onHold(...press);
|
|
73
110
|
}
|
|
74
111
|
else if (!enterFired) {
|
|
75
112
|
// No key-up and no auto-repeat arrived: resolve as a tap so the
|
|
76
113
|
// primary action still fires on remotes that swallow key-up.
|
|
77
114
|
enterFired = true;
|
|
78
|
-
props.onEnter();
|
|
115
|
+
props.onEnter(...press);
|
|
79
116
|
}
|
|
80
117
|
}, holdThreshold());
|
|
81
118
|
return true;
|
|
82
119
|
};
|
|
83
|
-
const releaseHold = () => {
|
|
120
|
+
const releaseHold = (e, target, handlerElm) => {
|
|
84
121
|
if (holdTimeout !== -1) {
|
|
85
122
|
// Released before the threshold → tap. Fires immediately where key-up is
|
|
86
123
|
// delivered, avoiding the timer latency.
|
|
@@ -88,13 +125,16 @@ export function useHold(props) {
|
|
|
88
125
|
holdTimeout = -1;
|
|
89
126
|
if (!enterFired) {
|
|
90
127
|
enterFired = true;
|
|
91
|
-
props.onEnter();
|
|
128
|
+
props.onEnter(e ?? press[0], target ?? press[1], handlerElm ?? press[2]);
|
|
92
129
|
}
|
|
130
|
+
reset();
|
|
93
131
|
}
|
|
94
|
-
else
|
|
95
|
-
|
|
132
|
+
else {
|
|
133
|
+
// After a hold, the suppression latch has usually already fired onRelease
|
|
134
|
+
// and reset — `holdFired` is false and this is a no-op.
|
|
135
|
+
fireRelease();
|
|
136
|
+
reset();
|
|
96
137
|
}
|
|
97
|
-
reset();
|
|
98
138
|
return true;
|
|
99
139
|
};
|
|
100
140
|
return [startHold, releaseHold];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHold.js","sourceRoot":"","sources":["../../../src/primitives/useHold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"useHold.js","sourceRoot":"","sources":["../../../src/primitives/useHold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAuClE;;;;;;;;;;;;;;;;;;;;;;;;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CAAC;YAC1B,WAAW,GAAG,CAAC,CAAC,CAAC;YACjB,IAAI,CAAC,UAAU,EAAE,CAAC;gBAChB,UAAU,GAAG,IAAI,CAAC;gBAClB,KAAK,CAAC,OAAO,CACX,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,EACb,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,EAClB,UAAU,IAAI,KAAK,CAAC,CAAC,CAAC,CACvB,CAAC;YACJ,CAAC;YACD,KAAK,EAAE,CAAC;QACV,CAAC;aAAM,CAAC;YACN,0EAA0E;YAC1E,wDAAwD;YACxD,WAAW,EAAE,CAAC;YACd,KAAK,EAAE,CAAC;QACV,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AAClC,CAAC;AAED,eAAe,OAAO,CAAC"}
|
package/dist/src/render.d.ts
CHANGED
|
@@ -7,7 +7,8 @@ export declare function createRenderer(rendererOptions?: RendererMainSettings |
|
|
|
7
7
|
rootNode: import("./core/elementNode.js").ElementNode;
|
|
8
8
|
render: (code: () => JSXElement) => () => void;
|
|
9
9
|
};
|
|
10
|
-
export declare const effect: <T>(fn: (prev?: T) => T, init?: T) => void, memo: <T>(fn: () => T, equal: boolean) => () => T, createComponent: <T>(Comp: (props: T) => SolidNode, props: T) => SolidNode, createElement: (tag: string) => SolidNode, createTextNode: (value: string) => SolidNode, insertNode: (parent: SolidNode, node: SolidNode, anchor?: SolidNode | undefined) => void, insert: <T>(parent: any, accessor: T | (() => T), marker?: any | null) => SolidNode, spread: <T>(node: any, accessor: (() => T) | T, skipChildren?: Boolean) => void, setProp: <T>(node: SolidNode, name: string, value: T, prev?: T | undefined) => T,
|
|
10
|
+
export declare const effect: <T>(fn: (prev?: T) => T, init?: T) => void, memo: <T>(fn: () => T, equal: boolean) => () => T, createComponent: <T>(Comp: (props: T) => SolidNode, props: T) => SolidNode, createElement: (tag: string) => SolidNode, createTextNode: (value: string) => SolidNode, insertNode: (parent: SolidNode, node: SolidNode, anchor?: SolidNode | undefined) => void, insert: <T>(parent: any, accessor: T | (() => T), marker?: any | null) => SolidNode, spread: <T>(node: any, accessor: (() => T) | T, skipChildren?: Boolean) => void, setProp: <T>(node: SolidNode, name: string, value: T, prev?: T | undefined) => T, use: <A, T>(fn: (element: SolidNode, arg: A) => T, element: SolidNode, arg: A) => T;
|
|
11
|
+
export { mergeProps } from './mergeProps.js';
|
|
11
12
|
type Task = () => void;
|
|
12
13
|
export declare function setTasksEnabled(enabled: boolean): void;
|
|
13
14
|
export declare function clearTasks(): void;
|
|
@@ -31,4 +32,3 @@ export declare const View: (props: NodeProps) => JSXElement;
|
|
|
31
32
|
*/
|
|
32
33
|
export declare const Text: (props: TextProps) => JSXElement;
|
|
33
34
|
export declare function registerDefaultShader(_name: string, _shader: any): void;
|
|
34
|
-
export {};
|
package/dist/src/render.js
CHANGED
|
@@ -25,7 +25,11 @@ export function createRenderer(rendererOptions, node) {
|
|
|
25
25
|
render,
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
export const { effect, memo, createComponent, createElement, createTextNode, insertNode, insert, spread, setProp,
|
|
28
|
+
export const { effect, memo, createComponent, createElement, createTextNode, insertNode, insert, spread, setProp, use, } = solidRenderer;
|
|
29
|
+
// Re-export a Proxy-free-safe mergeProps in place of the renderer's own so the
|
|
30
|
+
// JSX compiler routes compiled spreads through it — fixes dropped spread props
|
|
31
|
+
// on engines without Proxy (Chrome 38 / webOS 3). See ./mergeProps.ts.
|
|
32
|
+
export { mergeProps } from './mergeProps.js';
|
|
29
33
|
const taskQueue = [];
|
|
30
34
|
let tasksEnabled = false;
|
|
31
35
|
createRoot(() => {
|
package/dist/src/render.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.js","sourceRoot":"","sources":["../../src/render.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;A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