@tvuikit/navigation-dom 0.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/dist/domRegistry.d.ts +36 -0
- package/dist/domRegistry.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +119 -0
- package/dist/index.js.map +1 -0
- package/package.json +51 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { FocusReason, GroupId, NodeId, SpatialRegistry } from "@tvuikit/navigation";
|
|
2
|
+
export type DomRegistryOptions = {
|
|
3
|
+
/**
|
|
4
|
+
* When a node is focused, should we call `element.focus()`?
|
|
5
|
+
* - "none": do not call (default; avoids scroll/layout side-effects)
|
|
6
|
+
* - "native": call `focus({ preventScroll: true })` when supported
|
|
7
|
+
*/
|
|
8
|
+
focusBehavior?: "none" | "native";
|
|
9
|
+
/**
|
|
10
|
+
* Attribute toggled on focus/blur (if provided).
|
|
11
|
+
* Default: "data-tvkit-focused"
|
|
12
|
+
*/
|
|
13
|
+
focusedAttribute?: string;
|
|
14
|
+
/**
|
|
15
|
+
* If true, use IntersectionObserver to cache visibility (no layout reads).
|
|
16
|
+
* Default: true
|
|
17
|
+
*/
|
|
18
|
+
observeVisibility?: boolean;
|
|
19
|
+
};
|
|
20
|
+
export type DomRegisterOptions = {
|
|
21
|
+
enabled?: boolean;
|
|
22
|
+
visible?: boolean;
|
|
23
|
+
groupId?: GroupId | null;
|
|
24
|
+
onFocus?: (reason: FocusReason) => void;
|
|
25
|
+
onBlur?: (reason: FocusReason) => void;
|
|
26
|
+
};
|
|
27
|
+
export type DomRegistry = SpatialRegistry & {
|
|
28
|
+
register(id: NodeId, el: HTMLElement, options?: DomRegisterOptions): void;
|
|
29
|
+
unregister(id: NodeId): void;
|
|
30
|
+
invalidate(id: NodeId): void;
|
|
31
|
+
invalidateAll(): void;
|
|
32
|
+
getElement(id: NodeId): HTMLElement | undefined;
|
|
33
|
+
dispose(): void;
|
|
34
|
+
};
|
|
35
|
+
export declare function createDomRegistry(options?: DomRegistryOptions): DomRegistry;
|
|
36
|
+
//# sourceMappingURL=domRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domRegistry.d.ts","sourceRoot":"","sources":["../src/domRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,OAAO,EACP,MAAM,EAGN,eAAe,EAChB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAElC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACzB,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IACxC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG;IAC1C,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAC1E,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,aAAa,IAAI,IAAI,CAAC;IACtB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAAC;IAChD,OAAO,IAAI,IAAI,CAAC;CACjB,CAAC;AAMF,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,WAAW,CAuP3E"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
function L(d) {
|
|
2
|
+
return { x: d.left, y: d.top, w: d.width, h: d.height };
|
|
3
|
+
}
|
|
4
|
+
function D(d) {
|
|
5
|
+
const E = d?.focusBehavior ?? "none", I = d?.focusedAttribute ?? "data-tvkit-focused", R = d?.observeVisibility ?? !0, o = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), c = [], a = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set();
|
|
6
|
+
let w = !1, l = { added: [], removed: [], changed: [] };
|
|
7
|
+
const k = (e) => l.added.push(e), C = (e) => l.removed.push(e), O = (e) => l.changed.push(e);
|
|
8
|
+
let y = null;
|
|
9
|
+
typeof ResizeObserver < "u" && (y = new ResizeObserver((e) => {
|
|
10
|
+
for (let n = 0; n < e.length; n++) {
|
|
11
|
+
const t = e[n].target, s = M.get(t);
|
|
12
|
+
s && i.add(s);
|
|
13
|
+
}
|
|
14
|
+
}));
|
|
15
|
+
let p = null;
|
|
16
|
+
R && typeof IntersectionObserver < "u" && (p = new IntersectionObserver((e) => {
|
|
17
|
+
for (let n = 0; n < e.length; n++) {
|
|
18
|
+
const t = e[n], s = t.target, r = M.get(s);
|
|
19
|
+
r && A.set(r, t.isIntersecting);
|
|
20
|
+
}
|
|
21
|
+
}));
|
|
22
|
+
const x = () => {
|
|
23
|
+
w = !0;
|
|
24
|
+
};
|
|
25
|
+
return typeof window < "u" && (window.addEventListener("scroll", x, { passive: !0, capture: !0 }), window.addEventListener("resize", x, { passive: !0 })), {
|
|
26
|
+
ids() {
|
|
27
|
+
return c;
|
|
28
|
+
},
|
|
29
|
+
bounds(e) {
|
|
30
|
+
return u.get(e) ?? null;
|
|
31
|
+
},
|
|
32
|
+
group(e) {
|
|
33
|
+
return f.get(e) ?? null;
|
|
34
|
+
},
|
|
35
|
+
enabled(e) {
|
|
36
|
+
const n = o.get(e);
|
|
37
|
+
if (!n) return !1;
|
|
38
|
+
const t = g.get(e);
|
|
39
|
+
if (t !== void 0) return t;
|
|
40
|
+
const s = n;
|
|
41
|
+
return n.getAttribute("aria-disabled") !== "true" && !s.disabled;
|
|
42
|
+
},
|
|
43
|
+
visible(e) {
|
|
44
|
+
const n = o.get(e);
|
|
45
|
+
if (!n || !n.isConnected) return !1;
|
|
46
|
+
const t = v.get(e);
|
|
47
|
+
return t !== void 0 ? t : A.get(e) ?? !0;
|
|
48
|
+
},
|
|
49
|
+
sync(e) {
|
|
50
|
+
const n = [];
|
|
51
|
+
if (w) {
|
|
52
|
+
w = !1;
|
|
53
|
+
for (let r = 0; r < c.length; r++) n.push(c[r]);
|
|
54
|
+
} else if (i.size > 0) {
|
|
55
|
+
for (const r of i) n.push(r);
|
|
56
|
+
i.clear();
|
|
57
|
+
}
|
|
58
|
+
for (let r = 0; r < n.length; r++) {
|
|
59
|
+
const F = n[r], z = o.get(F);
|
|
60
|
+
if (!z) continue;
|
|
61
|
+
const B = L(z.getBoundingClientRect()), m = u.get(F);
|
|
62
|
+
u.set(F, B), (!m || m.x !== B.x || m.y !== B.y || m.w !== B.w || m.h !== B.h) && O(F);
|
|
63
|
+
}
|
|
64
|
+
const t = e?.added ?? [], s = e?.changed ?? [];
|
|
65
|
+
for (let r = 0; r < t.length; r++) i.add(t[r]);
|
|
66
|
+
for (let r = 0; r < s.length; r++) i.add(s[r]);
|
|
67
|
+
},
|
|
68
|
+
pendingUpdate() {
|
|
69
|
+
if (!(l.added.length > 0 || l.removed.length > 0 || l.changed.length > 0)) return;
|
|
70
|
+
const n = l;
|
|
71
|
+
return l = { added: [], removed: [], changed: [] }, n;
|
|
72
|
+
},
|
|
73
|
+
onFocus(e, n) {
|
|
74
|
+
const t = o.get(e);
|
|
75
|
+
if (t && (I && t.setAttribute(I, "true"), E === "native"))
|
|
76
|
+
try {
|
|
77
|
+
t.focus({ preventScroll: !0 });
|
|
78
|
+
} catch {
|
|
79
|
+
t.focus();
|
|
80
|
+
}
|
|
81
|
+
b.get(e)?.(n);
|
|
82
|
+
},
|
|
83
|
+
onBlur(e, n) {
|
|
84
|
+
const t = o.get(e);
|
|
85
|
+
t && I && t.removeAttribute(I), h.get(e)?.(n);
|
|
86
|
+
},
|
|
87
|
+
register(e, n, t) {
|
|
88
|
+
if (a.has(e)) {
|
|
89
|
+
o.set(e, n), M.set(n, e), t?.enabled !== void 0 && g.set(e, t.enabled), t?.visible !== void 0 && v.set(e, t.visible), t?.groupId !== void 0 && f.set(e, t.groupId), t?.onFocus && b.set(e, t.onFocus), t?.onBlur && h.set(e, t.onBlur), i.add(e), O(e);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
c.push(e), a.set(e, c.length - 1), o.set(e, n), M.set(n, e), t?.enabled !== void 0 && g.set(e, t.enabled), t?.visible !== void 0 && v.set(e, t.visible), t?.groupId !== void 0 && f.set(e, t.groupId), t?.onFocus && b.set(e, t.onFocus), t?.onBlur && h.set(e, t.onBlur), y?.observe(n), p?.observe(n), i.add(e), k(e);
|
|
93
|
+
},
|
|
94
|
+
unregister(e) {
|
|
95
|
+
const n = a.get(e);
|
|
96
|
+
if (n === void 0) return;
|
|
97
|
+
const t = o.get(e);
|
|
98
|
+
t && (y?.unobserve(t), p?.unobserve(t));
|
|
99
|
+
const s = c.pop();
|
|
100
|
+
s !== e && (c[n] = s, a.set(s, n)), a.delete(e), o.delete(e), u.delete(e), f.delete(e), g.delete(e), v.delete(e), A.delete(e), b.delete(e), h.delete(e), i.delete(e), C(e);
|
|
101
|
+
},
|
|
102
|
+
invalidate(e) {
|
|
103
|
+
i.add(e);
|
|
104
|
+
},
|
|
105
|
+
invalidateAll() {
|
|
106
|
+
w = !0;
|
|
107
|
+
},
|
|
108
|
+
getElement(e) {
|
|
109
|
+
return o.get(e);
|
|
110
|
+
},
|
|
111
|
+
dispose() {
|
|
112
|
+
typeof window < "u" && (window.removeEventListener("scroll", x, !0), window.removeEventListener("resize", x)), y?.disconnect(), p?.disconnect(), y = null, p = null, c.length = 0, a.clear(), o.clear(), u.clear(), f.clear(), g.clear(), v.clear(), A.clear(), b.clear(), h.clear(), i.clear(), w = !1, l = { added: [], removed: [], changed: [] };
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
export {
|
|
117
|
+
D as createDomRegistry
|
|
118
|
+
};
|
|
119
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/domRegistry.ts"],"sourcesContent":["import type {\n FocusReason,\n GroupId,\n NodeId,\n Rect,\n RegistryUpdate,\n SpatialRegistry,\n} from \"@tvuikit/navigation\";\n\nexport type DomRegistryOptions = {\n /**\n * When a node is focused, should we call `element.focus()`?\n * - \"none\": do not call (default; avoids scroll/layout side-effects)\n * - \"native\": call `focus({ preventScroll: true })` when supported\n */\n focusBehavior?: \"none\" | \"native\";\n\n /**\n * Attribute toggled on focus/blur (if provided).\n * Default: \"data-tvkit-focused\"\n */\n focusedAttribute?: string;\n\n /**\n * If true, use IntersectionObserver to cache visibility (no layout reads).\n * Default: true\n */\n observeVisibility?: boolean;\n};\n\nexport type DomRegisterOptions = {\n enabled?: boolean;\n visible?: boolean;\n groupId?: GroupId | null;\n onFocus?: (reason: FocusReason) => void;\n onBlur?: (reason: FocusReason) => void;\n};\n\nexport type DomRegistry = SpatialRegistry & {\n register(id: NodeId, el: HTMLElement, options?: DomRegisterOptions): void;\n unregister(id: NodeId): void;\n invalidate(id: NodeId): void;\n invalidateAll(): void;\n getElement(id: NodeId): HTMLElement | undefined;\n dispose(): void;\n};\n\nfunction rectFromClientRect(r: DOMRectReadOnly): Rect {\n return { x: r.left, y: r.top, w: r.width, h: r.height };\n}\n\nexport function createDomRegistry(options?: DomRegistryOptions): DomRegistry {\n const focusBehavior = options?.focusBehavior ?? \"none\";\n const focusedAttr = options?.focusedAttribute ?? \"data-tvkit-focused\";\n const observeVisibility = options?.observeVisibility ?? true;\n\n const elById = new Map<NodeId, HTMLElement>();\n const idByEl = new WeakMap<HTMLElement, NodeId>();\n const rectById = new Map<NodeId, Rect>();\n const groupById = new Map<NodeId, GroupId | null>();\n const enabledById = new Map<NodeId, boolean>();\n const visibleOverrideById = new Map<NodeId, boolean>();\n const intersectionVisibleById = new Map<NodeId, boolean>();\n const onFocusById = new Map<NodeId, (reason: FocusReason) => void>();\n const onBlurById = new Map<NodeId, (reason: FocusReason) => void>();\n\n // Stable ids array + swap-remove\n const idsArr: NodeId[] = [];\n const idToIndex = new Map<NodeId, number>();\n\n // Dirty tracking\n const dirty = new Set<NodeId>();\n let dirtyAll = false;\n\n // Pending incremental updates\n let pending: Required<RegistryUpdate> = { added: [], removed: [], changed: [] };\n const markAdded = (id: NodeId) => pending.added.push(id);\n const markRemoved = (id: NodeId) => pending.removed.push(id);\n const markChanged = (id: NodeId) => pending.changed.push(id);\n\n let resizeObserver: ResizeObserver | null = null;\n if (typeof ResizeObserver !== \"undefined\") {\n resizeObserver = new ResizeObserver((entries) => {\n for (let i = 0; i < entries.length; i++) {\n const el = entries[i]!.target as HTMLElement;\n const id = idByEl.get(el);\n if (id) dirty.add(id);\n }\n });\n }\n\n let intersectionObserver: IntersectionObserver | null = null;\n if (observeVisibility && typeof IntersectionObserver !== \"undefined\") {\n intersectionObserver = new IntersectionObserver((entries) => {\n for (let i = 0; i < entries.length; i++) {\n const e = entries[i]!;\n const el = e.target as HTMLElement;\n const id = idByEl.get(el);\n if (id) intersectionVisibleById.set(id, e.isIntersecting);\n }\n });\n }\n\n // Mark all dirty on viewport-affecting changes (coalesced via dirtyAll flag).\n const onViewportChange = () => {\n dirtyAll = true;\n };\n if (typeof window !== \"undefined\") {\n window.addEventListener(\"scroll\", onViewportChange, { passive: true, capture: true });\n window.addEventListener(\"resize\", onViewportChange, { passive: true });\n }\n\n const registry: DomRegistry = {\n ids() {\n return idsArr;\n },\n bounds(id) {\n return rectById.get(id) ?? null;\n },\n group(id) {\n return groupById.get(id) ?? null;\n },\n enabled(id) {\n const el = elById.get(id);\n if (!el) return false;\n const override = enabledById.get(id);\n if (override !== undefined) return override;\n const maybeDisabled = el as unknown as { disabled?: boolean };\n return el.getAttribute(\"aria-disabled\") !== \"true\" && !maybeDisabled.disabled;\n },\n visible(id) {\n const el = elById.get(id);\n if (!el) return false;\n if (!el.isConnected) return false;\n const override = visibleOverrideById.get(id);\n if (override !== undefined) return override;\n const observed = intersectionVisibleById.get(id);\n return observed ?? true;\n },\n sync(hint) {\n // Measure only when needed; do not write to the DOM here.\n // This is the critical place where we batch layout reads.\n const toMeasure: NodeId[] = [];\n\n if (dirtyAll) {\n dirtyAll = false;\n for (let i = 0; i < idsArr.length; i++) toMeasure.push(idsArr[i]!);\n } else if (dirty.size > 0) {\n for (const id of dirty) toMeasure.push(id);\n dirty.clear();\n }\n\n for (let i = 0; i < toMeasure.length; i++) {\n const id = toMeasure[i]!;\n const el = elById.get(id);\n if (!el) continue;\n const next = rectFromClientRect(el.getBoundingClientRect());\n const prev = rectById.get(id);\n rectById.set(id, next);\n if (\n !prev ||\n prev.x !== next.x ||\n prev.y !== next.y ||\n prev.w !== next.w ||\n prev.h !== next.h\n ) {\n markChanged(id);\n }\n }\n\n // If the engine provided a hint, ensure we at least have cached bounds for added/changed.\n const added = hint?.added ?? [];\n const changed = hint?.changed ?? [];\n for (let i = 0; i < added.length; i++) dirty.add(added[i]!);\n for (let i = 0; i < changed.length; i++) dirty.add(changed[i]!);\n },\n pendingUpdate() {\n const has =\n pending.added.length > 0 || pending.removed.length > 0 || pending.changed.length > 0;\n if (!has) return undefined;\n const hint: RegistryUpdate = pending;\n pending = { added: [], removed: [], changed: [] };\n return hint;\n },\n onFocus(id, reason) {\n const el = elById.get(id);\n if (el) {\n if (focusedAttr) el.setAttribute(focusedAttr, \"true\");\n if (focusBehavior === \"native\") {\n try {\n el.focus({ preventScroll: true });\n } catch {\n el.focus();\n }\n }\n }\n onFocusById.get(id)?.(reason);\n },\n onBlur(id, reason) {\n const el = elById.get(id);\n if (el && focusedAttr) el.removeAttribute(focusedAttr);\n onBlurById.get(id)?.(reason);\n },\n register(id, el, opts) {\n if (idToIndex.has(id)) {\n elById.set(id, el);\n idByEl.set(el, id);\n if (opts?.enabled !== undefined) enabledById.set(id, opts.enabled);\n if (opts?.visible !== undefined) visibleOverrideById.set(id, opts.visible);\n if (opts?.groupId !== undefined) groupById.set(id, opts.groupId);\n if (opts?.onFocus) onFocusById.set(id, opts.onFocus);\n if (opts?.onBlur) onBlurById.set(id, opts.onBlur);\n dirty.add(id);\n markChanged(id);\n return;\n }\n\n idsArr.push(id);\n idToIndex.set(id, idsArr.length - 1);\n\n elById.set(id, el);\n idByEl.set(el, id);\n if (opts?.enabled !== undefined) enabledById.set(id, opts.enabled);\n if (opts?.visible !== undefined) visibleOverrideById.set(id, opts.visible);\n if (opts?.groupId !== undefined) groupById.set(id, opts.groupId);\n if (opts?.onFocus) onFocusById.set(id, opts.onFocus);\n if (opts?.onBlur) onBlurById.set(id, opts.onBlur);\n\n resizeObserver?.observe(el);\n intersectionObserver?.observe(el);\n\n dirty.add(id);\n markAdded(id);\n },\n unregister(id) {\n const idx = idToIndex.get(id);\n if (idx === undefined) return;\n\n const el = elById.get(id);\n if (el) {\n resizeObserver?.unobserve(el);\n intersectionObserver?.unobserve(el);\n }\n\n const last = idsArr.pop()!;\n if (last !== id) {\n idsArr[idx] = last;\n idToIndex.set(last, idx);\n }\n idToIndex.delete(id);\n\n elById.delete(id);\n rectById.delete(id);\n groupById.delete(id);\n enabledById.delete(id);\n visibleOverrideById.delete(id);\n intersectionVisibleById.delete(id);\n onFocusById.delete(id);\n onBlurById.delete(id);\n dirty.delete(id);\n\n markRemoved(id);\n },\n invalidate(id) {\n dirty.add(id);\n },\n invalidateAll() {\n dirtyAll = true;\n },\n getElement(id) {\n return elById.get(id);\n },\n dispose() {\n if (typeof window !== \"undefined\") {\n window.removeEventListener(\"scroll\", onViewportChange, true);\n window.removeEventListener(\"resize\", onViewportChange);\n }\n resizeObserver?.disconnect();\n intersectionObserver?.disconnect();\n resizeObserver = null;\n intersectionObserver = null;\n idsArr.length = 0;\n idToIndex.clear();\n elById.clear();\n rectById.clear();\n groupById.clear();\n enabledById.clear();\n visibleOverrideById.clear();\n intersectionVisibleById.clear();\n onFocusById.clear();\n onBlurById.clear();\n dirty.clear();\n dirtyAll = false;\n pending = { added: [], removed: [], changed: [] };\n },\n };\n\n return registry;\n}\n"],"names":["rectFromClientRect","r","createDomRegistry","options","focusBehavior","focusedAttr","observeVisibility","elById","idByEl","rectById","groupById","enabledById","visibleOverrideById","intersectionVisibleById","onFocusById","onBlurById","idsArr","idToIndex","dirty","dirtyAll","pending","markAdded","id","markRemoved","markChanged","resizeObserver","entries","i","el","intersectionObserver","e","onViewportChange","override","maybeDisabled","hint","toMeasure","next","prev","added","changed","reason","opts","idx","last"],"mappings":"AA+CA,SAASA,EAAmBC,GAA0B;AACpD,SAAO,EAAE,GAAGA,EAAE,MAAM,GAAGA,EAAE,KAAK,GAAGA,EAAE,OAAO,GAAGA,EAAE,OAAA;AACjD;AAEO,SAASC,EAAkBC,GAA2C;AAC3E,QAAMC,IAAgBD,GAAS,iBAAiB,QAC1CE,IAAcF,GAAS,oBAAoB,sBAC3CG,IAAoBH,GAAS,qBAAqB,IAElDI,wBAAa,IAAA,GACbC,wBAAa,QAAA,GACbC,wBAAe,IAAA,GACfC,wBAAgB,IAAA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": "DOM registry for TVKit Navigation. Provides HTMLElement-based focusable registration.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"author": "TVKit Team",
|
|
9
|
+
"homepage": "https://github.com/tvkit/navigation#readme",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/tvkit/navigation.git",
|
|
13
|
+
"directory": "packages/dom"
|
|
14
|
+
},
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/tvkit/navigation/issues"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"tv",
|
|
20
|
+
"navigation",
|
|
21
|
+
"dom",
|
|
22
|
+
"focus",
|
|
23
|
+
"tvkit"
|
|
24
|
+
],
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"files": ["dist"],
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"import": "./dist/index.js"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"main": "./dist/index.js",
|
|
36
|
+
"module": "./dist/index.js",
|
|
37
|
+
"types": "./dist/index.d.ts",
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"@tvuikit/navigation": "^0.1.0"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@tvuikit/navigation": "file:../core"
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "vite build && npm run build:types",
|
|
46
|
+
"build:types": "tsc -p tsconfig.types.json",
|
|
47
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|