locatorjs
locatorjs copied to clipboard
feat: add mouseModifiers parameter to setupLocatorUI
Summary
Adds a mouseModifiers parameter to the setupLocatorUI() function, allowing users to configure custom keyboard shortcuts when using Locator without the browser extension.
Changes
- Added
mouseModifiers?: stringparameter tosetup()function inpackages/runtime/src/index.ts - Updated
initRuntime()to accept and set the mouse modifiers viadocument.documentElement.dataset.locatorMouseModifiers - Maintains full backward compatibility (defaults to 'alt' if not specified)
Usage
import setupLocatorUI from '@locator/runtime'
if (process?.env?.NODE_ENV === 'development') {
setupLocatorUI({
adapter: 'jsx',
mouseModifiers: 'meta+shift' // Cmd+Shift+Click instead of Option+Click
})
}
Available Options
'alt'- Option/Alt + Click (default)'meta'- Cmd/Windows + Click'shift'- Shift + Click'ctrl'- Ctrl + Click'meta+shift'- Cmd+Shift + Click'meta+alt'- Cmd+Option + Click- Any combination of
alt,ctrl,meta,shiftjoined by+
Motivation
This feature parity with the browser extension allows users who manually inject the Locator UI to customize keyboard shortcuts according to their preferences, avoiding conflicts with other tools or personal workflow preferences.