/**
 * Pointer Bindings
 *
 * All pointer/touch gesture bindings for the DEFAULT_CONTEXT.
 * Separated from keyboard bindings for readability.
 *
 * Extracted from pointer-contexts.ts in v1.7.0.
 *
 * @since 1.7.0
 */

/**
 * All pointer gesture bindings (tap, drag, long-press, pinch, scroll).
 */
export const POINTER_BINDINGS = [
	// --- Pointer taps ---
	{ id: 'tap-node', pattern: { type: 'tap', subjectKind: 'node' }, actionId: 'select-node' },
	{ id: 'tap-edge', pattern: { type: 'tap', subjectKind: 'edge' }, actionId: 'select-edge' },
	{ id: 'tap-bg', pattern: { type: 'tap', subjectKind: 'background' }, actionId: 'clear-selection' },
	{
		id: 'shift-tap-node',
		pattern: { type: 'tap', subjectKind: 'node', modifiers: { shift: true } },
		actionId: 'toggle-selection',
	},

	// --- Right-click ---
	{
		id: 'rc-node',
		pattern: { type: 'tap', subjectKind: 'node', button: 2 },
		actionId: 'context-menu',
		consumeInput: true,
	},
	{
		id: 'rc-bg',
		pattern: { type: 'tap', subjectKind: 'background', button: 2 },
		actionId: 'context-menu',
		consumeInput: true,
	},

	// --- Double/triple tap ---
	{ id: 'dtap-node', pattern: { type: 'double-tap', subjectKind: 'node' }, actionId: 'fit-to-view' },
	{ id: 'ttap-node', pattern: { type: 'triple-tap', subjectKind: 'node' }, actionId: 'toggle-lock' },

	// --- Drags ---
	{ id: 'drag-node', pattern: { type: 'drag', subjectKind: 'node' }, actionId: 'move-node' },
	{ id: 'drag-bg-finger', pattern: { type: 'drag', subjectKind: 'background', source: 'finger' }, actionId: 'pan' },
	{ id: 'drag-bg-mouse', pattern: { type: 'drag', subjectKind: 'background', source: 'mouse' }, actionId: 'pan' },
	{ id: 'drag-bg-pencil', pattern: { type: 'drag', subjectKind: 'background', source: 'pencil' }, actionId: 'lasso-select' },
	{
		id: 'space-drag-pan',
		pattern: { type: 'drag', heldKeys: { byCode: { Space: true } } },
		actionId: 'pan',
	},
	{
		id: 'shift-drag-bg',
		pattern: { type: 'drag', subjectKind: 'background', modifiers: { shift: true } },
		actionId: 'rect-select',
	},

	// Right/middle drag — no-ops by default
	{ id: 'rdrag-node', pattern: { type: 'drag', subjectKind: 'node', button: 2 }, actionId: 'none' },
	{ id: 'rdrag-bg', pattern: { type: 'drag', subjectKind: 'background', button: 2 }, actionId: 'none' },

	// --- Long-press ---
	{ id: 'lp-node', pattern: { type: 'long-press', subjectKind: 'node' }, actionId: 'context-menu' },
	{
		id: 'lp-bg-finger',
		pattern: { type: 'long-press', subjectKind: 'background', source: 'finger' },
		actionId: 'create-node',
	},

	// --- Pinch / scroll ---
	{ id: 'pinch-bg', pattern: { type: 'pinch', subjectKind: 'background' }, actionId: 'zoom' },
	{ id: 'scroll-any', pattern: { type: 'scroll' }, actionId: 'zoom' },
	{ id: 'pinch-node', pattern: { type: 'pinch', subjectKind: 'node' }, actionId: 'split-node' },
] as const;
