feat: fix codemirror width

This commit is contained in:
liyasthomas
2022-02-09 15:36:00 +05:30
parent 846ae087ae
commit 0895d65188
11 changed files with 13 additions and 117 deletions

View File

@@ -61,13 +61,6 @@
/> />
<SmartEnvInput <SmartEnvInput
v-model="variable.value" v-model="variable.value"
styles="
bg-transparent
flex
flex-1
py-1
px-4
"
:placeholder="`${$t('count.value', { count: index + 1 })}`" :placeholder="`${$t('count.value', { count: index + 1 })}`"
:name="'value' + index" :name="'value' + index"
/> />

View File

@@ -166,15 +166,6 @@
:spellcheck="false" :spellcheck="false"
:value="header.key" :value="header.key"
autofocus autofocus
styles="
bg-transparent
flex
flex-1
py-1
px-4
truncate
"
class="flex-1 !flex"
@input=" @input="
updateHeader(index, { updateHeader(index, {
key: $event, key: $event,

View File

@@ -158,50 +158,32 @@
<SmartEnvInput <SmartEnvInput
v-model="basicUsername" v-model="basicUsername"
:placeholder="$t('authorization.username')" :placeholder="$t('authorization.username')"
styles="bg-transparent flex flex-1 py-1 px-4"
/> />
</div> </div>
<div class="flex flex-1 border-b border-dividerLight"> <div class="flex flex-1 border-b border-dividerLight">
<SmartEnvInput <SmartEnvInput
v-model="basicPassword" v-model="basicPassword"
:placeholder="$t('authorization.password')" :placeholder="$t('authorization.password')"
styles="bg-transparent flex flex-1 py-1 px-4"
/> />
</div> </div>
</div> </div>
<div v-if="authType === 'bearer'"> <div v-if="authType === 'bearer'">
<div class="flex flex-1 border-b border-dividerLight"> <div class="flex flex-1 border-b border-dividerLight">
<SmartEnvInput <SmartEnvInput v-model="bearerToken" placeholder="Token" />
v-model="bearerToken"
placeholder="Token"
styles="bg-transparent flex flex-1 py-1 px-4"
/>
</div> </div>
</div> </div>
<div v-if="authType === 'oauth-2'"> <div v-if="authType === 'oauth-2'">
<div class="flex flex-1 border-b border-dividerLight"> <div class="flex flex-1 border-b border-dividerLight">
<SmartEnvInput <SmartEnvInput v-model="oauth2Token" placeholder="Token" />
v-model="oauth2Token"
placeholder="Token"
styles="bg-transparent flex flex-1 py-1 px-4"
/>
</div> </div>
<HttpOAuth2Authorization /> <HttpOAuth2Authorization />
</div> </div>
<div v-if="authType === 'api-key'"> <div v-if="authType === 'api-key'">
<div class="flex flex-1 border-b border-dividerLight"> <div class="flex flex-1 border-b border-dividerLight">
<SmartEnvInput <SmartEnvInput v-model="apiKey" placeholder="Key" />
v-model="apiKey"
placeholder="Key"
styles="bg-transparent flex flex-1 py-1 px-4"
/>
</div> </div>
<div class="flex flex-1 border-b border-dividerLight"> <div class="flex flex-1 border-b border-dividerLight">
<SmartEnvInput <SmartEnvInput v-model="apiValue" placeholder="Value" />
v-model="apiValue"
placeholder="Value"
styles="bg-transparent flex flex-1 py-1 px-4"
/>
</div> </div>
<div class="flex items-center border-b border-dividerLight"> <div class="flex items-center border-b border-dividerLight">
<label class="ml-4 text-secondaryLight"> <label class="ml-4 text-secondaryLight">

View File

@@ -36,13 +36,6 @@
<SmartEnvInput <SmartEnvInput
v-model="param.key" v-model="param.key"
:placeholder="`${$t('count.parameter', { count: index + 1 })}`" :placeholder="`${$t('count.parameter', { count: index + 1 })}`"
styles="
bg-transparent
flex
flex-1
py-1
px-4
"
@change=" @change="
updateBodyParam(index, { updateBodyParam(index, {
key: $event, key: $event,
@@ -66,13 +59,6 @@
<SmartEnvInput <SmartEnvInput
v-model="param.value" v-model="param.value"
:placeholder="`${$t('count.value', { count: index + 1 })}`" :placeholder="`${$t('count.value', { count: index + 1 })}`"
styles="
bg-transparent
flex
flex-1
py-1
px-4
"
@change=" @change="
updateBodyParam(index, { updateBodyParam(index, {
key: param.key, key: param.key,

View File

@@ -49,15 +49,6 @@
:spellcheck="false" :spellcheck="false"
:value="header.key" :value="header.key"
autofocus autofocus
styles="
bg-transparent
flex
flex-1
py-1
px-4
truncate
"
class="flex-1 !flex"
@input=" @input="
updateHeader(index, { updateHeader(index, {
key: $event, key: $event,
@@ -69,13 +60,6 @@
<SmartEnvInput <SmartEnvInput
v-model="header.value" v-model="header.value"
:placeholder="`${t('count.value', { count: index + 1 })}`" :placeholder="`${t('count.value', { count: index + 1 })}`"
styles="
bg-transparent
flex
flex-1
py-1
px-4
"
@change=" @change="
updateHeader(index, { updateHeader(index, {
key: header.key, key: header.key,

View File

@@ -46,13 +46,6 @@
<SmartEnvInput <SmartEnvInput
v-model="param.key" v-model="param.key"
:placeholder="`${t('count.parameter', { count: index + 1 })}`" :placeholder="`${t('count.parameter', { count: index + 1 })}`"
styles="
bg-transparent
flex
flex-1
py-1
px-4
"
@change=" @change="
updateParam(index, { updateParam(index, {
key: $event, key: $event,
@@ -64,13 +57,6 @@
<SmartEnvInput <SmartEnvInput
v-model="param.value" v-model="param.value"
:placeholder="`${t('count.value', { count: index + 1 })}`" :placeholder="`${t('count.value', { count: index + 1 })}`"
styles="
bg-transparent
flex
flex-1
py-1
px-4
"
@change=" @change="
updateParam(index, { updateParam(index, {
key: param.key, key: param.key,

View File

@@ -37,20 +37,6 @@
<SmartEnvInput <SmartEnvInput
v-model="newEndpoint" v-model="newEndpoint"
:placeholder="`${t('request.url')}`" :placeholder="`${t('request.url')}`"
styles="
bg-primaryLight
border border-divider
flex
flex-1
rounded-r
text-secondaryDark
min-w-32
py-1
px-4
hover:border-dividerDark
focus-visible:border-dividerDark
focus-visible:bg-transparent
"
@enter="newSendRequest()" @enter="newSendRequest()"
@paste="onPasteUrl($event)" @paste="onPasteUrl($event)"
/> />

View File

@@ -46,13 +46,6 @@
<SmartEnvInput <SmartEnvInput
v-model="param.key" v-model="param.key"
:placeholder="`${t('count.parameter', { count: index + 1 })}`" :placeholder="`${t('count.parameter', { count: index + 1 })}`"
styles="
bg-transparent
flex
flex-1
py-1
px-4
"
@change=" @change="
updateUrlEncodedParam(index, { updateUrlEncodedParam(index, {
key: $event, key: $event,
@@ -64,13 +57,6 @@
<SmartEnvInput <SmartEnvInput
v-model="param.value" v-model="param.value"
:placeholder="`${t('count.value', { count: index + 1 })}`" :placeholder="`${t('count.value', { count: index + 1 })}`"
styles="
bg-transparent
flex
flex-1
py-1
px-4
"
@change=" @change="
updateUrlEncodedParam(index, { updateUrlEncodedParam(index, {
key: param.key, key: param.key,

View File

@@ -18,7 +18,7 @@
class="hide-scrollbar !overflow-auto flex flex-col" class="hide-scrollbar !overflow-auto flex flex-col"
> >
<div <div
class="sticky top-0 z-10 flex flex-shrink-0 p-4 overflow-x-auto space-x-2 bg-primary hide-scrollbar" class="sticky top-0 z-10 flex flex-shrink-0 p-4 space-x-2 overflow-x-auto bg-primary hide-scrollbar"
> >
<div class="inline-flex flex-1 space-x-2"> <div class="inline-flex flex-1 space-x-2">
<div class="flex flex-1"> <div class="flex flex-1">
@@ -193,11 +193,7 @@
> >
<div class="w-2/3 border-r border-dividerLight"> <div class="w-2/3 border-r border-dividerLight">
<div class="flex flex-1 border-b border-dividerLight"> <div class="flex flex-1 border-b border-dividerLight">
<SmartEnvInput <SmartEnvInput v-model="bearerToken" placeholder="Token" />
v-model="bearerToken"
placeholder="Token"
styles="bg-transparent flex flex-1 py-1 px-4"
/>
</div> </div>
</div> </div>
<div <div

View File

@@ -150,8 +150,10 @@ watch(editor, () => {
<style lang="scss" scoped> <style lang="scss" scoped>
.env-input-container { .env-input-container {
@apply relative; @apply relative;
@apply inline-grid; @apply inline-flex;
@apply flex-1; @apply flex-1;
@apply bg-red-100;
@apply border border-red-400;
} }
[contenteditable] { [contenteditable] {
@@ -180,6 +182,9 @@ watch(editor, () => {
@apply overflow-y-hidden; @apply overflow-y-hidden;
@apply resize-none; @apply resize-none;
@apply focus:outline-none; @apply focus:outline-none;
@apply bg-green-100;
@apply border border-green-400;
@apply w-full;
} }
.env-input::-webkit-scrollbar { .env-input::-webkit-scrollbar {

View File

@@ -33,6 +33,7 @@ export const baseTheme = EditorView.theme({
fontSize: "var(--font-size-body)", fontSize: "var(--font-size-body)",
height: "100%", height: "100%",
width: "100%", width: "100%",
flex: "1",
}, },
".cm-content": { ".cm-content": {
caretColor: "var(--secondary-light-color)", caretColor: "var(--secondary-light-color)",