mirror of
https://github.com/Django-LiveView/liveview
synced 2026-01-09 06:43:40 +01:00
- Add data-liveview-keyboard-map attribute to map keyboard shortcuts to handlers - Implement keyboard event handling in page controller - Support letter keys (a-z), numbers (0-9), and special keys - Support modifier keys: ctrl, alt, meta, shift - Support key combinations like ctrl+s, alt+f, etc. - Add automatic focus management for keyboard-enabled elements - Handle dynamically added elements via MutationObserver - Add proper cleanup of keyboard listeners on disconnect - Update rollup config to output to liveview/static directory - Compile and minify JavaScript bundles
26 lines
580 B
JavaScript
26 lines
580 B
JavaScript
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
|
import terser from '@rollup/plugin-terser';
|
|
|
|
const production = process.env.BUILD === 'production';
|
|
|
|
export default {
|
|
input: 'main.js',
|
|
output: [
|
|
{
|
|
file: '../liveview/static/liveview/liveview.js',
|
|
format: 'iife',
|
|
name: 'DjangoLiveView',
|
|
sourcemap: !production
|
|
},
|
|
production && {
|
|
file: '../liveview/static/liveview/liveview.min.js',
|
|
format: 'iife',
|
|
name: 'DjangoLiveView',
|
|
plugins: [terser()]
|
|
}
|
|
].filter(Boolean),
|
|
plugins: [
|
|
nodeResolve()
|
|
]
|
|
};
|