@sveltejs/vite-plugin-svelte
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -57,2 +57,3 @@ import { UserConfig, Plugin } from 'vite'; | ||
injectCss?: boolean; | ||
partialAccept?: boolean; | ||
[key: string]: any; | ||
@@ -187,2 +188,31 @@ }; | ||
/** | ||
* define keys to select elements with via keyboard | ||
* @default {parent: 'ArrowUp', child: 'ArrowDown', next: 'ArrowRight', prev: 'ArrowLeft' } | ||
* | ||
* improves accessibility and also helps when you want to select elements that do not have a hoverable surface area | ||
* due to tight wrapping | ||
* | ||
* A note for users of screen-readers: | ||
* If you are using arrow keys to navigate the page itself, change the navKeys to avoid conflicts. | ||
* e.g. navKeys: {parent: 'w', prev: 'a', child: 's', next: 'd'} | ||
* | ||
* | ||
* parent: select closest parent | ||
* child: select first child (or grandchild) | ||
* next: next sibling (or parent if no next sibling exists) | ||
* prev: previous sibling (or parent if no prev sibling exists) | ||
*/ | ||
navKeys?: { | ||
parent: string; | ||
child: string; | ||
next: string; | ||
prev: string; | ||
}; | ||
/** | ||
* define key to open the editor for the currently selected dom node | ||
* | ||
* @default 'Enter' | ||
*/ | ||
openKey?: string; | ||
/** | ||
* inspector is automatically disabled when releasing toggleKeyCombo after holding it for a longpress | ||
@@ -189,0 +219,0 @@ * @default false |
{ | ||
"name": "@sveltejs/vite-plugin-svelte", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"license": "MIT", | ||
@@ -49,3 +49,3 @@ "author": "dominikg", | ||
"magic-string": "^0.26.3", | ||
"svelte-hmr": "^0.14.12" | ||
"svelte-hmr": "^0.15.0" | ||
}, | ||
@@ -52,0 +52,0 @@ "peerDependencies": { |
@@ -11,2 +11,4 @@ import { Plugin, normalizePath } from 'vite'; | ||
toggleKeyCombo: process.platform === 'win32' ? 'control-shift' : 'meta-shift', | ||
navKeys: { parent: 'ArrowUp', child: 'ArrowDown', next: 'ArrowRight', prev: 'ArrowLeft' }, | ||
openKey: 'Enter', | ||
holdMode: false, | ||
@@ -13,0 +15,0 @@ showToggleButton: 'active', |
@@ -173,3 +173,8 @@ /* eslint-disable no-unused-vars */ | ||
const defaultOptions: Partial<Options> = { | ||
hot: viteConfig.isProduction ? false : { injectCss: !preResolveOptions.emitCss }, | ||
hot: viteConfig.isProduction | ||
? false | ||
: { | ||
injectCss: !preResolveOptions.emitCss, | ||
partialAccept: !!viteConfig.experimental?.hmrPartialAccept | ||
}, | ||
compilerOptions: { | ||
@@ -335,2 +340,13 @@ css: !preResolveOptions.emitCss, | ||
// enable hmrPartialAccept if not explicitly disabled | ||
if ( | ||
(options.hot == null || | ||
options.hot === true || | ||
(options.hot && options.hot.partialAccept !== false)) && // deviate from svelte-hmr, default to true | ||
config.experimental?.hmrPartialAccept !== false | ||
) { | ||
log.debug('enabling "experimental.hmrPartialAccept" in vite config'); | ||
extraViteConfig.experimental = { hmrPartialAccept: true }; | ||
} | ||
return extraViteConfig; | ||
@@ -505,3 +521,3 @@ } | ||
*/ | ||
hot?: boolean | { injectCss?: boolean; [key: string]: any }; | ||
hot?: boolean | { injectCss?: boolean; partialAccept?: boolean; [key: string]: any }; | ||
@@ -650,2 +666,28 @@ /** | ||
/** | ||
* define keys to select elements with via keyboard | ||
* @default {parent: 'ArrowUp', child: 'ArrowDown', next: 'ArrowRight', prev: 'ArrowLeft' } | ||
* | ||
* improves accessibility and also helps when you want to select elements that do not have a hoverable surface area | ||
* due to tight wrapping | ||
* | ||
* A note for users of screen-readers: | ||
* If you are using arrow keys to navigate the page itself, change the navKeys to avoid conflicts. | ||
* e.g. navKeys: {parent: 'w', prev: 'a', child: 's', next: 'd'} | ||
* | ||
* | ||
* parent: select closest parent | ||
* child: select first child (or grandchild) | ||
* next: next sibling (or parent if no next sibling exists) | ||
* prev: previous sibling (or parent if no prev sibling exists) | ||
*/ | ||
navKeys?: { parent: string; child: string; next: string; prev: string }; | ||
/** | ||
* define key to open the editor for the currently selected dom node | ||
* | ||
* @default 'Enter' | ||
*/ | ||
openKey?: string; | ||
/** | ||
* inspector is automatically disabled when releasing toggleKeyCombo after holding it for a longpress | ||
@@ -652,0 +694,0 @@ * @default false |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
537982
7057
+ Addedsvelte-hmr@0.15.3(transitive)
- Removedsvelte-hmr@0.14.12(transitive)
Updatedsvelte-hmr@^0.15.0