Brunobkr/llama.cpp_AlgMor24_github
ΩFFFΣLLIa • llama.cpp • AlgMor24 ██████╗ ███████╗███████╗███████╗██╗ ██╗ ██╗ █████╗ ██╔═══██╗██╔════╝██╔════╝██╔════╝██║ ██║ ██║██╔══██╗ ██║ ██║█████╗ █████╗ █████╗ ██║ ██║ ██║███████║ ██║ ██║██╔══╝ ██╔══╝ ██╔══╝ ██║ ██║ ██║██╔══██║ ╚██████╔╝██║ ██║ ███████╗███████╗███████╗██║██║ ██║ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝╚══════╝╚═╝╚═╝ ╚═╝ High-Performance LLM / VLM Inference & Autonomous Agentic Ecosystem… See the full description on the dataset page: https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github.
03.1k
1import { focusable, isFocusable, isTabbable, tabbable } from "tabbable";2import { getDocument } from "svelte-toolbelt";3function getTabbableOptions() {4 return {5 getShadowRoot: true,6 displayCheck: 7 // JSDOM does not support the `tabbable` library. To solve this we can8 // check if `ResizeObserver` is a real function (not polyfilled), which9 // determines if the current environment is JSDOM-like.10 typeof ResizeObserver === "function" &&11 ResizeObserver.toString().includes("[native code]")12 ? "full"13 : "none",14 };15}16/**17 * Gets all tabbable elements in the body and finds the next/previous tabbable element18 * from the `currentNode` based on the `direction` provided.19 * @param currentNode - the node we want to get the next/previous tabbable from20 */21export function getTabbableFrom(currentNode, direction) {22 if (!isTabbable(currentNode, getTabbableOptions())) {23 return getTabbableFromFocusable(currentNode, direction);24 }25 const doc = getDocument(currentNode);26 const allTabbable = tabbable(doc.body, getTabbableOptions());27 if (direction === "prev")28 allTabbable.reverse();29 const activeIndex = allTabbable.indexOf(currentNode);30 if (activeIndex === -1)31 return doc.body;32 const nextTabbableElements = allTabbable.slice(activeIndex + 1);33 return nextTabbableElements[0];34}35export function getTabbableFromFocusable(currentNode, direction) {36 const doc = getDocument(currentNode);37 if (!isFocusable(currentNode, getTabbableOptions()))38 return doc.body;39 // find all focusable nodes, since some elements may be focusable but not tabbable40 // such as context menu triggers41 const allFocusable = focusable(doc.body, getTabbableOptions());42 // find index of current node among focusable siblings43 if (direction === "prev")44 allFocusable.reverse();45 const activeIndex = allFocusable.indexOf(currentNode);46 if (activeIndex === -1)47 return doc.body;48 const nextFocusableElements = allFocusable.slice(activeIndex + 1);49 // find the next focusable node that is also tabbable50 return nextFocusableElements.find((node) => isTabbable(node, getTabbableOptions())) ?? doc.body;51}52 