Skip to content

Commit

Permalink
fix: eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
productdevbook committed Sep 21, 2022
1 parent a0dd571 commit c835143
Show file tree
Hide file tree
Showing 17 changed files with 345 additions and 145 deletions.
2 changes: 1 addition & 1 deletion apps/docs/docs/.vitepress/theme/index.ts
Expand Up @@ -5,7 +5,7 @@ import { h } from 'vue'

import Demo from '../../../components/Demo.vue'
import GithubUrl from '../../../components/GithubUrl.vue'
import Language from '../../../components/Language.vue'
// import Language from '../../../components/Language.vue'
import Tab from '../../../components/Tabs/Tab.vue'
import Tabs from '../../../components/Tabs/Tabs.vue'
import { extractFileNameFromPath } from '../../../utils'
Expand Down
7 changes: 6 additions & 1 deletion docs/components/content/Ellipsis.vue
Expand Up @@ -7,7 +7,12 @@
<style lang="postcss" scoped>
.ellipsis {
@apply h-[160px] md:w-[600px];
background: linear-gradient(97.62deg, rgba(0, 71, 225, 0.22) 2.27%, rgba(26, 214, 255, 0.22) 50.88%, rgba(0, 220, 130, 0.22) 98.48%);
background: linear-gradient(
97.62deg,
rgba(0, 71, 225, 0.22) 2.27%,
rgba(26, 214, 255, 0.22) 50.88%,
rgba(0, 220, 130, 0.22) 98.48%
);
filter: blur(169px);
transform: matrix(-0.95, -0.3, -0.3, 0.95, 200, 250);
}
Expand Down
10 changes: 5 additions & 5 deletions docs/components/content/ExampleMultiselect.vue
@@ -1,7 +1,3 @@
<template>
<div>Not working on content v2 docs!</div>
</template>

<script>
export default {
props: {
Expand All @@ -10,10 +6,14 @@ export default {
default: () => []
}
},
data () {
data() {
return {
value: null
}
}
}
</script>

<template>
<div>Not working on content v2 docs!</div>
</template>
5 changes: 4 additions & 1 deletion docs/components/content/HeroAnnouncement.vue
Expand Up @@ -12,7 +12,10 @@ defineProps({
</script>

<template>
<NuxtLink :to="to" class="hover:bg-primary-200 text-primary-900 bg-primary-100 transition dark:bg-transparent hover:dark:bg-primary-900 dark:border-primary-700 dark:text-primary-100 border border-primary-400 mb-8 px-4 py-2 rounded-md flex gap-x-1 inline-flex items-center justify-center">
<NuxtLink
:to="to"
class="hover:bg-primary-200 text-primary-900 bg-primary-100 transition dark:bg-transparent hover:dark:bg-primary-900 dark:border-primary-700 dark:text-primary-100 border border-primary-400 mb-8 px-4 py-2 rounded-md flex gap-x-1 inline-flex items-center justify-center"
>
<Icon name="heroicons-solid:sparkles" class="h-4 w-4" />
<span class="font-medium text-sm">{{ label }}</span>
</NuxtLink>
Expand Down
7 changes: 6 additions & 1 deletion docs/components/content/IconHeart.vue
@@ -1,5 +1,10 @@
<template>
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24">
<svg
xmlns="http://www.w3.org/2000/svg"
width="18"
height="18"
viewBox="0 0 24 24"
>
<path
class="icon"
fill="currentColor"
Expand Down
5 changes: 4 additions & 1 deletion docs/components/content/IconZap.vue
Expand Up @@ -7,6 +7,9 @@
width="64"
height="64"
>
<polygon fill="currentColor" points="16.828,5.828 29.966,5.828 25.172,19.414 33.966,19.414 18.621,43.138 21.034,26.379 12.828,26.379" />
<polygon
fill="currentColor"
points="16.828,5.828 29.966,5.828 25.172,19.414 33.966,19.414 18.621,43.138 21.034,26.379 12.828,26.379"
/>
</svg>
</template>
24 changes: 20 additions & 4 deletions docs/components/content/Logo.vue
@@ -1,7 +1,23 @@
<template>
<svg class="text-gray-900 dark:text-white h-5 sm:h-6" viewBox="0 0 126 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.6009 1.34267c-.9666-1.65485-3.3832-1.65485-4.3499 0L.71619 19.3781c-.96664 1.6549.24165 3.7234 2.17494 3.7234h8.22407c-.8261-.7188-1.13199-1.9623-.5068-3.0293L18.587 6.45475l-2.9861-5.11208Z" fill="#80EEC0" />
<path d="M22.276 5.29879c.8-1.35398 2.7999-1.35398 3.5999 0L34.5944 20.055c.8 1.354-.2 3.0465-1.7999 3.0465h-17.437c-1.5999 0-2.6-1.6925-1.8-3.0465L22.276 5.29879Z" fill="#00DC82" />
<path d="M49.5744 23.0432c3.8655 0 6.7421-2.2261 7.0567-5.4866h-2.9665c-.2697 1.7089-1.9327 2.9007-4.0902 2.9007-2.7418 0-4.8094-1.8888-4.8094-5.4641 0-3.5753 2.0676-5.48663 4.8094-5.48663 2.1125 0 3.7756 1.19173 4.0003 2.92323h3.1014c-.427-3.26053-3.3036-5.48664-7.1017-5.48664-4.1127 0-7.7984 2.6983-7.7984 8.05004 0 5.3517 3.6183 8.05 7.7984 8.05Zm14.2834 0c3.4385 0 5.9104-2.4735 5.9104-5.8464s-2.4719-5.8464-5.9104-5.8464c-3.461 0-5.9329 2.4735-5.9329 5.8464s2.4719 5.8464 5.9329 5.8464Zm0-2.3836c-1.8878 0-3.1464-1.4166-3.1464-3.4628 0-2.0463 1.2586-3.4628 3.1464-3.4628 1.8653 0 3.124 1.4165 3.124 3.4628 0 2.0462-1.2587 3.4628-3.124 3.4628Zm10.5403 2.2037v-6.1837c0-1.664 1.0787-2.8782 2.6295-2.8782 1.4156 0 2.3598 1.0794 2.3598 2.6309v6.431h2.764v-7.0157c0-2.6533-1.6629-4.4972-4.2251-4.4972-1.618 0-2.8991.6971-3.5282 1.9338v-1.7539h-2.764v11.333h2.764Zm11.2487-11.333h-2.2252v2.3161h2.2252v5.0594c0 2.5184 1.6181 3.9575 4.09 3.9575h1.8205v-2.3386h-1.506c-1.0332 0-1.6404-.5846-1.6404-1.7314v-4.9469h3.1464v-2.3161h-3.1464V8.11242h-2.7641v3.41788Zm15.2492 7.5553c-.292 1.0793-1.2134 1.664-2.629 1.664-1.7532 0-2.9216-1.1693-3.124-2.9906h8.36c.023-.2249.045-.5622.045-.9445 0-2.6983-1.707-5.4641-5.5059-5.4641-3.7082 0-5.551 2.8108-5.551 5.8014 0 2.9682 2.0677 5.8914 5.7759 5.8914 2.787 0 4.899-1.5516 5.326-3.9576h-2.697Zm-2.8539-5.6664c1.6405 0 2.6299 1.0793 2.7419 2.5184h-5.5732c.2921-1.709 1.2805-2.5184 2.8313-2.5184Zm10.1759 9.4441v-6.1837c0-1.664 1.079-2.8782 2.63-2.8782 1.416 0 2.36 1.0794 2.36 2.6309v6.431h2.764v-7.0157c0-2.6533-1.663-4.4972-4.225-4.4972-1.618 0-2.899.6971-3.529 1.9338v-1.7539h-2.764v11.333h2.764Zm11.249-11.333h-2.225v2.3161h2.225v5.0594c0 2.5184 1.618 3.9575 4.09 3.9575h1.821v-2.3386h-1.506c-1.034 0-1.641-.5846-1.641-1.7314v-4.9469h3.147v-2.3161h-3.147V8.11242h-2.764v3.41788Z" fill="currentColor" />
<svg
class="text-gray-900 dark:text-white h-5 sm:h-6"
viewBox="0 0 126 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M15.6009 1.34267c-.9666-1.65485-3.3832-1.65485-4.3499 0L.71619 19.3781c-.96664 1.6549.24165 3.7234 2.17494 3.7234h8.22407c-.8261-.7188-1.13199-1.9623-.5068-3.0293L18.587 6.45475l-2.9861-5.11208Z"
fill="#80EEC0"
/>
<path
d="M22.276 5.29879c.8-1.35398 2.7999-1.35398 3.5999 0L34.5944 20.055c.8 1.354-.2 3.0465-1.7999 3.0465h-17.437c-1.5999 0-2.6-1.6925-1.8-3.0465L22.276 5.29879Z"
fill="#00DC82"
/>
<path
d="M49.5744 23.0432c3.8655 0 6.7421-2.2261 7.0567-5.4866h-2.9665c-.2697 1.7089-1.9327 2.9007-4.0902 2.9007-2.7418 0-4.8094-1.8888-4.8094-5.4641 0-3.5753 2.0676-5.48663 4.8094-5.48663 2.1125 0 3.7756 1.19173 4.0003 2.92323h3.1014c-.427-3.26053-3.3036-5.48664-7.1017-5.48664-4.1127 0-7.7984 2.6983-7.7984 8.05004 0 5.3517 3.6183 8.05 7.7984 8.05Zm14.2834 0c3.4385 0 5.9104-2.4735 5.9104-5.8464s-2.4719-5.8464-5.9104-5.8464c-3.461 0-5.9329 2.4735-5.9329 5.8464s2.4719 5.8464 5.9329 5.8464Zm0-2.3836c-1.8878 0-3.1464-1.4166-3.1464-3.4628 0-2.0463 1.2586-3.4628 3.1464-3.4628 1.8653 0 3.124 1.4165 3.124 3.4628 0 2.0462-1.2587 3.4628-3.124 3.4628Zm10.5403 2.2037v-6.1837c0-1.664 1.0787-2.8782 2.6295-2.8782 1.4156 0 2.3598 1.0794 2.3598 2.6309v6.431h2.764v-7.0157c0-2.6533-1.6629-4.4972-4.2251-4.4972-1.618 0-2.8991.6971-3.5282 1.9338v-1.7539h-2.764v11.333h2.764Zm11.2487-11.333h-2.2252v2.3161h2.2252v5.0594c0 2.5184 1.6181 3.9575 4.09 3.9575h1.8205v-2.3386h-1.506c-1.0332 0-1.6404-.5846-1.6404-1.7314v-4.9469h3.1464v-2.3161h-3.1464V8.11242h-2.7641v3.41788Zm15.2492 7.5553c-.292 1.0793-1.2134 1.664-2.629 1.664-1.7532 0-2.9216-1.1693-3.124-2.9906h8.36c.023-.2249.045-.5622.045-.9445 0-2.6983-1.707-5.4641-5.5059-5.4641-3.7082 0-5.551 2.8108-5.551 5.8014 0 2.9682 2.0677 5.8914 5.7759 5.8914 2.787 0 4.899-1.5516 5.326-3.9576h-2.697Zm-2.8539-5.6664c1.6405 0 2.6299 1.0793 2.7419 2.5184h-5.5732c.2921-1.709 1.2805-2.5184 2.8313-2.5184Zm10.1759 9.4441v-6.1837c0-1.664 1.079-2.8782 2.63-2.8782 1.416 0 2.36 1.0794 2.36 2.6309v6.431h2.764v-7.0157c0-2.6533-1.663-4.4972-4.225-4.4972-1.618 0-2.899.6971-3.529 1.9338v-1.7539h-2.764v11.333h2.764Zm11.249-11.333h-2.225v2.3161h2.225v5.0594c0 2.5184 1.618 3.9575 4.09 3.9575h1.821v-2.3386h-1.506c-1.034 0-1.641-.5846-1.641-1.7314v-4.9469h3.147v-2.3161h-3.147V8.11242h-2.764v3.41788Z"
fill="currentColor"
/>
</svg>
</template>
30 changes: 15 additions & 15 deletions docs/components/content/MyButton.vue
Expand Up @@ -14,19 +14,19 @@ defineProps({
</template>

<style scoped>
button {
padding: .5rem;
border-radius: 4px;
color: #000;
}
.info {
background-color: blue
}
.warning {
background-color: orange
}
.success {
background-color: rgb(209, 250, 229);
border: 1px solid rgb(52, 211, 153)
}
button {
padding: 0.5rem;
border-radius: 4px;
color: #000;
}
.info {
background-color: blue;
}
.warning {
background-color: orange;
}
.success {
background-color: rgb(209, 250, 229);
border: 1px solid rgb(52, 211, 153);
}
</style>
3 changes: 1 addition & 2 deletions docs/components/content/PackageGrid.vue
@@ -1,5 +1,4 @@
<script lang="ts" setup>
</script>
<script lang="ts" setup></script>

<template>
<div>
Expand Down
9 changes: 6 additions & 3 deletions docs/components/content/PropInspector.vue
@@ -1,16 +1,19 @@
<script setup>
import { computed } from 'vue'
// eslint-disable-next-line vue/require-prop-types
const props = defineProps(['prop'])
const propType = computed(() => Array.isArray(props.prop) ? 'array' : typeof props.prop)
const propType = computed(() =>
Array.isArray(props.prop) ? 'array' : typeof props.prop
)
</script>

<template>
<pre>
Type: {{ propType }}
Value:
{{ prop }}
</pre>
</pre
>
</template>

<style scoped>
Expand Down
34 changes: 23 additions & 11 deletions docs/components/content/ReadMore.vue
@@ -1,13 +1,3 @@
<template>
<Alert>
<Icon class="inline-block w-5 h-5" name="heroicons-outline:information-circle" />
Read more in
<NuxtLink :to="link">
{{ computedTitle }}
</NuxtLink>.
</Alert>
</template>

<script setup lang="ts">
import { splitByCase, upperFirst } from 'scule'
Expand All @@ -23,7 +13,29 @@ const props = defineProps({
}
})
const createTitle = (title, link) => (title || link.split('/').filter(Boolean).map(part => splitByCase(part).map(p => upperFirst(p)).join(' ')).join(' > ').replace('Api', 'API'))
const createTitle = (title, link) =>
title ||
link
.split('/')
.filter(Boolean)
.map((part) =>
splitByCase(part)
.map((p) => upperFirst(p))
.join(' ')
)
.join(' > ')
.replace('Api', 'API')
const computedTitle = computed(() => createTitle(props.title, props.link))
</script>

<template>
<Alert>
<Icon
class="inline-block w-5 h-5"
name="heroicons-outline:information-circle"
/>
Read more in
<NuxtLink :to="link"> {{ computedTitle }} </NuxtLink>.
</Alert>
</template>
19 changes: 12 additions & 7 deletions docs/editor/Editor.vue
@@ -1,7 +1,3 @@
<template>
<Monaco :value="readOnly? modelValue : raw" :language="language" :read-only="readOnly" @change="update" />
</template>

<script setup lang="ts">
import Monaco from './Monaco.vue'
Expand All @@ -20,11 +16,20 @@ const props = defineProps({
}
})
const raw = ref(props.modelValue)
const emit = defineEmits(['update:modelValue'])
function update (content) {
const raw = ref(props.modelValue)
function update(content) {
emit('update:modelValue', content)
}
</script>

<template>
<Monaco
:value="readOnly ? modelValue : raw"
:language="language"
:read-only="readOnly"
@change="update"
/>
</template>
62 changes: 35 additions & 27 deletions docs/editor/Monaco.vue
@@ -1,49 +1,57 @@
<script setup lang="ts">
const props = defineProps<{
language: string
value: string
readOnly: boolean
}>()
const emit = defineEmits<(e: 'change', content: string) => void>()
const editorState = ref('loading')
const props = defineProps<{ language: string; value: string, readOnly: boolean }>()
const target = ref()
onMounted(
async () => {
try {
const { useMonaco } = await import('./useMonacoEditor')
onMounted(async () => {
try {
const { useMonaco } = await import('./useMonacoEditor')
const { setContent } = useMonaco(target, {
language: props.language,
code: props.value,
readOnly: props.readOnly,
onChanged (content: string) {
emit('change', content)
},
onDidCreateEditor () {
editorState.value = 'ready'
}
})
const { setContent } = useMonaco(target, {
language: props.language,
code: props.value,
readOnly: props.readOnly,
onChanged(content: string) {
emit('change', content)
},
onDidCreateEditor() {
editorState.value = 'ready'
}
})
watch(
() => props.value,
() => setContent(props.value)
)
watch(
() => props.value,
() => setContent(props.value)
)
emit('change', props.value)
} catch (_) {
editorState.value = 'error'
}
emit('change', props.value)
} catch (_) {
editorState.value = 'error'
}
)
})
</script>

<template>
<div class="relative h-full w-full">
<div v-if="editorState === 'loading'" class="absolute left-0 top-0 h-full w-full flex justify-center items-center">
<div
v-if="editorState === 'loading'"
class="absolute left-0 top-0 h-full w-full flex justify-center items-center"
>
<Alert type="primary">
<span>Editor is loading...</span>
<Icon name="file-icons:sandbox" class="ml-2 inline" />
</Alert>
</div>

<div v-else-if="editorState === 'error'" class="absolute left-0 top-0 h-full w-full flex justify-center items-center">
<div
v-else-if="editorState === 'error'"
class="absolute left-0 top-0 h-full w-full flex justify-center items-center"
>
<Alert type="warning">
<span>Error while loading editor!</span>
<Icon name="heroicons-outline:cog" class="inline ml-2" />
Expand Down

0 comments on commit c835143

Please sign in to comment.