feat(quick-261022-k9k): admin save shortcuts and Create and new on record forms
- app/hotkeys.ts: dependency-free data-hotkey core (Ctrl/Cmd+S, Ctrl/Cmd+Enter, Ctrl/Cmd+Shift+S, Esc, / and ?), innermost-modal root, capture-phase modifier listener, platform labels and the help-dialog state - Button hotkey prop (data-hotkey, aria-keyshortcuts); shortcuts installed by AppShell - FormView: save keys and tooltips, Create and new on create forms via remountView - phrasebook: form.create_and_new and the shortcuts group (en, pl)
This commit is contained in:
@@ -13,19 +13,27 @@ import { activeEntry } from '../../state/useNavigation'
|
||||
import { settingsEntry, settingsLinkFor, settingsSectionOf } from '../../state/useSettings'
|
||||
import { useSidebar } from '../../state/useSidebar'
|
||||
import { t } from '../../app/i18n'
|
||||
import { closeShortcutHelp, installHotkeys } from '../../app/hotkeys'
|
||||
|
||||
// Navigation shell (design: Navigation shell and Top header; D-06, D-10):
|
||||
// the plugin rail, the section panel (the active plugin's side menu or, on a
|
||||
// settings page, the settings panel of its category; hidden when the
|
||||
// sidebar is collapsed by the viewport or by the admin), and the 64px header
|
||||
// with breadcrumbs and the user menu. The toast queue is mounted here so
|
||||
// toasts survive navigation.
|
||||
// toasts survive navigation. The keyboard shortcuts (app/hotkeys.ts) are
|
||||
// installed here, so only signed-in shell screens answer them.
|
||||
const route = useRoute()
|
||||
const { collapsed, watchViewport } = useSidebar()
|
||||
|
||||
const stopViewport = watchViewport()
|
||||
onBeforeUnmount(stopViewport)
|
||||
|
||||
const uninstallHotkeys = installHotkeys()
|
||||
onBeforeUnmount(() => {
|
||||
uninstallHotkeys()
|
||||
closeShortcutHelp()
|
||||
})
|
||||
|
||||
// "View site" (WinterCMS parity) opens the public site in a new tab: the
|
||||
// admin page's own origin, without the admin path prefix.
|
||||
const siteURL = `${window.location.origin}/`
|
||||
|
||||
Reference in New Issue
Block a user