refactor: full-width modal for search, transparent tabs

This commit is contained in:
liyasthomas
2021-08-29 09:44:46 +05:30
parent 16b9a2b06e
commit 647599e5aa
10 changed files with 63 additions and 49 deletions

View File

@@ -4,7 +4,6 @@
v-for="(shortcut, shortcutIndex) in theOutput" v-for="(shortcut, shortcutIndex) in theOutput"
:key="`shortcut-${shortcutIndex}`" :key="`shortcut-${shortcutIndex}`"
class=" class="
rounded
cursor-pointer cursor-pointer
flex flex
py-2 py-2
@@ -16,10 +15,11 @@
" "
@click="$emit('action', shortcut.action)" @click="$emit('action', shortcut.action)"
> >
<i class="mr-4 opacity-75 material-icons group-hover:opacity-100"> <SmartIcon
{{ shortcut.icon }} class="mr-4 opacity-75 transition svg-icons group-hover:opacity-100"
</i> :name="shortcut.icon"
<span class="flex flex-1 mr-4 group-hover:text-secondaryDark"> />
<span class="flex flex-1 mr-4 transition group-hover:text-secondaryDark">
{{ $t(shortcut.label) }} {{ $t(shortcut.label) }}
</span> </span>
<span <span

View File

@@ -1,5 +1,5 @@
<template> <template>
<SmartModal v-if="show" @close="$emit('hide-modal')"> <SmartModal v-if="show" full-width @close="$emit('hide-modal')">
<template #body> <template #body>
<input <input
id="command" id="command"
@@ -11,11 +11,11 @@
class=" class="
bg-transparent bg-transparent
border-b border-dividerLight border-b border-dividerLight
flex flex-shrink-0
text-secondaryDark text-base text-secondaryDark text-base
leading-normal leading-normal
px-4 py-4
pt-2 px-6
pb-6
" "
/> />
<AppLunr <AppLunr
@@ -37,18 +37,17 @@
" "
> >
<div v-for="(map, mapIndex) in mappings" :key="`map-${mapIndex}`"> <div v-for="(map, mapIndex) in mappings" :key="`map-${mapIndex}`">
<h5 class="my-2 text-secondaryLight py-2 px-4"> <h5 class="my-2 text-secondaryLight py-2 px-6">
{{ $t(map.section) }} {{ $t(map.section) }}
</h5> </h5>
<div <div
v-for="(shortcut, shortcutIndex) in map.shortcuts" v-for="(shortcut, shortcutIndex) in map.shortcuts"
:key="`map-${mapIndex}-shortcut-${shortcutIndex}`" :key="`map-${mapIndex}-shortcut-${shortcutIndex}`"
class=" class="
rounded
cursor-pointer cursor-pointer
flex flex
py-2 py-2
px-4 px-6
transition transition
items-center items-center
group group
@@ -56,10 +55,19 @@
" "
@click="runAction(shortcut.action)" @click="runAction(shortcut.action)"
> >
<i class="mr-4 opacity-75 material-icons group-hover:opacity-100"> <SmartIcon
{{ shortcut.icon }} class="
</i> mr-4
<span class="flex flex-1 mr-4 group-hover:text-secondaryDark"> opacity-75
transition
svg-icons
group-hover:opacity-100
"
:name="shortcut.icon"
/>
<span
class="flex flex-1 mr-4 transition group-hover:text-secondaryDark"
>
{{ $t(shortcut.label) }} {{ $t(shortcut.label) }}
</span> </span>
<span <span

View File

@@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<SmartTabs styles="sticky top-upperPrimaryStickyFold z-10"> <SmartTabs styles="sticky bg-primary top-upperPrimaryStickyFold z-10">
<SmartTab :id="'query'" :label="$t('tab.query')" :selected="true"> <SmartTab :id="'query'" :label="$t('tab.query')" :selected="true">
<AppSection label="query"> <AppSection label="query">
<div <div

View File

@@ -1,6 +1,6 @@
<template> <template>
<aside> <aside>
<SmartTabs styles="sticky z-10 top-0"> <SmartTabs styles="sticky bg-primary z-10 top-0">
<SmartTab :id="'docs'" :label="`Docs`" :selected="true"> <SmartTab :id="'docs'" :label="`Docs`" :selected="true">
<AppSection label="docs"> <AppSection label="docs">
<div class="bg-primary flex top-sidebarPrimaryStickyFold z-10 sticky"> <div class="bg-primary flex top-sidebarPrimaryStickyFold z-10 sticky">
@@ -22,7 +22,7 @@
</div> </div>
<SmartTabs <SmartTabs
ref="gqlTabs" ref="gqlTabs"
styles="border-t border-dividerLight sticky z-10 top-sidebarSecondaryStickyFold" styles="border-t border-dividerLight bg-primary sticky z-10 top-sidebarSecondaryStickyFold"
> >
<div class="gqlTabs"> <div class="gqlTabs">
<SmartTab <SmartTab

View File

@@ -1,5 +1,5 @@
<template> <template>
<SmartTabs styles="sticky z-10 top-lowerPrimaryStickyFold"> <SmartTabs styles="sticky z-10 bg-primary top-lowerPrimaryStickyFold">
<SmartTab <SmartTab
v-for="(lens, index) in validLenses" v-for="(lens, index) in validLenses"
:id="lens.renderer" :id="lens.renderer"

View File

@@ -37,7 +37,6 @@
shadow-lg shadow-lg
text-left text-left
w-full w-full
p-4
transform transform
transition-all transition-all
inline-block inline-block
@@ -46,7 +45,10 @@
sm:max-w-md sm:align-middle sm:max-w-md sm:align-middle
md:rounded-lg md:rounded-lg
" "
:class="{ 'mt-24 md:mb-8': placement === 'top' }" :class="[
{ 'mt-24 md:mb-8': placement === 'top' },
{ 'p-4': !fullWidth },
]"
> >
<div <div
v-if="title" v-if="title"
@@ -64,7 +66,8 @@
</span> </span>
</div> </div>
<div <div
class="flex flex-col max-h-md py-2 overflow-y-auto hide-scrollbar" class="flex flex-col max-h-md overflow-y-auto hide-scrollbar"
:class="{ 'py-2': !fullWidth }"
> >
<slot name="body"></slot> <slot name="body"></slot>
</div> </div>
@@ -115,6 +118,10 @@ export default defineComponent({
type: String, type: String,
default: "top", default: "top",
}, },
fullWidth: {
type: Boolean,
default: false,
},
}, },
setup() { setup() {
const { disableKeybindings, enableKeybindings } = useKeybindingDisabler() const { disableKeybindings, enableKeybindings } = useKeybindingDisabler()

View File

@@ -69,7 +69,6 @@ export default defineComponent({
@apply flex; @apply flex;
@apply whitespace-nowrap; @apply whitespace-nowrap;
@apply overflow-auto; @apply overflow-auto;
@apply bg-primary;
// &::after { // &::after {
// @apply absolute; // @apply absolute;

View File

@@ -123,13 +123,13 @@ export const spotlight = [
keys: ["?"], keys: ["?"],
label: "shortcut.general.help_menu", label: "shortcut.general.help_menu",
action: "modals.support.toggle", action: "modals.support.toggle",
icon: "support", icon: "life-buoy",
}, },
{ {
keys: [getPlatformSpecialKey(), "K"], keys: [getPlatformSpecialKey(), "K"],
label: "shortcut.general.show_all", label: "shortcut.general.show_all",
action: "flyouts.keybinds.toggle", action: "flyouts.keybinds.toggle",
icon: "keyboard", icon: "zap",
}, },
], ],
}, },
@@ -140,43 +140,43 @@ export const spotlight = [
keys: [getPlatformSpecialKey(), "←"], keys: [getPlatformSpecialKey(), "←"],
label: "shortcut.navigation.back", label: "shortcut.navigation.back",
action: "navigation.jump.back", action: "navigation.jump.back",
icon: "arrow_forward", icon: "arrow-right",
}, },
{ {
keys: [getPlatformSpecialKey(), "→"], keys: [getPlatformSpecialKey(), "→"],
label: "shortcut.navigation.forward", label: "shortcut.navigation.forward",
action: "navigation.jump.forward", action: "navigation.jump.forward",
icon: "arrow_forward", icon: "arrow-right",
}, },
{ {
keys: [getPlatformAlternateKey(), "R"], keys: [getPlatformAlternateKey(), "R"],
label: "shortcut.navigation.rest", label: "shortcut.navigation.rest",
action: "navigation.jump.rest", action: "navigation.jump.rest",
icon: "arrow_forward", icon: "arrow-right",
}, },
{ {
keys: [getPlatformAlternateKey(), "Q"], keys: [getPlatformAlternateKey(), "Q"],
label: "shortcut.navigation.graphql", label: "shortcut.navigation.graphql",
action: "navigation.jump.graphql", action: "navigation.jump.graphql",
icon: "arrow_forward", icon: "arrow-right",
}, },
{ {
keys: [getPlatformAlternateKey(), "W"], keys: [getPlatformAlternateKey(), "W"],
label: "shortcut.navigation.realtime", label: "shortcut.navigation.realtime",
action: "navigation.jump.realtime", action: "navigation.jump.realtime",
icon: "arrow_forward", icon: "arrow-right",
}, },
{ {
keys: [getPlatformAlternateKey(), "D"], keys: [getPlatformAlternateKey(), "D"],
label: "shortcut.navigation.documentation", label: "shortcut.navigation.documentation",
action: "navigation.jump.documentation", action: "navigation.jump.documentation",
icon: "arrow_forward", icon: "arrow-right",
}, },
{ {
keys: [getPlatformAlternateKey(), "S"], keys: [getPlatformAlternateKey(), "S"],
label: "shortcut.navigation.settings", label: "shortcut.navigation.settings",
action: "navigation.jump.settings", action: "navigation.jump.settings",
icon: "arrow_forward", icon: "arrow-right",
}, },
], ],
}, },
@@ -187,7 +187,7 @@ export const spotlight = [
keys: [getPlatformSpecialKey(), "M"], keys: [getPlatformSpecialKey(), "M"],
label: "shortcut.miscellaneous.invite", label: "shortcut.miscellaneous.invite",
action: "modals.share.toggle", action: "modals.share.toggle",
icon: "person_add_alt", icon: "gift",
}, },
], ],
}, },
@@ -198,70 +198,70 @@ export const lunr = [
keys: ["?"], keys: ["?"],
label: "shortcut.general.help_menu", label: "shortcut.general.help_menu",
action: "modals.support.toggle", action: "modals.support.toggle",
icon: "support", icon: "life-buoy",
tags: "help support documentation troubleshooting chat community feedback report bug issue ticket", tags: "help support menu discord twitter documentation troubleshooting chat community feedback report bug issue ticket",
}, },
{ {
keys: [getPlatformSpecialKey(), "K"], keys: [getPlatformSpecialKey(), "K"],
label: "shortcut.general.show_all", label: "shortcut.general.show_all",
action: "flyouts.keybinds.toggle", action: "flyouts.keybinds.toggle",
icon: "keyboard", icon: "zap",
tags: "keyboard shortcuts", tags: "keyboard shortcuts",
}, },
{ {
keys: [getPlatformSpecialKey(), "←"], keys: [getPlatformSpecialKey(), "←"],
label: "shortcut.navigation.back", label: "shortcut.navigation.back",
action: "navigation.jump.back", action: "navigation.jump.back",
icon: "arrow_forward", icon: "arrow-right",
tags: "back jump page navigation go", tags: "back jump page navigation go",
}, },
{ {
keys: [getPlatformSpecialKey(), "→"], keys: [getPlatformSpecialKey(), "→"],
label: "shortcut.navigation.forward", label: "shortcut.navigation.forward",
action: "navigation.jump.forward", action: "navigation.jump.forward",
icon: "arrow_forward", icon: "arrow-right",
tags: "forward jump next forward page navigation go", tags: "forward jump next forward page navigation go",
}, },
{ {
keys: [getPlatformAlternateKey(), "R"], keys: [getPlatformAlternateKey(), "R"],
label: "shortcut.navigation.rest", label: "shortcut.navigation.rest",
action: "navigation.jump.rest", action: "navigation.jump.rest",
icon: "arrow_forward", icon: "arrow-right",
tags: "rest jump page navigation go", tags: "rest jump page navigation go",
}, },
{ {
keys: [getPlatformAlternateKey(), "Q"], keys: [getPlatformAlternateKey(), "Q"],
label: "shortcut.navigation.graphql", label: "shortcut.navigation.graphql",
action: "navigation.jump.graphql", action: "navigation.jump.graphql",
icon: "arrow_forward", icon: "arrow-right",
tags: "graphql jump page navigation go", tags: "graphql jump page navigation go",
}, },
{ {
keys: [getPlatformAlternateKey(), "W"], keys: [getPlatformAlternateKey(), "W"],
label: "shortcut.navigation.realtime", label: "shortcut.navigation.realtime",
action: "navigation.jump.realtime", action: "navigation.jump.realtime",
icon: "arrow_forward", icon: "arrow-right",
tags: "realtime jump page navigation websocket socket mqtt sse go", tags: "realtime jump page navigation websocket socket mqtt sse go",
}, },
{ {
keys: [getPlatformAlternateKey(), "D"], keys: [getPlatformAlternateKey(), "D"],
label: "shortcut.navigation.documentation", label: "shortcut.navigation.documentation",
action: "navigation.jump.documentation", action: "navigation.jump.documentation",
icon: "arrow_forward", icon: "arrow-right",
tags: "documentation jump page navigation go", tags: "documentation jump page navigation go",
}, },
{ {
keys: [getPlatformAlternateKey(), "S"], keys: [getPlatformAlternateKey(), "S"],
label: "shortcut.navigation.settings", label: "shortcut.navigation.settings",
action: "navigation.jump.settings", action: "navigation.jump.settings",
icon: "arrow_forward", icon: "arrow-right",
tags: "settings jump page navigation account theme go", tags: "settings jump page navigation account theme go",
}, },
{ {
keys: [getPlatformSpecialKey(), "M"], keys: [getPlatformSpecialKey(), "M"],
label: "shortcut.miscellaneous.invite", label: "shortcut.miscellaneous.invite",
action: "modals.share.toggle", action: "modals.share.toggle",
icon: "person_add_alt", icon: "gift",
tags: "invite share app social", tags: "invite share app friends people social",
}, },
] ]

View File

@@ -4,7 +4,7 @@
<Splitpanes class="smart-splitter" :dbl-click-splitter="false" horizontal> <Splitpanes class="smart-splitter" :dbl-click-splitter="false" horizontal>
<Pane class="hide-scrollbar !overflow-auto"> <Pane class="hide-scrollbar !overflow-auto">
<HttpRequest /> <HttpRequest />
<SmartTabs styles="sticky top-upperPrimaryStickyFold z-10"> <SmartTabs styles="sticky bg-primary top-upperPrimaryStickyFold z-10">
<SmartTab <SmartTab
:id="'params'" :id="'params'"
:label="$t('tab.parameters')" :label="$t('tab.parameters')"
@@ -55,7 +55,7 @@
class="hide-scrollbar !overflow-auto" class="hide-scrollbar !overflow-auto"
> >
<aside> <aside>
<SmartTabs styles="sticky z-10 top-0"> <SmartTabs styles="sticky bg-primary z-10 top-0">
<SmartTab :id="'history'" :label="$t('tab.history')" :selected="true"> <SmartTab :id="'history'" :label="$t('tab.history')" :selected="true">
<History ref="historyComponent" :page="'rest'" /> <History ref="historyComponent" :page="'rest'" />
</SmartTab> </SmartTab>

View File

@@ -1,7 +1,7 @@
<template> <template>
<SmartTabs <SmartTabs
class="h-full overflow-hidden" class="h-full overflow-hidden"
styles="sticky top-0 z-10 border-b border-dividerLight !overflow-visible" styles="sticky bg-primary top-0 z-10 border-b border-dividerLight !overflow-visible"
> >
<SmartTab <SmartTab
id="websocket" id="websocket"