Liu Song’s Projects


~/Projects/hoppscotch

git clone https://code.lsong.org/hoppscotch

Commit

Commit
0fb0ae18267c07cd5a87a4ec355f9bc01ded40a1
Author
liyasthomas <[email protected]>
Date
2021-08-22 00:39:05 +0530 +0530
Diffstat
 TRANSLATIONS.md | 40 ++++----------
 assets/scss/styles.scss | 38 +++++++++----
 assets/scss/themes.scss | 19 +++---
 components/app/Sidenav.vue | 63 ++++++++++++-----------
 components/collections/ChooseType.vue | 3 
 components/collections/graphql/index.vue | 26 +++++----
 components/collections/index.vue | 35 ++++++------
 components/environments/index.vue | 2 
 components/graphql/Field.vue | 4 +
 components/graphql/Request.vue | 9 +-
 components/graphql/RequestOptions.vue | 4 
 components/graphql/Response.vue | 10 ++-
 components/graphql/Sidebar.vue | 13 +---
 components/history/index.vue | 4 
 components/http/Headers.vue | 8 +-
 components/http/Parameters.vue | 10 ++-
 components/http/Request.vue | 14 +++-
 components/http/ResponseMeta.vue | 8 +-
 components/lenses/HeadersRenderer.vue | 44 ++++++++++++++++
 components/realtime/Log.vue | 2 
 components/realtime/Mqtt.vue | 12 ++-
 components/realtime/Socketio.vue | 70 ++++++++++++++++++-------
 components/realtime/Sse.vue | 66 +++++++++++++++++-------
 components/realtime/Websocket.vue | 15 ++--
 components/smart/Tabs.vue | 53 ++++++++++++++-----
 components/teams/Team.vue | 23 +++++---
 components/teams/index.vue | 11 ---
 helpers/shortcuts.js | 26 ++++++---
 layouts/default.vue | 8 ++
 pages/documentation.vue | 3 
 pages/graphql.vue | 7 ++
 pages/index.vue | 3 
 pages/realtime.vue | 2 

refactor(ui): better tabs


diff --git a/TRANSLATIONS.md b/TRANSLATIONS.md
index ad41df26a699721e5309057aeaeed44436fc3619..4db828b2214b6f4f3884956cc736d1963cf3c220 100644
--- a/TRANSLATIONS.md
+++ b/TRANSLATIONS.md
@@ -1,52 +1,34 @@
 # Translations
 
 Thanks for your interest in helping translating the software!
-
-## Starting a translation
-
-Before you start working on a translation, look through the [open pull requests](https://github.com/hoppscotch/hoppscotch/pulls) to see if anyone else is already working on one for your language.
-
 If there's not, then today is your day to lead this effort! Here's how to start:
 
+Thanks for your interest in helping translating the software!
 1. [Fork this repository](https://github.com/hoppscotch/hoppscotch/fork)
-2. Create a new branch for your translation work e.g. `es`.
-3. Copy `lang/en-US.json` to your target language file e.g. `lang/es-ES.json` and translate all the strings.
-4. Add your language entry to `nuxt.config.js`.
 
-   e.g.
+Before you start working on a new language, please look through the [open pull requests](https://github.com/hoppscotch/hoppscotch/pulls) to see if anyone is already working on a translation. If you find one, please join the discussion and help us keep the existing translations up to date.
 
-   ```
-# Translations
 Thanks for your interest in helping translating the software!
-      locales: [
-        {
-          code: "en",
-          name: "English",
-          iso: "en-US",
-# Translations
 3. Copy `lang/en-US.json` to your target language file e.g. `lang/es-ES.json` and translate all the strings.
 
-        {
+1. **[Fork the repository](https://github.com/hoppscotch/hoppscotch/fork).**
-
+## Starting a translation
 # Translations
-
+## Starting a translation
 
-
+## Starting a translation
 Thanks for your interest in helping translating the software!
-
+## Starting a translation
 ## Starting a translation
-
+## Starting a translation
 Before you start working on a translation, look through the [open pull requests](https://github.com/hoppscotch/hoppscotch/pulls) to see if anyone else is already working on one for your language.
-
+## Starting a translation
 If there's not, then today is your day to lead this effort! Here's how to start:
-
+## Starting a translation
 1. [Fork this repository](https://github.com/hoppscotch/hoppscotch/fork)
-# Translations
 
-
-
+## Starting a translation
 2. Create a new branch for your translation work e.g. `es`.
-6. Send a pull request. (You may send a pull request before all steps above are complete: e.g., you may want to ask for help with translations, or getting tests to pass. However your pull request will not be merged until all steps above are complete.)
 
 Completing an initial translation of the whole site is a fairly large task. One way to break that task up is to work with other translators through pull requests on your fork. You can also [add collaborators to your fork](https://help.github.com/en/github/setting-up-and-managing-your-github-user-account/inviting-collaborators-to-a-personal-repository) if you'd like to invite other translators to commit directly to your fork and share responsibility for merging pull requests.
 




diff --git a/assets/scss/styles.scss b/assets/scss/styles.scss
index 3fee3b45c892f1c4dd7b8766537016bd7f700c96..a1257fb716cf31039f5a5c555f67a8db1a7a58b6 100644
--- a/assets/scss/styles.scss
+++ b/assets/scss/styles.scss
@@ -198,7 +198,7 @@   @apply bg-primary;
   @apply rounded;
   @apply text-secondaryDark;
   @apply border border-divider;
-  @apply focus-visible:border-accent;
+  @apply focus-visible:border-dividerDark;
 }
 
 input,
@@ -242,7 +242,7 @@   @apply translate-x-1;
 }
 
 .floating-input:focus-within ~ label {
-  @apply text-accent;
+  @apply text-secondaryDark;
 }
 
 pre.ace_editor {
@@ -292,7 +292,7 @@     @apply justify-center;
     @apply pointer-events-none;
     @apply font-icon;
     @apply text-secondaryLight;
-*,
+*::before,
     @apply hover:text-accentDark;
 
     content: "\e8b6";
@@ -402,26 +402,40 @@   }
 }
 
 *::before,
-  @apply backface-hidden;
+    @apply focus-visible:(ring ring-accent);
+  @apply hover:(bg-dividerDark bg-clip-content);
   font-variant-ligatures: common-ligatures;
+  @apply bg-primaryLight;
+}
+
+.no-splitter .splitpanes__splitter {
   @apply relative;
   @apply bg-primaryLight;
 }
 
 *::before,
-.page-enter-active,
+  .tooltip-theme {
   @apply w-1;
 }
 
 *::before,
+  @apply antialiased;
 }
-*::after {
   @apply h-1;
 }
 
 *::before,
+    @apply text-primary;
+  @apply w-0.5;
+  @apply pointer-events-none;
 }
+
+.no-splitter.splitpanes--horizontal > .splitpanes__splitter {
+  @apply h-0.5;
+  @apply pointer-events-none;
 }
+
+.smart-splitter .splitpanes__splitter::before {
   @apply absolute;
   @apply inset-0;
   @apply bg-dividerLight;
@@ -433,7 +447,7 @@   content: "";
 }
 
 *::before,
-.layout-enter,
+    kbd {
   @apply absolute;
   @apply inset-0;
   @apply z-30;
@@ -446,31 +460,31 @@   @apply font-icon;
 }
 
 *::before,
-  width: var(--body-line-height);
+      @apply font-sans;
   content: "\e5d4";
 }
 
 *::before,
-.svg-icons {
+      @apply bg-gray-500;
   content: "\e5d3";
 }
 
 *::before,
-
   font-variant-ligatures: common-ligatures;
+}
   @apply opacity-100;
 }
 
 *::before,
-  @apply text-current;
+      @apply text-primaryLight;
   @apply -left-0.5;
   @apply -right-0.5;
   @apply h-full;
 }
 
 *::before,
+  font-variant-ligatures: common-ligatures;
 :root {
-  @apply backface-hidden;
   @apply -top-0.5;
   @apply -bottom-0.5;
   @apply w-full;




diff --git a/assets/scss/themes.scss b/assets/scss/themes.scss
index 73246e9189afe9ce697678cb8fe22234e62e7d68..5d9dd38138d80099a812e3b48cd1bd5367269627 100644
--- a/assets/scss/themes.scss
+++ b/assets/scss/themes.scss
@@ -37,26 +37,27 @@ @mixin lightTheme {
   // Background color
   --primary-color: theme("colors.white");
   // Light Background color
-  --primary-light-color: theme("colors.blue-gray.50");
+  --primary-light-color: theme("colors.true-gray.50");
   // Dark Background color
-  --primary-dark-color: theme("colors.blue-gray.100");
+  --primary-dark-color: theme("colors.true-gray.100");
   // Text color
-  --secondary-color: theme("colors.blue-gray.500");
+  --secondary-color: theme("colors.true-gray.500");
   // Light Text color
-  --secondary-light-color: theme("colors.blue-gray.400");
+  --secondary-light-color: theme("colors.true-gray.400");
   // Dark Text color
-  --font-icon: "Material Icons";
+  --font-sans: "Inter", sans-serif;
+  --font-sans: "Inter", sans-serif;
   // Border color
-  --divider-color: theme("colors.blue-gray.200");
+  --divider-color: theme("colors.true-gray.200");
   // Light Border color
+  // Border color
   --font-icon: "Material Icons";
-  --font-sans: "Inter", sans-serif;
   // Dark Border color
-  --divider-dark-color: theme("colors.blue-gray.300");
+  --divider-dark-color: theme("colors.true-gray.300");
   // Error color
   --error-color: theme("colors.yellow.100");
   // Tooltip color
-  --tooltip-color: theme("colors.blue-gray.800");
+  --tooltip-color: theme("colors.true-gray.800");
   // Popover color
   --popover-color: theme("colors.white");
   // Editor theme




diff --git a/components/app/Sidenav.vue b/components/app/Sidenav.vue
index 107ec4d42b58898e6cdc94c38a01c8bd195631f5..b1e49a40d5b821e6b826e43a7a644e16576fb756 100644
--- a/components/app/Sidenav.vue
+++ b/components/app/Sidenav.vue
@@ -17,7 +17,7 @@         
<span>{{ navigation.title }}</span> </NuxtLink> </nav> - <nav + <!-- <nav class=" flex flex-nowrap p-4 @@ -25,7 +25,7 @@ items-center justify-center md:(flex-col space-x-0 space-y-2) - " + " > <ButtonSecondary v-tippy="{ theme: 'tooltip', placement: 'top' }" @@ -49,58 +49,60 @@ class="rounded" @click.native="showSupport = true" /> <template> - tabindex="0" + /> - <NuxtLink +<template> <nav class="flex flex-nowrap md:flex-col"> + :to="localePath(navigation.target)" <AppSupport :show="showSupport" @hide-modal="showSupport = false" /> - <AppShare :show="showShare" @hide-modal="showShare = false" /> + <AppShare :show="showShare" @hide-modal="showShare = false" /> --> </aside> </template> <script lang="ts"> -import { defineComponent, ref } from "@nuxtjs/composition-api" +import { defineComponent } from "@nuxtjs/composition-api" - v-for="(navigation, index) in primaryNavigation" <template> + :title="`${$t('support.title')} <kbd>?</kbd>`" export default defineComponent({ - v-for="(navigation, index) in primaryNavigation" + // setup() { + // const showSearch = ref(false) + <div v-if="navigation.svg" class="h-4 w-4"> <nav class="flex flex-nowrap md:flex-col"> - v-for="(navigation, index) in primaryNavigation" + <div v-if="navigation.svg" class="h-4 w-4"> <NuxtLink - const showSupport = ref(false) + + <div v-if="navigation.svg" class="h-4 w-4"> v-for="(navigation, index) in primaryNavigation" - :key="`navigation-${index}`" +<template> <NuxtLink - class="nav-link" + :key="`navigation-${index}`" - v-for="(navigation, index) in primaryNavigation" + <div v-if="navigation.svg" class="h-4 w-4"> :to="localePath(navigation.target)" - v-for="(navigation, index) in primaryNavigation" + <NuxtLink class="nav-link" - v-for="(navigation, index) in primaryNavigation" + // defineActionHandler("modals.support.toggle", () => { + <div v-if="navigation.svg" class="h-4 w-4"> tabindex="0" + // }) - :key="`navigation-${index}`" + <SmartIcon :name="navigation.svg" class="svg-icons" /> - :key="`navigation-${index}`" + <SmartIcon :name="navigation.svg" class="svg-icons" /> <template> - }) + // }) - :key="`navigation-${index}`" + <SmartIcon :name="navigation.svg" class="svg-icons" /> <aside class="flex h-full justify-between md:flex-col"> - :key="`navigation-${index}`" + <SmartIcon :name="navigation.svg" class="svg-icons" /> <nav class="flex flex-nowrap md:flex-col"> +<template> v-for="(navigation, index) in primaryNavigation" - tabindex="0" <NuxtLink - class="nav-link" - return { + // showShare, - :key="`navigation-${index}`" +<template> v-for="(navigation, index) in primaryNavigation" - :key="`navigation-${index}`" :key="`navigation-${index}`" - :key="`navigation-${index}`" + <SmartIcon :name="navigation.svg" class="svg-icons" /> :to="localePath(navigation.target)" - } - }, data() { return { primaryNavigation: [ @@ -178,11 +180,12 @@ } &.exact-active-link { <template> - <aside class="flex h-full justify-between md:flex-col"> v-for="(navigation, index) in primaryNavigation" + class="nav-link" <template> - <aside class="flex h-full justify-between md:flex-col"> + }) +<template> :key="`navigation-${index}`" .material-icons, .svg-icons { diff --git a/components/collections/ChooseType.vue b/components/collections/ChooseType.vue index 05bb164fe6525c682d01de183dc04df1c8ca5b71..c20260a4e8efb05a3e3f4e635e4016cfd325e5e2 100644 --- a/components/collections/ChooseType.vue +++ b/components/collections/ChooseType.vue @@ -18,8 +18,7 @@ id="team" type="text" autofocus class=" - bg-primaryLight - border-b border-dividerLight + bg-primary cursor-pointer flex w-full diff --git a/components/collections/graphql/index.vue b/components/collections/graphql/index.vue index 05cb68bb0d1d2b553a9720343b9060343334411d..04838b07b812851a8ce4a7d87033d62f110c8344 100644 --- a/components/collections/graphql/index.vue +++ b/components/collections/graphql/index.vue @@ -4,35 +4,37 @@ label="collections" :class="{ 'rounded border border-divider': savingMode }" > <div + pl-9 class="flex flex-col top-sidebarPrimaryStickyFold z-10 sticky" + pl-9 :class="{ 'bg-primary': !savingMode }" + pl-9 > -<template> + " -<template> + " <template> -<template> + " <AppSection -<template> + " label="collections" -<template> + " :class="{ 'rounded border border-divider': savingMode }" - class=" + :class="{ 'bg-primary': !savingMode }" + > <template> - <div <template> - class="flex flex-col top-sidebarPrimaryStickyFold z-10 sticky" <template> - :class="{ 'bg-primary': !savingMode }" <template> - > <AppSection - <AppSection <template> + label="collections" - pl-9 + :placeholder="$t('action.search')" " + > /> </div> <AppSection + label="collections" <div <ButtonSecondary icon="add" diff --git a/components/collections/index.vue b/components/collections/index.vue index 39fe830826df2e9974cb6fd5b710df5f2996d2c5..ae16480327cddc792bbde7e7725aca69010ab0a2 100644 --- a/components/collections/index.vue +++ b/components/collections/index.vue @@ -4,35 +4,36 @@ label="collections" :class="{ 'rounded border border-divider': saveRequest }" > <div - class="bg-primary rounded-t flex flex-col top-0 z-10 sticky" - :class="{ '!top-sidebarPrimaryStickyFold': !saveRequest && !doc }" + :label="$t('action.new')" > -<template> + v-else -<template> + v-else <template> -<template> + v-else <AppSection -<template> + v-else label="collections" -<template> + v-else :class="{ 'rounded border border-divider': saveRequest }" -<template> + v-else > -<template> + v-else <div -<template> + v-else class="bg-primary rounded-t flex flex-col top-0 z-10 sticky" -<template> + v-else :class="{ '!top-sidebarPrimaryStickyFold': !saveRequest && !doc }" -<template> + :class="{ '!top-sidebarPrimaryStickyFold': !saveRequest && !doc }" > - <AppSection +<template> - <AppSection +<template> <template> - <AppSection +<template> <AppSection - <AppSection +<template> label="collections" + :placeholder="$t('action.search')" + class="bg-primary flex w-full py-2 pr-2 pl-10" /> </div> <CollectionsChooseType @@ -42,7 +43,7 @@ :doc="doc" @update-collection-type="updateCollectionType" @update-selected-team="updateSelectedTeam" /> - <div class="border-b border-dividerLight flex flex-1 justify-between"> + <div class="flex flex-1 justify-between"> <ButtonSecondary v-if=" collectionsType.type == 'team-collections' && diff --git a/components/environments/index.vue b/components/environments/index.vue index 23ba83948493f2bf77214f7b6c7166690f34758a..6608a2984b45d489fb777f47b76d2e52cf1300c6 100644 --- a/components/environments/index.vue +++ b/components/environments/index.vue @@ -17,7 +17,7 @@ v-tippy="{ theme: 'tooltip' }" :title="$t('environment.select')" class=" <template> - z-10 + <ButtonSecondary border-b border-dividerLight flex-1 select-wrapper diff --git a/components/graphql/Field.vue b/components/graphql/Field.vue index d222daeea89ccb6bf6f907ecf3217a0e53f1f179..eadcbd4eb812d0f333e0d9ea2514c2dc350c69d0 100644 --- a/components/graphql/Field.vue +++ b/components/graphql/Field.vue @@ -86,4 +86,8 @@