forked from vuejs/devtools-v6
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New keyboard shortcuts + tooltips refactoring (vuejs#519)
* Tooltip style tweak * Refactoring with new i18n plugin * Add [F] to focus filter input * Fix index going out of bounds * Tooltip key background has more contrast in Dark mode * More history keyboard shortcuts * App keyboard shortcuts + improvements * Disable keyboard shortcuts if target is textarea * Improved entry list keyboard navigation + bug fixes * Update locale interpolation * Change Force refresh to Ctrl+Alt+R to avoid conflict with page refresh * Better keyboard shortcuts * Shortcuts: now uses `key` and modifiers are now exclusive For example, modifier 'ctrl+alt' isn't dispatch if 'shift' is pressed too. * Change Tabs shorctus * Fix Ctrl+Alt+R shortcut on Mac * Added Backspace to Ctrl+Del for convenience on MacBook * Fix key tooltip on MacOS * Removed right-margin on keys in tooltips * Fix icon alignment on MacOS * New GlobalRefs plugin for better code maintainability * More explicit keyboard mixin * Fix tests
- Loading branch information
Guillaume Chau
authored
Jan 22, 2018
1 parent
99cc2e3
commit 000a632
Showing
21 changed files
with
573 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import Vue from 'vue' | ||
|
||
export const isChrome = typeof chrome !== 'undefined' && !!chrome.devtools | ||
export const isMac = navigator.platform === 'MacIntel' | ||
export const keys = { | ||
ctrl: isMac ? '⌘' : 'Ctrl', | ||
shift: 'Shift', | ||
alt: isMac ? '⌥' : 'Alt', | ||
del: 'Del', | ||
enter: 'Enter', | ||
esc: 'Esc' | ||
} | ||
|
||
Object.defineProperties(Vue.prototype, { | ||
'$isChrome': { get: () => isChrome }, | ||
'$isMac': { get: () => isMac }, | ||
'$keys': { get: () => keys } | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
export default { | ||
App: { | ||
components: { | ||
tooltip: '[[{{keys.ctrl}}]] + [[1]] Switch to Components' | ||
}, | ||
events: { | ||
tooltip: '[[{{keys.ctrl}}]] + [[3]] Switch to Events' | ||
}, | ||
refresh: { | ||
tooltip: '[[{{keys.ctrl}}]] + [[{{keys.alt}}]] + [[R]] Force Refresh' | ||
}, | ||
vuex: { | ||
tooltip: '[[{{keys.ctrl}}]] + [[2]] Switch to Vuex' | ||
} | ||
}, | ||
StateInspector: { | ||
dataType: { | ||
tooltip: '[[{{keys.ctrl}}]] + <<mouse>>: Collapse All<br>[[{{keys.shift}}]] + <<mouse>>: Expand All' | ||
} | ||
}, | ||
DataField: { | ||
edit: { | ||
cancel: { | ||
tooltip: '[[{{keys.esc}}]] Cancel' | ||
}, | ||
submit: { | ||
tooltip: '[[{{keys.enter}}]] Submit change' | ||
} | ||
}, | ||
quickEdit: { | ||
number: { | ||
tooltip: `Quick Edit<br><br> | ||
[[{{keys.ctrl}}]] + <<mouse>>: {{operator}}5<br> | ||
[[{{keys.shift}}]] + <<mouse>>: {{operator}}10<br> | ||
[[{{keys.alt}}]] + <<mouse>>: {{operator}}100` | ||
} | ||
} | ||
}, | ||
ComponentTree: { | ||
select: { | ||
tooltip: '[[S]] Select component in the page' | ||
}, | ||
filter: { | ||
tooltip: '[[{{keys.ctrl}}]] + [[F]] Filter components by name' | ||
} | ||
}, | ||
EventsHistory: { | ||
filter: { | ||
tooltip: '[[{{keys.ctrl}}]] + [[F]] To filter on components, type <input><<search>> <MyComponent></input> or just <input><<search>> <mycomp</input>.' | ||
}, | ||
clear: { | ||
tooltip: '[[{{keys.ctrl}}]] + [[{{keys.del}}]] Clear Log' | ||
}, | ||
startRecording: { | ||
tooltip: '[[R]] Start recording' | ||
}, | ||
stopRecording: { | ||
tooltip: '[[R]] Stop recording' | ||
} | ||
}, | ||
VuexHistory: { | ||
filter: { | ||
tooltip: '[[{{keys.ctrl}}]] + [[F]] Filter mutations' | ||
}, | ||
commitAll: { | ||
tooltip: '[[{{keys.ctrl}}]] + [[{{keys.enter}}]] Commit all' | ||
}, | ||
revertAll: { | ||
tooltip: '[[{{keys.ctrl}}]] + [[{{keys.del}}]] Revert all' | ||
}, | ||
startRecording: { | ||
tooltip: '[[R]] Start recording' | ||
}, | ||
stopRecording: { | ||
tooltip: '[[R]] Stop recording' | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { scrollIntoView } from 'src/util' | ||
|
||
export default { | ||
watch: { | ||
inspectedIndex (value) { | ||
this.$nextTick(() => { | ||
const el = value === -1 ? this.$refs.baseEntry : this.$refs.entries[value] | ||
el && scrollIntoView(this.$globalRefs.leftScroll, el, false) | ||
}) | ||
} | ||
} | ||
} |
Oops, something went wrong.