@buoy-gg/tv-remote 7.0.41 → 7.0.43

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.
@@ -1,56 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "arm", {
7
- enumerable: true,
8
- get: function () {
9
- return _tvEventStore.arm;
10
- }
11
- });
12
- Object.defineProperty(exports, "clear", {
13
- enumerable: true,
14
- get: function () {
15
- return _tvEventStore.clear;
16
- }
17
- });
18
- Object.defineProperty(exports, "disarm", {
19
- enumerable: true,
20
- get: function () {
21
- return _tvEventStore.disarm;
22
- }
23
- });
24
- Object.defineProperty(exports, "getEventsSince", {
25
- enumerable: true,
26
- get: function () {
27
- return _tvEventStore.getEventsSince;
28
- }
29
- });
30
- Object.defineProperty(exports, "getState", {
31
- enumerable: true,
32
- get: function () {
33
- return _tvEventStore.getState;
34
- }
35
- });
36
- Object.defineProperty(exports, "setMenuCapture", {
37
- enumerable: true,
38
- get: function () {
39
- return _tvEventStore.setMenuCapture;
40
- }
41
- });
42
- Object.defineProperty(exports, "subscribe", {
43
- enumerable: true,
44
- get: function () {
45
- return _tvEventStore.subscribe;
46
- }
47
- });
48
- Object.defineProperty(exports, "tvRemoteSyncAdapter", {
49
- enumerable: true,
50
- get: function () {
51
- return _tvRemoteSyncAdapter.tvRemoteSyncAdapter;
52
- }
53
- });
54
- var _tvRemoteSyncAdapter = require("./sync/tvRemoteSyncAdapter");
55
- var _tvEventStore = require("./store/tvEventStore");
56
- //# sourceMappingURL=index.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"arm",{enumerable:true,get:function(){return _tvEventStore.arm}});Object.defineProperty(exports,"clear",{enumerable:true,get:function(){return _tvEventStore.clear}});Object.defineProperty(exports,"disarm",{enumerable:true,get:function(){return _tvEventStore.disarm}});Object.defineProperty(exports,"getEventsSince",{enumerable:true,get:function(){return _tvEventStore.getEventsSince}});Object.defineProperty(exports,"getState",{enumerable:true,get:function(){return _tvEventStore.getState}});Object.defineProperty(exports,"setMenuCapture",{enumerable:true,get:function(){return _tvEventStore.setMenuCapture}});Object.defineProperty(exports,"subscribe",{enumerable:true,get:function(){return _tvEventStore.subscribe}});Object.defineProperty(exports,"tvRemoteSyncAdapter",{enumerable:true,get:function(){return _tvRemoteSyncAdapter.tvRemoteSyncAdapter}});var _tvRemoteSyncAdapter=require("./sync/tvRemoteSyncAdapter");var _tvEventStore=require("./store/tvEventStore");
@@ -1,10 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.remotePlatform = void 0;
7
- var ReactNative = _interopRequireWildcard(require("react-native"));
8
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
9
- const remotePlatform = exports.remotePlatform = ReactNative;
10
- //# sourceMappingURL=remotePlatform.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.remotePlatform=void 0;var ReactNative=_interopRequireWildcard(require("react-native"));function _interopRequireWildcard(i,f){if("function"==typeof WeakMap)var u=new WeakMap,c=new WeakMap;return(_interopRequireWildcard=function(t,a){if(!a&&t&&t.__esModule)return t;var e,n,o={__proto__:null,default:t};if(null===t||"object"!=typeof t&&"function"!=typeof t)return o;if(e=a?c:u){if(e.has(t))return e.get(t);e.set(t,o)}for(const r in t)"default"!==r&&{}.hasOwnProperty.call(t,r)&&((n=(e=Object.defineProperty)&&Object.getOwnPropertyDescriptor(t,r))&&(n.get||n.set)?e(o,r,n):o[r]=t[r]);return o})(i,f)}const remotePlatform=exports.remotePlatform=ReactNative;
@@ -1,43 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.remotePlatform = void 0;
7
- const keys = {
8
- ArrowUp: 'up',
9
- ArrowDown: 'down',
10
- ArrowLeft: 'left',
11
- ArrowRight: 'right',
12
- Enter: 'select',
13
- ' ': 'select',
14
- Escape: 'menu',
15
- MediaPlayPause: 'playPause'
16
- };
17
- const remotePlatform = exports.remotePlatform = {
18
- Platform: {
19
- OS: 'web',
20
- isTV: false
21
- },
22
- TVEventHandler: {
23
- addListener(listener) {
24
- if (typeof document === 'undefined') return {
25
- remove() {}
26
- };
27
- const onKey = event => {
28
- const eventType = keys[event.key];
29
- if (eventType) listener({
30
- eventType,
31
- eventKeyAction: 1
32
- });
33
- };
34
- document.addEventListener('keyup', onKey, true);
35
- return {
36
- remove() {
37
- document.removeEventListener('keyup', onKey, true);
38
- }
39
- };
40
- }
41
- }
42
- };
43
- //# sourceMappingURL=remotePlatform.web.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.remotePlatform=void 0;const keys={ArrowUp:"up",ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right",Enter:"select"," ":"select",Escape:"menu",MediaPlayPause:"playPause"};const remotePlatform=exports.remotePlatform={Platform:{OS:"web",isTV:false},TVEventHandler:{addListener(r){if(typeof document==="undefined")return{remove(){}};const e=o=>{const t=keys[o.key];if(t)r({eventType:t,eventKeyAction:1})};document.addEventListener("keyup",e,true);return{remove(){document.removeEventListener("keyup",e,true)}}}}};
@@ -1,167 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.arm = arm;
7
- exports.clear = clear;
8
- exports.disarm = disarm;
9
- exports.getEventsSince = getEventsSince;
10
- exports.getState = getState;
11
- exports.setMenuCapture = setMenuCapture;
12
- exports.subscribe = subscribe;
13
- var _remotePlatform = require("./remotePlatform");
14
- /**
15
- * tvEventStore — the whole device-side half of the TV remote tool.
16
- *
17
- * CONTRACT: this store only ever OBSERVES. It never injects, synthesizes, or
18
- * fakes a remote press. Presses come from the host (Buoy Desktop shells out to
19
- * `adb shell input keyevent` / `idb ui key`), because those go through the real
20
- * platform focus engine; anything we could fake in-process would move focus
21
- * without firing events, or fire events without moving focus. See
22
- * TV_REMOTE_DRIVER_PLAN.md §2.
23
- *
24
- * It is also deliberately UI-less. On Android TV any focusable view we rendered
25
- * would become a D-pad stop in the host app's focus order, so the tool would
26
- * alter the navigation it is supposed to be replaying.
27
- *
28
- * Safe to ship in non-TV apps: the native event emitter is never touched unless
29
- * `Platform.isTV` is true, so the cost on a phone is one boolean.
30
- */
31
-
32
- /** One captured remote event, as it goes over the wire to the dashboard. */
33
-
34
- /**
35
- * Ring buffer depth. Replay polls `getEventsSince` every few dozen ms with a
36
- * ~2s budget per step, so 50 is many times more than any echo needs; it exists
37
- * so a human scrubbing the echo strip has some scrollback.
38
- */
39
- const MAX_EVENTS = 50;
40
-
41
- /**
42
- * Continuous gestures are not presses and are never recorded — the macro format
43
- * is discrete keys. Dropping them here keeps them out of the ring buffer so
44
- * they can't push real presses out of it during a replay.
45
- */
46
- const IGNORED_EVENT_TYPES = new Set(["pan", "swipeUp", "swipeDown", "swipeLeft", "swipeRight"]);
47
- /**
48
- * `TVEventHandler` / `TVEventControl` only exist on the react-native-tvos fork.
49
- * A namespace read (rather than a named import) keeps this module importable on
50
- * stock react-native, where those exports are absent.
51
- */
52
- const RN = _remotePlatform.remotePlatform;
53
- const isTV = RN.Platform?.isTV === true;
54
- const supportsInput = isTV || RN.Platform?.OS === "web";
55
- let events = [];
56
- let seq = 0;
57
- let armed = false;
58
- let menuCaptureArmed = false;
59
- let subscription = null;
60
- const listeners = new Set();
61
- function emitChange() {
62
- listeners.forEach(listener => {
63
- listener();
64
- });
65
- }
66
- function handleEvent(raw) {
67
- // Disarming removes the subscription, but don't take that on trust: a native
68
- // emitter that delivered one more event after `remove()` would land a stray
69
- // press in the buffer, and a stray press is exactly what a replay would
70
- // mistake for a step's echo.
71
- if (!armed) return;
72
- const event = raw;
73
- const eventType = event?.eventType;
74
- if (typeof eventType !== "string") return;
75
- if (IGNORED_EVENT_TYPES.has(eventType)) return;
76
-
77
- /**
78
- * Dedupe by ignoring key DOWN, never key UP. tvOS emits keyAction 1 (up)
79
- * ONLY — taps reach the gesture recognizer at StateEnded — so filtering to
80
- * "down" would swallow every tvOS event. Android's down-emit is
81
- * feature-flagged off by default, but dropping it here is the correct
82
- * invariant either way: one press must produce exactly one echo.
83
- */
84
- if (event?.eventKeyAction === 0) return;
85
- seq += 1;
86
- const next = {
87
- seq,
88
- t: Date.now(),
89
- eventType,
90
- eventKeyAction: event?.eventKeyAction
91
- };
92
- events = events.length >= MAX_EVENTS ? [...events.slice(1), next] : [...events, next];
93
- emitChange();
94
- }
95
-
96
- /** Start pushing remote events into the buffer. Idempotent. */
97
- function arm() {
98
- if (armed) return;
99
- armed = true;
100
- if (supportsInput && RN.TVEventHandler && !subscription) {
101
- subscription = RN.TVEventHandler.addListener(handleEvent);
102
- }
103
- emitChange();
104
- }
105
-
106
- /**
107
- * Stop capturing and hand the Menu key back to the platform. Every teardown
108
- * path funnels through here — leaving menu capture on would leave the app
109
- * unable to navigate back, which is an App Store behavior change.
110
- */
111
- function disarm() {
112
- if (subscription) {
113
- subscription.remove();
114
- subscription = null;
115
- }
116
- if (menuCaptureArmed) setMenuCapture(false);
117
- if (!armed) return;
118
- armed = false;
119
- emitChange();
120
- }
121
-
122
- /**
123
- * tvOS: route the Menu key to JS so it can be recorded, instead of letting it
124
- * pop the navigation stack (and background the app at the root). This changes
125
- * how the app under test behaves, so it is opt-in per recording session and is
126
- * always undone on disarm.
127
- */
128
- function setMenuCapture(on) {
129
- if (!isTV || RN.Platform.OS !== "ios" || !RN.TVEventControl) return;
130
- if (on === menuCaptureArmed) return;
131
- if (on) {
132
- RN.TVEventControl.enableTVMenuKey();
133
- } else {
134
- RN.TVEventControl.disableTVMenuKey();
135
- }
136
- menuCaptureArmed = on;
137
- emitChange();
138
- }
139
- function clear() {
140
- if (events.length === 0) return;
141
- events = [];
142
- emitChange();
143
- }
144
-
145
- /** Events strictly newer than `sinceSeq` — the replay echo cursor. */
146
- function getEventsSince(sinceSeq) {
147
- if (!Number.isFinite(sinceSeq)) return events.slice();
148
- return events.filter(event => event.seq > sinceSeq);
149
- }
150
- function getState() {
151
- return {
152
- supported: supportsInput,
153
- platform: RN.Platform?.OS ?? "unknown",
154
- captureArmed: armed,
155
- listening: subscription !== null,
156
- menuCaptureArmed,
157
- seq,
158
- recent: events.slice()
159
- };
160
- }
161
- function subscribe(listener) {
162
- listeners.add(listener);
163
- return () => {
164
- listeners.delete(listener);
165
- };
166
- }
167
- //# sourceMappingURL=tvEventStore.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.arm=arm;exports.clear=clear;exports.disarm=disarm;exports.getEventsSince=getEventsSince;exports.getState=getState;exports.setMenuCapture=setMenuCapture;exports.subscribe=subscribe;var _remotePlatform=require("./remotePlatform");const MAX_EVENTS=50;const IGNORED_EVENT_TYPES=new Set(["pan","swipeUp","swipeDown","swipeLeft","swipeRight"]);const RN=_remotePlatform.remotePlatform;const isTV=RN.Platform?.isTV===true;const supportsInput=isTV||RN.Platform?.OS==="web";let events=[];let seq=0;let armed=false;let menuCaptureArmed=false;let subscription=null;const listeners=new Set;function emitChange(){listeners.forEach(e=>{e()})}function handleEvent(e){if(!armed)return;const t=e;const n=t?.eventType;if(typeof n!=="string")return;if(IGNORED_EVENT_TYPES.has(n))return;if(t?.eventKeyAction===0)return;seq+=1;const r={seq,t:Date.now(),eventType:n,eventKeyAction:t?.eventKeyAction};events=events.length>=MAX_EVENTS?[...events.slice(1),r]:[...events,r];emitChange()}function arm(){if(armed)return;armed=true;if(supportsInput&&RN.TVEventHandler&&!subscription){subscription=RN.TVEventHandler.addListener(handleEvent)}emitChange()}function disarm(){if(subscription){subscription.remove();subscription=null}if(menuCaptureArmed)setMenuCapture(false);if(!armed)return;armed=false;emitChange()}function setMenuCapture(e){if(!isTV||RN.Platform.OS!=="ios"||!RN.TVEventControl)return;if(e===menuCaptureArmed)return;if(e){RN.TVEventControl.enableTVMenuKey()}else{RN.TVEventControl.disableTVMenuKey()}menuCaptureArmed=e;emitChange()}function clear(){if(events.length===0)return;events=[];emitChange()}function getEventsSince(e){if(!Number.isFinite(e))return events.slice();return events.filter(t=>t.seq>e)}function getState(){return{supported:supportsInput,platform:RN.Platform?.OS??"unknown",captureArmed:armed,listening:subscription!==null,menuCaptureArmed,seq,recent:events.slice()}}function subscribe(e){listeners.add(e);return()=>{listeners.delete(e)}}
@@ -1,57 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.tvRemoteSyncAdapter = void 0;
7
- var _tvEventStore = require("../store/tvEventStore");
8
- /**
9
- * tvRemoteSyncAdapter — streams captured TV remote events to Buoy Desktop via
10
- * @buoy-gg/external-sync.
11
- *
12
- * Structurally matches external-sync's `ToolSyncAdapter` WITHOUT importing the
13
- * package (same as every other tool's adapter). Auto-discovery in @buoy-gg/core
14
- * picks it up by export name and announces the "tv-remote" capability.
15
- *
16
- * `getEventsSince` exists because snapshots are throttled 200ms trailing-edge
17
- * per tool, which is too coarse to time a replay step's echo. Replay polls this
18
- * awaited action instead and gets the real latency.
19
- */
20
-
21
- const tvRemoteSyncAdapter = exports.tvRemoteSyncAdapter = {
22
- version: 1,
23
- getSnapshot() {
24
- return (0, _tvEventStore.getState)();
25
- },
26
- subscribe(onChange) {
27
- return (0, _tvEventStore.subscribe)(onChange);
28
- },
29
- actions: {
30
- arm() {
31
- (0, _tvEventStore.arm)();
32
- return (0, _tvEventStore.getState)();
33
- },
34
- disarm() {
35
- (0, _tvEventStore.disarm)();
36
- return (0, _tvEventStore.getState)();
37
- },
38
- /** Cursor-paged echo poll. `seq: 0` returns everything buffered. */
39
- getEventsSince(params) {
40
- const since = typeof params?.seq === "number" ? params.seq : 0;
41
- const state = (0, _tvEventStore.getState)();
42
- return {
43
- seq: state.seq,
44
- events: (0, _tvEventStore.getEventsSince)(since)
45
- };
46
- },
47
- setMenuCapture(params) {
48
- (0, _tvEventStore.setMenuCapture)(params?.on === true);
49
- return (0, _tvEventStore.getState)();
50
- },
51
- clear() {
52
- (0, _tvEventStore.clear)();
53
- return (0, _tvEventStore.getState)();
54
- }
55
- }
56
- };
57
- //# sourceMappingURL=tvRemoteSyncAdapter.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.tvRemoteSyncAdapter=void 0;var _tvEventStore=require("../store/tvEventStore");const tvRemoteSyncAdapter=exports.tvRemoteSyncAdapter={version:1,getSnapshot(){return(0,_tvEventStore.getState)()},subscribe(e){return(0,_tvEventStore.subscribe)(e)},actions:{arm(){(0,_tvEventStore.arm)();return(0,_tvEventStore.getState)()},disarm(){(0,_tvEventStore.disarm)();return(0,_tvEventStore.getState)()},getEventsSince(e){const t=typeof e?.seq==="number"?e.seq:0;const r=(0,_tvEventStore.getState)();return{seq:r.seq,events:(0,_tvEventStore.getEventsSince)(t)}},setMenuCapture(e){(0,_tvEventStore.setMenuCapture)(e?.on===true);return(0,_tvEventStore.getState)()},clear(){(0,_tvEventStore.clear)();return(0,_tvEventStore.getState)()}}};
@@ -1,23 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * @buoy-gg/tv-remote
5
- *
6
- * The device-side half of Buoy's TV remote driver: it CAPTURES the D-pad /
7
- * select / menu / play-pause events the app actually receives and streams them
8
- * to Buoy Desktop, which is where presses are injected from (adb / idb) and
9
- * where macros are recorded and replayed.
10
- *
11
- * This package renders nothing and injects nothing. See the README for why.
12
- */
13
-
14
- // =============================================================================
15
- // EXTERNAL SYNC (device → desktop dashboard)
16
- // =============================================================================
17
- export { tvRemoteSyncAdapter } from "./sync/tvRemoteSyncAdapter";
18
-
19
- // =============================================================================
20
- // CAPTURE STORE (arm/disarm + types)
21
- // =============================================================================
22
- export { arm, disarm, clear, setMenuCapture, getEventsSince, getState, subscribe } from "./store/tvEventStore";
23
- //# sourceMappingURL=index.js.map
1
+ "use strict";export{tvRemoteSyncAdapter}from"./sync/tvRemoteSyncAdapter";export{arm,disarm,clear,setMenuCapture,getEventsSince,getState,subscribe}from"./store/tvEventStore";
@@ -1,5 +1 @@
1
- "use strict";
2
-
3
- import * as ReactNative from 'react-native';
4
- export const remotePlatform = ReactNative;
5
- //# sourceMappingURL=remotePlatform.js.map
1
+ "use strict";import*as t from"react-native";export const remotePlatform=t;
@@ -1,39 +1 @@
1
- "use strict";
2
-
3
- const keys = {
4
- ArrowUp: 'up',
5
- ArrowDown: 'down',
6
- ArrowLeft: 'left',
7
- ArrowRight: 'right',
8
- Enter: 'select',
9
- ' ': 'select',
10
- Escape: 'menu',
11
- MediaPlayPause: 'playPause'
12
- };
13
- export const remotePlatform = {
14
- Platform: {
15
- OS: 'web',
16
- isTV: false
17
- },
18
- TVEventHandler: {
19
- addListener(listener) {
20
- if (typeof document === 'undefined') return {
21
- remove() {}
22
- };
23
- const onKey = event => {
24
- const eventType = keys[event.key];
25
- if (eventType) listener({
26
- eventType,
27
- eventKeyAction: 1
28
- });
29
- };
30
- document.addEventListener('keyup', onKey, true);
31
- return {
32
- remove() {
33
- document.removeEventListener('keyup', onKey, true);
34
- }
35
- };
36
- }
37
- }
38
- };
39
- //# sourceMappingURL=remotePlatform.web.js.map
1
+ "use strict";const o={ArrowUp:"up",ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right",Enter:"select"," ":"select",Escape:"menu",MediaPlayPause:"playPause"};export const remotePlatform={Platform:{OS:"web",isTV:false},TVEventHandler:{addListener(r){if(typeof document==="undefined")return{remove(){}};const e=n=>{const t=o[n.key];if(t)r({eventType:t,eventKeyAction:1})};document.addEventListener("keyup",e,true);return{remove(){document.removeEventListener("keyup",e,true)}}}}};
@@ -1,158 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * tvEventStore — the whole device-side half of the TV remote tool.
5
- *
6
- * CONTRACT: this store only ever OBSERVES. It never injects, synthesizes, or
7
- * fakes a remote press. Presses come from the host (Buoy Desktop shells out to
8
- * `adb shell input keyevent` / `idb ui key`), because those go through the real
9
- * platform focus engine; anything we could fake in-process would move focus
10
- * without firing events, or fire events without moving focus. See
11
- * TV_REMOTE_DRIVER_PLAN.md §2.
12
- *
13
- * It is also deliberately UI-less. On Android TV any focusable view we rendered
14
- * would become a D-pad stop in the host app's focus order, so the tool would
15
- * alter the navigation it is supposed to be replaying.
16
- *
17
- * Safe to ship in non-TV apps: the native event emitter is never touched unless
18
- * `Platform.isTV` is true, so the cost on a phone is one boolean.
19
- */
20
-
21
- import { remotePlatform as ReactNative } from "./remotePlatform";
22
-
23
- /** One captured remote event, as it goes over the wire to the dashboard. */
24
-
25
- /**
26
- * Ring buffer depth. Replay polls `getEventsSince` every few dozen ms with a
27
- * ~2s budget per step, so 50 is many times more than any echo needs; it exists
28
- * so a human scrubbing the echo strip has some scrollback.
29
- */
30
- const MAX_EVENTS = 50;
31
-
32
- /**
33
- * Continuous gestures are not presses and are never recorded — the macro format
34
- * is discrete keys. Dropping them here keeps them out of the ring buffer so
35
- * they can't push real presses out of it during a replay.
36
- */
37
- const IGNORED_EVENT_TYPES = new Set(["pan", "swipeUp", "swipeDown", "swipeLeft", "swipeRight"]);
38
- /**
39
- * `TVEventHandler` / `TVEventControl` only exist on the react-native-tvos fork.
40
- * A namespace read (rather than a named import) keeps this module importable on
41
- * stock react-native, where those exports are absent.
42
- */
43
- const RN = ReactNative;
44
- const isTV = RN.Platform?.isTV === true;
45
- const supportsInput = isTV || RN.Platform?.OS === "web";
46
- let events = [];
47
- let seq = 0;
48
- let armed = false;
49
- let menuCaptureArmed = false;
50
- let subscription = null;
51
- const listeners = new Set();
52
- function emitChange() {
53
- listeners.forEach(listener => {
54
- listener();
55
- });
56
- }
57
- function handleEvent(raw) {
58
- // Disarming removes the subscription, but don't take that on trust: a native
59
- // emitter that delivered one more event after `remove()` would land a stray
60
- // press in the buffer, and a stray press is exactly what a replay would
61
- // mistake for a step's echo.
62
- if (!armed) return;
63
- const event = raw;
64
- const eventType = event?.eventType;
65
- if (typeof eventType !== "string") return;
66
- if (IGNORED_EVENT_TYPES.has(eventType)) return;
67
-
68
- /**
69
- * Dedupe by ignoring key DOWN, never key UP. tvOS emits keyAction 1 (up)
70
- * ONLY — taps reach the gesture recognizer at StateEnded — so filtering to
71
- * "down" would swallow every tvOS event. Android's down-emit is
72
- * feature-flagged off by default, but dropping it here is the correct
73
- * invariant either way: one press must produce exactly one echo.
74
- */
75
- if (event?.eventKeyAction === 0) return;
76
- seq += 1;
77
- const next = {
78
- seq,
79
- t: Date.now(),
80
- eventType,
81
- eventKeyAction: event?.eventKeyAction
82
- };
83
- events = events.length >= MAX_EVENTS ? [...events.slice(1), next] : [...events, next];
84
- emitChange();
85
- }
86
-
87
- /** Start pushing remote events into the buffer. Idempotent. */
88
- export function arm() {
89
- if (armed) return;
90
- armed = true;
91
- if (supportsInput && RN.TVEventHandler && !subscription) {
92
- subscription = RN.TVEventHandler.addListener(handleEvent);
93
- }
94
- emitChange();
95
- }
96
-
97
- /**
98
- * Stop capturing and hand the Menu key back to the platform. Every teardown
99
- * path funnels through here — leaving menu capture on would leave the app
100
- * unable to navigate back, which is an App Store behavior change.
101
- */
102
- export function disarm() {
103
- if (subscription) {
104
- subscription.remove();
105
- subscription = null;
106
- }
107
- if (menuCaptureArmed) setMenuCapture(false);
108
- if (!armed) return;
109
- armed = false;
110
- emitChange();
111
- }
112
-
113
- /**
114
- * tvOS: route the Menu key to JS so it can be recorded, instead of letting it
115
- * pop the navigation stack (and background the app at the root). This changes
116
- * how the app under test behaves, so it is opt-in per recording session and is
117
- * always undone on disarm.
118
- */
119
- export function setMenuCapture(on) {
120
- if (!isTV || RN.Platform.OS !== "ios" || !RN.TVEventControl) return;
121
- if (on === menuCaptureArmed) return;
122
- if (on) {
123
- RN.TVEventControl.enableTVMenuKey();
124
- } else {
125
- RN.TVEventControl.disableTVMenuKey();
126
- }
127
- menuCaptureArmed = on;
128
- emitChange();
129
- }
130
- export function clear() {
131
- if (events.length === 0) return;
132
- events = [];
133
- emitChange();
134
- }
135
-
136
- /** Events strictly newer than `sinceSeq` — the replay echo cursor. */
137
- export function getEventsSince(sinceSeq) {
138
- if (!Number.isFinite(sinceSeq)) return events.slice();
139
- return events.filter(event => event.seq > sinceSeq);
140
- }
141
- export function getState() {
142
- return {
143
- supported: supportsInput,
144
- platform: RN.Platform?.OS ?? "unknown",
145
- captureArmed: armed,
146
- listening: subscription !== null,
147
- menuCaptureArmed,
148
- seq,
149
- recent: events.slice()
150
- };
151
- }
152
- export function subscribe(listener) {
153
- listeners.add(listener);
154
- return () => {
155
- listeners.delete(listener);
156
- };
157
- }
158
- //# sourceMappingURL=tvEventStore.js.map
1
+ "use strict";import{remotePlatform as v}from"./remotePlatform";const d=50;const E=new Set(["pan","swipeUp","swipeDown","swipeLeft","swipeRight"]);const t=v;const p=t.Platform?.isTV===true;const m=p||t.Platform?.OS==="web";let n=[];let f=0;let r=false;let u=false;let i=null;const a=new Set;function s(){a.forEach(e=>{e()})}function T(e){if(!r)return;const o=e;const l=o?.eventType;if(typeof l!=="string")return;if(E.has(l))return;if(o?.eventKeyAction===0)return;f+=1;const c={seq:f,t:Date.now(),eventType:l,eventKeyAction:o?.eventKeyAction};n=n.length>=d?[...n.slice(1),c]:[...n,c];s()}export function arm(){if(r)return;r=true;if(m&&t.TVEventHandler&&!i){i=t.TVEventHandler.addListener(T)}s()}export function disarm(){if(i){i.remove();i=null}if(u)setMenuCapture(false);if(!r)return;r=false;s()}export function setMenuCapture(e){if(!p||t.Platform.OS!=="ios"||!t.TVEventControl)return;if(e===u)return;if(e){t.TVEventControl.enableTVMenuKey()}else{t.TVEventControl.disableTVMenuKey()}u=e;s()}export function clear(){if(n.length===0)return;n=[];s()}export function getEventsSince(e){if(!Number.isFinite(e))return n.slice();return n.filter(o=>o.seq>e)}export function getState(){return{supported:m,platform:t.Platform?.OS??"unknown",captureArmed:r,listening:i!==null,menuCaptureArmed:u,seq:f,recent:n.slice()}}export function subscribe(e){a.add(e);return()=>{a.delete(e)}}
@@ -1,53 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * tvRemoteSyncAdapter — streams captured TV remote events to Buoy Desktop via
5
- * @buoy-gg/external-sync.
6
- *
7
- * Structurally matches external-sync's `ToolSyncAdapter` WITHOUT importing the
8
- * package (same as every other tool's adapter). Auto-discovery in @buoy-gg/core
9
- * picks it up by export name and announces the "tv-remote" capability.
10
- *
11
- * `getEventsSince` exists because snapshots are throttled 200ms trailing-edge
12
- * per tool, which is too coarse to time a replay step's echo. Replay polls this
13
- * awaited action instead and gets the real latency.
14
- */
15
-
16
- import { arm, clear, disarm, getEventsSince, getState, setMenuCapture, subscribe } from "../store/tvEventStore";
17
- export const tvRemoteSyncAdapter = {
18
- version: 1,
19
- getSnapshot() {
20
- return getState();
21
- },
22
- subscribe(onChange) {
23
- return subscribe(onChange);
24
- },
25
- actions: {
26
- arm() {
27
- arm();
28
- return getState();
29
- },
30
- disarm() {
31
- disarm();
32
- return getState();
33
- },
34
- /** Cursor-paged echo poll. `seq: 0` returns everything buffered. */
35
- getEventsSince(params) {
36
- const since = typeof params?.seq === "number" ? params.seq : 0;
37
- const state = getState();
38
- return {
39
- seq: state.seq,
40
- events: getEventsSince(since)
41
- };
42
- },
43
- setMenuCapture(params) {
44
- setMenuCapture(params?.on === true);
45
- return getState();
46
- },
47
- clear() {
48
- clear();
49
- return getState();
50
- }
51
- }
52
- };
53
- //# sourceMappingURL=tvRemoteSyncAdapter.js.map
1
+ "use strict";import{arm as s,clear as u,disarm as c,getEventsSince as o,getState as t,setMenuCapture as a,subscribe as i}from"../store/tvEventStore";export const tvRemoteSyncAdapter={version:1,getSnapshot(){return t()},subscribe(e){return i(e)},actions:{arm(){s();return t()},disarm(){c();return t()},getEventsSince(e){const r=typeof e?.seq==="number"?e.seq:0;const n=t();return{seq:n.seq,events:o(r)}},setMenuCapture(e){a(e?.on===true);return t()},clear(){u();return t()}}};
package/lib/web/index.mjs CHANGED
@@ -1,2 +1 @@
1
- "use client";
2
- typeof window<"u"&&typeof globalThis.global>"u"&&(globalThis.global=globalThis);var V={ArrowUp:"up",ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right",Enter:"select"," ":"select",Escape:"menu",MediaPlayPause:"playPause"},S={Platform:{OS:"web",isTV:!1},TVEventHandler:{addListener(e){if(typeof document>"u")return{remove(){}};let t=i=>{let u=V[i.key];u&&e({eventType:u,eventKeyAction:1})};return document.addEventListener("keyup",t,!0),{remove(){document.removeEventListener("keyup",t,!0)}}}}};var w=50,A=new Set(["pan","swipeUp","swipeDown","swipeLeft","swipeRight"]),n=S,g=n.Platform?.isTV===!0,R=g||n.Platform?.OS==="web",r=[],d=0,a=!1,l=!1,s=null,p=new Set;function v(){p.forEach(e=>{e()})}function x(e){if(!a)return;let t=e,i=t?.eventType;if(typeof i!="string"||A.has(i)||t?.eventKeyAction===0)return;d+=1;let u={seq:d,t:Date.now(),eventType:i,eventKeyAction:t?.eventKeyAction};r=r.length>=w?[...r.slice(1),u]:[...r,u],v()}function f(){a||(a=!0,R&&n.TVEventHandler&&!s&&(s=n.TVEventHandler.addListener(x)),v())}function T(){s&&(s.remove(),s=null),l&&c(!1),a&&(a=!1,v())}function c(e){!g||n.Platform.OS!=="ios"||!n.TVEventControl||e!==l&&(e?n.TVEventControl.enableTVMenuKey():n.TVEventControl.disableTVMenuKey(),l=e,v())}function b(){r.length!==0&&(r=[],v())}function E(e){return Number.isFinite(e)?r.filter(t=>t.seq>e):r.slice()}function o(){return{supported:R,platform:n.Platform?.OS??"unknown",captureArmed:a,listening:s!==null,menuCaptureArmed:l,seq:d,recent:r.slice()}}function y(e){return p.add(e),()=>{p.delete(e)}}var M={version:1,getSnapshot(){return o()},subscribe(e){return y(e)},actions:{arm(){return f(),o()},disarm(){return T(),o()},getEventsSince(e){let t=typeof e?.seq=="number"?e.seq:0;return{seq:o().seq,events:E(t)}},setMenuCapture(e){return c(e?.on===!0),o()},clear(){return b(),o()}}};export{f as arm,b as clear,T as disarm,E as getEventsSince,o as getState,c as setMenuCapture,y as subscribe,M as tvRemoteSyncAdapter};
1
+ "use client";typeof window<"u"&&typeof globalThis.global>"u"&&(globalThis.global=globalThis);var E={ArrowUp:"up",ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right",Enter:"select"," ":"select",Escape:"menu",MediaPlayPause:"playPause"},A={Platform:{OS:"web",isTV:false},TVEventHandler:{addListener(e){if(typeof document>"u")return{remove(){}};let t=i=>{let u=E[i.key];u&&e({eventType:u,eventKeyAction:1})};return document.addEventListener("keyup",t,true),{remove(){document.removeEventListener("keyup",t,true)}}}}};var S=50,h=new Set(["pan","swipeUp","swipeDown","swipeLeft","swipeRight"]),n=A,d=n.Platform?.isTV===true,m=d||n.Platform?.OS==="web",r=[],p=0,s=false,c=false,a=null,f=new Set;function l(){f.forEach(e=>{e()})}function V(e){if(!s)return;let t=e,i=t?.eventType;if(typeof i!="string"||h.has(i)||t?.eventKeyAction===0)return;p+=1;let u={seq:p,t:Date.now(),eventType:i,eventKeyAction:t?.eventKeyAction};r=r.length>=S?[...r.slice(1),u]:[...r,u],l()}function y(){s||(s=true,m&&n.TVEventHandler&&!a&&(a=n.TVEventHandler.addListener(V)),l())}function w(){a&&(a.remove(),a=null),c&&v(false),s&&(s=false,l())}function v(e){!d||n.Platform.OS!=="ios"||!n.TVEventControl||e!==c&&(e?n.TVEventControl.enableTVMenuKey():n.TVEventControl.disableTVMenuKey(),c=e,l())}function g(){r.length!==0&&(r=[],l())}function T(e){return Number.isFinite(e)?r.filter(t=>t.seq>e):r.slice()}function o(){return{supported:m,platform:n.Platform?.OS??"unknown",captureArmed:s,listening:a!==null,menuCaptureArmed:c,seq:p,recent:r.slice()}}function b(e){return f.add(e),()=>{f.delete(e)}}var P={version:1,getSnapshot(){return o()},subscribe(e){return b(e)},actions:{arm(){return y(),o()},disarm(){return w(),o()},getEventsSince(e){let t=typeof e?.seq=="number"?e.seq:0;return{seq:o().seq,events:T(t)}},setMenuCapture(e){return v(e?.on===true),o()},clear(){return g(),o()}}};export{y as arm,g as clear,w as disarm,T as getEventsSince,o as getState,v as setMenuCapture,b as subscribe,P as tvRemoteSyncAdapter};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buoy-gg/tv-remote",
3
- "version": "7.0.41",
3
+ "version": "7.0.43",
4
4
  "description": "TV remote capture for React Native TV apps — records the D-pad/select/menu events the app actually receives, so Buoy Desktop can drive and replay real remote presses. Part of Buoy devtools.",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -12,10 +12,7 @@
12
12
  ],
13
13
  "sideEffects": false,
14
14
  "peerDependencies": {
15
- "react": "*",
16
- "react-native": "*",
17
- "react-native-web": "^0.21.0",
18
- "react-dom": ">=18"
15
+ "react": "*"
19
16
  },
20
17
  "devDependencies": {
21
18
  "@types/react": "^19.1.0",
@@ -1 +0,0 @@
1
- {"version":3,"names":["_tvRemoteSyncAdapter","require","_tvEventStore"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,IAAAA,oBAAA,GAAAC,OAAA;AAKA,IAAAC,aAAA,GAAAD,OAAA","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["ReactNative","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","remotePlatform","exports"],"sourceRoot":"../../../src","sources":["store/remotePlatform.ts"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA4C,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AACrC,MAAMkB,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAGtB,WAAW","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["keys","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Enter","Escape","MediaPlayPause","remotePlatform","exports","Platform","OS","isTV","TVEventHandler","addListener","listener","document","remove","onKey","event","eventType","key","eventKeyAction","addEventListener","removeEventListener"],"sourceRoot":"../../../src","sources":["store/remotePlatform.web.ts"],"mappings":";;;;;;AAAA,MAAMA,IAA4B,GAAG;EAAEC,OAAO,EAAE,IAAI;EAAEC,SAAS,EAAE,MAAM;EAAEC,SAAS,EAAE,MAAM;EAAEC,UAAU,EAAE,OAAO;EAAEC,KAAK,EAAE,QAAQ;EAAE,GAAG,EAAE,QAAQ;EAAEC,MAAM,EAAE,MAAM;EAAEC,cAAc,EAAE;AAAY,CAAC;AACvL,MAAMC,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG;EAC5BE,QAAQ,EAAE;IAAEC,EAAE,EAAE,KAAK;IAAEC,IAAI,EAAE;EAAM,CAAC;EACpCC,cAAc,EAAE;IAAEC,WAAWA,CAACC,QAAkC,EAAE;MAChE,IAAI,OAAOC,QAAQ,KAAK,WAAW,EAAE,OAAO;QAAEC,MAAMA,CAAA,EAAG,CAAC;MAAE,CAAC;MAC3D,MAAMC,KAAK,GAAIC,KAAoB,IAAK;QAAE,MAAMC,SAAS,GAAGpB,IAAI,CAACmB,KAAK,CAACE,GAAG,CAAC;QAAE,IAAID,SAAS,EAAEL,QAAQ,CAAC;UAAEK,SAAS;UAAEE,cAAc,EAAE;QAAE,CAAC,CAAC;MAAE,CAAC;MACzIN,QAAQ,CAACO,gBAAgB,CAAC,OAAO,EAAEL,KAAK,EAAE,IAAI,CAAC;MAC/C,OAAO;QAAED,MAAMA,CAAA,EAAG;UAAED,QAAQ,CAACQ,mBAAmB,CAAC,OAAO,EAAEN,KAAK,EAAE,IAAI,CAAC;QAAE;MAAE,CAAC;IAC7E;EAAE;AACJ,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["_remotePlatform","require","MAX_EVENTS","IGNORED_EVENT_TYPES","Set","RN","ReactNative","isTV","Platform","supportsInput","OS","events","seq","armed","menuCaptureArmed","subscription","listeners","emitChange","forEach","listener","handleEvent","raw","event","eventType","has","eventKeyAction","next","t","Date","now","length","slice","arm","TVEventHandler","addListener","disarm","remove","setMenuCapture","on","TVEventControl","enableTVMenuKey","disableTVMenuKey","clear","getEventsSince","sinceSeq","Number","isFinite","filter","getState","supported","platform","captureArmed","listening","recent","subscribe","add","delete"],"sourceRoot":"../../../src","sources":["store/tvEventStore.ts"],"mappings":";;;;;;;;;;;;AAkBA,IAAAA,eAAA,GAAAC,OAAA;AAlBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;;AA8BA;AACA;AACA;AACA;AACA;AACA,MAAMC,UAAU,GAAG,EAAE;;AAErB;AACA;AACA;AACA;AACA;AACA,MAAMC,mBAAmB,GAAG,IAAIC,GAAG,CAAC,CAAC,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC;AAe/F;AACA;AACA;AACA;AACA;AACA,MAAMC,EAAE,GAAGC,8BAIV;AAED,MAAMC,IAAI,GAAGF,EAAE,CAACG,QAAQ,EAAED,IAAI,KAAK,IAAI;AACvC,MAAME,aAAa,GAAGF,IAAI,IAAIF,EAAE,CAACG,QAAQ,EAAEE,EAAE,KAAK,KAAK;AAEvD,IAAIC,MAAuB,GAAG,EAAE;AAChC,IAAIC,GAAG,GAAG,CAAC;AACX,IAAIC,KAAK,GAAG,KAAK;AACjB,IAAIC,gBAAgB,GAAG,KAAK;AAC5B,IAAIC,YAAiC,GAAG,IAAI;AAE5C,MAAMC,SAAS,GAAG,IAAIZ,GAAG,CAAa,CAAC;AAEvC,SAASa,UAAUA,CAAA,EAAS;EAC1BD,SAAS,CAACE,OAAO,CAAEC,QAAQ,IAAK;IAC9BA,QAAQ,CAAC,CAAC;EACZ,CAAC,CAAC;AACJ;AAEA,SAASC,WAAWA,CAACC,GAAY,EAAQ;EACvC;EACA;EACA;EACA;EACA,IAAI,CAACR,KAAK,EAAE;EAEZ,MAAMS,KAAK,GAAGD,GAA6D;EAC3E,MAAME,SAAS,GAAGD,KAAK,EAAEC,SAAS;EAClC,IAAI,OAAOA,SAAS,KAAK,QAAQ,EAA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ports","version","getSnapshot","getState","subscribe","onChange","actions","arm","disarm","getEventsSince","params","since","seq","state","events","setMenuCapture","on","clear"],"sourceRoot":"../../../src","sources":["sync/tvRemoteSyncAdapter.ts"],"mappings":";;;;;;AAaA,IAAAA,aAAA,GAAAC,OAAA;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcO,MAAMC,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAG;EACjCE,OAAO,EAAE,CAAC;EAEVC,WAAWA,CAAA,EAAkB;IAC3B,OAAO,IAAAC,sBAAQ,EAAC,CAAC;EACnB,CAAC;EAEDC,SAASA,CAACC,QAAoB,EAAc;IAC1C,OAAO,IAAAD,uBAAS,EAACC,QAAQ,CAAC;EAC5B,CAAC;EAEDC,OAAO,EAAE;IACPC,GAAGA,CAAA,EAAkB;MACnB,IAAAA,iBAAG,EAAC,CAAC;MACL,OAAO,IAAAJ,sBAAQ,EAAC,CAAC;IACnB,CAAC;IAEDK,MAAMA,CAAA,EAAkB;MACtB,IAAAA,oBAAM,EAAC,CAAC;MACR,OAAO,IAAAL,sBAAQ,EAAC,CAAC;IACnB,CAAC;IAED;IACAM,cAAcA,CAACC,MAAyB,EAGtC;MACA,MAAMC,KAAK,GAAG,OAAOD,MAAM,EAAEE,GAAG,KAAK,QAAQ,GAAGF,MAAM,CAACE,GAAG,GAAG,CAAC;MAC9D,MAAMC,KAAK,GAAG,IAAAV,sBAAQ,EAAC,CAAC;MACxB,OAAO;QAAES,GAAG,EAAEC,KAAK,CAACD,GAAG;QAAEE,MAAM,EAAE,IAAAL,4BAAc,EAACE,KAAK;MAAE,CAAC;IAC1D,CAAC;IAEDI,cAAcA,CAACL,MAAyB,EAAiB;MACvD,IAAAK,4BAAc,EAACL,MAAM,EAAEM,EAAE,KAAK,IAAI,CAAC;MACnC,OAAO,IAAAb,sBAAQ,EAAC,CAAC;IACnB,CAAC;IAEDc,KAAKA,CAAA,EAAkB;MACrB,IAAAA,mBAAK,EAAC,CAAC;MACP,OAAO,IAAAd,sBAAQ,EAAC,CAAC;IACnB;EACF;AACF,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["tvRemoteSyncAdapter","arm","disarm","clear","setMenuCapture","getEventsSince","getState","subscribe"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAASA,mBAAmB,QAAQ,4BAA4B;;AAEhE;AACA;AACA;AACA,SACEC,GAAG,EACHC,MAAM,EACNC,KAAK,EACLC,cAAc,EACdC,cAAc,EACdC,QAAQ,EACRC,SAAS,QACJ,sBAAsB","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["ReactNative","remotePlatform"],"sourceRoot":"../../../src","sources":["store/remotePlatform.ts"],"mappings":";;AAAA,OAAO,KAAKA,WAAW,MAAM,cAAc;AAC3C,OAAO,MAAMC,cAAc,GAAGD,WAAW","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["keys","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Enter","Escape","MediaPlayPause","remotePlatform","Platform","OS","isTV","TVEventHandler","addListener","listener","document","remove","onKey","event","eventType","key","eventKeyAction","addEventListener","removeEventListener"],"sourceRoot":"../../../src","sources":["store/remotePlatform.web.ts"],"mappings":";;AAAA,MAAMA,IAA4B,GAAG;EAAEC,OAAO,EAAE,IAAI;EAAEC,SAAS,EAAE,MAAM;EAAEC,SAAS,EAAE,MAAM;EAAEC,UAAU,EAAE,OAAO;EAAEC,KAAK,EAAE,QAAQ;EAAE,GAAG,EAAE,QAAQ;EAAEC,MAAM,EAAE,MAAM;EAAEC,cAAc,EAAE;AAAY,CAAC;AAC9L,OAAO,MAAMC,cAAc,GAAG;EAC5BC,QAAQ,EAAE;IAAEC,EAAE,EAAE,KAAK;IAAEC,IAAI,EAAE;EAAM,CAAC;EACpCC,cAAc,EAAE;IAAEC,WAAWA,CAACC,QAAkC,EAAE;MAChE,IAAI,OAAOC,QAAQ,KAAK,WAAW,EAAE,OAAO;QAAEC,MAAMA,CAAA,EAAG,CAAC;MAAE,CAAC;MAC3D,MAAMC,KAAK,GAAIC,KAAoB,IAAK;QAAE,MAAMC,SAAS,GAAGnB,IAAI,CAACkB,KAAK,CAACE,GAAG,CAAC;QAAE,IAAID,SAAS,EAAEL,QAAQ,CAAC;UAAEK,SAAS;UAAEE,cAAc,EAAE;QAAE,CAAC,CAAC;MAAE,CAAC;MACzIN,QAAQ,CAACO,gBAAgB,CAAC,OAAO,EAAEL,KAAK,EAAE,IAAI,CAAC;MAC/C,OAAO;QAAED,MAAMA,CAAA,EAAG;UAAED,QAAQ,CAACQ,mBAAmB,CAAC,OAAO,EAAEN,KAAK,EAAE,IAAI,CAAC;QAAE;MAAE,CAAC;IAC7E;EAAE;AACJ,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["remotePlatform","ReactNative","MAX_EVENTS","IGNORED_EVENT_TYPES","Set","RN","isTV","Platform","supportsInput","OS","events","seq","armed","menuCaptureArmed","subscription","listeners","emitChange","forEach","listener","handleEvent","raw","event","eventType","has","eventKeyAction","next","t","Date","now","length","slice","arm","TVEventHandler","addListener","disarm","remove","setMenuCapture","on","TVEventControl","enableTVMenuKey","disableTVMenuKey","clear","getEventsSince","sinceSeq","Number","isFinite","filter","getState","supported","platform","captureArmed","listening","recent","subscribe","add","delete"],"sourceRoot":"../../../src","sources":["store/tvEventStore.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,cAAc,IAAIC,WAAW,QAAQ,kBAAkB;;AAEhE;;AA8BA;AACA;AACA;AACA;AACA;AACA,MAAMC,UAAU,GAAG,EAAE;;AAErB;AACA;AACA;AACA;AACA;AACA,MAAMC,mBAAmB,GAAG,IAAIC,GAAG,CAAC,CA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C,EAAE;EACzBnB,MAAM,GAAG,EAAE;EACXM,UAAU,CAAC,CAAC;AACd;;AAEA;AACA,OAAO,SAAS0B,cAAcA,CAACC,QAAgB,EAAmB;EAChE,IAAI,CAACC,MAAM,CAACC,QAAQ,CAACF,QAAQ,CAAC,EAAE,OAAOjC,MAAM,CAACoB,KAAK,CAAC,CAAC;EACrD,OAAOpB,MAAM,CAACoC,MAAM,CAAEzB,KAAK,IAAKA,KAAK,CAACV,GAAG,GAAGgC,QAAQ,CAAC;AACvD;AAEA,OAAO,SAASI,QAAQA,CAAA,EAAkB;EACxC,OAAO;IACLC,SAAS,EAAExC,aAAa;IACxByC,QAAQ,EAAE5C,EAAE,CAACE,QAAQ,EAAEE,EAAE,IAAI,SAAS;IACtCyC,YAAY,EAAEtC,KAAK;IACnBuC,SAAS,EAAErC,YAAY,KAAK,IAAI;IAChCD,gBAAgB;IAChBF,GAAG;IACHyC,MAAM,EAAE1C,MAAM,CAACoB,KAAK,CAAC;EACvB,CAAC;AACH;AAEA,OAAO,SAASuB,SAASA,CAACnC,QAAoB,EAAc;EAC1DH,SAAS,CAACuC,GAAG,CAACpC,QAAQ,CAAC;EACvB,OAAO,MAAM;IACXH,SAAS,CAACwC,MAAM,CAACrC,QAAQ,CAAC;EAC5B,CAAC;AACH","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["arm","clear","disarm","getEventsSince","getState","setMenuCapture","subscribe","tvRemoteSyncAdapter","version","getSnapshot","onChange","actions","params","since","seq","state","events","on"],"sourceRoot":"../../../src","sources":["sync/tvRemoteSyncAdapter.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,GAAG,EACHC,KAAK,EACLC,MAAM,EACNC,cAAc,EACdC,QAAQ,EACRC,cAAc,EACdC,SAAS,QAGJ,uBAAuB;AAE9B,OAAO,MAAMC,mBAAmB,GAAG;EACjCC,OAAO,EAAE,CAAC;EAEVC,WAA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AM,sBAAsB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"remotePlatform.d.ts","sourceRoot":"","sources":["../../../src/store/remotePlatform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,cAAc,CAAC;AAC5C,eAAO,MAAM,cAAc,oBAAc,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"remotePlatform.web.d.ts","sourceRoot":"","sources":["../../../src/store/remotePlatform.web.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,cAAc;;;;;;8BAEe,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI;;;;CAMjE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"tvEventStore.d.ts","sourceRoot":"","sources":["../../../src/store/tvEventStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,4EAA4E;AAC5E,MAAM,WAAW,aAAa;IAC5B,kEAAkE;IAClE,GAAG,EAAE,MAAM,CAAC;IACZ,+BAA+B;IAC/B,CAAC,EAAE,MAAM,CAAC;IACV,+GAA+G;IAC/G,SAAS,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,aAAa;IAC5B,gEAAgE;IAChE,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB;;;;;OAKG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB,0EAA0E;IAC1E,gBAAgB,EAAE,OAAO,CAAC;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,aAAa,EAAE,CAAC;CACzB;AAyFD,+DAA+D;AAC/D,wBAAgB,GAAG,IAAI,IAAI,CAO1B;AAED;;;;GAIG;AACH,wBAAgB,MAAM,IAAI,IAAI,CAS7B;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,OAAO,GAAG,IAAI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