@alfakit/vue 0.1.8 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/app/components.d.ts.map +1 -1
- package/dist/app/components.js +1 -0
- package/dist/app/components.js.map +1 -1
- package/dist/components/actions/ActionModal.js.map +1 -1
- package/dist/components/actions/ActionModal.vue.d.ts.map +1 -1
- package/dist/components/actions/ActionModal.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/actions/ActionModal.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/dev-tools/DevToolsInspector.js.map +1 -1
- package/dist/components/dev-tools/DevToolsInspector.vue.d.ts.map +1 -1
- package/dist/components/dev-tools/DevToolsInspector.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/dev-tools/DevToolsInspector.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/fields/CheckboxListField.js.map +1 -1
- package/dist/components/fields/CheckboxListField.vue.d.ts.map +1 -1
- package/dist/components/fields/CheckboxListField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/fields/CheckboxListField.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/fields/DatePickerField.js.map +1 -1
- package/dist/components/fields/DatePickerField.vue.d.ts.map +1 -1
- package/dist/components/fields/DatePickerField.vue_vue_type_script_setup_true_lang.js +34 -32
- package/dist/components/fields/DatePickerField.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/fields/RichEditorSuggestions.js.map +1 -1
- package/dist/components/fields/RichEditorSuggestions.vue.d.ts +1 -1
- package/dist/components/fields/RichEditorSuggestions.vue.d.ts.map +1 -1
- package/dist/components/fields/RichEditorSuggestions.vue_vue_type_script_setup_true_lang.js +29 -23
- package/dist/components/fields/RichEditorSuggestions.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/fields/RichEditorToolbarGroup.js.map +1 -1
- package/dist/components/fields/RichEditorToolbarGroup.vue.d.ts.map +1 -1
- package/dist/components/fields/RichEditorToolbarGroup.vue_vue_type_script_setup_true_lang.js +9 -4
- package/dist/components/fields/RichEditorToolbarGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/file-manager/FileManagerView.js.map +1 -1
- package/dist/components/file-manager/FileManagerView.vue.d.ts.map +1 -1
- package/dist/components/file-manager/FileManagerView.vue_vue_type_script_setup_true_lang.js +5 -1
- package/dist/components/file-manager/FileManagerView.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/form/FormBlock.js.map +1 -1
- package/dist/components/form/FormBlock.vue.d.ts.map +1 -1
- package/dist/components/form/FormBlock.vue_vue_type_script_setup_true_lang.js +79 -78
- package/dist/components/form/FormBlock.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/layout/CalloutComponent.js.map +1 -1
- package/dist/components/layout/CalloutComponent.vue.d.ts.map +1 -1
- package/dist/components/layout/CalloutComponent.vue_vue_type_script_setup_true_lang.js +43 -39
- package/dist/components/layout/CalloutComponent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/layout/EmptyStateComponent.js.map +1 -1
- package/dist/components/layout/EmptyStateComponent.vue.d.ts.map +1 -1
- package/dist/components/layout/EmptyStateComponent.vue_vue_type_script_setup_true_lang.js +29 -26
- package/dist/components/layout/EmptyStateComponent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/layout/MixedContent.js.map +1 -1
- package/dist/components/layout/MixedContent.vue.d.ts +5 -3
- package/dist/components/layout/MixedContent.vue.d.ts.map +1 -1
- package/dist/components/layout/MixedContent.vue_vue_type_script_setup_true_lang.js +5 -4
- package/dist/components/layout/MixedContent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/layout/SectionComponent.js.map +1 -1
- package/dist/components/layout/SectionComponent.vue.d.ts.map +1 -1
- package/dist/components/layout/SectionComponent.vue_vue_type_script_setup_true_lang.js +12 -8
- package/dist/components/layout/SectionComponent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/notifications/NotificationsMenu.js.map +1 -1
- package/dist/components/notifications/NotificationsMenu.vue.d.ts.map +1 -1
- package/dist/components/notifications/NotificationsMenu.vue_vue_type_script_setup_true_lang.js +133 -104
- package/dist/components/notifications/NotificationsMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/panel/BottomNav.js.map +1 -1
- package/dist/components/panel/BottomNav.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/panel/BottomNav.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/panel/KeyboardShortcuts.js.map +1 -1
- package/dist/components/panel/KeyboardShortcuts.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/panel/KeyboardShortcuts.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/panel/NavGroup.js.map +1 -1
- package/dist/components/panel/NavGroup.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/panel/NavGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/panel/NavItem.js.map +1 -1
- package/dist/components/panel/NavItem.vue.d.ts.map +1 -1
- package/dist/components/panel/NavItem.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/panel/NavItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/panel/NavSubItem.js.map +1 -1
- package/dist/components/panel/NavSubItem.vue.d.ts.map +1 -1
- package/dist/components/panel/NavSubItem.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/panel/NavSubItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/panel/ShortcutsOverlay.js.map +1 -1
- package/dist/components/panel/ShortcutsOverlay.vue.d.ts.map +1 -1
- package/dist/components/panel/ShortcutsOverlay.vue_vue_type_script_setup_true_lang.js +20 -19
- package/dist/components/panel/ShortcutsOverlay.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/table/ColumnManager.js.map +1 -1
- package/dist/components/table/ColumnManager.vue.d.ts.map +1 -1
- package/dist/components/table/ColumnManager.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/components/table/ColumnManager.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/table/Spreadsheet.js.map +1 -1
- package/dist/components/table/Spreadsheet.vue.d.ts.map +1 -1
- package/dist/components/table/Spreadsheet.vue_vue_type_script_setup_true_lang.js +37 -33
- package/dist/components/table/Spreadsheet.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/translation-manager/TranslationManagerView.js.map +1 -1
- package/dist/components/translation-manager/TranslationManagerView.vue.d.ts.map +1 -1
- package/dist/components/translation-manager/TranslationManagerView.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/translation-manager/TranslationManagerView.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ui/SidebarMenuButton.js.map +1 -1
- package/dist/components/ui/SidebarMenuButton.vue.d.ts.map +1 -1
- package/dist/components/ui/SidebarMenuButton.vue_vue_type_script_setup_true_lang.js +12 -12
- package/dist/components/ui/SidebarMenuButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ui/TooltipTrigger.js.map +1 -1
- package/dist/components/ui/TooltipTrigger.vue.d.ts +2 -2
- package/dist/components/ui/TooltipTrigger.vue.d.ts.map +1 -1
- package/dist/components/ui/TooltipTrigger.vue_vue_type_script_setup_true_lang.js +10 -7
- package/dist/components/ui/TooltipTrigger.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/widgets/StatCard.js.map +1 -1
- package/dist/components/widgets/StatCard.vue.d.ts.map +1 -1
- package/dist/components/widgets/StatCard.vue_vue_type_script_setup_true_lang.js +30 -30
- package/dist/components/widgets/StatCard.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/eject-manifest.json +2 -2
- package/dist/layouts/TopNavLayout.js.map +1 -1
- package/dist/layouts/TopNavLayout.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/layouts/TopNavLayout.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/layouts/TopNavMenu.js.map +1 -1
- package/dist/layouts/TopNavMenu.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/layouts/TopNavMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/pages/AlfakitPage.js.map +1 -1
- package/dist/pages/AlfakitPage.vue.d.ts.map +1 -1
- package/dist/pages/AlfakitPage.vue_vue_type_script_setup_true_lang.js +16 -19
- package/dist/pages/AlfakitPage.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/standalone/AlfakitComponent.js.map +1 -1
- package/dist/standalone/AlfakitComponent.vue.d.ts.map +1 -1
- package/dist/standalone/AlfakitComponent.vue_vue_type_script_setup_true_lang.js +29 -24
- package/dist/standalone/AlfakitComponent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/standalone/runtime.d.ts.map +1 -1
- package/dist/standalone/runtime.js +25 -25
- package/dist/standalone/runtime.js.map +1 -1
- package/dist/standalone.css +12 -7
- package/dist/starter-kit/AlfakitStarterKitRoot.js.map +1 -1
- package/dist/starter-kit/AlfakitStarterKitRoot.vue.d.ts.map +1 -1
- package/dist/starter-kit/AlfakitStarterKitRoot.vue_vue_type_script_setup_true_lang.js +25 -21
- package/dist/starter-kit/AlfakitStarterKitRoot.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/starter-kit/navigation.d.ts +6 -1
- package/dist/starter-kit/navigation.d.ts.map +1 -1
- package/dist/starter-kit/navigation.js +11 -10
- package/dist/starter-kit/navigation.js.map +1 -1
- package/dist/styles.css +2 -1
- package/dist/themes.css +4 -0
- package/package.json +2 -2
- package/src/app/components.ts +3 -0
- package/src/components/actions/ActionModal.vue +2 -0
- package/src/components/dev-tools/DevToolsInspector.vue +1 -1
- package/src/components/fields/CheckboxListField.vue +2 -2
- package/src/components/fields/DatePickerField.vue +1 -0
- package/src/components/fields/RichEditorSuggestions.vue +13 -6
- package/src/components/fields/RichEditorToolbarGroup.vue +16 -1
- package/src/components/file-manager/FileManagerView.vue +3 -1
- package/src/components/form/FormBlock.vue +15 -2
- package/src/components/layout/CalloutComponent.vue +15 -2
- package/src/components/layout/EmptyStateComponent.vue +10 -1
- package/src/components/layout/MixedContent.vue +12 -4
- package/src/components/layout/SectionComponent.vue +20 -4
- package/src/components/notifications/NotificationsMenu.vue +45 -1
- package/src/components/panel/BottomNav.vue +2 -2
- package/src/components/panel/KeyboardShortcuts.vue +1 -1
- package/src/components/panel/NavGroup.vue +3 -3
- package/src/components/panel/NavItem.vue +5 -1
- package/src/components/panel/NavSubItem.vue +5 -1
- package/src/components/panel/ShortcutsOverlay.vue +27 -22
- package/src/components/table/ColumnManager.vue +6 -4
- package/src/components/table/Spreadsheet.vue +9 -4
- package/src/components/translation-manager/TranslationManagerView.vue +1 -1
- package/src/components/ui/SidebarMenuButton.vue +6 -0
- package/src/components/ui/TooltipTrigger.vue +4 -1
- package/src/components/widgets/StatCard.vue +6 -3
- package/src/layouts/TopNavLayout.vue +2 -2
- package/src/layouts/TopNavMenu.vue +1 -1
- package/src/pages/AlfakitPage.vue +13 -3
- package/src/standalone/AlfakitComponent.vue +16 -5
- package/src/standalone/runtime.ts +3 -0
- package/src/starter-kit/AlfakitStarterKitRoot.vue +7 -0
- package/src/starter-kit/navigation.ts +12 -1
- package/src/styles.css +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyboardShortcuts.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_unref","_createCommentVNode","KeyboardShortcuts_vue_vue_type_script_setup_true_lang_default","t","useT","panel","usePanel","page","usePageSchema","runner","useActionRunner","open","ref","Overlay","shallowRef","shortcutsOverlay","value","active","onCleanup","component","config","computed","overrides","stored","shortcuts","registrations","command","disposers","SHORTCUT_IDS","focusTableSearch","home","router","commands","commandShortcutId","COMMANDS_COMPONENT","dispose","customizable","openBlock","createBlock","resolveDynamicComponent","unref","_cache","$event","createCommentVNode"],"sources":["../../../src/components/panel/KeyboardShortcuts.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { CommandSchema } from '@alfakit/core'\nimport {\n commandShortcutId,\n COMMANDS_COMPONENT,\n focusTableSearch,\n SHORTCUT_IDS,\n shortcuts,\n} from '@alfakit/core'\nimport { router } from '@inertiajs/vue3'\nimport { computed, ref, shallowRef, watch, type Component } from 'vue'\nimport { useActionRunner, usePageSchema, usePanel, useT } from '../../context'\nimport { shortcutsOverlay } from './lazy-chrome'\n\n/**\n * Keyboard shortcuts of the panel: `/` (focus the table search), `g d` (dashboard), `?`\n * (the overlay) and the panel commands' `shortcut()`, with the user's customised keys\n * (`alfakit.keyboardShortcuts`).\n */\nconst t = useT()\nconst panel = usePanel()\nconst page = usePageSchema()\nconst runner = useActionRunner()\nconst open = ref(false)\n// Null on the server and during hydration (nothing loads there), so the markup matches.\nconst Overlay = shallowRef<Component | null>(shortcutsOverlay.current)\n\n// `?` (or the palette's \"Keyboard shortcuts\") before the code has arrived keeps `open` set;\n// the overlay mounts open once it has loaded.\nwatch(open, (value, _old, onCleanup) => {\n if (!value) return\n\n // Already loaded (by another instance): mount it straight away.\n if (shortcutsOverlay.current) {\n Overlay.value = shortcutsOverlay.current\n\n return\n }\n\n let active = true\n onCleanup(() => {\n active = false\n })\n\n shortcutsOverlay.load().then(\n (component) => {\n if (active) Overlay.value = component\n },\n () => {\n if (active) open.value = false\n },\n )\n})\nconst config = computed(() => panel.value.keyboardShortcuts)\nconst overrides = computed(() => JSON.stringify(config.value ? (config.value.overrides ?? {}) : {}))\n\nwatch(\n [config, overrides],\n ([value, stored]) => {\n if (typeof window === 'undefined') return\n\n shortcuts.setEnabled(value !== false)\n shortcuts.setOverrides(JSON.parse(stored) as Record<string, string[]>)\n },\n { immediate: true },\n)\n\n// Keyed on what the registrations depend on, so reloads (a new panel object) don't churn.\nconst registrations = computed(() =>\n config.value\n ? JSON.stringify({\n token: page.value?.token ?? '',\n home: panel.value.url ?? null,\n commands: (panel.value.commandPalette?.commands ?? []).filter(\n (command) => command.keyBindings?.length && !command.disabled,\n ),\n })\n : '',\n)\n\nwatch(\n registrations,\n (value, _old, onCleanup) => {\n if (!value || typeof window === 'undefined') return\n\n const { token, home, commands } = JSON.parse(value) as {\n token: string\n home: string | null\n commands: CommandSchema[]\n }\n\n const disposers = [\n shortcuts.register({\n id: SHORTCUT_IDS.overlay,\n keys: ['?'],\n label: t('shortcuts.show_overlay', {}, 'Show keyboard shortcuts'),\n group: 'general',\n handler: () => {\n open.value = true\n },\n }),\n // Declined (`false`) on pages without a table search, so `/` keeps its default.\n shortcuts.register({\n id: SHORTCUT_IDS.search,\n keys: ['/'],\n label: t('shortcuts.focus_search', {}, 'Search the table'),\n group: 'general',\n handler: () => focusTableSearch(),\n }),\n ...(home\n ? [\n shortcuts.register({\n id: SHORTCUT_IDS.dashboard,\n keys: ['g d'],\n label: t('shortcuts.go_dashboard', {}, 'Go to the dashboard'),\n group: 'navigation',\n handler: () => router.visit(home),\n }),\n ]\n : []),\n ...commands.map((command) =>\n shortcuts.register({\n id: commandShortcutId(command.name),\n keys: command.keyBindings ?? [],\n label: command.label ?? command.name,\n group: command.url ? 'navigation' : 'commands',\n handler: () => void runner.trigger(command, { token, component: COMMANDS_COMPONENT }),\n }),\n ),\n ]\n\n onCleanup(() => disposers.forEach((dispose) => dispose()))\n },\n { immediate: true },\n)\n\nconst customizable = computed(() =>\n Boolean(config.value && config.value.customizable && panel.value.endpoints.shortcuts),\n)\n</script>\n\n<template>\n <component\n :is=\"Overlay\"\n v-if=\"config && Overlay\"\n :open=\"open\"\n :customizable=\"customizable\"\n :endpoint=\"panel.endpoints.shortcuts\"\n @update:open=\"open = $event\"\n />\n</template>\n"],"mappings":";;;;;;;;;EAmBA,IAAMM,IAAIC,EAAK,GACTC,IAAQC,EAAS,GACjBC,IAAOC,EAAc,GACrBC,IAASC,EAAgB,GACzBC,IAAOC,EAAI,EAAK,GAEhBC,IAAUC,EAA6BC,EAAiB,OAAO;EAIrE,EAAMJ,IAAO,GAAO,GAAM,MAAc;GACtC,IAAI,CAACK,GAAO;GAGZ,IAAID,EAAiB,SAAS;IAC5B,EAAQ,QAAQA,EAAiB;IAEjC;GACF;GAEA,IAAIE,IAAS;GAKb,AAJAC,QAAgB;IACd,IAAS;GACX,CAAC,GAEDH,EAAiB,KAAK,CAAC,CAAC,MACrB,MAAc;IACb,AAAIE,MAAQ,EAAQ,QAAQE;GAC9B,SACM;IACJ,AAAIF,MAAQ,EAAK,QAAQ;GAC3B,CACF;EACF,CAAC;EACD,IAAMG,IAASC,QAAehB,EAAM,MAAM,iBAAiB,GACrDiB,IAAYD,QAAe,KAAK,UAAUD,EAAO,QAASA,EAAO,MAAM,aAAa,CAAC,IAAK,CAAC,CAAC,CAAC;EAEnG,EACE,CAACA,GAAQE,CAAS,IACjB,CAACN,GAAOO,OAAY;GACnB,AAAI,OAAO,SAAW,QAEtBC,EAAU,WAAWR,MAAU,EAAK,GACpCQ,EAAU,aAAa,KAAK,MAAMD,CAAM,CAA6B;EACvE,GACA,EAAE,WAAW,GAAK,CACpB;EAGA,IAAME,IAAgBJ,QACpBD,EAAO,QACH,KAAK,UAAU;GACb,OAAOb,EAAK,OAAO,SAAS;GAC5B,MAAMF,EAAM,MAAM,OAAO;
|
|
1
|
+
{"version":3,"file":"KeyboardShortcuts.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_unref","_createCommentVNode","KeyboardShortcuts_vue_vue_type_script_setup_true_lang_default","t","useT","panel","usePanel","page","usePageSchema","runner","useActionRunner","open","ref","Overlay","shallowRef","shortcutsOverlay","value","active","onCleanup","component","config","computed","overrides","stored","shortcuts","registrations","command","disposers","SHORTCUT_IDS","focusTableSearch","home","router","commands","commandShortcutId","COMMANDS_COMPONENT","dispose","customizable","openBlock","createBlock","resolveDynamicComponent","unref","_cache","$event","createCommentVNode"],"sources":["../../../src/components/panel/KeyboardShortcuts.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { CommandSchema } from '@alfakit/core'\nimport {\n commandShortcutId,\n COMMANDS_COMPONENT,\n focusTableSearch,\n SHORTCUT_IDS,\n shortcuts,\n} from '@alfakit/core'\nimport { router } from '@inertiajs/vue3'\nimport { computed, ref, shallowRef, watch, type Component } from 'vue'\nimport { useActionRunner, usePageSchema, usePanel, useT } from '../../context'\nimport { shortcutsOverlay } from './lazy-chrome'\n\n/**\n * Keyboard shortcuts of the panel: `/` (focus the table search), `g d` (dashboard), `?`\n * (the overlay) and the panel commands' `shortcut()`, with the user's customised keys\n * (`alfakit.keyboardShortcuts`).\n */\nconst t = useT()\nconst panel = usePanel()\nconst page = usePageSchema()\nconst runner = useActionRunner()\nconst open = ref(false)\n// Null on the server and during hydration (nothing loads there), so the markup matches.\nconst Overlay = shallowRef<Component | null>(shortcutsOverlay.current)\n\n// `?` (or the palette's \"Keyboard shortcuts\") before the code has arrived keeps `open` set;\n// the overlay mounts open once it has loaded.\nwatch(open, (value, _old, onCleanup) => {\n if (!value) return\n\n // Already loaded (by another instance): mount it straight away.\n if (shortcutsOverlay.current) {\n Overlay.value = shortcutsOverlay.current\n\n return\n }\n\n let active = true\n onCleanup(() => {\n active = false\n })\n\n shortcutsOverlay.load().then(\n (component) => {\n if (active) Overlay.value = component\n },\n () => {\n if (active) open.value = false\n },\n )\n})\nconst config = computed(() => panel.value.keyboardShortcuts)\nconst overrides = computed(() => JSON.stringify(config.value ? (config.value.overrides ?? {}) : {}))\n\nwatch(\n [config, overrides],\n ([value, stored]) => {\n if (typeof window === 'undefined') return\n\n shortcuts.setEnabled(value !== false)\n shortcuts.setOverrides(JSON.parse(stored) as Record<string, string[]>)\n },\n { immediate: true },\n)\n\n// Keyed on what the registrations depend on, so reloads (a new panel object) don't churn.\nconst registrations = computed(() =>\n config.value\n ? JSON.stringify({\n token: page.value?.token ?? '',\n home: panel.value.dashboardUrl ?? panel.value.url ?? null,\n commands: (panel.value.commandPalette?.commands ?? []).filter(\n (command) => command.keyBindings?.length && !command.disabled,\n ),\n })\n : '',\n)\n\nwatch(\n registrations,\n (value, _old, onCleanup) => {\n if (!value || typeof window === 'undefined') return\n\n const { token, home, commands } = JSON.parse(value) as {\n token: string\n home: string | null\n commands: CommandSchema[]\n }\n\n const disposers = [\n shortcuts.register({\n id: SHORTCUT_IDS.overlay,\n keys: ['?'],\n label: t('shortcuts.show_overlay', {}, 'Show keyboard shortcuts'),\n group: 'general',\n handler: () => {\n open.value = true\n },\n }),\n // Declined (`false`) on pages without a table search, so `/` keeps its default.\n shortcuts.register({\n id: SHORTCUT_IDS.search,\n keys: ['/'],\n label: t('shortcuts.focus_search', {}, 'Search the table'),\n group: 'general',\n handler: () => focusTableSearch(),\n }),\n ...(home\n ? [\n shortcuts.register({\n id: SHORTCUT_IDS.dashboard,\n keys: ['g d'],\n label: t('shortcuts.go_dashboard', {}, 'Go to the dashboard'),\n group: 'navigation',\n handler: () => router.visit(home),\n }),\n ]\n : []),\n ...commands.map((command) =>\n shortcuts.register({\n id: commandShortcutId(command.name),\n keys: command.keyBindings ?? [],\n label: command.label ?? command.name,\n group: command.url ? 'navigation' : 'commands',\n handler: () => void runner.trigger(command, { token, component: COMMANDS_COMPONENT }),\n }),\n ),\n ]\n\n onCleanup(() => disposers.forEach((dispose) => dispose()))\n },\n { immediate: true },\n)\n\nconst customizable = computed(() =>\n Boolean(config.value && config.value.customizable && panel.value.endpoints.shortcuts),\n)\n</script>\n\n<template>\n <component\n :is=\"Overlay\"\n v-if=\"config && Overlay\"\n :open=\"open\"\n :customizable=\"customizable\"\n :endpoint=\"panel.endpoints.shortcuts\"\n @update:open=\"open = $event\"\n />\n</template>\n"],"mappings":";;;;;;;;;EAmBA,IAAMM,IAAIC,EAAK,GACTC,IAAQC,EAAS,GACjBC,IAAOC,EAAc,GACrBC,IAASC,EAAgB,GACzBC,IAAOC,EAAI,EAAK,GAEhBC,IAAUC,EAA6BC,EAAiB,OAAO;EAIrE,EAAMJ,IAAO,GA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C;IAEDqB,EAAU,SAAS;KACjB,IAAII,EAAa;KACjB,MAAM,CAAC,GAAG;KACV,OAAOzB,EAAE,0BAA0B,CAAC,GAAG,kBAAkB;KACzD,OAAO;KACP,eAAe0B,EAAiB;IAClC,CAAC;IACD,GAAIC,IACA,CACEN,EAAU,SAAS;KACjB,IAAII,EAAa;KACjB,MAAM,CAAC,KAAK;KACZ,OAAOzB,EAAE,0BAA0B,CAAC,GAAG,qBAAqB;KAC5D,OAAO;KACP,eAAe4B,EAAO,MAAMD,CAAI;IAClC,CAAC,CACH,IACA,CAAC;IACL,GAAGE,EAAS,KAAK,MACfR,EAAU,SAAS;KACjB,IAAIS,EAAkBP,EAAQ,IAAI;KAClC,MAAMA,EAAQ,eAAe,CAAC;KAC9B,OAAOA,EAAQ,SAASA,EAAQ;KAChC,OAAOA,EAAQ,MAAM,eAAe;KACpC,eAAe,KAAKjB,EAAO,QAAQiB,GAAS;MAAE;MAAO,WAAWQ;KAAmB,CAAC;IACtF,CAAC,CACH;GACF;GAEA,QAAgBP,EAAU,SAAS,MAAYQ,EAAQ,CAAC,CAAC;EAC3D,GACA,EAAE,WAAW,GAAK,CACpB;EAEA,IAAMC,IAAef,QACnB,GAAQD,EAAO,SAASA,EAAO,MAAM,gBAAgBf,EAAM,MAAM,UAAU,UAC7E;mBAMUe,EAAA,SAAUP,EAAA,SAFlBhB,EAAA,GAAAC,EAOEC,EANKc,EAAA,KAAO,GAAA;;GAEX,MAAMF,EAAA;GACN,cAAcyB,EAAA;GACd,UAAUpC,EAAAK,CAAA,CAAK,CAAC,UAAU;GAC1B,iBAAW,AAAAoC,EAAA,QAAA,MAAE,EAAA,QAAOC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavGroup.js","names":["_sfc_main","NavGroup_vue_vue_type_script_setup_true_lang_default","NavGroup_default"],"sources":["../../../src/components/panel/NavGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { NavigationGroupSchema } from '@alfakit/core'\nimport { ChevronRightIcon } from '@lucide/vue'\nimport { Icon } from '../../lib/icons'\nimport Collapsible from '../ui/Collapsible.vue'\nimport CollapsibleContent from '../ui/CollapsibleContent.vue'\nimport CollapsibleTrigger from '../ui/CollapsibleTrigger.vue'\nimport SidebarGroup from '../ui/SidebarGroup.vue'\nimport SidebarGroupContent from '../ui/SidebarGroupContent.vue'\nimport SidebarGroupLabel from '../ui/SidebarGroupLabel.vue'\nimport SidebarMenu from '../ui/SidebarMenu.vue'\nimport { cn } from '../../lib/utils'\nimport NavGroupFlyout from './NavGroupFlyout.vue'\nimport NavItem from './NavItem.vue'\n\nconst props = defineProps<{ group: NavigationGroupSchema }>()\n// `NavigationGroup::extraSidebarAttributes()`; Vue merges `class` with the group's own.\nconst attributes = () => props.group.extraSidebarAttributes ?? {}\n// A labelled group with an icon collapses into a flyout in the icon-only sidebar.\nconst flyout = () => Boolean(props.group.label && props.group.icon)\nconst contentClass = () => cn(flyout() && 'group-data-[collapsible=icon]:hidden')\n</script>\n\n<template>\n <SidebarGroup v-if=\"!props.group.label\" v-bind=\"attributes()\">\n <SidebarGroupContent>\n <SidebarMenu>\n <NavItem v-for=\"item in props.group.items\" :key=\"item.label\" :item=\"item\" />\n </SidebarMenu>\n </SidebarGroupContent>\n </SidebarGroup>\n <SidebarGroup v-else-if=\"!props.group.collapsible\" v-bind=\"attributes()\">\n <SidebarGroupLabel>\n <Icon v-if=\"props.group.icon\" :name=\"props.group.icon\" class=\"me-1.5\" />\n {{ props.group.label }}\n </SidebarGroupLabel>\n <SidebarGroupContent :class=\"contentClass()\">\n <SidebarMenu>\n <NavItem v-for=\"item in props.group.items\" :key=\"item.label\" :item=\"item\" />\n </SidebarMenu>\n </SidebarGroupContent>\n <NavGroupFlyout v-if=\"flyout()\" :group=\"props.group\" />\n </SidebarGroup>\n <Collapsible\n v-else\n :default-open=\"!props.group.collapsed || props.group.items.some((item) => item.active)\"\n class=\"group/nav-group\"\n >\n <SidebarGroup v-bind=\"attributes()\">\n <CollapsibleTrigger as-child>\n <SidebarGroupLabel\n as=\"button\"\n type=\"button\"\n class=\"hover:bg-sidebar-accent w-full cursor-pointer justify-between\"\n >\n <span class=\"flex items-center gap-1.5\">\n <Icon v-if=\"props.group.icon\" :name=\"props.group.icon\" />\n {{ props.group.label }}\n </span>\n <Icon\n name=\"alfakit::panels.sidebar.group.collapse-button\"\n :fallback=\"ChevronRightIcon\"\n class=\"size-3.5 transition-transform group-data-[state=open]/nav-group:rotate-90 rtl:rotate-180 rtl:group-data-[state=open]/nav-group:rotate-90\"\n />\n </SidebarGroupLabel>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <SidebarGroupContent :class=\"contentClass()\">\n <SidebarMenu>\n <NavItem v-for=\"item in props.group.items\" :key=\"item.label\" :item=\"item\" />\n </SidebarMenu>\n </SidebarGroupContent>\n </CollapsibleContent>\n <NavGroupFlyout v-if=\"flyout()\" :group=\"props.group\" />\n </SidebarGroup>\n </Collapsible>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"NavGroup.js","names":["_sfc_main","NavGroup_vue_vue_type_script_setup_true_lang_default","NavGroup_default"],"sources":["../../../src/components/panel/NavGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { NavigationGroupSchema } from '@alfakit/core'\nimport { ChevronRightIcon } from '@lucide/vue'\nimport { Icon } from '../../lib/icons'\nimport Collapsible from '../ui/Collapsible.vue'\nimport CollapsibleContent from '../ui/CollapsibleContent.vue'\nimport CollapsibleTrigger from '../ui/CollapsibleTrigger.vue'\nimport SidebarGroup from '../ui/SidebarGroup.vue'\nimport SidebarGroupContent from '../ui/SidebarGroupContent.vue'\nimport SidebarGroupLabel from '../ui/SidebarGroupLabel.vue'\nimport SidebarMenu from '../ui/SidebarMenu.vue'\nimport { cn } from '../../lib/utils'\nimport NavGroupFlyout from './NavGroupFlyout.vue'\nimport NavItem from './NavItem.vue'\n\nconst props = defineProps<{ group: NavigationGroupSchema }>()\n// `NavigationGroup::extraSidebarAttributes()`; Vue merges `class` with the group's own.\nconst attributes = () => props.group.extraSidebarAttributes ?? {}\n// A labelled group with an icon collapses into a flyout in the icon-only sidebar.\nconst flyout = () => Boolean(props.group.label && props.group.icon)\nconst contentClass = () => cn(flyout() && 'group-data-[collapsible=icon]:hidden')\n</script>\n\n<template>\n <SidebarGroup v-if=\"!props.group.label\" v-bind=\"attributes()\">\n <SidebarGroupContent>\n <SidebarMenu>\n <NavItem v-for=\"item in props.group.items\" :key=\"item.url ?? item.label\" :item=\"item\" />\n </SidebarMenu>\n </SidebarGroupContent>\n </SidebarGroup>\n <SidebarGroup v-else-if=\"!props.group.collapsible\" v-bind=\"attributes()\">\n <SidebarGroupLabel>\n <Icon v-if=\"props.group.icon\" :name=\"props.group.icon\" class=\"me-1.5\" />\n {{ props.group.label }}\n </SidebarGroupLabel>\n <SidebarGroupContent :class=\"contentClass()\">\n <SidebarMenu>\n <NavItem v-for=\"item in props.group.items\" :key=\"item.url ?? item.label\" :item=\"item\" />\n </SidebarMenu>\n </SidebarGroupContent>\n <NavGroupFlyout v-if=\"flyout()\" :group=\"props.group\" />\n </SidebarGroup>\n <Collapsible\n v-else\n :default-open=\"!props.group.collapsed || props.group.items.some((item) => item.active)\"\n class=\"group/nav-group\"\n >\n <SidebarGroup v-bind=\"attributes()\">\n <CollapsibleTrigger as-child>\n <SidebarGroupLabel\n as=\"button\"\n type=\"button\"\n class=\"hover:bg-sidebar-accent w-full cursor-pointer justify-between\"\n >\n <span class=\"flex items-center gap-1.5\">\n <Icon v-if=\"props.group.icon\" :name=\"props.group.icon\" />\n {{ props.group.label }}\n </span>\n <Icon\n name=\"alfakit::panels.sidebar.group.collapse-button\"\n :fallback=\"ChevronRightIcon\"\n class=\"size-3.5 transition-transform group-data-[state=open]/nav-group:rotate-90 rtl:rotate-180 rtl:group-data-[state=open]/nav-group:rotate-90\"\n />\n </SidebarGroupLabel>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <SidebarGroupContent :class=\"contentClass()\">\n <SidebarMenu>\n <NavItem v-for=\"item in props.group.items\" :key=\"item.url ?? item.label\" :item=\"item\" />\n </SidebarMenu>\n </SidebarGroupContent>\n </CollapsibleContent>\n <NavGroupFlyout v-if=\"flyout()\" :group=\"props.group\" />\n </SidebarGroup>\n </Collapsible>\n</template>\n"],"mappings":""}
|
|
@@ -46,7 +46,7 @@ var k = { class: "flex items-center gap-1.5" }, A = /*@__PURE__*/ v({
|
|
|
46
46
|
default: D(() => [_(s, { class: x(N()) }, {
|
|
47
47
|
default: D(() => [_(a, null, {
|
|
48
48
|
default: D(() => [(C(!0), m(d, null, w(A.group.items, (e) => (C(), f(u, {
|
|
49
|
-
key: e.label,
|
|
49
|
+
key: e.url ?? e.label,
|
|
50
50
|
item: e
|
|
51
51
|
}, null, 8, ["item"]))), 128))]),
|
|
52
52
|
_: 1
|
|
@@ -76,7 +76,7 @@ var k = { class: "flex items-center gap-1.5" }, A = /*@__PURE__*/ v({
|
|
|
76
76
|
_(s, { class: x(N()) }, {
|
|
77
77
|
default: D(() => [_(a, null, {
|
|
78
78
|
default: D(() => [(C(!0), m(d, null, w(A.group.items, (e) => (C(), f(u, {
|
|
79
|
-
key: e.label,
|
|
79
|
+
key: e.url ?? e.label,
|
|
80
80
|
item: e
|
|
81
81
|
}, null, 8, ["item"]))), 128))]),
|
|
82
82
|
_: 1
|
|
@@ -93,7 +93,7 @@ var k = { class: "flex items-center gap-1.5" }, A = /*@__PURE__*/ v({
|
|
|
93
93
|
default: D(() => [_(s, null, {
|
|
94
94
|
default: D(() => [_(a, null, {
|
|
95
95
|
default: D(() => [(C(!0), m(d, null, w(A.group.items, (e) => (C(), f(u, {
|
|
96
|
-
key: e.label,
|
|
96
|
+
key: e.url ?? e.label,
|
|
97
97
|
item: e
|
|
98
98
|
}, null, 8, ["item"]))), 128))]),
|
|
99
99
|
_: 1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavGroup.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","SidebarGroup","_normalizeProps","_mergeProps","_withCtx","_createVNode","SidebarGroupContent","SidebarMenu","_createElementBlock","_Fragment","_renderList","NavItem","SidebarGroupLabel","_unref","Icon","_createCommentVNode","_createTextVNode","_toDisplayString","_normalizeClass","NavGroupFlyout","Collapsible","_guardReactiveProps","CollapsibleTrigger","_createElementVNode","CollapsibleContent","Icon_default","Collapsible_default","CollapsibleContent_default","CollapsibleTrigger_default","SidebarMenu_default","SidebarGroup_default","SidebarGroupContent_default","SidebarGroupLabel_default","NavGroupFlyout_default","NavItem_default","_hoisted_1","NavGroup_vue_vue_type_script_setup_true_lang_default","props","__props","attributes","flyout","contentClass","cn","openBlock","createBlock","item","withCtx","createVNode","normalizeProps","guardReactiveProps","createElementVNode","unref","createCommentVNode","createTextVNode","toDisplayString","ChevronRightIcon","normalizeClass","createElementBlock","Fragment","renderList","mergeProps"],"sources":["../../../src/components/panel/NavGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { NavigationGroupSchema } from '@alfakit/core'\nimport { ChevronRightIcon } from '@lucide/vue'\nimport { Icon } from '../../lib/icons'\nimport Collapsible from '../ui/Collapsible.vue'\nimport CollapsibleContent from '../ui/CollapsibleContent.vue'\nimport CollapsibleTrigger from '../ui/CollapsibleTrigger.vue'\nimport SidebarGroup from '../ui/SidebarGroup.vue'\nimport SidebarGroupContent from '../ui/SidebarGroupContent.vue'\nimport SidebarGroupLabel from '../ui/SidebarGroupLabel.vue'\nimport SidebarMenu from '../ui/SidebarMenu.vue'\nimport { cn } from '../../lib/utils'\nimport NavGroupFlyout from './NavGroupFlyout.vue'\nimport NavItem from './NavItem.vue'\n\nconst props = defineProps<{ group: NavigationGroupSchema }>()\n// `NavigationGroup::extraSidebarAttributes()`; Vue merges `class` with the group's own.\nconst attributes = () => props.group.extraSidebarAttributes ?? {}\n// A labelled group with an icon collapses into a flyout in the icon-only sidebar.\nconst flyout = () => Boolean(props.group.label && props.group.icon)\nconst contentClass = () => cn(flyout() && 'group-data-[collapsible=icon]:hidden')\n</script>\n\n<template>\n <SidebarGroup v-if=\"!props.group.label\" v-bind=\"attributes()\">\n <SidebarGroupContent>\n <SidebarMenu>\n <NavItem v-for=\"item in props.group.items\" :key=\"item.label\" :item=\"item\" />\n </SidebarMenu>\n </SidebarGroupContent>\n </SidebarGroup>\n <SidebarGroup v-else-if=\"!props.group.collapsible\" v-bind=\"attributes()\">\n <SidebarGroupLabel>\n <Icon v-if=\"props.group.icon\" :name=\"props.group.icon\" class=\"me-1.5\" />\n {{ props.group.label }}\n </SidebarGroupLabel>\n <SidebarGroupContent :class=\"contentClass()\">\n <SidebarMenu>\n <NavItem v-for=\"item in props.group.items\" :key=\"item.label\" :item=\"item\" />\n </SidebarMenu>\n </SidebarGroupContent>\n <NavGroupFlyout v-if=\"flyout()\" :group=\"props.group\" />\n </SidebarGroup>\n <Collapsible\n v-else\n :default-open=\"!props.group.collapsed || props.group.items.some((item) => item.active)\"\n class=\"group/nav-group\"\n >\n <SidebarGroup v-bind=\"attributes()\">\n <CollapsibleTrigger as-child>\n <SidebarGroupLabel\n as=\"button\"\n type=\"button\"\n class=\"hover:bg-sidebar-accent w-full cursor-pointer justify-between\"\n >\n <span class=\"flex items-center gap-1.5\">\n <Icon v-if=\"props.group.icon\" :name=\"props.group.icon\" />\n {{ props.group.label }}\n </span>\n <Icon\n name=\"alfakit::panels.sidebar.group.collapse-button\"\n :fallback=\"ChevronRightIcon\"\n class=\"size-3.5 transition-transform group-data-[state=open]/nav-group:rotate-90 rtl:rotate-180 rtl:group-data-[state=open]/nav-group:rotate-90\"\n />\n </SidebarGroupLabel>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <SidebarGroupContent :class=\"contentClass()\">\n <SidebarMenu>\n <NavItem v-for=\"item in props.group.items\" :key=\"item.label\" :item=\"item\" />\n </SidebarMenu>\n </SidebarGroupContent>\n </CollapsibleContent>\n <NavGroupFlyout v-if=\"flyout()\" :group=\"props.group\" />\n </SidebarGroup>\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S,
|
|
1
|
+
{"version":3,"file":"NavGroup.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","SidebarGroup","_normalizeProps","_mergeProps","_withCtx","_createVNode","SidebarGroupContent","SidebarMenu","_createElementBlock","_Fragment","_renderList","NavItem","SidebarGroupLabel","_unref","Icon","_createCommentVNode","_createTextVNode","_toDisplayString","_normalizeClass","NavGroupFlyout","Collapsible","_guardReactiveProps","CollapsibleTrigger","_createElementVNode","CollapsibleContent","Icon_default","Collapsible_default","CollapsibleContent_default","CollapsibleTrigger_default","SidebarMenu_default","SidebarGroup_default","SidebarGroupContent_default","SidebarGroupLabel_default","NavGroupFlyout_default","NavItem_default","_hoisted_1","NavGroup_vue_vue_type_script_setup_true_lang_default","props","__props","attributes","flyout","contentClass","cn","openBlock","createBlock","item","withCtx","createVNode","normalizeProps","guardReactiveProps","createElementVNode","unref","createCommentVNode","createTextVNode","toDisplayString","ChevronRightIcon","normalizeClass","createElementBlock","Fragment","renderList","mergeProps"],"sources":["../../../src/components/panel/NavGroup.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { NavigationGroupSchema } from '@alfakit/core'\nimport { ChevronRightIcon } from '@lucide/vue'\nimport { Icon } from '../../lib/icons'\nimport Collapsible from '../ui/Collapsible.vue'\nimport CollapsibleContent from '../ui/CollapsibleContent.vue'\nimport CollapsibleTrigger from '../ui/CollapsibleTrigger.vue'\nimport SidebarGroup from '../ui/SidebarGroup.vue'\nimport SidebarGroupContent from '../ui/SidebarGroupContent.vue'\nimport SidebarGroupLabel from '../ui/SidebarGroupLabel.vue'\nimport SidebarMenu from '../ui/SidebarMenu.vue'\nimport { cn } from '../../lib/utils'\nimport NavGroupFlyout from './NavGroupFlyout.vue'\nimport NavItem from './NavItem.vue'\n\nconst props = defineProps<{ group: NavigationGroupSchema }>()\n// `NavigationGroup::extraSidebarAttributes()`; Vue merges `class` with the group's own.\nconst attributes = () => props.group.extraSidebarAttributes ?? {}\n// A labelled group with an icon collapses into a flyout in the icon-only sidebar.\nconst flyout = () => Boolean(props.group.label && props.group.icon)\nconst contentClass = () => cn(flyout() && 'group-data-[collapsible=icon]:hidden')\n</script>\n\n<template>\n <SidebarGroup v-if=\"!props.group.label\" v-bind=\"attributes()\">\n <SidebarGroupContent>\n <SidebarMenu>\n <NavItem v-for=\"item in props.group.items\" :key=\"item.url ?? item.label\" :item=\"item\" />\n </SidebarMenu>\n </SidebarGroupContent>\n </SidebarGroup>\n <SidebarGroup v-else-if=\"!props.group.collapsible\" v-bind=\"attributes()\">\n <SidebarGroupLabel>\n <Icon v-if=\"props.group.icon\" :name=\"props.group.icon\" class=\"me-1.5\" />\n {{ props.group.label }}\n </SidebarGroupLabel>\n <SidebarGroupContent :class=\"contentClass()\">\n <SidebarMenu>\n <NavItem v-for=\"item in props.group.items\" :key=\"item.url ?? item.label\" :item=\"item\" />\n </SidebarMenu>\n </SidebarGroupContent>\n <NavGroupFlyout v-if=\"flyout()\" :group=\"props.group\" />\n </SidebarGroup>\n <Collapsible\n v-else\n :default-open=\"!props.group.collapsed || props.group.items.some((item) => item.active)\"\n class=\"group/nav-group\"\n >\n <SidebarGroup v-bind=\"attributes()\">\n <CollapsibleTrigger as-child>\n <SidebarGroupLabel\n as=\"button\"\n type=\"button\"\n class=\"hover:bg-sidebar-accent w-full cursor-pointer justify-between\"\n >\n <span class=\"flex items-center gap-1.5\">\n <Icon v-if=\"props.group.icon\" :name=\"props.group.icon\" />\n {{ props.group.label }}\n </span>\n <Icon\n name=\"alfakit::panels.sidebar.group.collapse-button\"\n :fallback=\"ChevronRightIcon\"\n class=\"size-3.5 transition-transform group-data-[state=open]/nav-group:rotate-90 rtl:rotate-180 rtl:group-data-[state=open]/nav-group:rotate-90\"\n />\n </SidebarGroupLabel>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <SidebarGroupContent :class=\"contentClass()\">\n <SidebarMenu>\n <NavItem v-for=\"item in props.group.items\" :key=\"item.url ?? item.label\" :item=\"item\" />\n </SidebarMenu>\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AAA,CAAA,GAAA;GACxD,SAAAnC,QAIsB,CAJtBC,EAIsBC,GAAA,MAAA;IAHpB,SAAAF,QAEc,CAFdC,EAEcE,GAAA,MAAA;KADH,SAAAH,QAAiC,EAA1CL,EAAA,EAAA,GAAAS,EAAwFC,GAAA,MAAAC,EAAhE2B,EAAM,MAAM,QAApB,OAAhBtC,EAAA,GAAAC,EAAwFW,GAAA;MAA5C,KAAKkC,EAAK,OAAOA,EAAK;MAAc;;;;;;;EAI5D,GAAA,EAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavItem.js","names":["_sfc_main","NavItem_vue_vue_type_script_setup_true_lang_default","NavItem_default"],"sources":["../../../src/components/panel/NavItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { navigationItemText, PREFETCH_CACHE_FOR, type NavigationItemSchema } from '@alfakit/core'\nimport { Link } from '@inertiajs/vue3'\nimport { ChevronRightIcon } from '@lucide/vue'\nimport { badgeColorClasses, colorClass } from '../../lib/colors'\nimport { Icon } from '../../lib/icons'\nimport { cn } from '../../lib/utils'\nimport Badge from '../ui/Badge.vue'\nimport Collapsible from '../ui/Collapsible.vue'\nimport CollapsibleContent from '../ui/CollapsibleContent.vue'\nimport CollapsibleTrigger from '../ui/CollapsibleTrigger.vue'\nimport SidebarMenuButton from '../ui/SidebarMenuButton.vue'\nimport SidebarMenuItem from '../ui/SidebarMenuItem.vue'\nimport SidebarMenuSub from '../ui/SidebarMenuSub.vue'\nimport NavSubItem from './NavSubItem.vue'\nimport NewTabHint from '../../lib/NewTabHint.vue'\nimport NavLabel from './NavLabel.vue'\nimport { useT } from '../../context'\n\nconst props = defineProps<{ item: NavigationItemSchema }>()\nconst t = useT()\n</script>\n\n<template>\n <Collapsible\n v-if=\"props.item.children && props.item.children.length > 0\"\n as-child\n :default-open=\"props.item.active\"\n class=\"group/collapsible\"\n >\n <SidebarMenuItem>\n <CollapsibleTrigger as-child>\n <SidebarMenuButton\n v-bind=\"props.item.extraAttributes ?? {}\"\n :tooltip=\"navigationItemText(props.item)\"\n :is-active=\"props.item.active\"\n >\n <Icon v-if=\"props.item.icon\" :name=\"props.item.icon\" />\n <NavLabel :text=\"props.item.label\" :html=\"props.item.labelHtml\" />\n <Badge\n v-if=\"props.item.badge !== undefined && props.item.badge !== null\"\n variant=\"outline\"\n :class=\"\n cn(\n 'ms-auto px-1.5 py-0',\n colorClass(badgeColorClasses, props.item.badgeColor, 'gray'),\n )\n \"\n :title=\"props.item.badgeTooltip\"\n >{{ props.item.badge }}</Badge\n >\n <span\n v-else-if=\"props.item.badgePending\"\n data-slot=\"badge\"\n aria-busy=\"true\"\n :aria-label=\"t('loading', {}, 'Loading')\"\n class=\"bg-muted-foreground/20 ms-auto inline-block h-4 w-5 animate-pulse rounded-md\"\n />\n <ChevronRightIcon\n class=\"ms-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90 rtl:rotate-180 rtl:group-data-[state=open]/collapsible:rotate-90\"\n />\n </SidebarMenuButton>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <SidebarMenuSub>\n <NavSubItem
|
|
1
|
+
{"version":3,"file":"NavItem.js","names":["_sfc_main","NavItem_vue_vue_type_script_setup_true_lang_default","NavItem_default"],"sources":["../../../src/components/panel/NavItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { navigationItemText, PREFETCH_CACHE_FOR, type NavigationItemSchema } from '@alfakit/core'\nimport { Link } from '@inertiajs/vue3'\nimport { ChevronRightIcon } from '@lucide/vue'\nimport { badgeColorClasses, colorClass } from '../../lib/colors'\nimport { Icon } from '../../lib/icons'\nimport { cn } from '../../lib/utils'\nimport Badge from '../ui/Badge.vue'\nimport Collapsible from '../ui/Collapsible.vue'\nimport CollapsibleContent from '../ui/CollapsibleContent.vue'\nimport CollapsibleTrigger from '../ui/CollapsibleTrigger.vue'\nimport SidebarMenuButton from '../ui/SidebarMenuButton.vue'\nimport SidebarMenuItem from '../ui/SidebarMenuItem.vue'\nimport SidebarMenuSub from '../ui/SidebarMenuSub.vue'\nimport NavSubItem from './NavSubItem.vue'\nimport NewTabHint from '../../lib/NewTabHint.vue'\nimport NavLabel from './NavLabel.vue'\nimport { useT } from '../../context'\n\nconst props = defineProps<{ item: NavigationItemSchema }>()\nconst t = useT()\n</script>\n\n<template>\n <Collapsible\n v-if=\"props.item.children && props.item.children.length > 0\"\n as-child\n :default-open=\"props.item.active\"\n class=\"group/collapsible\"\n >\n <SidebarMenuItem>\n <CollapsibleTrigger as-child>\n <SidebarMenuButton\n v-bind=\"props.item.extraAttributes ?? {}\"\n :tooltip=\"navigationItemText(props.item)\"\n :is-active=\"props.item.active\"\n >\n <Icon v-if=\"props.item.icon\" :name=\"props.item.icon\" />\n <NavLabel :text=\"props.item.label\" :html=\"props.item.labelHtml\" />\n <Badge\n v-if=\"props.item.badge !== undefined && props.item.badge !== null\"\n variant=\"outline\"\n :class=\"\n cn(\n 'ms-auto px-1.5 py-0',\n colorClass(badgeColorClasses, props.item.badgeColor, 'gray'),\n )\n \"\n :title=\"props.item.badgeTooltip\"\n >{{ props.item.badge }}</Badge\n >\n <span\n v-else-if=\"props.item.badgePending\"\n data-slot=\"badge\"\n aria-busy=\"true\"\n :aria-label=\"t('loading', {}, 'Loading')\"\n class=\"bg-muted-foreground/20 ms-auto inline-block h-4 w-5 animate-pulse rounded-md\"\n />\n <ChevronRightIcon\n class=\"ms-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90 rtl:rotate-180 rtl:group-data-[state=open]/collapsible:rotate-90\"\n />\n </SidebarMenuButton>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <SidebarMenuSub>\n <NavSubItem\n v-for=\"child in props.item.children\"\n :key=\"child.url ?? child.label\"\n :item=\"child\"\n />\n </SidebarMenuSub>\n </CollapsibleContent>\n </SidebarMenuItem>\n </Collapsible>\n <SidebarMenuItem v-else>\n <SidebarMenuButton\n as-child\n :is-active=\"props.item.active\"\n :tooltip=\"navigationItemText(props.item)\"\n >\n <a\n v-if=\"props.item.openInNewTab\"\n v-bind=\"props.item.extraAttributes ?? {}\"\n :href=\"props.item.url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <Icon v-if=\"props.item.icon\" :name=\"props.item.icon\" />\n <NavLabel :text=\"props.item.label\" :html=\"props.item.labelHtml\" />\n <NewTabHint />\n <Badge\n v-if=\"props.item.badge !== undefined && props.item.badge !== null\"\n variant=\"outline\"\n :class=\"\n cn('ms-auto px-1.5 py-0', colorClass(badgeColorClasses, props.item.badgeColor, 'gray'))\n \"\n :title=\"props.item.badgeTooltip\"\n >{{ props.item.badge }}</Badge\n >\n <span\n v-else-if=\"props.item.badgePending\"\n data-slot=\"badge\"\n aria-busy=\"true\"\n :aria-label=\"t('loading', {}, 'Loading')\"\n class=\"bg-muted-foreground/20 ms-auto inline-block h-4 w-5 animate-pulse rounded-md\"\n />\n </a>\n <Link\n v-else\n v-bind=\"props.item.extraAttributes ?? {}\"\n :href=\"props.item.url ?? '#'\"\n prefetch\n :cache-for=\"PREFETCH_CACHE_FOR\"\n >\n <Icon v-if=\"props.item.icon\" :name=\"props.item.icon\" />\n <NavLabel :text=\"props.item.label\" :html=\"props.item.labelHtml\" />\n <Badge\n v-if=\"props.item.badge !== undefined && props.item.badge !== null\"\n variant=\"outline\"\n :class=\"\n cn('ms-auto px-1.5 py-0', colorClass(badgeColorClasses, props.item.badgeColor, 'gray'))\n \"\n :title=\"props.item.badgeTooltip\"\n >{{ props.item.badge }}</Badge\n >\n <span\n v-else-if=\"props.item.badgePending\"\n data-slot=\"badge\"\n aria-busy=\"true\"\n :aria-label=\"t('loading', {}, 'Loading')\"\n class=\"bg-muted-foreground/20 ms-auto inline-block h-4 w-5 animate-pulse rounded-md\"\n />\n </Link>\n </SidebarMenuButton>\n </SidebarMenuItem>\n</template>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/panel/NavItem.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NavItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/panel/NavItem.vue"],"names":[],"mappings":"AA0IA,OAAO,EAA0C,KAAK,oBAAoB,EAAE,MAAM,eAAe,CAAA;AAkBjG,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,oBAAoB,CAAA;CAAE,CAAC;;AA2XlD,wBAMG"}
|
|
@@ -66,7 +66,7 @@ var N = ["aria-label"], P = ["href"], F = ["aria-label"], I = ["aria-label"], L
|
|
|
66
66
|
}), C(l, null, {
|
|
67
67
|
default: j(() => [C(p, null, {
|
|
68
68
|
default: j(() => [(D(!0), x(v, null, O(L.item.children, (e) => (D(), y(m, {
|
|
69
|
-
key: e.label,
|
|
69
|
+
key: e.url ?? e.label,
|
|
70
70
|
item: e
|
|
71
71
|
}, null, 8, ["item"]))), 128))]),
|
|
72
72
|
_: 1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavItem.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","Collapsible","_withCtx","_createVNode","SidebarMenuItem","CollapsibleTrigger","SidebarMenuButton","_mergeProps","_unref","Icon","_createCommentVNode","NavLabel","Badge","_normalizeClass","_createTextVNode","_toDisplayString","_createElementBlock","CollapsibleContent","SidebarMenuSub","_Fragment","_renderList","NavSubItem","NewTabHint","Icon_default","Badge_default","NewTabHint_default","NavLabel_default","Collapsible_default","CollapsibleContent_default","CollapsibleTrigger_default","SidebarMenuButton_default","SidebarMenuItem_default","SidebarMenuSub_default","NavSubItem_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","NavItem_vue_vue_type_script_setup_true_lang_default","props","__props","t","useT","openBlock","createBlock","withCtx","createVNode","mergeProps","unref","navigationItemText","createCommentVNode","normalizeClass","cn","colorClass","badgeColorClasses","createTextVNode","toDisplayString","createElementBlock","ChevronRightIcon","Fragment","renderList","child","Link","PREFETCH_CACHE_FOR"],"sources":["../../../src/components/panel/NavItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { navigationItemText, PREFETCH_CACHE_FOR, type NavigationItemSchema } from '@alfakit/core'\nimport { Link } from '@inertiajs/vue3'\nimport { ChevronRightIcon } from '@lucide/vue'\nimport { badgeColorClasses, colorClass } from '../../lib/colors'\nimport { Icon } from '../../lib/icons'\nimport { cn } from '../../lib/utils'\nimport Badge from '../ui/Badge.vue'\nimport Collapsible from '../ui/Collapsible.vue'\nimport CollapsibleContent from '../ui/CollapsibleContent.vue'\nimport CollapsibleTrigger from '../ui/CollapsibleTrigger.vue'\nimport SidebarMenuButton from '../ui/SidebarMenuButton.vue'\nimport SidebarMenuItem from '../ui/SidebarMenuItem.vue'\nimport SidebarMenuSub from '../ui/SidebarMenuSub.vue'\nimport NavSubItem from './NavSubItem.vue'\nimport NewTabHint from '../../lib/NewTabHint.vue'\nimport NavLabel from './NavLabel.vue'\nimport { useT } from '../../context'\n\nconst props = defineProps<{ item: NavigationItemSchema }>()\nconst t = useT()\n</script>\n\n<template>\n <Collapsible\n v-if=\"props.item.children && props.item.children.length > 0\"\n as-child\n :default-open=\"props.item.active\"\n class=\"group/collapsible\"\n >\n <SidebarMenuItem>\n <CollapsibleTrigger as-child>\n <SidebarMenuButton\n v-bind=\"props.item.extraAttributes ?? {}\"\n :tooltip=\"navigationItemText(props.item)\"\n :is-active=\"props.item.active\"\n >\n <Icon v-if=\"props.item.icon\" :name=\"props.item.icon\" />\n <NavLabel :text=\"props.item.label\" :html=\"props.item.labelHtml\" />\n <Badge\n v-if=\"props.item.badge !== undefined && props.item.badge !== null\"\n variant=\"outline\"\n :class=\"\n cn(\n 'ms-auto px-1.5 py-0',\n colorClass(badgeColorClasses, props.item.badgeColor, 'gray'),\n )\n \"\n :title=\"props.item.badgeTooltip\"\n >{{ props.item.badge }}</Badge\n >\n <span\n v-else-if=\"props.item.badgePending\"\n data-slot=\"badge\"\n aria-busy=\"true\"\n :aria-label=\"t('loading', {}, 'Loading')\"\n class=\"bg-muted-foreground/20 ms-auto inline-block h-4 w-5 animate-pulse rounded-md\"\n />\n <ChevronRightIcon\n class=\"ms-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90 rtl:rotate-180 rtl:group-data-[state=open]/collapsible:rotate-90\"\n />\n </SidebarMenuButton>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <SidebarMenuSub>\n <NavSubItem
|
|
1
|
+
{"version":3,"file":"NavItem.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","Collapsible","_withCtx","_createVNode","SidebarMenuItem","CollapsibleTrigger","SidebarMenuButton","_mergeProps","_unref","Icon","_createCommentVNode","NavLabel","Badge","_normalizeClass","_createTextVNode","_toDisplayString","_createElementBlock","CollapsibleContent","SidebarMenuSub","_Fragment","_renderList","NavSubItem","NewTabHint","Icon_default","Badge_default","NewTabHint_default","NavLabel_default","Collapsible_default","CollapsibleContent_default","CollapsibleTrigger_default","SidebarMenuButton_default","SidebarMenuItem_default","SidebarMenuSub_default","NavSubItem_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","NavItem_vue_vue_type_script_setup_true_lang_default","props","__props","t","useT","openBlock","createBlock","withCtx","createVNode","mergeProps","unref","navigationItemText","createCommentVNode","normalizeClass","cn","colorClass","badgeColorClasses","createTextVNode","toDisplayString","createElementBlock","ChevronRightIcon","Fragment","renderList","child","Link","PREFETCH_CACHE_FOR"],"sources":["../../../src/components/panel/NavItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { navigationItemText, PREFETCH_CACHE_FOR, type NavigationItemSchema } from '@alfakit/core'\nimport { Link } from '@inertiajs/vue3'\nimport { ChevronRightIcon } from '@lucide/vue'\nimport { badgeColorClasses, colorClass } from '../../lib/colors'\nimport { Icon } from '../../lib/icons'\nimport { cn } from '../../lib/utils'\nimport Badge from '../ui/Badge.vue'\nimport Collapsible from '../ui/Collapsible.vue'\nimport CollapsibleContent from '../ui/CollapsibleContent.vue'\nimport CollapsibleTrigger from '../ui/CollapsibleTrigger.vue'\nimport SidebarMenuButton from '../ui/SidebarMenuButton.vue'\nimport SidebarMenuItem from '../ui/SidebarMenuItem.vue'\nimport SidebarMenuSub from '../ui/SidebarMenuSub.vue'\nimport NavSubItem from './NavSubItem.vue'\nimport NewTabHint from '../../lib/NewTabHint.vue'\nimport NavLabel from './NavLabel.vue'\nimport { useT } from '../../context'\n\nconst props = defineProps<{ item: NavigationItemSchema }>()\nconst t = useT()\n</script>\n\n<template>\n <Collapsible\n v-if=\"props.item.children && props.item.children.length > 0\"\n as-child\n :default-open=\"props.item.active\"\n class=\"group/collapsible\"\n >\n <SidebarMenuItem>\n <CollapsibleTrigger as-child>\n <SidebarMenuButton\n v-bind=\"props.item.extraAttributes ?? {}\"\n :tooltip=\"navigationItemText(props.item)\"\n :is-active=\"props.item.active\"\n >\n <Icon v-if=\"props.item.icon\" :name=\"props.item.icon\" />\n <NavLabel :text=\"props.item.label\" :html=\"props.item.labelHtml\" />\n <Badge\n v-if=\"props.item.badge !== undefined && props.item.badge !== null\"\n variant=\"outline\"\n :class=\"\n cn(\n 'ms-auto px-1.5 py-0',\n colorClass(badgeColorClasses, props.item.badgeColor, 'gray'),\n )\n \"\n :title=\"props.item.badgeTooltip\"\n >{{ props.item.badge }}</Badge\n >\n <span\n v-else-if=\"props.item.badgePending\"\n data-slot=\"badge\"\n aria-busy=\"true\"\n :aria-label=\"t('loading', {}, 'Loading')\"\n class=\"bg-muted-foreground/20 ms-auto inline-block h-4 w-5 animate-pulse rounded-md\"\n />\n <ChevronRightIcon\n class=\"ms-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90 rtl:rotate-180 rtl:group-data-[state=open]/collapsible:rotate-90\"\n />\n </SidebarMenuButton>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <SidebarMenuSub>\n <NavSubItem\n v-for=\"child in props.item.children\"\n :key=\"child.url ?? child.label\"\n :item=\"child\"\n />\n </SidebarMenuSub>\n </CollapsibleContent>\n </SidebarMenuItem>\n </Collapsible>\n <SidebarMenuItem v-else>\n <SidebarMenuButton\n as-child\n :is-active=\"props.item.active\"\n :tooltip=\"navigationItemText(props.item)\"\n >\n <a\n v-if=\"props.item.openInNewTab\"\n v-bind=\"props.item.extraAttributes ?? {}\"\n :href=\"props.item.url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <Icon v-if=\"props.item.icon\" :name=\"props.item.icon\" />\n <NavLabel :text=\"props.item.label\" :html=\"props.item.labelHtml\" />\n <NewTabHint />\n <Badge\n v-if=\"props.item.badge !== undefined && props.item.badge !== null\"\n variant=\"outline\"\n :class=\"\n cn('ms-auto px-1.5 py-0', colorClass(badgeColorClasses, props.item.badgeColor, 'gray'))\n \"\n :title=\"props.item.badgeTooltip\"\n >{{ props.item.badge }}</Badge\n >\n <span\n v-else-if=\"props.item.badgePending\"\n data-slot=\"badge\"\n aria-busy=\"true\"\n :aria-label=\"t('loading', {}, 'Loading')\"\n class=\"bg-muted-foreground/20 ms-auto inline-block h-4 w-5 animate-pulse rounded-md\"\n />\n </a>\n <Link\n v-else\n v-bind=\"props.item.extraAttributes ?? {}\"\n :href=\"props.item.url ?? '#'\"\n prefetch\n :cache-for=\"PREFETCH_CACHE_FOR\"\n >\n <Icon v-if=\"props.item.icon\" :name=\"props.item.icon\" />\n <NavLabel :text=\"props.item.label\" :html=\"props.item.labelHtml\" />\n <Badge\n v-if=\"props.item.badge !== undefined && props.item.badge !== null\"\n variant=\"outline\"\n :class=\"\n cn('ms-auto px-1.5 py-0', colorClass(badgeColorClasses, props.item.badgeColor, 'gray'))\n \"\n :title=\"props.item.badgeTooltip\"\n >{{ props.item.badge }}</Badge\n >\n <span\n v-else-if=\"props.item.badgePending\"\n data-slot=\"badge\"\n aria-busy=\"true\"\n :aria-label=\"t('loading', {}, 'Loading')\"\n class=\"bg-muted-foreground/20 ms-auto inline-block h-4 w-5 animate-pulse rounded-md\"\n />\n </Link>\n </SidebarMenuButton>\n </SidebarMenuItem>\n</template>\n"],"mappings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AAK,gBADxBxC,EAAA,GAAAiB,EAME,QAAA;;OAJA,aAAU;OACV,aAAU;OACT,cAAYR,EAAAiC,CAAA,CAAC,CAAA,WAAA,CAAA,GAAA,SAAA;OACd,OAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavSubItem.js","names":["_sfc_main","NavSubItem_vue_vue_type_script_setup_true_lang_default","NavSubItem_default"],"sources":["../../../src/components/panel/NavSubItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { PREFETCH_CACHE_FOR, type NavigationItemSchema } from '@alfakit/core'\nimport { Link } from '@inertiajs/vue3'\nimport { ChevronRightIcon } from '@lucide/vue'\nimport { computed } from 'vue'\nimport { badgeColorClasses, colorClass } from '../../lib/colors'\nimport { Icon } from '../../lib/icons'\nimport { cn } from '../../lib/utils'\nimport Badge from '../ui/Badge.vue'\nimport Collapsible from '../ui/Collapsible.vue'\nimport CollapsibleContent from '../ui/CollapsibleContent.vue'\nimport CollapsibleTrigger from '../ui/CollapsibleTrigger.vue'\nimport SidebarMenuSub from '../ui/SidebarMenuSub.vue'\nimport SidebarMenuSubButton from '../ui/SidebarMenuSubButton.vue'\nimport SidebarMenuSubItem from '../ui/SidebarMenuSubItem.vue'\nimport NavSubItem from './NavSubItem.vue'\nimport NewTabHint from '../../lib/NewTabHint.vue'\nimport NavLabel from './NavLabel.vue'\nimport { useT } from '../../context'\n\n/** A child navigation item (any depth): badge, new-tab link and nested children. */\nconst props = defineProps<{ item: NavigationItemSchema }>()\nconst t = useT()\nconst hasBadge = computed(() => props.item.badge !== undefined && props.item.badge !== null)\nconst badgeClass = computed(() =>\n cn('ms-auto px-1.5 py-0', colorClass(badgeColorClasses, props.item.badgeColor, 'gray')),\n)\n</script>\n\n<template>\n <SidebarMenuSubItem>\n <Collapsible\n v-if=\"props.item.children && props.item.children.length > 0\"\n :default-open=\"props.item.active\"\n class=\"group/nav-sub\"\n >\n <CollapsibleTrigger as-child>\n <SidebarMenuSubButton\n v-bind=\"props.item.extraAttributes ?? {}\"\n as=\"button\"\n type=\"button\"\n class=\"w-full\"\n :is-active=\"props.item.active\"\n >\n <Icon v-if=\"props.item.icon\" :name=\"props.item.icon\" />\n <NavLabel :text=\"props.item.label\" :html=\"props.item.labelHtml\" />\n <Badge\n v-if=\"hasBadge\"\n variant=\"outline\"\n :class=\"badgeClass\"\n :title=\"props.item.badgeTooltip\"\n >{{ props.item.badge }}</Badge\n >\n <span\n v-else-if=\"props.item.badgePending\"\n data-slot=\"badge\"\n aria-busy=\"true\"\n :aria-label=\"t('loading', {}, 'Loading')\"\n class=\"bg-muted-foreground/20 ms-auto inline-block h-4 w-5 animate-pulse rounded-md\"\n />\n <ChevronRightIcon\n class=\"ms-auto transition-transform duration-200 group-data-[state=open]/nav-sub:rotate-90 rtl:rotate-180 rtl:group-data-[state=open]/nav-sub:rotate-90\"\n />\n </SidebarMenuSubButton>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <SidebarMenuSub>\n <NavSubItem
|
|
1
|
+
{"version":3,"file":"NavSubItem.js","names":["_sfc_main","NavSubItem_vue_vue_type_script_setup_true_lang_default","NavSubItem_default"],"sources":["../../../src/components/panel/NavSubItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { PREFETCH_CACHE_FOR, type NavigationItemSchema } from '@alfakit/core'\nimport { Link } from '@inertiajs/vue3'\nimport { ChevronRightIcon } from '@lucide/vue'\nimport { computed } from 'vue'\nimport { badgeColorClasses, colorClass } from '../../lib/colors'\nimport { Icon } from '../../lib/icons'\nimport { cn } from '../../lib/utils'\nimport Badge from '../ui/Badge.vue'\nimport Collapsible from '../ui/Collapsible.vue'\nimport CollapsibleContent from '../ui/CollapsibleContent.vue'\nimport CollapsibleTrigger from '../ui/CollapsibleTrigger.vue'\nimport SidebarMenuSub from '../ui/SidebarMenuSub.vue'\nimport SidebarMenuSubButton from '../ui/SidebarMenuSubButton.vue'\nimport SidebarMenuSubItem from '../ui/SidebarMenuSubItem.vue'\nimport NavSubItem from './NavSubItem.vue'\nimport NewTabHint from '../../lib/NewTabHint.vue'\nimport NavLabel from './NavLabel.vue'\nimport { useT } from '../../context'\n\n/** A child navigation item (any depth): badge, new-tab link and nested children. */\nconst props = defineProps<{ item: NavigationItemSchema }>()\nconst t = useT()\nconst hasBadge = computed(() => props.item.badge !== undefined && props.item.badge !== null)\nconst badgeClass = computed(() =>\n cn('ms-auto px-1.5 py-0', colorClass(badgeColorClasses, props.item.badgeColor, 'gray')),\n)\n</script>\n\n<template>\n <SidebarMenuSubItem>\n <Collapsible\n v-if=\"props.item.children && props.item.children.length > 0\"\n :default-open=\"props.item.active\"\n class=\"group/nav-sub\"\n >\n <CollapsibleTrigger as-child>\n <SidebarMenuSubButton\n v-bind=\"props.item.extraAttributes ?? {}\"\n as=\"button\"\n type=\"button\"\n class=\"w-full\"\n :is-active=\"props.item.active\"\n >\n <Icon v-if=\"props.item.icon\" :name=\"props.item.icon\" />\n <NavLabel :text=\"props.item.label\" :html=\"props.item.labelHtml\" />\n <Badge\n v-if=\"hasBadge\"\n variant=\"outline\"\n :class=\"badgeClass\"\n :title=\"props.item.badgeTooltip\"\n >{{ props.item.badge }}</Badge\n >\n <span\n v-else-if=\"props.item.badgePending\"\n data-slot=\"badge\"\n aria-busy=\"true\"\n :aria-label=\"t('loading', {}, 'Loading')\"\n class=\"bg-muted-foreground/20 ms-auto inline-block h-4 w-5 animate-pulse rounded-md\"\n />\n <ChevronRightIcon\n class=\"ms-auto transition-transform duration-200 group-data-[state=open]/nav-sub:rotate-90 rtl:rotate-180 rtl:group-data-[state=open]/nav-sub:rotate-90\"\n />\n </SidebarMenuSubButton>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <SidebarMenuSub>\n <NavSubItem\n v-for=\"child in props.item.children\"\n :key=\"child.url ?? child.label\"\n :item=\"child\"\n />\n </SidebarMenuSub>\n </CollapsibleContent>\n </Collapsible>\n <SidebarMenuSubButton v-else as-child :is-active=\"props.item.active\">\n <a\n v-if=\"props.item.openInNewTab\"\n v-bind=\"props.item.extraAttributes ?? {}\"\n :href=\"props.item.url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <Icon v-if=\"props.item.icon\" :name=\"props.item.icon\" />\n <NavLabel :text=\"props.item.label\" :html=\"props.item.labelHtml\" />\n <NewTabHint />\n <Badge\n v-if=\"hasBadge\"\n variant=\"outline\"\n :class=\"badgeClass\"\n :title=\"props.item.badgeTooltip\"\n >{{ props.item.badge }}</Badge\n >\n <span\n v-else-if=\"props.item.badgePending\"\n data-slot=\"badge\"\n aria-busy=\"true\"\n :aria-label=\"t('loading', {}, 'Loading')\"\n class=\"bg-muted-foreground/20 ms-auto inline-block h-4 w-5 animate-pulse rounded-md\"\n />\n </a>\n <Link\n v-else\n v-bind=\"props.item.extraAttributes ?? {}\"\n :href=\"props.item.url ?? '#'\"\n prefetch\n :cache-for=\"PREFETCH_CACHE_FOR\"\n >\n <Icon v-if=\"props.item.icon\" :name=\"props.item.icon\" />\n <NavLabel :text=\"props.item.label\" :html=\"props.item.labelHtml\" />\n <Badge\n v-if=\"hasBadge\"\n variant=\"outline\"\n :class=\"badgeClass\"\n :title=\"props.item.badgeTooltip\"\n >{{ props.item.badge }}</Badge\n >\n <span\n v-else-if=\"props.item.badgePending\"\n data-slot=\"badge\"\n aria-busy=\"true\"\n :aria-label=\"t('loading', {}, 'Loading')\"\n class=\"bg-muted-foreground/20 ms-auto inline-block h-4 w-5 animate-pulse rounded-md\"\n />\n </Link>\n </SidebarMenuSubButton>\n </SidebarMenuSubItem>\n</template>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavSubItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/panel/NavSubItem.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NavSubItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/panel/NavSubItem.vue"],"names":[],"mappings":"AAkIA,OAAO,EAAsB,KAAK,oBAAoB,EAAE,MAAM,eAAe,CAAA;AAmB7E,oFAAoF;AACpF,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,oBAAoB,CAAA;CAAE,CAAC;;AAkWlD,wBAMG"}
|
|
@@ -67,7 +67,7 @@ var N = ["aria-label"], P = ["href"], F = ["aria-label"], I = ["aria-label"], L
|
|
|
67
67
|
}), C(l, null, {
|
|
68
68
|
default: j(() => [C(d, null, {
|
|
69
69
|
default: j(() => [(D(!0), x(_, null, O(L.item.children, (e) => (D(), y(m, {
|
|
70
|
-
key: e.label,
|
|
70
|
+
key: e.url ?? e.label,
|
|
71
71
|
item: e
|
|
72
72
|
}, null, 8, ["item"]))), 128))]),
|
|
73
73
|
_: 1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavSubItem.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","SidebarMenuSubItem","_withCtx","Collapsible","_createVNode","CollapsibleTrigger","SidebarMenuSubButton","_mergeProps","_unref","Icon","_createCommentVNode","NavLabel","Badge","_normalizeClass","_createTextVNode","_toDisplayString","_createElementBlock","CollapsibleContent","SidebarMenuSub","_Fragment","_renderList","NavSubItem","NewTabHint","Icon_default","Badge_default","NewTabHint_default","NavLabel_default","Collapsible_default","CollapsibleContent_default","CollapsibleTrigger_default","SidebarMenuSub_default","SidebarMenuSubButton_default","SidebarMenuSubItem_default","NavSubItem_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","NavSubItem_vue_vue_type_script_setup_true_lang_default","props","__props","t","useT","hasBadge","computed","badgeClass","cn","colorClass","badgeColorClasses","openBlock","createBlock","withCtx","createVNode","mergeProps","unref","createCommentVNode","normalizeClass","createTextVNode","toDisplayString","createElementBlock","ChevronRightIcon","Fragment","renderList","child","Link","PREFETCH_CACHE_FOR"],"sources":["../../../src/components/panel/NavSubItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { PREFETCH_CACHE_FOR, type NavigationItemSchema } from '@alfakit/core'\nimport { Link } from '@inertiajs/vue3'\nimport { ChevronRightIcon } from '@lucide/vue'\nimport { computed } from 'vue'\nimport { badgeColorClasses, colorClass } from '../../lib/colors'\nimport { Icon } from '../../lib/icons'\nimport { cn } from '../../lib/utils'\nimport Badge from '../ui/Badge.vue'\nimport Collapsible from '../ui/Collapsible.vue'\nimport CollapsibleContent from '../ui/CollapsibleContent.vue'\nimport CollapsibleTrigger from '../ui/CollapsibleTrigger.vue'\nimport SidebarMenuSub from '../ui/SidebarMenuSub.vue'\nimport SidebarMenuSubButton from '../ui/SidebarMenuSubButton.vue'\nimport SidebarMenuSubItem from '../ui/SidebarMenuSubItem.vue'\nimport NavSubItem from './NavSubItem.vue'\nimport NewTabHint from '../../lib/NewTabHint.vue'\nimport NavLabel from './NavLabel.vue'\nimport { useT } from '../../context'\n\n/** A child navigation item (any depth): badge, new-tab link and nested children. */\nconst props = defineProps<{ item: NavigationItemSchema }>()\nconst t = useT()\nconst hasBadge = computed(() => props.item.badge !== undefined && props.item.badge !== null)\nconst badgeClass = computed(() =>\n cn('ms-auto px-1.5 py-0', colorClass(badgeColorClasses, props.item.badgeColor, 'gray')),\n)\n</script>\n\n<template>\n <SidebarMenuSubItem>\n <Collapsible\n v-if=\"props.item.children && props.item.children.length > 0\"\n :default-open=\"props.item.active\"\n class=\"group/nav-sub\"\n >\n <CollapsibleTrigger as-child>\n <SidebarMenuSubButton\n v-bind=\"props.item.extraAttributes ?? {}\"\n as=\"button\"\n type=\"button\"\n class=\"w-full\"\n :is-active=\"props.item.active\"\n >\n <Icon v-if=\"props.item.icon\" :name=\"props.item.icon\" />\n <NavLabel :text=\"props.item.label\" :html=\"props.item.labelHtml\" />\n <Badge\n v-if=\"hasBadge\"\n variant=\"outline\"\n :class=\"badgeClass\"\n :title=\"props.item.badgeTooltip\"\n >{{ props.item.badge }}</Badge\n >\n <span\n v-else-if=\"props.item.badgePending\"\n data-slot=\"badge\"\n aria-busy=\"true\"\n :aria-label=\"t('loading', {}, 'Loading')\"\n class=\"bg-muted-foreground/20 ms-auto inline-block h-4 w-5 animate-pulse rounded-md\"\n />\n <ChevronRightIcon\n class=\"ms-auto transition-transform duration-200 group-data-[state=open]/nav-sub:rotate-90 rtl:rotate-180 rtl:group-data-[state=open]/nav-sub:rotate-90\"\n />\n </SidebarMenuSubButton>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <SidebarMenuSub>\n <NavSubItem
|
|
1
|
+
{"version":3,"file":"NavSubItem.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","SidebarMenuSubItem","_withCtx","Collapsible","_createVNode","CollapsibleTrigger","SidebarMenuSubButton","_mergeProps","_unref","Icon","_createCommentVNode","NavLabel","Badge","_normalizeClass","_createTextVNode","_toDisplayString","_createElementBlock","CollapsibleContent","SidebarMenuSub","_Fragment","_renderList","NavSubItem","NewTabHint","Icon_default","Badge_default","NewTabHint_default","NavLabel_default","Collapsible_default","CollapsibleContent_default","CollapsibleTrigger_default","SidebarMenuSub_default","SidebarMenuSubButton_default","SidebarMenuSubItem_default","NavSubItem_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","NavSubItem_vue_vue_type_script_setup_true_lang_default","props","__props","t","useT","hasBadge","computed","badgeClass","cn","colorClass","badgeColorClasses","openBlock","createBlock","withCtx","createVNode","mergeProps","unref","createCommentVNode","normalizeClass","createTextVNode","toDisplayString","createElementBlock","ChevronRightIcon","Fragment","renderList","child","Link","PREFETCH_CACHE_FOR"],"sources":["../../../src/components/panel/NavSubItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { PREFETCH_CACHE_FOR, type NavigationItemSchema } from '@alfakit/core'\nimport { Link } from '@inertiajs/vue3'\nimport { ChevronRightIcon } from '@lucide/vue'\nimport { computed } from 'vue'\nimport { badgeColorClasses, colorClass } from '../../lib/colors'\nimport { Icon } from '../../lib/icons'\nimport { cn } from '../../lib/utils'\nimport Badge from '../ui/Badge.vue'\nimport Collapsible from '../ui/Collapsible.vue'\nimport CollapsibleContent from '../ui/CollapsibleContent.vue'\nimport CollapsibleTrigger from '../ui/CollapsibleTrigger.vue'\nimport SidebarMenuSub from '../ui/SidebarMenuSub.vue'\nimport SidebarMenuSubButton from '../ui/SidebarMenuSubButton.vue'\nimport SidebarMenuSubItem from '../ui/SidebarMenuSubItem.vue'\nimport NavSubItem from './NavSubItem.vue'\nimport NewTabHint from '../../lib/NewTabHint.vue'\nimport NavLabel from './NavLabel.vue'\nimport { useT } from '../../context'\n\n/** A child navigation item (any depth): badge, new-tab link and nested children. */\nconst props = defineProps<{ item: NavigationItemSchema }>()\nconst t = useT()\nconst hasBadge = computed(() => props.item.badge !== undefined && props.item.badge !== null)\nconst badgeClass = computed(() =>\n cn('ms-auto px-1.5 py-0', colorClass(badgeColorClasses, props.item.badgeColor, 'gray')),\n)\n</script>\n\n<template>\n <SidebarMenuSubItem>\n <Collapsible\n v-if=\"props.item.children && props.item.children.length > 0\"\n :default-open=\"props.item.active\"\n class=\"group/nav-sub\"\n >\n <CollapsibleTrigger as-child>\n <SidebarMenuSubButton\n v-bind=\"props.item.extraAttributes ?? {}\"\n as=\"button\"\n type=\"button\"\n class=\"w-full\"\n :is-active=\"props.item.active\"\n >\n <Icon v-if=\"props.item.icon\" :name=\"props.item.icon\" />\n <NavLabel :text=\"props.item.label\" :html=\"props.item.labelHtml\" />\n <Badge\n v-if=\"hasBadge\"\n variant=\"outline\"\n :class=\"badgeClass\"\n :title=\"props.item.badgeTooltip\"\n >{{ props.item.badge }}</Badge\n >\n <span\n v-else-if=\"props.item.badgePending\"\n data-slot=\"badge\"\n aria-busy=\"true\"\n :aria-label=\"t('loading', {}, 'Loading')\"\n class=\"bg-muted-foreground/20 ms-auto inline-block h-4 w-5 animate-pulse rounded-md\"\n />\n <ChevronRightIcon\n class=\"ms-auto transition-transform duration-200 group-data-[state=open]/nav-sub:rotate-90 rtl:rotate-180 rtl:group-data-[state=open]/nav-sub:rotate-90\"\n />\n </SidebarMenuSubButton>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <SidebarMenuSub>\n <NavSubItem\n v-for=\"child in props.item.children\"\n :key=\"child.url ?? child.label\"\n :item=\"child\"\n />\n </SidebarMenuSub>\n </CollapsibleContent>\n </Collapsible>\n <SidebarMenuSubButton v-else as-child :is-active=\"props.item.active\">\n <a\n v-if=\"props.item.openInNewTab\"\n v-bind=\"props.item.extraAttributes ?? {}\"\n :href=\"props.item.url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <Icon v-if=\"props.item.icon\" :name=\"props.item.icon\" />\n <NavLabel :text=\"props.item.label\" :html=\"props.item.labelHtml\" />\n <NewTabHint />\n <Badge\n v-if=\"hasBadge\"\n variant=\"outline\"\n :class=\"badgeClass\"\n :title=\"props.item.badgeTooltip\"\n >{{ props.item.badge }}</Badge\n >\n <span\n v-else-if=\"props.item.badgePending\"\n data-slot=\"badge\"\n aria-busy=\"true\"\n :aria-label=\"t('loading', {}, 'Loading')\"\n class=\"bg-muted-foreground/20 ms-auto inline-block h-4 w-5 animate-pulse rounded-md\"\n />\n </a>\n <Link\n v-else\n v-bind=\"props.item.extraAttributes ?? {}\"\n :href=\"props.item.url ?? '#'\"\n prefetch\n :cache-for=\"PREFETCH_CACHE_FOR\"\n >\n <Icon v-if=\"props.item.icon\" :name=\"props.item.icon\" />\n <NavLabel :text=\"props.item.label\" :html=\"props.item.labelHtml\" />\n <Badge\n v-if=\"hasBadge\"\n variant=\"outline\"\n :class=\"badgeClass\"\n :title=\"props.item.badgeTooltip\"\n >{{ props.item.badge }}</Badge\n >\n <span\n v-else-if=\"props.item.badgePending\"\n data-slot=\"badge\"\n aria-busy=\"true\"\n :aria-label=\"t('loading', {}, 'Loading')\"\n class=\"bg-muted-foreground/20 ms-auto inline-block h-4 w-5 animate-pulse rounded-md\"\n />\n </Link>\n </SidebarMenuSubButton>\n </SidebarMenuSubItem>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;EAqBA,IAAMwC,IAAQC,GACRC,IAAIC,EAAK,GACTC,IAAW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,GAAAA,IAAAA,CAAAA,MAAAA,EAAA,GAAAC,EAuBOQ,EAAAwD,CAAA,GAvBPzD,EAuBO,EAAA,KAAA,EAAA,GArBGgC,EAAM,KAAK,mBAAe,CAAA,GAAA;KACjC,MAAMA,EAAM,KAAK,OAAG;KACrB,UAAA;KACC,aAAW/B,EAAAyD,CAAA;;KAEZ,SAAA/D,QAAuD;MAA3CqC,EAAM,KAAK,QAAvBxC,EAAA,GAAAC,EAAuDQ,EAAAC,CAAA,GAAA;;OAAzB,MAAM8B,EAAM,KAAK;;MAC/CnC,EAAkEO,GAAA;OAAvD,MAAM4B,EAAM,KAAK;OAAQ,MAAMA,EAAM,KAAK;;MAE7CI,EAAA,SADR5C,EAAA,GAAAC,EAMCY,GAAA;;OAJC,SAAQ;OACP,OAAKC,EAAEgC,EAAA,KAAU;OACjB,OAAON,EAAM,KAAK;;OAClB,SAAArC,QAAsB,CAAnBY,EAAAC,EAAAwB,EAAM,KAAK,KAAK,GAAA,CAAA,CAAA,CAAA;;MAGT,GAAA,GAAA,CAAA,SAAA,OAAA,CAAA,KAAAA,EAAM,KAAK,gBADxBxC,EAAA,GAAAiB,EAME,QAAA;;OAJA,aAAU;OACV,aAAU;OACT,cAAYR,EAAAiC,CAAA,CAAC,CAAA,WAAA,CAAA,GAAA,SAAA;OACd,OAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShortcutsOverlay.js","names":["_sfc_main","ShortcutsOverlay_vue_vue_type_script_setup_true_lang_default","ShortcutsOverlay_default"],"sources":["../../../src/components/panel/ShortcutsOverlay.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ShortcutListGroup, ShortcutListItem } from '@alfakit/core'\nimport {\n
|
|
1
|
+
{"version":3,"file":"ShortcutsOverlay.js","names":["_sfc_main","ShortcutsOverlay_vue_vue_type_script_setup_true_lang_default","ShortcutsOverlay_default"],"sources":["../../../src/components/panel/ShortcutsOverlay.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ShortcutListGroup, ShortcutListItem } from '@alfakit/core'\nimport {\n ShortcutRecorder,\n flattenActionGroup,\n saveShortcutOverrides,\n shortcutOverlayGroups,\n shortcuts,\n} from '@alfakit/core'\nimport { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue'\nimport { usePageSchema, useT } from '../../context'\nimport Button from '../ui/Button.vue'\nimport Dialog from '../ui/Dialog.vue'\nimport DialogContent from '../ui/DialogContent.vue'\nimport DialogDescription from '../ui/DialogDescription.vue'\nimport DialogHeader from '../ui/DialogHeader.vue'\nimport DialogTitle from '../ui/DialogTitle.vue'\nimport ShortcutKeys from './ShortcutKeys.vue'\n\n/** The `?` overlay: every shortcut on the page, grouped; users may change their keys. */\nconst props = defineProps<{ open: boolean; customizable: boolean; endpoint?: string }>()\nconst emit = defineEmits<{ 'update:open': [open: boolean] }>()\n\nconst t = useT()\nconst page = usePageSchema()\nconst version = ref(shortcuts.getVersion())\nconst recording = ref<string | null>(null)\nconst message = ref('')\n\n// Subscribed once mounted: a server render must not leave listeners on the shared registry.\nlet unsubscribe = () => {}\n\nonMounted(() => {\n version.value = shortcuts.getVersion()\n unsubscribe = shortcuts.subscribe(() => {\n version.value = shortcuts.getVersion()\n })\n})\n\nonBeforeUnmount(() => unsubscribe())\n\nconst groups = computed(() => {\n void version.value\n\n return shortcutOverlayGroups(\n shortcuts.list(),\n flattenActionGroup(page.value?.headerActions ?? []),\n )\n})\n\nconst groupLabel = (group: ShortcutListGroup['group']) =>\n ({\n general: t('shortcuts.groups.general', {}, 'General'),\n navigation: t('shortcuts.groups.navigation', {}, 'Navigation'),\n commands: t('shortcuts.groups.commands', {}, 'Commands'),\n actions: t('shortcuts.groups.actions', {}, 'Actions on this page'),\n })[group]\n\nconst save = async (id: string, keys: string[] | null) => {\n if (!props.endpoint) return\n\n try {\n shortcuts.setOverrides(await saveShortcutOverrides(props.endpoint, { [id]: keys }))\n message.value = t('shortcuts.saved', {}, 'Shortcut saved.')\n } catch {\n message.value = t('shortcuts.save_failed', {}, 'The shortcut could not be saved.')\n }\n}\n\nconst change = (item: ShortcutListItem) => {\n message.value = t(\n 'shortcuts.recording',\n { label: item.label },\n `Press the new keys for “${item.label}”. Escape cancels.`,\n )\n recording.value = item.id\n}\n\n// While recording, the keys pressed are the new binding: one key (with modifiers) or a\n// sequence (\"g o\"), finished a second after the last key (Escape cancels). Listening in\n// the capture phase keeps the keys from closing the dialog or running another shortcut.\nwatch(recording, (id, _old, onCleanup) => {\n if (!id || typeof window === 'undefined') return\n\n shortcuts.setPaused(true)\n\n const recorder = new ShortcutRecorder({\n onDone: (binding) => {\n recording.value = null\n\n const conflict = shortcuts.conflict([binding], id)\n\n if (conflict) {\n message.value = t(\n 'shortcuts.conflict',\n { label: conflict.label },\n `Already used by “${conflict.label}”.`,\n )\n\n return\n }\n\n void save(id, [binding])\n },\n })\n\n const listener = (event: KeyboardEvent) => {\n event.preventDefault()\n event.stopPropagation()\n\n if (event.key === 'Escape') {\n recorder.cancel()\n recording.value = null\n message.value = t('shortcuts.cancelled', {}, 'Change cancelled.')\n\n return\n }\n\n recorder.press(event)\n }\n\n window.addEventListener('keydown', listener, true)\n onCleanup(() => {\n recorder.cancel()\n window.removeEventListener('keydown', listener, true)\n shortcuts.setPaused(false)\n })\n})\n\nconst update = (next: boolean) => {\n recording.value = null\n message.value = ''\n emit('update:open', next)\n}\n</script>\n\n<template>\n <Dialog :open=\"props.open\" @update:open=\"update\">\n <DialogContent class=\"max-h-[85vh] overflow-y-auto sm:max-w-lg\">\n <div data-slot=\"shortcuts-overlay\" class=\"flex flex-col gap-4\">\n <DialogHeader>\n <DialogTitle>{{ t('shortcuts.title', {}, 'Keyboard shortcuts') }}</DialogTitle>\n <DialogDescription>{{\n t('shortcuts.description', {}, 'Shortcuts available on this page.')\n }}</DialogDescription>\n </DialogHeader>\n <div role=\"status\" aria-live=\"polite\" class=\"text-muted-foreground min-h-5 text-sm\">\n {{ message }}\n </div>\n <div class=\"flex flex-col gap-5\">\n <section\n v-for=\"group in groups\"\n :key=\"group.group\"\n :data-group=\"group.group\"\n :aria-labelledby=\"`shortcuts-${group.group}`\"\n >\n <h3\n :id=\"`shortcuts-${group.group}`\"\n class=\"text-muted-foreground mb-2 text-xs font-medium uppercase\"\n >\n {{ groupLabel(group.group) }}\n </h3>\n <ul class=\"flex flex-col divide-y rounded-md border\">\n <li\n v-for=\"item in group.items\"\n :key=\"item.id\"\n :data-shortcut=\"item.id\"\n class=\"flex items-center gap-3 px-3 py-2 text-sm\"\n >\n <span class=\"min-w-0 flex-1 truncate\">{{ item.label }}</span>\n <span v-if=\"recording === item.id\" class=\"text-primary text-xs\">{{\n t('shortcuts.press_keys', {}, 'Press keys…')\n }}</span>\n <span v-else-if=\"item.keys.length === 0\" class=\"text-muted-foreground text-xs\">{{\n t('shortcuts.off', {}, 'Off')\n }}</span>\n <span v-else class=\"flex flex-wrap items-center justify-end gap-2\">\n <ShortcutKeys v-for=\"key in item.keys\" :key=\"key\" :binding=\"key\" />\n </span>\n <span v-if=\"props.customizable && item.customizable\" class=\"flex shrink-0 gap-1\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"xs\"\n :aria-label=\"\n t(\n 'shortcuts.change_label',\n { label: item.label },\n `Change the shortcut for ${item.label}`,\n )\n \"\n @click=\"change(item)\"\n >{{ t('shortcuts.change', {}, 'Change') }}</Button\n >\n <Button\n v-if=\"item.keys.length > 0\"\n type=\"button\"\n variant=\"ghost\"\n size=\"xs\"\n :aria-label=\"\n t(\n 'shortcuts.turn_off_label',\n { label: item.label },\n `Turn off the shortcut for ${item.label}`,\n )\n \"\n @click=\"save(item.id, [])\"\n >{{ t('shortcuts.turn_off', {}, 'Turn off') }}</Button\n >\n <Button\n v-if=\"item.customized\"\n type=\"button\"\n variant=\"ghost\"\n size=\"xs\"\n :aria-label=\"\n t(\n 'shortcuts.reset_label',\n { label: item.label },\n `Restore the default shortcut for ${item.label}`,\n )\n \"\n @click=\"save(item.id, null)\"\n >{{ t('shortcuts.reset', {}, 'Reset') }}</Button\n >\n </span>\n </li>\n </ul>\n </section>\n </div>\n </div>\n </DialogContent>\n </Dialog>\n</template>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShortcutsOverlay.vue.d.ts","sourceRoot":"","sources":["../../../src/components/panel/ShortcutsOverlay.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ShortcutsOverlay.vue.d.ts","sourceRoot":"","sources":["../../../src/components/panel/ShortcutsOverlay.vue"],"names":[],"mappings":"AA6PA,yFAAyF;AACzF,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,YAAY,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;;;;;;AA2c/E,wBAOG"}
|
|
@@ -3,10 +3,10 @@ import n from "../ui/Button2.js";
|
|
|
3
3
|
import r from "../ui/Dialog.js";
|
|
4
4
|
import i from "../ui/DialogContent.js";
|
|
5
5
|
import a from "../ui/DialogDescription.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
6
|
+
import o from "../ui/DialogHeader.js";
|
|
7
|
+
import s from "../ui/DialogTitle.js";
|
|
8
|
+
import c from "./ShortcutKeys.js";
|
|
9
|
+
import { ShortcutRecorder as l, flattenActionGroup as ee, saveShortcutOverrides as u, shortcutOverlayGroups as d, shortcuts as f } from "@alfakit/core";
|
|
10
10
|
import { Fragment as p, computed as m, createBlock as h, createCommentVNode as g, createElementBlock as _, createElementVNode as v, createTextVNode as y, createVNode as b, defineComponent as x, onBeforeUnmount as S, onMounted as C, openBlock as w, ref as T, renderList as E, toDisplayString as D, unref as O, watch as k, withCtx as A } from "vue";
|
|
11
11
|
//#region src/components/panel/ShortcutsOverlay.vue?vue&type=script&setup=true&lang.ts
|
|
12
12
|
var j = {
|
|
@@ -43,7 +43,7 @@ var j = {
|
|
|
43
43
|
J.value = f.getVersion();
|
|
44
44
|
});
|
|
45
45
|
}), S(() => Z());
|
|
46
|
-
let Q = m(() => (J.value, d(f.list(),
|
|
46
|
+
let Q = m(() => (J.value, d(f.list(), ee(q.value?.headerActions ?? [])))), te = (e) => ({
|
|
47
47
|
general: K("shortcuts.groups.general", {}, "General"),
|
|
48
48
|
navigation: K("shortcuts.groups.navigation", {}, "Navigation"),
|
|
49
49
|
commands: K("shortcuts.groups.commands", {}, "Commands"),
|
|
@@ -60,22 +60,23 @@ var j = {
|
|
|
60
60
|
k(Y, (e, t, n) => {
|
|
61
61
|
if (!e || typeof window > "u") return;
|
|
62
62
|
f.setPaused(!0);
|
|
63
|
-
let r = (t) => {
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
let r = new l({ onDone: (t) => {
|
|
64
|
+
Y.value = null;
|
|
65
|
+
let n = f.conflict([t], e);
|
|
66
|
+
if (n) {
|
|
67
|
+
X.value = K("shortcuts.conflict", { label: n.label }, `Already used by “${n.label}”.`);
|
|
66
68
|
return;
|
|
67
69
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
X.value = K("shortcuts.conflict", { label: r.label }, `Already used by “${r.label}”.`);
|
|
70
|
+
$(e, [t]);
|
|
71
|
+
} }), i = (e) => {
|
|
72
|
+
if (e.preventDefault(), e.stopPropagation(), e.key === "Escape") {
|
|
73
|
+
r.cancel(), Y.value = null, X.value = K("shortcuts.cancelled", {}, "Change cancelled.");
|
|
73
74
|
return;
|
|
74
75
|
}
|
|
75
|
-
|
|
76
|
+
r.press(e);
|
|
76
77
|
};
|
|
77
|
-
window.addEventListener("keydown",
|
|
78
|
-
window.removeEventListener("keydown",
|
|
78
|
+
window.addEventListener("keydown", i, !0), n(() => {
|
|
79
|
+
r.cancel(), window.removeEventListener("keydown", i, !0), f.setPaused(!1);
|
|
79
80
|
});
|
|
80
81
|
});
|
|
81
82
|
let re = (e) => {
|
|
@@ -87,8 +88,8 @@ var j = {
|
|
|
87
88
|
}, {
|
|
88
89
|
default: A(() => [b(i, { class: "max-h-[85vh] overflow-y-auto sm:max-w-lg" }, {
|
|
89
90
|
default: A(() => [v("div", j, [
|
|
90
|
-
b(
|
|
91
|
-
default: A(() => [b(
|
|
91
|
+
b(o, null, {
|
|
92
|
+
default: A(() => [b(s, null, {
|
|
92
93
|
default: A(() => [y(D(O(K)("shortcuts.title", {}, "Keyboard shortcuts")), 1)]),
|
|
93
94
|
_: 1
|
|
94
95
|
}), b(a, null, {
|
|
@@ -111,7 +112,7 @@ var j = {
|
|
|
111
112
|
class: "flex items-center gap-3 px-3 py-2 text-sm"
|
|
112
113
|
}, [
|
|
113
114
|
v("span", R, D(e.label), 1),
|
|
114
|
-
Y.value === e.id ? (w(), _("span", z, D(O(K)("shortcuts.press_keys", {}, "Press keys…")), 1)) : e.keys.length === 0 ? (w(), _("span", B, D(O(K)("shortcuts.off", {}, "Off")), 1)) : (w(), _("span", V, [(w(!0), _(p, null, E(e.keys, (e) => (w(), h(
|
|
115
|
+
Y.value === e.id ? (w(), _("span", z, D(O(K)("shortcuts.press_keys", {}, "Press keys…")), 1)) : e.keys.length === 0 ? (w(), _("span", B, D(O(K)("shortcuts.off", {}, "Off")), 1)) : (w(), _("span", V, [(w(!0), _(p, null, E(e.keys, (e) => (w(), h(c, {
|
|
115
116
|
key: e,
|
|
116
117
|
binding: e
|
|
117
118
|
}, null, 8, ["binding"]))), 128))])),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShortcutsOverlay.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","Dialog","_withCtx","_createVNode","DialogContent","_createElementVNode","DialogHeader","DialogTitle","_createTextVNode","_toDisplayString","_unref","DialogDescription","_createElementBlock","_Fragment","_renderList","ShortcutKeys","Button","_createCommentVNode","Button_default","Dialog_default","DialogContent_default","DialogDescription_default","DialogHeader_default","DialogTitle_default","ShortcutKeys_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","ShortcutsOverlay_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emit","t","useT","page","usePageSchema","version","ref","shortcuts","recording","message","unsubscribe","onMounted","onBeforeUnmount","groups","computed","shortcutOverlayGroups","flattenActionGroup","groupLabel","group","save","saveShortcutOverrides","id","keys","change","item","listener","event","binding","bindingFromEvent","conflict","onCleanup","update","next","openBlock","createBlock","withCtx","createVNode","createElementVNode","createTextVNode","toDisplayString","unref","createElementBlock","Fragment","renderList","key","createCommentVNode"],"sources":["../../../src/components/panel/ShortcutsOverlay.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ShortcutListGroup, ShortcutListItem } from '@alfakit/core'\nimport {\n bindingFromEvent,\n flattenActionGroup,\n saveShortcutOverrides,\n shortcutOverlayGroups,\n shortcuts,\n} from '@alfakit/core'\nimport { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue'\nimport { usePageSchema, useT } from '../../context'\nimport Button from '../ui/Button.vue'\nimport Dialog from '../ui/Dialog.vue'\nimport DialogContent from '../ui/DialogContent.vue'\nimport DialogDescription from '../ui/DialogDescription.vue'\nimport DialogHeader from '../ui/DialogHeader.vue'\nimport DialogTitle from '../ui/DialogTitle.vue'\nimport ShortcutKeys from './ShortcutKeys.vue'\n\n/** The `?` overlay: every shortcut on the page, grouped; users may change their keys. */\nconst props = defineProps<{ open: boolean; customizable: boolean; endpoint?: string }>()\nconst emit = defineEmits<{ 'update:open': [open: boolean] }>()\n\nconst t = useT()\nconst page = usePageSchema()\nconst version = ref(shortcuts.getVersion())\nconst recording = ref<string | null>(null)\nconst message = ref('')\n\n// Subscribed once mounted: a server render must not leave listeners on the shared registry.\nlet unsubscribe = () => {}\n\nonMounted(() => {\n version.value = shortcuts.getVersion()\n unsubscribe = shortcuts.subscribe(() => {\n version.value = shortcuts.getVersion()\n })\n})\n\nonBeforeUnmount(() => unsubscribe())\n\nconst groups = computed(() => {\n void version.value\n\n return shortcutOverlayGroups(\n shortcuts.list(),\n flattenActionGroup(page.value?.headerActions ?? []),\n )\n})\n\nconst groupLabel = (group: ShortcutListGroup['group']) =>\n ({\n general: t('shortcuts.groups.general', {}, 'General'),\n navigation: t('shortcuts.groups.navigation', {}, 'Navigation'),\n commands: t('shortcuts.groups.commands', {}, 'Commands'),\n actions: t('shortcuts.groups.actions', {}, 'Actions on this page'),\n })[group]\n\nconst save = async (id: string, keys: string[] | null) => {\n if (!props.endpoint) return\n\n try {\n shortcuts.setOverrides(await saveShortcutOverrides(props.endpoint, { [id]: keys }))\n message.value = t('shortcuts.saved', {}, 'Shortcut saved.')\n } catch {\n message.value = t('shortcuts.save_failed', {}, 'The shortcut could not be saved.')\n }\n}\n\nconst change = (item: ShortcutListItem) => {\n message.value = t(\n 'shortcuts.recording',\n { label: item.label },\n `Press the new keys for “${item.label}”. Escape cancels.`,\n )\n recording.value = item.id\n}\n\n// While recording, the next key press is the new binding (Escape cancels). Listening in the\n// capture phase keeps the key from closing the dialog or running another shortcut.\nwatch(recording, (id, _old, onCleanup) => {\n if (!id || typeof window === 'undefined') return\n\n shortcuts.setPaused(true)\n\n const listener = (event: KeyboardEvent) => {\n event.preventDefault()\n event.stopPropagation()\n\n if (event.key === 'Escape') {\n recording.value = null\n message.value = t('shortcuts.cancelled', {}, 'Change cancelled.')\n\n return\n }\n\n const binding = bindingFromEvent(event)\n\n if (!binding) return\n\n const conflict = shortcuts.conflict([binding], id)\n\n recording.value = null\n\n if (conflict) {\n message.value = t(\n 'shortcuts.conflict',\n { label: conflict.label },\n `Already used by “${conflict.label}”.`,\n )\n\n return\n }\n\n void save(id, [binding])\n }\n\n window.addEventListener('keydown', listener, true)\n onCleanup(() => {\n window.removeEventListener('keydown', listener, true)\n shortcuts.setPaused(false)\n })\n})\n\nconst update = (next: boolean) => {\n recording.value = null\n message.value = ''\n emit('update:open', next)\n}\n</script>\n\n<template>\n <Dialog :open=\"props.open\" @update:open=\"update\">\n <DialogContent class=\"max-h-[85vh] overflow-y-auto sm:max-w-lg\">\n <div data-slot=\"shortcuts-overlay\" class=\"flex flex-col gap-4\">\n <DialogHeader>\n <DialogTitle>{{ t('shortcuts.title', {}, 'Keyboard shortcuts') }}</DialogTitle>\n <DialogDescription>{{\n t('shortcuts.description', {}, 'Shortcuts available on this page.')\n }}</DialogDescription>\n </DialogHeader>\n <div role=\"status\" aria-live=\"polite\" class=\"text-muted-foreground min-h-5 text-sm\">\n {{ message }}\n </div>\n <div class=\"flex flex-col gap-5\">\n <section\n v-for=\"group in groups\"\n :key=\"group.group\"\n :data-group=\"group.group\"\n :aria-labelledby=\"`shortcuts-${group.group}`\"\n >\n <h3\n :id=\"`shortcuts-${group.group}`\"\n class=\"text-muted-foreground mb-2 text-xs font-medium uppercase\"\n >\n {{ groupLabel(group.group) }}\n </h3>\n <ul class=\"flex flex-col divide-y rounded-md border\">\n <li\n v-for=\"item in group.items\"\n :key=\"item.id\"\n :data-shortcut=\"item.id\"\n class=\"flex items-center gap-3 px-3 py-2 text-sm\"\n >\n <span class=\"min-w-0 flex-1 truncate\">{{ item.label }}</span>\n <span v-if=\"recording === item.id\" class=\"text-primary text-xs\">{{\n t('shortcuts.press_keys', {}, 'Press keys…')\n }}</span>\n <span v-else-if=\"item.keys.length === 0\" class=\"text-muted-foreground text-xs\">{{\n t('shortcuts.off', {}, 'Off')\n }}</span>\n <span v-else class=\"flex flex-wrap items-center justify-end gap-2\">\n <ShortcutKeys v-for=\"key in item.keys\" :key=\"key\" :binding=\"key\" />\n </span>\n <span v-if=\"props.customizable && item.customizable\" class=\"flex shrink-0 gap-1\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"xs\"\n :aria-label=\"\n t(\n 'shortcuts.change_label',\n { label: item.label },\n `Change the shortcut for ${item.label}`,\n )\n \"\n @click=\"change(item)\"\n >{{ t('shortcuts.change', {}, 'Change') }}</Button\n >\n <Button\n v-if=\"item.keys.length > 0\"\n type=\"button\"\n variant=\"ghost\"\n size=\"xs\"\n :aria-label=\"\n t(\n 'shortcuts.turn_off_label',\n { label: item.label },\n `Turn off the shortcut for ${item.label}`,\n )\n \"\n @click=\"save(item.id, [])\"\n >{{ t('shortcuts.turn_off', {}, 'Turn off') }}</Button\n >\n <Button\n v-if=\"item.customized\"\n type=\"button\"\n variant=\"ghost\"\n size=\"xs\"\n :aria-label=\"\n t(\n 'shortcuts.reset_label',\n { label: item.label },\n `Restore the default shortcut for ${item.label}`,\n )\n \"\n @click=\"save(item.id, null)\"\n >{{ t('shortcuts.reset', {}, 'Reset') }}</Button\n >\n </span>\n </li>\n </ul>\n </section>\n </div>\n </div>\n </DialogContent>\n </Dialog>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBA,IAAMwC,IAAQC,GACRC,IAAOH,GAEPI,IAAIC,EAAK,GACTC,IAAOC,EAAc,GACrBC,IAAUC,EAAIC,EAAU,WAAW,CAAC,GACpCC,IAAYF,EAAmB,IAAI,GACnCG,IAAUH,EAAI,EAAE,GAGlBI,UAAoB,CAAC;EASzB,AAPAC,QAAgB;GAEd,AADA,EAAQ,QAAQJ,EAAU,WAAW,GACrC,IAAcA,EAAU,gBAAgB;IACtC,EAAQ,QAAQA,EAAU,WAAW;GACvC,CAAC;EACH,CAAC,GAEDK,QAAsBF,EAAY,CAAC;EAEnC,IAAMG,IAASC,SACbT,EAAa,OAENU,EACLR,EAAU,KAAK,GACfS,EAAmBb,EAAK,OAAO,iBAAiB,CAAC,CAAC,CACpD,EACD,GAEKc,MAAc,OACjB;GACC,SAAShB,EAAE,4BAA4B,CAAC,GAAG,SAAS;GACpD,YAAYA,EAAE,+BAA+B,CAAC,GAAG,YAAY;GAC7D,UAAUA,EAAE,6BAA6B,CAAC,GAAG,UAAU;GACvD,SAASA,EAAE,4BAA4B,CAAC,GAAG,sBAAsB;EACnE,EAAA,CAAGiB,IAECC,IAAO,OAAO,GAAY,MAA0B;GACx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EAAAgC,CAAA,CAAC,CAAA,sBAAA,CAAA,GAAA,UAAA,CAAA,GAAA,CAAA,CAAA,CAAA;;;OAGCuB,EAAK,cADblE,EAAA,GAAAC,EAcCgB,GAAA;;QAZC,MAAK;QACL,SAAQ;QACR,MAAK;QACJ,cAAmCN,EAAAgC,CAAA,CAAC,CAAA,yBAAoF,EAAA,OAAAuB,EAAK,MAAK,GAAgE,oCAAAA,EAAK,OAAA;QAOvM,UAAK,MAAEL,EAAKK,EAAK,IAAE,IAAA;;QACnB,SAAA/D,QAAuC,CAApCM,EAAAC,EAAAC,EAAAgC,CAAA,CAAC,CAAA,mBAAA,CAAA,GAAA,OAAA,CAAA,GAAA,CAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"ShortcutsOverlay.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","Dialog","_withCtx","_createVNode","DialogContent","_createElementVNode","DialogHeader","DialogTitle","_createTextVNode","_toDisplayString","_unref","DialogDescription","_createElementBlock","_Fragment","_renderList","ShortcutKeys","Button","_createCommentVNode","Button_default","Dialog_default","DialogContent_default","DialogDescription_default","DialogHeader_default","DialogTitle_default","ShortcutKeys_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","ShortcutsOverlay_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emit","t","useT","page","usePageSchema","version","ref","shortcuts","recording","message","unsubscribe","onMounted","onBeforeUnmount","groups","computed","shortcutOverlayGroups","flattenActionGroup","groupLabel","group","save","saveShortcutOverrides","id","keys","change","item","recorder","ShortcutRecorder","conflict","binding","listener","event","onCleanup","update","next","openBlock","createBlock","withCtx","createVNode","createElementVNode","createTextVNode","toDisplayString","unref","createElementBlock","Fragment","renderList","key","createCommentVNode"],"sources":["../../../src/components/panel/ShortcutsOverlay.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ShortcutListGroup, ShortcutListItem } from '@alfakit/core'\nimport {\n ShortcutRecorder,\n flattenActionGroup,\n saveShortcutOverrides,\n shortcutOverlayGroups,\n shortcuts,\n} from '@alfakit/core'\nimport { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue'\nimport { usePageSchema, useT } from '../../context'\nimport Button from '../ui/Button.vue'\nimport Dialog from '../ui/Dialog.vue'\nimport DialogContent from '../ui/DialogContent.vue'\nimport DialogDescription from '../ui/DialogDescription.vue'\nimport DialogHeader from '../ui/DialogHeader.vue'\nimport DialogTitle from '../ui/DialogTitle.vue'\nimport ShortcutKeys from './ShortcutKeys.vue'\n\n/** The `?` overlay: every shortcut on the page, grouped; users may change their keys. */\nconst props = defineProps<{ open: boolean; customizable: boolean; endpoint?: string }>()\nconst emit = defineEmits<{ 'update:open': [open: boolean] }>()\n\nconst t = useT()\nconst page = usePageSchema()\nconst version = ref(shortcuts.getVersion())\nconst recording = ref<string | null>(null)\nconst message = ref('')\n\n// Subscribed once mounted: a server render must not leave listeners on the shared registry.\nlet unsubscribe = () => {}\n\nonMounted(() => {\n version.value = shortcuts.getVersion()\n unsubscribe = shortcuts.subscribe(() => {\n version.value = shortcuts.getVersion()\n })\n})\n\nonBeforeUnmount(() => unsubscribe())\n\nconst groups = computed(() => {\n void version.value\n\n return shortcutOverlayGroups(\n shortcuts.list(),\n flattenActionGroup(page.value?.headerActions ?? []),\n )\n})\n\nconst groupLabel = (group: ShortcutListGroup['group']) =>\n ({\n general: t('shortcuts.groups.general', {}, 'General'),\n navigation: t('shortcuts.groups.navigation', {}, 'Navigation'),\n commands: t('shortcuts.groups.commands', {}, 'Commands'),\n actions: t('shortcuts.groups.actions', {}, 'Actions on this page'),\n })[group]\n\nconst save = async (id: string, keys: string[] | null) => {\n if (!props.endpoint) return\n\n try {\n shortcuts.setOverrides(await saveShortcutOverrides(props.endpoint, { [id]: keys }))\n message.value = t('shortcuts.saved', {}, 'Shortcut saved.')\n } catch {\n message.value = t('shortcuts.save_failed', {}, 'The shortcut could not be saved.')\n }\n}\n\nconst change = (item: ShortcutListItem) => {\n message.value = t(\n 'shortcuts.recording',\n { label: item.label },\n `Press the new keys for “${item.label}”. Escape cancels.`,\n )\n recording.value = item.id\n}\n\n// While recording, the keys pressed are the new binding: one key (with modifiers) or a\n// sequence (\"g o\"), finished a second after the last key (Escape cancels). Listening in\n// the capture phase keeps the keys from closing the dialog or running another shortcut.\nwatch(recording, (id, _old, onCleanup) => {\n if (!id || typeof window === 'undefined') return\n\n shortcuts.setPaused(true)\n\n const recorder = new ShortcutRecorder({\n onDone: (binding) => {\n recording.value = null\n\n const conflict = shortcuts.conflict([binding], id)\n\n if (conflict) {\n message.value = t(\n 'shortcuts.conflict',\n { label: conflict.label },\n `Already used by “${conflict.label}”.`,\n )\n\n return\n }\n\n void save(id, [binding])\n },\n })\n\n const listener = (event: KeyboardEvent) => {\n event.preventDefault()\n event.stopPropagation()\n\n if (event.key === 'Escape') {\n recorder.cancel()\n recording.value = null\n message.value = t('shortcuts.cancelled', {}, 'Change cancelled.')\n\n return\n }\n\n recorder.press(event)\n }\n\n window.addEventListener('keydown', listener, true)\n onCleanup(() => {\n recorder.cancel()\n window.removeEventListener('keydown', listener, true)\n shortcuts.setPaused(false)\n })\n})\n\nconst update = (next: boolean) => {\n recording.value = null\n message.value = ''\n emit('update:open', next)\n}\n</script>\n\n<template>\n <Dialog :open=\"props.open\" @update:open=\"update\">\n <DialogContent class=\"max-h-[85vh] overflow-y-auto sm:max-w-lg\">\n <div data-slot=\"shortcuts-overlay\" class=\"flex flex-col gap-4\">\n <DialogHeader>\n <DialogTitle>{{ t('shortcuts.title', {}, 'Keyboard shortcuts') }}</DialogTitle>\n <DialogDescription>{{\n t('shortcuts.description', {}, 'Shortcuts available on this page.')\n }}</DialogDescription>\n </DialogHeader>\n <div role=\"status\" aria-live=\"polite\" class=\"text-muted-foreground min-h-5 text-sm\">\n {{ message }}\n </div>\n <div class=\"flex flex-col gap-5\">\n <section\n v-for=\"group in groups\"\n :key=\"group.group\"\n :data-group=\"group.group\"\n :aria-labelledby=\"`shortcuts-${group.group}`\"\n >\n <h3\n :id=\"`shortcuts-${group.group}`\"\n class=\"text-muted-foreground mb-2 text-xs font-medium uppercase\"\n >\n {{ groupLabel(group.group) }}\n </h3>\n <ul class=\"flex flex-col divide-y rounded-md border\">\n <li\n v-for=\"item in group.items\"\n :key=\"item.id\"\n :data-shortcut=\"item.id\"\n class=\"flex items-center gap-3 px-3 py-2 text-sm\"\n >\n <span class=\"min-w-0 flex-1 truncate\">{{ item.label }}</span>\n <span v-if=\"recording === item.id\" class=\"text-primary text-xs\">{{\n t('shortcuts.press_keys', {}, 'Press keys…')\n }}</span>\n <span v-else-if=\"item.keys.length === 0\" class=\"text-muted-foreground text-xs\">{{\n t('shortcuts.off', {}, 'Off')\n }}</span>\n <span v-else class=\"flex flex-wrap items-center justify-end gap-2\">\n <ShortcutKeys v-for=\"key in item.keys\" :key=\"key\" :binding=\"key\" />\n </span>\n <span v-if=\"props.customizable && item.customizable\" class=\"flex shrink-0 gap-1\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"xs\"\n :aria-label=\"\n t(\n 'shortcuts.change_label',\n { label: item.label },\n `Change the shortcut for ${item.label}`,\n )\n \"\n @click=\"change(item)\"\n >{{ t('shortcuts.change', {}, 'Change') }}</Button\n >\n <Button\n v-if=\"item.keys.length > 0\"\n type=\"button\"\n variant=\"ghost\"\n size=\"xs\"\n :aria-label=\"\n t(\n 'shortcuts.turn_off_label',\n { label: item.label },\n `Turn off the shortcut for ${item.label}`,\n )\n \"\n @click=\"save(item.id, [])\"\n >{{ t('shortcuts.turn_off', {}, 'Turn off') }}</Button\n >\n <Button\n v-if=\"item.customized\"\n type=\"button\"\n variant=\"ghost\"\n size=\"xs\"\n :aria-label=\"\n t(\n 'shortcuts.reset_label',\n { label: item.label },\n `Restore the default shortcut for ${item.label}`,\n )\n \"\n @click=\"save(item.id, null)\"\n >{{ t('shortcuts.reset', {}, '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