Fix: css modulesを使うように
その他修正 Signed-off-by: mattyatea <mattyacocacora0@gmail.com>
This commit is contained in:
parent
28dd05216f
commit
1d30c51d77
|
@ -1 +1 @@
|
||||||
Subproject commit 0179793ec891856d6f37a3be16ba4c22f67a81b5
|
Subproject commit cf3ce27b2eb8417233072e3d6d2fb7c5356c2364
|
|
@ -18,20 +18,20 @@
|
||||||
<MkPagination ref="emojisPaginationComponent" :pagination="pagination" :displayLimit="100">
|
<MkPagination ref="emojisPaginationComponent" :pagination="pagination" :displayLimit="100">
|
||||||
<template #empty><span>{{ i18n.ts.noCustomEmojis }}</span></template>
|
<template #empty><span>{{ i18n.ts.noCustomEmojis }}</span></template>
|
||||||
<template #default="{items}">
|
<template #default="{items}">
|
||||||
<div class="ldhfsamy">
|
<div :class="$style.root">
|
||||||
<div v-for="emoji in items" :key="emoji.id">
|
<div v-for="emoji in items" :key="emoji.id">
|
||||||
<button v-if="emoji.request" class="emoji _panel _button emoji-request" :class="{ selected: selectedEmojis.includes(emoji.id) }" @click="selectMode ? toggleSelect(emoji) : edit(emoji)">
|
<button v-if="emoji.request" class="_panel _button" :class="[{ selected: selectedEmojis.includes(emoji.id) },$style.emoji,$style.emojirequest]" @click="selectMode ? toggleSelect(emoji) : edit(emoji)">
|
||||||
<img :src="emoji.url" class="img" :alt="emoji.name"/>
|
<img :src="emoji.url" class="img" :alt="emoji.name"/>
|
||||||
<div class="body">
|
<div class="body">
|
||||||
<div class="name _monospace">{{ emoji.name }}</div>
|
<div class="name _monospace">{{ emoji.name }}</div>
|
||||||
<div class="info">{{ emoji.category }}</div>
|
<div class="info">{{ emoji.category }}</div>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
<button v-else class="emoji _panel _button" :class="{ selected: selectedEmojis.includes(emoji.id) }" @click="selectMode ? toggleSelect(emoji) : edit(emoji)">
|
<button v-else class="_panel _button" :class="[{ selected: selectedEmojis.includes(emoji.id) },$style.emoji]" @click="selectMode ? toggleSelect(emoji) : edit(emoji)">
|
||||||
<img :src="emoji.url" class="img" :alt="emoji.name"/>
|
<img :src="emoji.url" :class="$style.img" :alt="emoji.name"/>
|
||||||
<div class="body">
|
<div :class="$style.body">
|
||||||
<div class="name _monospace">{{ emoji.name }}</div>
|
<div :class="$style.name" class="_monospace">{{ emoji.name }}</div>
|
||||||
<div class="info">{{ emoji.category }}</div>
|
<div :class="$style.info">{{ emoji.category }}</div>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -82,7 +82,7 @@ const toggleSelect = (emoji) => {
|
||||||
const edit = (emoji) => {
|
const edit = (emoji) => {
|
||||||
os.popup(defineAsyncComponent(() => import('@/components/MkEmojiEditDialog.vue')), {
|
os.popup(defineAsyncComponent(() => import('@/components/MkEmojiEditDialog.vue')), {
|
||||||
emoji: emoji,
|
emoji: emoji,
|
||||||
requestNow: false,
|
isRequest: false,
|
||||||
}, {
|
}, {
|
||||||
done: result => {
|
done: result => {
|
||||||
if (result.updated) {
|
if (result.updated) {
|
||||||
|
@ -171,13 +171,13 @@ const delBulk = async () => {
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" module>
|
||||||
.ldhfsamy {
|
.root {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
|
grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
|
||||||
grid-gap: var(--margin);
|
grid-gap: var(--margin);
|
||||||
|
}
|
||||||
div > .emoji {
|
.emoji {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 11px;
|
padding: 11px;
|
||||||
|
@ -192,32 +192,27 @@ const delBulk = async () => {
|
||||||
&.selected {
|
&.selected {
|
||||||
border-color: var(--accent);
|
border-color: var(--accent);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
> .img {
|
.img {
|
||||||
width: 42px;
|
width: 42px;
|
||||||
height: 42px;
|
height: 42px;
|
||||||
}
|
}
|
||||||
|
.body {
|
||||||
> .body {
|
|
||||||
padding: 0 0 0 8px;
|
padding: 0 0 0 8px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
}
|
||||||
> .name {
|
.name {
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
> .info {
|
.info {
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
.emojirequest {
|
||||||
.emoji-request {
|
|
||||||
--c: rgb(255 196 0 / 15%);;
|
--c: rgb(255 196 0 / 15%);;
|
||||||
background-image: linear-gradient(45deg,var(--c) 16.67%,transparent 16.67%,transparent 50%,var(--c) 50%,var(--c) 66.67%,transparent 66.67%,transparent 100%);
|
background-image: linear-gradient(45deg,var(--c) 16.67%,transparent 16.67%,transparent 50%,var(--c) 50%,var(--c) 66.67%,transparent 66.67%,transparent 100%);
|
||||||
background-size: 16px 16px;
|
background-size: 16px 16px;
|
||||||
|
|
|
@ -11,12 +11,12 @@
|
||||||
<MkPagination :pagination="remotePagination">
|
<MkPagination :pagination="remotePagination">
|
||||||
<template #empty><span>{{ i18n.ts.noCustomEmojis }}</span></template>
|
<template #empty><span>{{ i18n.ts.noCustomEmojis }}</span></template>
|
||||||
<template #default="{items}">
|
<template #default="{items}">
|
||||||
<div class="ldhfsamy">
|
<div :class="$style.root">
|
||||||
<div v-for="emoji in items" :key="emoji.id" class="emoji _panel _button" @click="remoteMenu(emoji, $event)">
|
<div v-for="emoji in items" :key="emoji.id" :class="$style.emoji" class="_panel _button" @click="remoteMenu(emoji, $event)">
|
||||||
<img :src="`/emoji/${emoji.name}@${emoji.host}.webp`" class="img" :alt="emoji.name"/>
|
<img :src="`/emoji/${emoji.name}@${emoji.host}.webp`" :class="$style.img" :alt="emoji.name"/>
|
||||||
<div class="body">
|
<div :class="$style.body">
|
||||||
<div class="name _monospace">{{ emoji.name }}</div>
|
<div :class="$style.name" class="_monospace">{{ emoji.name }}</div>
|
||||||
<div class="info">{{ emoji.host }}</div>
|
<div :class="$style.info">{{ emoji.host }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -62,18 +62,16 @@ const remoteMenu = (emoji, ev: MouseEvent) => {
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" module>
|
||||||
.empty {
|
|
||||||
margin: var(--margin);
|
|
||||||
}
|
|
||||||
|
|
||||||
.ldhfsamy {
|
.root {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
|
grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
|
||||||
grid-gap: 12px;
|
grid-gap: 12px;
|
||||||
margin: var(--margin) 0;
|
margin: var(--margin) 0;
|
||||||
|
}
|
||||||
|
|
||||||
> .emoji {
|
.emoji {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
|
@ -82,29 +80,27 @@ const remoteMenu = (emoji, ev: MouseEvent) => {
|
||||||
&:hover {
|
&:hover {
|
||||||
color: var(--accent);
|
color: var(--accent);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
> .img {
|
.img {
|
||||||
width: 32px;
|
width: 32px;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
> .body {
|
.body {
|
||||||
padding: 0 0 0 8px;
|
padding: 0 0 0 8px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
}
|
||||||
> .name {
|
.name {
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
> .info {
|
.info {
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
font-size: 90%;
|
font-size: 90%;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -2,33 +2,31 @@
|
||||||
<MkPagination ref="emojisRequestPaginationComponent" :pagination="paginationRequest">
|
<MkPagination ref="emojisRequestPaginationComponent" :pagination="paginationRequest">
|
||||||
<template #empty><span>{{ i18n.ts.noCustomEmojis }}</span></template>
|
<template #empty><span>{{ i18n.ts.noCustomEmojis }}</span></template>
|
||||||
<template #default="{items}">
|
<template #default="{items}">
|
||||||
<div class="ldhfsamy">
|
|
||||||
<template v-for="emoji in items" :key="emoji.id">
|
<template v-for="emoji in items" :key="emoji.id">
|
||||||
<div class="emoji _panel">
|
<div :class="$style.emoji" class="_panel">
|
||||||
<div class="img">
|
<div :class="$style.img">
|
||||||
<div class="imgLight"><img :src="emoji.url" :alt="emoji.name"/></div>
|
<div :class="$style.imgLight"><img :src="emoji.url" :alt="emoji.name"/></div>
|
||||||
<div class="imgDark"><img :src="emoji.url" :alt="emoji.name"/></div>
|
<div :class="$style.imgDark"><img :src="emoji.url" :alt="emoji.name"/></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="info">
|
<div :class="$style.info">
|
||||||
<div class="name">{{ i18n.ts.name }}: {{ emoji.name }}</div>
|
<div :class="$style.name">{{ i18n.ts.name }}: {{ emoji.name }}</div>
|
||||||
<div class="category">{{ i18n.ts.category }}:{{ emoji.category }}</div>
|
<div :class="$style.category">{{ i18n.ts.category }}:{{ emoji.category }}</div>
|
||||||
<div class="aliases">{{ i18n.ts.tags }}:{{ emoji.aliases.join(' ') }}</div>
|
<div :class="$style.aliases">{{ i18n.ts.tags }}:{{ emoji.aliases.join(' ') }}</div>
|
||||||
<div class="license">{{ i18n.ts.license }}:{{ emoji.license }}</div>
|
<div :class="$style.license">{{ i18n.ts.license }}:{{ emoji.license }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="edit-button">
|
<div :class="$style.editbutton">
|
||||||
<MkButton primary class="edit" @click="editRequest(emoji)">
|
<MkButton primary :class="$style.edit" @click="editRequest(emoji)">
|
||||||
{{ i18n.ts.edit }}
|
{{ i18n.ts.edit }}
|
||||||
</MkButton>
|
</MkButton>
|
||||||
<MkButton class="request" @click="unrequested(emoji)">
|
<MkButton :class="$style.request" @click="unrequested(emoji)">
|
||||||
{{ i18n.ts.approve }}
|
{{ i18n.ts.approve }}
|
||||||
</MkButton>
|
</MkButton>
|
||||||
<MkButton danger class="delete" @click="deleteRequest(emoji)">
|
<MkButton danger :class="$style.delete" @click="deleteRequest(emoji)">
|
||||||
{{ i18n.ts.delete }}
|
{{ i18n.ts.delete }}
|
||||||
</MkButton>
|
</MkButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
</MkPagination>
|
</MkPagination>
|
||||||
</template>
|
</template>
|
||||||
|
@ -52,12 +50,10 @@ const paginationRequest = {
|
||||||
})),
|
})),
|
||||||
};
|
};
|
||||||
|
|
||||||
const editRequest = (emoji) => {
|
function editRequest(emoji) {
|
||||||
emoji.requestNow = true;
|
|
||||||
os.popup(defineAsyncComponent(() => import('@/components/MkEmojiEditDialog.vue')), {
|
os.popup(defineAsyncComponent(() => import('@/components/MkEmojiEditDialog.vue')), {
|
||||||
emoji: emoji,
|
emoji: emoji,
|
||||||
requestNow: false,
|
isRequest: true,
|
||||||
isRequestEdit: true,
|
|
||||||
}, {
|
}, {
|
||||||
done: result => {
|
done: result => {
|
||||||
if (result.updated) {
|
if (result.updated) {
|
||||||
|
@ -72,7 +68,7 @@ const editRequest = (emoji) => {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}, 'closed');
|
}, 'closed');
|
||||||
};
|
}
|
||||||
|
|
||||||
async function unrequested(emoji) {
|
async function unrequested(emoji) {
|
||||||
const { canceled } = await os.confirm({
|
const { canceled } = await os.confirm({
|
||||||
|
@ -113,103 +109,90 @@ async function deleteRequest(emoji) {
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" module>
|
||||||
.empty {
|
.emoji {
|
||||||
margin: var(--margin);
|
|
||||||
}
|
|
||||||
|
|
||||||
.ldhfsamy {
|
|
||||||
> .emoji {
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 11px;
|
padding: 11px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
border: solid 1px var(--panel);
|
border: solid 1px var(--panel);
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
|
}
|
||||||
> .img {
|
.img {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-row: 1;
|
grid-row: 1;
|
||||||
grid-column: 1/ span 2;
|
grid-column: 1/ span 2;
|
||||||
grid-template-columns: 50% 50%;
|
grid-template-columns: 50% 50%;
|
||||||
place-content: center;
|
place-content: center;
|
||||||
place-items: center;
|
place-items: center;
|
||||||
|
}
|
||||||
> .imgLight {
|
.imgLight {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-column: 1;
|
grid-column: 1;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
> img {
|
img {
|
||||||
max-height: 64px;
|
max-height: 64px;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.imgDark {
|
||||||
> .imgDark {
|
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-column: 2;
|
grid-column: 2;
|
||||||
background-color: #000;
|
background-color: #000;
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
> img {
|
img {
|
||||||
max-height: 64px;
|
max-height: 64px;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
.info {
|
||||||
|
|
||||||
> .info {
|
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-row: 2;
|
grid-row: 2;
|
||||||
grid-template-rows: 30px 30px 30px;
|
grid-template-rows: 30px 30px 30px;
|
||||||
|
}
|
||||||
> .name {
|
.name {
|
||||||
grid-row: 1;
|
grid-row: 1;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
> .category {
|
.category {
|
||||||
grid-row: 2;
|
grid-row: 2;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
> .aliases {
|
.aliases {
|
||||||
grid-row: 3;
|
grid-row: 3;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
> .license {
|
.license {
|
||||||
grid-row: 4;
|
grid-row: 4;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
}
|
.editbutton {
|
||||||
|
|
||||||
> .edit-button {
|
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-rows: 42px;
|
grid-template-rows: 42px;
|
||||||
margin-top: 6px;
|
margin-top: 6px;
|
||||||
|
}
|
||||||
> .edit {
|
.edit {
|
||||||
grid-row: 1;
|
grid-row: 1;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 6px 0;
|
margin: 6px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
> .request {
|
.request {
|
||||||
grid-row: 2;
|
grid-row: 2;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 6px 0;
|
margin: 6px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
> .delete {
|
.delete {
|
||||||
grid-row: 3;
|
grid-row: 3;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 6px 0;
|
margin: 6px 0;
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -11,7 +11,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
@closed="$emit('closed')"
|
@closed="$emit('closed')"
|
||||||
>
|
>
|
||||||
<template v-if="emoji" #header>:{{ emoji.name }}:</template>
|
<template v-if="emoji" #header>:{{ emoji.name }}:</template>
|
||||||
<template v-else-if="requestNow" #header>{{ i18n.ts.requestCustomEmojis }}</template>
|
<template v-else-if="isRequest && !emoji" #header>{{ i18n.ts.requestCustomEmojis }}</template>
|
||||||
<template v-else #header>New emoji</template>
|
<template v-else #header>New emoji</template>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
@ -46,7 +46,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<MkInput v-model="license">
|
<MkInput v-model="license">
|
||||||
<template #label>{{ i18n.ts.license }}</template>
|
<template #label>{{ i18n.ts.license }}</template>
|
||||||
</MkInput>
|
</MkInput>
|
||||||
<MkFolder v-if="!requestNow && !isRequestEdit">
|
<MkFolder v-if="!isRequest">
|
||||||
<template #label>{{ i18n.ts.rolesThatCanBeUsedThisEmojiAsReaction }}</template>
|
<template #label>{{ i18n.ts.rolesThatCanBeUsedThisEmojiAsReaction }}</template>
|
||||||
<template #suffix>{{ rolesThatCanBeUsedThisEmojiAsReaction.length === 0 ? i18n.ts.all : rolesThatCanBeUsedThisEmojiAsReaction.length }}</template>
|
<template #suffix>{{ rolesThatCanBeUsedThisEmojiAsReaction.length === 0 ? i18n.ts.all : rolesThatCanBeUsedThisEmojiAsReaction.length }}</template>
|
||||||
|
|
||||||
|
@ -65,14 +65,11 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</MkFolder>
|
</MkFolder>
|
||||||
<MkSwitch v-model="isSensitive">isSensitive</MkSwitch>
|
<MkSwitch v-model="isSensitive">isSensitive</MkSwitch>
|
||||||
<MkSwitch v-model="localOnly">{{ i18n.ts.localOnly }}</MkSwitch>
|
<MkSwitch v-model="localOnly">{{ i18n.ts.localOnly }}</MkSwitch>
|
||||||
<MkSwitch v-if="!requestNow" v-model="isRequest" :disabled="requestNow">
|
|
||||||
{{ i18n.ts.requestPending }}
|
|
||||||
</MkSwitch>
|
|
||||||
</div>
|
</div>
|
||||||
</MkSpacer>
|
</MkSpacer>
|
||||||
<div :class="$style.footer">
|
<div :class="$style.footer">
|
||||||
<div :class="$style.footerButtons">
|
<div :class="$style.footerButtons">
|
||||||
<MkButton v-if="!requestNow" danger rounded style="margin: 0 auto;" @click="del()"><i class="ti ti-trash"></i> {{ i18n.ts.delete }}</MkButton>
|
<MkButton v-if="!isRequest" danger rounded style="margin: 0 auto;" @click="del()"><i class="ti ti-trash"></i> {{ i18n.ts.delete }}</MkButton>
|
||||||
<MkButton v-if="validation" primary rounded style="margin: 0 auto;" @click="done"><i class="ti ti-check"></i> {{ props.emoji ? i18n.ts.update : i18n.ts.create }}</MkButton>
|
<MkButton v-if="validation" primary rounded style="margin: 0 auto;" @click="done"><i class="ti ti-check"></i> {{ props.emoji ? i18n.ts.update : i18n.ts.create }}</MkButton>
|
||||||
<MkButton v-else rounded style="margin: 0 auto;"><i class="ti ti-check"></i> {{ props.emoji ? i18n.ts.update : i18n.ts.create }}</MkButton>
|
<MkButton v-else rounded style="margin: 0 auto;"><i class="ti ti-check"></i> {{ props.emoji ? i18n.ts.update : i18n.ts.create }}</MkButton>
|
||||||
</div>
|
</div>
|
||||||
|
@ -99,8 +96,7 @@ import MkRolePreview from '@/components/MkRolePreview.vue';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
emoji?: any,
|
emoji?: any,
|
||||||
requestNow: boolean,
|
isRequest: boolean,
|
||||||
isRequestEdit?: boolean,
|
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
let dialog = $ref(null);
|
let dialog = $ref(null);
|
||||||
|
@ -114,14 +110,12 @@ let roleIdsThatCanBeUsedThisEmojiAsReaction = $ref((props.emoji && props.emoji.r
|
||||||
let rolesThatCanBeUsedThisEmojiAsReaction = $ref([]);
|
let rolesThatCanBeUsedThisEmojiAsReaction = $ref([]);
|
||||||
let file = $ref<Misskey.entities.DriveFile>();
|
let file = $ref<Misskey.entities.DriveFile>();
|
||||||
let chooseFile: DriveFile|null = $ref(null);
|
let chooseFile: DriveFile|null = $ref(null);
|
||||||
let requestNow = $ref(props.requestNow);
|
let isRequest = $ref(props.isRequest ?? false);
|
||||||
let isRequestEdit = $ref(props.isRequestEdit ?? false);
|
|
||||||
let isRequest = $ref(!!(isRequestEdit || props.requestNow));
|
|
||||||
watch($$(roleIdsThatCanBeUsedThisEmojiAsReaction), async () => {
|
watch($$(roleIdsThatCanBeUsedThisEmojiAsReaction), async () => {
|
||||||
rolesThatCanBeUsedThisEmojiAsReaction = (await Promise.all(roleIdsThatCanBeUsedThisEmojiAsReaction.map((id) => os.api('admin/roles/show', { roleId: id }).catch(() => null)))).filter(x => x != null);
|
rolesThatCanBeUsedThisEmojiAsReaction = (await Promise.all(roleIdsThatCanBeUsedThisEmojiAsReaction.map((id) => os.api('admin/roles/show', { roleId: id }).catch(() => null)))).filter(x => x != null);
|
||||||
}, { immediate: true });
|
}, { immediate: true });
|
||||||
|
|
||||||
const imgUrl = computed(() => file ? file.url : props.emoji && !isRequestEdit ? `/emoji/${props.emoji.name}.webp` : props.emoji && props.emoji.url ? props.emoji.url : null);
|
const imgUrl = computed(() => file ? file.url : props.emoji && !isRequest ? `/emoji/${props.emoji.name}.webp` : props.emoji && props.emoji.url ? props.emoji.url : null);
|
||||||
const validation = computed(() => {
|
const validation = computed(() => {
|
||||||
return name.match(/^[a-zA-Z0-9_]+$/) && imgUrl.value != null;
|
return name.match(/^[a-zA-Z0-9_]+$/) && imgUrl.value != null;
|
||||||
});
|
});
|
||||||
|
@ -171,7 +165,7 @@ async function done() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (props.emoji) {
|
if (props.emoji) {
|
||||||
if (isRequestEdit) {
|
if (isRequest) {
|
||||||
await os.apiWithDialog('admin/emoji/update-request', {
|
await os.apiWithDialog('admin/emoji/update-request', {
|
||||||
id: props.emoji.id,
|
id: props.emoji.id,
|
||||||
...params,
|
...params,
|
||||||
|
|
|
@ -98,7 +98,7 @@ function search() {
|
||||||
|
|
||||||
const edit = () => {
|
const edit = () => {
|
||||||
os.popup(defineAsyncComponent(() => import('@/components/MkEmojiEditDialog.vue')), {
|
os.popup(defineAsyncComponent(() => import('@/components/MkEmojiEditDialog.vue')), {
|
||||||
requestNow: true,
|
isRequest: true,
|
||||||
}, {
|
}, {
|
||||||
done: result => {
|
done: result => {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
|
|
|
@ -319,7 +319,6 @@ export type CustomEmoji = {
|
||||||
url: string;
|
url: string;
|
||||||
category: string;
|
category: string;
|
||||||
aliases: string[];
|
aliases: string[];
|
||||||
Request: boolean;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export type LiteInstanceMetadata = {
|
export type LiteInstanceMetadata = {
|
||||||
|
|
Loading…
Reference in New Issue