惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
Engineering at Meta
Engineering at Meta
月光博客
月光博客
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog
博客园 - Franky
The GitHub Blog
The GitHub Blog
大猫的无限游戏
大猫的无限游戏
The Cloudflare Blog
B
Blog RSS Feed
云风的 BLOG
云风的 BLOG
小众软件
小众软件
罗磊的独立博客
Microsoft Azure Blog
Microsoft Azure Blog
I
InfoQ
美团技术团队
H
Hackread – Cybersecurity News, Data Breaches, AI and More
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
V2EX
C
Check Point Blog
WordPress大学
WordPress大学
博客园 - 【当耐特】
博客园 - 司徒正美
D
Docker

RSS Minima activity

Commits · main · Dan Wolff / RSS Minima · GitLab Simplify focusability check - just use CSS selector (54a793c2) · Commits · Dan Wolff / RSS Minima · GitLab Add options for wraparound; remove "singleton" version: use more constants (9645e697) · Commits · Dan Wolff / RSS Minima · GitLab Keyboard nav: Refactor (1c3d583a) · Commits · Dan Wolff / RSS Minima · GitLab Refactor keyboard nav (b7f4c485) · Commits · Dan Wolff / RSS Minima · GitLab 89b30bd99cd47db3f069b1afa1dab30ae768e80f to af96dfe02ba2e1bb1f8e305ec418e1dff4b4ef11 · Dan Wolff / RSS Minima · GitLab Support specifying a copy format, e.g. a yt-dlp command (89b30bd9) · Commits · Dan Wolff / RSS Minima · GitLab a28898e0b013a75a7f103049894ecab36ae3f990 to 46ac7df8d6b151c6c6f1eede52fdb75a5dca4ce4 · Dan Wolff / RSS Minima · GitLab ef463f06d6b3e3850441482fba774d61a91ab477 to a28898e0b013a75a7f103049894ecab36ae3f990 · Dan Wolff / RSS Minima · GitLab 339ccf9ac2206fdd123a9a38b5c9b05c426392e7 to ef463f06d6b3e3850441482fba774d61a91ab477 · Dan Wolff / RSS Minima · GitLab Support enabling and disabling feeds (339ccf9a) · Commits · Dan Wolff / RSS Minima · GitLab 3dcfae9d95512e48127a97effc2cc5071b60ecdd to 085fced8c32f6a71b9b256fa44828d016dd5fc9b · Dan Wolff / RSS Minima · GitLab Show the add feed form in the 'highlight' area (3dcfae9d) · Commits · Dan Wolff / RSS Minima · GitLab 6346d59cd010c1513ac9b7d4bf0a67424eb2d3b0 to 1df02a1b329902ab0e56fd1976851b8c0f715e65 · Dan Wolff / RSS Minima · GitLab c4da933b50794d649c07324c051c8b60ed45a770 to 6346d59cd010c1513ac9b7d4bf0a67424eb2d3b0 · Dan Wolff / RSS Minima · GitLab e21d4054912d86e30be16c105f916d35661ccb6f to c4da933b50794d649c07324c051c8b60ed45a770 · Dan Wolff / RSS Minima · GitLab Update readme (e21d4054) · Commits · Dan Wolff / RSS Minima · GitLab f6bc674460abacff785466f41feba4f73d3140d6 to fe6633a595231107eeb35f03b1d202fe1bd67626 · Dan Wolff / RSS Minima · GitLab Dan Wolff / RSS Minima · GitLab
Keyboard nav: Extract constants (bbbc3736) · Commits · Da...
Dan Wolff · 2024-03-14 · via RSS Minima activity
Original line number Diff line number Diff line
export const ATTR_FOCUSABLE = "data-kbd-focusable";
export const ATTR_GRID_ROW = "data-kbd-grid-row";
export const ATTR_GROUP = "data-kbd-group";

export const SEL_FOCUSABLE = `[${ATTR_FOCUSABLE}]`;
export const SEL_GRID_ROW = `[${ATTR_GRID_ROW}]`;
export const SEL_GROUP = `[${ATTR_GROUP}]`;

export const DATA_GROUP_TYPE = "kbdGroup";

export const GROUP_TYPE_GRID = "grid";
export const GROUP_TYPE_HORIZONTAL = "horizontal";
export const GROUP_TYPE_VERTICAL = "vertical";
Original line number Diff line number Diff line
import {
  DATA_GROUP_TYPE,
  GROUP_TYPE_GRID,
  GROUP_TYPE_HORIZONTAL,
  GROUP_TYPE_VERTICAL,
  SEL_FOCUSABLE,
  SEL_GRID_ROW,
  SEL_GROUP,
} from "./constants.ts";
import {
  findAll,
  findAllFocusable,
@@ -24,14 +33,6 @@ interface GroupModel {
  moveFocus(direction: GridDirection): boolean;
}

const SEL_FOCUSABLE = "[data-kbd-focusable]";
const SEL_GRID_ROW = "[data-kbd-grid-row]";
const SEL_GROUP = "[data-kbd-group]";
const DATA_GROUP_TYPE = "kbdGroup";
const GROUP_TYPE_GRID = "grid";
const GROUP_TYPE_HORIZONTAL = "horizontal";
const GROUP_TYPE_VERTICAL = "vertical";

interface GridCurrent {
  cell: HTMLElement;
  row: HTMLElement;
Original line number Diff line number Diff line
import { createContext } from "preact";
import { SingletonKeyboardNav } from "./mod.ts";
import { useContext, useEffect } from "preact/hooks";
import {
  ATTR_FOCUSABLE,
  ATTR_GRID_ROW,
  ATTR_GROUP,
  GROUP_TYPE_GRID,
} from "./constants.ts";
import { GROUP_TYPE_VERTICAL } from "./constants.ts";
import { GROUP_TYPE_HORIZONTAL } from "./constants.ts";

const keyboardNavContext = createContext(
  new SingletonKeyboardNav(
@@ -17,9 +25,9 @@ export const useKeyboardNav = () => {
};

export const keyboardProps = {
  focusable: { "data-kbd-focusable": "" },
  grid: { "data-kbd-group": "grid" },
  gridRow: { "data-kbd-grid-row": "" },
  vertical: { "data-kbd-group": "vertical" },
  horizontal: { "data-kbd-group": "horizontal" },
  focusable: { [ATTR_FOCUSABLE]: "" },
  grid: { [ATTR_GROUP]: GROUP_TYPE_GRID },
  gridRow: { [ATTR_GRID_ROW]: "" },
  horizontal: { [ATTR_GROUP]: GROUP_TYPE_HORIZONTAL },
  vertical: { [ATTR_GROUP]: GROUP_TYPE_VERTICAL },
};