refactor: reorganize components into domain subfolders and replace relative imports
Move components from flat src/lib/components/ into recipes/, faith/, and cospend/ subdirectories. Replace ~144 relative imports across API routes and lib files with $models, $utils, $types, and $lib aliases. Add $types alias to svelte.config.js. Remove unused EditRecipe.svelte.
This commit is contained in:
14
src/lib/components/recipes/do_on_key.js
Normal file
14
src/lib/components/recipes/do_on_key.js
Normal file
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* @param {KeyboardEvent} event
|
||||
* @param {string} key
|
||||
* @param {boolean} needsctrl
|
||||
* @param {() => void} fn
|
||||
*/
|
||||
export function do_on_key(event, key, needsctrl, fn){
|
||||
if(event.key == key){
|
||||
if(needsctrl && !event.ctrlKey){
|
||||
return
|
||||
}
|
||||
fn()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user