@lumx/core 4.16.0-alpha.6 → 4.16.0-alpha.7

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.
@@ -18,4 +18,6 @@ import type { ComboboxEventMap, ComboboxHandle } from './types';
18
18
  * @param notify Notify subscribers of combobox events.
19
19
  * @returns The created focus navigation controller.
20
20
  */
21
- export declare function setupListbox(handle: ComboboxHandle, signal: AbortSignal, notify: <K extends keyof ComboboxEventMap>(event: K, value: ComboboxEventMap[K]) => void): FocusNavigationController;
21
+ export declare function setupListbox(handle: ComboboxHandle, signal: AbortSignal, notify: <K extends keyof ComboboxEventMap>(event: K, value: ComboboxEventMap[K]) => void, options?: {
22
+ wrapNavigation?: boolean;
23
+ }): FocusNavigationController;
@@ -2,16 +2,13 @@ import type { FocusNavigationCallbacks, FocusNavigationController, GridNavigatio
2
2
  /**
3
3
  * Create a focus navigation controller for a 2D grid.
4
4
  *
5
- * The controller is composed of two layers:
6
- * - a pure, side-effect-free **selection** layer ({@link createGridSelectors}) that only
7
- * resolves/reports rows and cells by querying the DOM, and
8
- * - a **mover** layer (this function) that commits focus by updating the active-item state
9
- * (which fires {@link FocusNavigationCallbacks}) on top of the selectors.
5
+ * Resolves rows and cells by querying the DOM and commits focus by updating the
6
+ * active-item state (which fires {@link FocusNavigationCallbacks}).
10
7
  *
11
8
  * Supports Up/Down between rows (with column memory) and Left/Right between cells
12
9
  * (with wrapping across rows).
13
10
  *
14
- * @param options Grid navigation options (container, rowSelector, cellSelector, isRowVisible, wrap).
11
+ * @param options Grid navigation options (container, rowSelector, cellSelector, wrap).
15
12
  * @param callbacks Callbacks for focus state changes.
16
13
  * @param signal AbortSignal for cleanup.
17
14
  * @returns FocusNavigationController instance.
@@ -2,12 +2,6 @@ import type { FocusNavigationCallbacks, ListFocusNavigationController, ListNavig
2
2
  /**
3
3
  * Create a focus navigation controller for a 1D list.
4
4
  *
5
- * The controller is composed of two layers:
6
- * - a pure, side-effect-free **selection** layer ({@link createListSelectors}) that only
7
- * resolves/reports items by querying the DOM, and
8
- * - a **mover** layer (this function) that commits focus by calling
9
- * {@link FocusNavigationCallbacks} on top of the selectors.
10
- *
11
5
  * This controller is **stateless** — it does not maintain an internal reference to
12
6
  * the active item. Instead it reads the active item from the DOM each time via the
13
7
  * `getActiveItem` callback provided in the options. This avoids any desync between
@@ -17,7 +17,6 @@ export interface GridNavigationOptions {
17
17
  container: HTMLElement;
18
18
  rowSelector: string;
19
19
  cellSelector: string;
20
- isRowVisible?: (row: HTMLElement) => boolean;
21
20
  wrap?: boolean;
22
21
  }
23
22
  /** Pure, side-effect-free selection layer for focus navigation. */
@@ -46,7 +45,6 @@ export interface ListFocusNavigationSelectors extends FocusNavigationSelectors {
46
45
  export interface FocusNavigationController<Selectors extends FocusNavigationSelectors = FocusNavigationSelectors> {
47
46
  readonly type: 'list' | 'grid';
48
47
  readonly selectors: Selectors;
49
- goToItem(item: HTMLElement): boolean;
50
48
  goToOffset(offset: number): boolean;
51
49
  clear(): void;
52
50
  goUp(): boolean;
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "dependencies": {
9
9
  "@floating-ui/dom": "^1.7.5",
10
- "@lumx/icons": "^4.16.0-alpha.6",
10
+ "@lumx/icons": "^4.16.0-alpha.7",
11
11
  "classnames": "^2.3.2",
12
12
  "focus-visible": "^5.0.2",
13
13
  "lodash": "4.18.1",
@@ -69,7 +69,7 @@
69
69
  "update-version-changelog": "yarn version-changelog ../../CHANGELOG.md"
70
70
  },
71
71
  "sideEffects": false,
72
- "version": "4.16.0-alpha.6",
72
+ "version": "4.16.0-alpha.7",
73
73
  "devDependencies": {
74
74
  "@rollup/plugin-typescript": "^12.3.0",
75
75
  "@testing-library/dom": "^10.4.1",
@@ -1,25 +0,0 @@
1
- import type { FocusNavigationSelectors, GridNavigationOptions } from './types';
2
- /**
3
- * Create the pure selection layer for a 2D grid.
4
- *
5
- * Everything here is side-effect-free: it only *queries* the DOM to resolve and report
6
- * rows/cells. No focus is moved and no {@link FocusNavigationCallbacks} are invoked — that
7
- * is the job of the mover layer built on top of this.
8
- *
9
- * @param options Grid navigation options (container, rowSelector, cellSelector).
10
- * @param getActive Reader for the currently active cell (owned by the mover's active-item state).
11
- * @param isVisible Predicate deciding whether a row is visible (derived from `isRowVisible`).
12
- * @returns The public {@link FocusNavigationSelectors} plus the internal
13
- * {@link GridSelectorHelpers} the mover layer consumes.
14
- */
15
- export declare function createGridSelectors(options: GridNavigationOptions, getActive: () => HTMLElement | null, isVisible: (row: HTMLElement) => boolean): {
16
- selectors: FocusNavigationSelectors;
17
- helpers: {
18
- findFirstVisibleRow: () => HTMLElement | null;
19
- findLastVisibleRow: () => HTMLElement | null;
20
- findAllVisibleRows: () => HTMLElement[];
21
- getRowCells: (row: HTMLElement) => HTMLElement[];
22
- findParentRow: (cell: HTMLElement) => HTMLElement | null;
23
- findAdjacentVisibleRow: (fromRow: HTMLElement, direction: "next" | "prev") => HTMLElement | null;
24
- };
25
- };
@@ -1,21 +0,0 @@
1
- import type { ListFocusNavigationSelectors, ListNavigationOptions } from './types';
2
- /**
3
- * Create the pure selection layer for a 1D list.
4
- *
5
- * Everything here is side-effect-free: it only *queries* the DOM to resolve and report
6
- * items. No focus is moved and no {@link FocusNavigationCallbacks} are invoked — that is
7
- * the job of the mover layer built on top of this (`createListFocusNavigation`).
8
- *
9
- * @param options List navigation options (container, itemSelector, itemDisabledSelector, getActiveItem).
10
- * @returns The public {@link ListFocusNavigationSelectors} plus the internal
11
- * {@link ListSelectorHelpers} the mover layer consumes.
12
- */
13
- export declare function createListSelectors(options: ListNavigationOptions): {
14
- selectors: ListFocusNavigationSelectors;
15
- helpers: {
16
- createItemWalker: (enabledOnly?: boolean) => TreeWalker;
17
- findFirstEnabled: () => HTMLElement | null;
18
- findLastEnabled: () => HTMLElement | null;
19
- getActiveItem: () => HTMLElement | null;
20
- };
21
- };