react-native-web-tv 0.21.2-tv.3 → 0.21.2-tv.4

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 CHANGED
@@ -2,10 +2,33 @@
2
2
 
3
3
  [![npm version][package-badge]][package-url] [![Build Status][ci-badge]][ci-url] [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://reactjs.org/docs/how-to-contribute.html#your-first-pull-request)
4
4
 
5
- "React Native Web for TV" makes it possible to run [React Native][react-native-url] components and APIs on the web based TVs using React Native Web.
5
+ "React Native Web for TV" makes it possible to run [React Native][react-native-url] components and APIs on the web based TVs using React Native Web with spatial navigation enabled by default.
6
6
 
7
7
  It is derived from [React Native Web](https://github.com/necolas/react-native-web), and this fork remains intentionally close to that project while extending it for browser-based TV platforms. Thanks to the RNW project for the foundation this fork builds on 🙏.
8
8
 
9
+ ---
10
+
11
+ ## 🚀 Out-of-the-box Spatial Navigation for Web-based TV
12
+
13
+
14
+ **Built-in LRUD spatial navigation and remote focus for web-based TV platforms (e.g., Samsung Tizen TV, LG webOS TV, and other browser-based TV environments).**
15
+
16
+ > **â„šī¸ Note:** This package provides built-in spatial navigation logic (LRUD) and remote focus, but your app must ensure that platform-specific remote keys (such as arrow, OK, Back, Menu) are registered and delivered to the browser. On some TV platforms, this requires a one-time setup in your app or hosting environment. Once keys are registered, no extra libraries are needed for spatial navigation.
17
+
18
+ The spatial navigation layer is integrated and enabled by default once remote key events reach the browser.
19
+
20
+ ### Configurability
21
+
22
+ Spatial navigation and remote key handling can be customized for your app or platform. See the [Spatial navigation configuration](#spatial-navigation-configuration) section below for details and examples.
23
+
24
+ For advanced use cases, you can:
25
+ - Remap remote keys for different TV platforms
26
+ - Adjust focus and scroll behavior
27
+
28
+ See the [TV Navigation documentation](https://hps1978.github.io/react-native-web-tv/docs/tv-navigation/) for more platform-specific tips, best practices, and migration notes.
29
+
30
+ ---
31
+
9
32
  ## Documentation
10
33
 
11
34
  The documentation site is hosted at [https://hps1978.github.io/react-native-web-tv/](https://hps1978.github.io/react-native-web-tv/). Documentation source lives in `packages/react-native-web-docs` and can also be built locally from the monorepo.
@@ -42,7 +65,7 @@ This fork keeps the broader React Native Web example surface and adds TV-specifi
42
65
 
43
66
  Some inherited examples are still general RNW demos and are not yet adapted for LRUD or remote-focus behavior. The TV-focused routes, along with the examples already updated for focus handling, can be exercised directly in a browser for testing and debugging.
44
67
 
45
- Useful TV-oriented routes include:
68
+ Useful TV-oriented examples include:
46
69
 
47
70
  * `/tv-event-handler`
48
71
  * `/tv-focus-guide-view`
@@ -54,7 +77,7 @@ Useful TV-oriented routes include:
54
77
  This fork adds Web TV spatial navigation and TV-specific APIs.
55
78
 
56
79
  Highlights:
57
- * TV spatial navigation via a forked `@bbc/tv-lrud-spatial` implementation from [hps1978/lrud-spatial-rnw](https://github.com/hps1978/lrud-spatial-rnw). It's wired into React Native Web through SpatialManager.
80
+ * TV spatial navigation via a forked `@hps1978/tv-lrud-spatial` implementation from [hps1978/lrud-spatial-rnw](https://github.com/hps1978/lrud-spatial-rnw). It's wired into React Native Web through SpatialManager.
58
81
  * New TV exports: `TVEventHandler`, `TVEventControl`, `TVFocusGuideView`, `TVTextScrollView`, `useTVEventHandler`, and `TVRemoteEvent`.
59
82
  * TV focus props include `tvFocusable`, `isTVSelectable`, `hasTVPreferredFocus`, `autoFocus`, `trapFocusUp/Down/Left/Right`, `destinations`, and directional focus routing (`nextFocusUp/Down/Left/Right/Forward`).
60
83
  * RecyclerListView adapter for `VirtualizedList`/`FlatList` (via `recyclerlistview`) to improve large-list performance on TV. NOTE: Disabled at the moment to fix some issues.
@@ -131,7 +154,7 @@ To help you get you familiar with the contribution process, there is a list of [
131
154
 
132
155
  React Native Web for TV is [MIT licensed](./LICENSE). By contributing to React Native Web for TV, you agree that your contributions will be licensed under its MIT license.
133
156
 
134
- This fork also depends on Apache-2.0 licensed TV navigation code via `@bbc/tv-lrud-spatial`.
157
+ This fork also depends on Apache-2.0 licensed TV navigation code via `@hps1978/tv-lrud-spatial`.
135
158
  See [THIRD_PARTY_NOTICES.md](./THIRD_PARTY_NOTICES.md) and [APACHE-2.0.txt](./APACHE-2.0.txt) for redistribution details.
136
159
 
137
160
  [package-badge]: https://img.shields.io/npm/v/react-native-web-tv.svg?style=flat
@@ -4,7 +4,7 @@ This package is primarily distributed under the MIT license.
4
4
 
5
5
  It also depends on third-party TV spatial navigation code under the Apache License 2.0:
6
6
 
7
- - `@bbc/tv-lrud-spatial`
7
+ - `@hps1978/tv-lrud-spatial`
8
8
  - Source used by this fork is resolved from `github:hps1978/lrud-spatial-rnw`
9
9
  - Package version in the current dependency tree: `0.0.16`
10
10
  - Original upstream project: `https://github.com/bbc/lrud-spatial`
@@ -6,7 +6,7 @@ exports.teardownSpatialNavigation = exports.takeKeyHandlerControl = exports.setu
6
6
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
7
7
  var _classPrivateFieldLooseBase2 = _interopRequireDefault(require("@babel/runtime/helpers/classPrivateFieldLooseBase"));
8
8
  var _classPrivateFieldLooseKey2 = _interopRequireDefault(require("@babel/runtime/helpers/classPrivateFieldLooseKey"));
9
- var _tvLrudSpatial = require("@bbc/tv-lrud-spatial");
9
+ var _tvLrudSpatial = require("@hps1978/tv-lrud-spatial");
10
10
  var _addEventListener = require("../addEventListener");
11
11
  var _utils = require("../../exports/TV/utils");
12
12
  var _mutationObserver = require("./mutationObserver");
@@ -25,7 +25,7 @@ var _SpatialManager;
25
25
  var _instance = /*#__PURE__*/(0, _classPrivateFieldLooseKey2.default)("_instance");
26
26
  /**
27
27
  * SpatialManager
28
- * Manages spatial navigation for TV platforms using the @bbc/tv-lrud-spatial library.
28
+ * Manages spatial navigation for TV platforms using the @hps1978/tv-lrud-spatial library.
29
29
  * Implements singleton pattern to ensure only one instance exists across the app.
30
30
  */
31
31
  class SpatialManager {
@@ -12,7 +12,7 @@ var _SpatialManager;
12
12
  * @format
13
13
  */
14
14
 
15
- import { setConfig as setLrudConfig, getNextFocus, getParentContainer, updateAncestorsAutoFocus, findDestinationOrAutofocus, getNextFocusInViewport } from '@bbc/tv-lrud-spatial';
15
+ import { setConfig as setLrudConfig, getNextFocus, getParentContainer, updateAncestorsAutoFocus, findDestinationOrAutofocus, getNextFocusInViewport } from '@hps1978/tv-lrud-spatial';
16
16
  import { addEventListener } from '../addEventListener';
17
17
  import { setupNodeId } from '../../exports/TV/utils';
18
18
  import { startObserving, stopObserving } from './mutationObserver';
@@ -20,7 +20,7 @@ import { scrollContainer, scrollToElement, setupAppInitiatedScrollHandler, isEle
20
20
  var _instance = /*#__PURE__*/_classPrivateFieldLooseKey("_instance");
21
21
  /**
22
22
  * SpatialManager
23
- * Manages spatial navigation for TV platforms using the @bbc/tv-lrud-spatial library.
23
+ * Manages spatial navigation for TV platforms using the @hps1978/tv-lrud-spatial library.
24
24
  * Implements singleton pattern to ensure only one instance exists across the app.
25
25
  */
26
26
  class SpatialManager {
@@ -8,7 +8,7 @@
8
8
  * @format
9
9
  */
10
10
 
11
- import { setConfig as setLrudConfig, getNextFocus, getParentContainer, updateAncestorsAutoFocus, findDestinationOrAutofocus, getNextFocusInViewport } from '@bbc/tv-lrud-spatial';
11
+ import { setConfig as setLrudConfig, getNextFocus, getParentContainer, updateAncestorsAutoFocus, findDestinationOrAutofocus, getNextFocusInViewport } from '@hps1978/tv-lrud-spatial';
12
12
  import { addEventListener } from '../addEventListener';
13
13
  import { setupNodeId } from '../../exports/TV/utils';
14
14
  import type { ElemData } from './utils';
@@ -27,7 +27,7 @@ type SpatialNavigationConfigType = {
27
27
 
28
28
  /**
29
29
  * SpatialManager
30
- * Manages spatial navigation for TV platforms using the @bbc/tv-lrud-spatial library.
30
+ * Manages spatial navigation for TV platforms using the @hps1978/tv-lrud-spatial library.
31
31
  * Implements singleton pattern to ensure only one instance exists across the app.
32
32
  */
33
33
  declare class SpatialManager {
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "name": "react-native-web-tv",
7
- "version": "0.21.2-tv.3",
7
+ "version": "0.21.2-tv.4",
8
8
  "description": "React Native Web for TV",
9
9
  "module": "dist/index.js",
10
10
  "main": "dist/cjs/index.js",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@babel/runtime": "^7.18.6",
31
- "@bbc/tv-lrud-spatial": "github:hps1978/lrud-spatial-rnw",
31
+ "@hps1978/tv-lrud-spatial": "^0.0.17",
32
32
  "@react-native/normalize-colors": "^0.74.1",
33
33
  "fbjs": "^3.0.4",
34
34
  "inline-style-prefixer": "^7.0.1",
@@ -15,7 +15,7 @@ import {
15
15
  updateAncestorsAutoFocus,
16
16
  findDestinationOrAutofocus,
17
17
  getNextFocusInViewport
18
- } from '@bbc/tv-lrud-spatial';
18
+ } from '@hps1978/tv-lrud-spatial';
19
19
  import { addEventListener } from '../addEventListener';
20
20
  import { setupNodeId } from '../../exports/TV/utils';
21
21
  import type { ElemData } from './utils';
@@ -47,7 +47,7 @@ type SpatialNavigationConfigType = {
47
47
 
48
48
  /**
49
49
  * SpatialManager
50
- * Manages spatial navigation for TV platforms using the @bbc/tv-lrud-spatial library.
50
+ * Manages spatial navigation for TV platforms using the @hps1978/tv-lrud-spatial library.
51
51
  * Implements singleton pattern to ensure only one instance exists across the app.
52
52
  */
53
53
  class SpatialManager {