Skip to content

Commit

Permalink
fix(frontend-embed): 型チェックエラーを修正 (#15216)
Browse files Browse the repository at this point in the history
* fix(frontend): frontend / frontend-embedにあるtsconfig.jsonのmoduleをES2022にする

* fixed errors

* fixed errors

* fixed errors

* fix(frontend-embed): 型チェックエラーを修正
  • Loading branch information
samunohito authored Jan 8, 2025
1 parent bb44572 commit 13439e0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
2 changes: 0 additions & 2 deletions packages/frontend-embed/src/components/EmMfm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,6 @@ export default function (props: MfmProps, { emit }: { emit: SetupContext<MfmEven
return [h(EmEmoji, {
key: Math.random(),
emoji: token.props.emoji,
menu: props.enableEmojiMenu,
menuReaction: props.enableEmojiMenuReaction,
})];
}

Expand Down
3 changes: 2 additions & 1 deletion packages/frontend-embed/src/components/EmNotes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SPDX-License-Identifier: AGPL-3.0-only

<template #default="{ items: notes }">
<div :class="[$style.root]">
<EmNote v-for="note in notes" :key="note._featuredId_ || note._prId_ || note.id" :class="$style.note" :note="note"/>
<EmNote v-for="note in notes" :key="note._featuredId_ || note._prId_ || note.id" :class="$style.note" :note="note as Misskey.entities.Note"/>
</div>
</template>
</EmPagination>
Expand All @@ -24,6 +24,7 @@ import { useTemplateRef } from 'vue';
import EmNote from '@/components/EmNote.vue';
import EmPagination, { Paging } from '@/components/EmPagination.vue';
import { i18n } from '@/i18n.js';
import * as Misskey from 'misskey-js';

withDefaults(defineProps<{
pagination: Paging;
Expand Down
25 changes: 15 additions & 10 deletions packages/frontend-embed/src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,21 @@ function compile(theme: Theme): Record<string, string> {
return getColor(theme.props[val]);
} else if (val[0] === ':') { // func
const parts = val.split('<');
const func = parts.shift().substring(1);
const arg = parseFloat(parts.shift());
const color = getColor(parts.join('<'));

switch (func) {
case 'darken': return color.darken(arg);
case 'lighten': return color.lighten(arg);
case 'alpha': return color.setAlpha(arg);
case 'hue': return color.spin(arg);
case 'saturate': return color.saturate(arg);
const funcTxt = parts.shift();
const argTxt = parts.shift();

if (funcTxt && argTxt) {
const func = funcTxt.substring(1);
const arg = parseFloat(argTxt);
const color = getColor(parts.join('<'));

switch (func) {
case 'darken': return color.darken(arg);
case 'lighten': return color.lighten(arg);
case 'alpha': return color.setAlpha(arg);
case 'hue': return color.spin(arg);
case 'saturate': return color.saturate(arg);
}
}
}

Expand Down

0 comments on commit 13439e0

Please sign in to comment.