Skip to content

Commit

Permalink
style: fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
malkja committed Aug 7, 2024
1 parent 8839796 commit 8b57a8a
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 28 deletions.
41 changes: 29 additions & 12 deletions src/components/annotations/AnnotationVariantItem.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,41 @@
<template>
<div v-for="(variant, i) in annotation.body.value" :key="i" class="t-items-center t-flex t-mb-1 t-relative"
<div
v-for="(variant, i) in annotation.body.value"
:key="i"
class="t-items-center t-flex t-mb-1 t-relative"
:class="[
't-py-2 t-px-3 t-mb-1 t-rounded-md',
{ 'hover:t-bg-gray-200 dark:hover:t-bg-gray-600 t-cursor-pointer': !isText(annotation) && !isActive(annotation) },
{ 't-bg-gray-300 dark:t-bg-gray-600 active': isVariantItemActive(variant.witness)}]"
@click="isText(annotation) ? ()=>{} : handleClick(variant.witness, i)" :data-annotation-id="annotation.id">
<div class="t-relative t-rounded-3xl t-box-border t-w-75 t-h-8 t-border-2 t-p-[2px]" :style="{'border-color': getItemColorBasedOnIndex(i)}">
<span v-if="variant.witness" v-html="variant.witness" class="t-text-sm"/>
<span v-else class="t-text-sm"> - </span>
</div>
<span v-html="variant.entry" class="t-absolute t-right-[50%]"/>
't-py-2 t-px-3 t-mb-1 t-rounded-md',
{ 'hover:t-bg-gray-200 dark:hover:t-bg-gray-600 t-cursor-pointer': !isText(annotation) && !isActive(annotation) },
{ 't-bg-gray-300 dark:t-bg-gray-600 active': isVariantItemActive(variant.witness)}]"
:data-annotation-id="annotation.id"
@click="isText(annotation) ? ()=>{} : handleClick(variant.witness, i)"
>
<div
class="t-relative t-rounded-3xl t-box-border t-w-75 t-h-8 t-border-2 t-p-[2px]"
:style="{'border-color': getItemColorBasedOnIndex(i)}"
>
<span
v-if="variant.witness"
class="t-text-sm"
v-html="variant.witness"
/>
<span
v-else
class="t-text-sm"
> - </span>
</div>
<span
class="t-absolute t-right-[50%]"
v-html="variant.entry"
/>
</div>
</template>



<script setup lang="ts">
import { getItemColorBasedOnIndex } from '@/utils/color';
import { isReactive } from 'vue';
import { computed, reactive } from 'vue';
import { reactive } from 'vue';
import * as AnnotationUtils from '@/utils/annotations';
Expand Down
42 changes: 26 additions & 16 deletions src/components/annotations/AnnotationsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,33 @@
v-for="annotation in configuredAnnotations"
:key="annotation.id"
>
<div v-if="!isVariant(annotation)" class="t-flex t-items-center t-space-x-2 item" :class="[
't-py-2 t-px-3 t-mb-1 t-rounded-md',
{ 'hover:t-bg-gray-200 dark:hover:t-bg-gray-600 t-cursor-pointer': !isText(annotation) && !isActive(annotation) },
{ 't-bg-gray-300 dark:t-bg-gray-600 active': isActive(annotation) }]"
@click="isText(annotation) ? ()=>{} : toggle(annotation)" :data-annotation-id="annotation.id">
<AnnotationIcon
v-if="!isText(annotation)"
:name="getIconName(annotation.body['x-content-type'])"
/>
<span v-html="annotation.body.value"/>
</div>

<div v-else>
<AnnotationVariantItem :annotation="annotation" :isText="isText" :isActive="isActive" :toggle="toggle"/>
</div>
<div
v-if="!isVariant(annotation)"
class="t-flex t-items-center t-space-x-2 item"
:class="[
't-py-2 t-px-3 t-mb-1 t-rounded-md',
{ 'hover:t-bg-gray-200 dark:hover:t-bg-gray-600 t-cursor-pointer': !isText(annotation) && !isActive(annotation) },
{ 't-bg-gray-300 dark:t-bg-gray-600 active': isActive(annotation) }]"
:data-annotation-id="annotation.id"
@click="isText(annotation) ? ()=>{} : toggle(annotation)"
>
<AnnotationIcon
v-if="!isText(annotation)"
:name="getIconName(annotation.body['x-content-type'])"
/>
<span v-html="annotation.body.value" />
</div>

<div v-else>
<AnnotationVariantItem
:annotation="annotation"
:is-text="isText"
:is-active="isActive"
:toggle="toggle"
/>
</div>

<!-- eslint-disable -- https://eslint.vuejs.org/rules/no-v-html.html -->
<!-- eslint-disable -- https://eslint.vuejs.org/rules/no-v-html.html -->


</div>
Expand Down

0 comments on commit 8b57a8a

Please sign in to comment.