@action-finder/core
v0.1.1
Published
Framework-agnostic command palette engine and action helpers for action-finder.
Maintainers
Readme
@action-finder/core
Framework-agnostic engine and helpers for building command palettes, page search, and executable actions.
Install
pnpm add @action-finder/coreIncluded
SearchEngineKeyboardManagercreateActionHelpers()createDataSelector()waitForElement()clickElement()highlightElement()navigateAndRun()executeSearchItem()- shared types such as
SearchItem,SearchResult, andSearchActionContext
Example
import { SearchEngine, createDataSelector, navigateAndRun, type SearchItem } from '@action-finder/core';
const items: SearchItem[] = [
{
id: 'ticket-create',
title: 'Create ticket',
group: 'action',
path: '/tickets',
dataKey: 'ticket-create-action'
}
];
const engine = new SearchEngine({ items, maxResults: 10 });
const results = engine.search('create ticket');
await navigateAndRun({
path: '/tickets',
navigate: (path) => window.history.pushState({}, '', path),
target: createDataSelector('ticket-create-action'),
timeoutMs: 6000
});Related packages
@action-finder/vue@action-finder/react
Repository and full docs:
- https://codeup.aliyun.com/605efecf7470561e6a71441e/taixiaoyou.git
