diff --git a/src/assets/icons/Icon32PauseCircle.svg b/src/assets/icons/Icon32PauseCircle.svg deleted file mode 100644 index d19c9adb..00000000 --- a/src/assets/icons/Icon32PauseCircle.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/assets/icons/Icon32PauseCircle.tsx b/src/assets/icons/Icon32PauseCircle.tsx new file mode 100644 index 00000000..abd1d01c --- /dev/null +++ b/src/assets/icons/Icon32PauseCircle.tsx @@ -0,0 +1,24 @@ +import { defineComponent, useId } from 'vue' + +type Props = { + withUnlistenedDot?: boolean +} + +export const Icon32PauseCircle = defineComponent((props) => { + const id = useId() + + return () => ( + + {!props.withUnlistenedDot && ( + + + + + )} + + {!props.withUnlistenedDot && } + + ) +}, { + props: ['withUnlistenedDot'] +}) diff --git a/src/assets/icons/Icon32PlayCircle.svg b/src/assets/icons/Icon32PlayCircle.svg deleted file mode 100644 index 0fcdf3d4..00000000 --- a/src/assets/icons/Icon32PlayCircle.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/assets/icons/Icon32PlayCircle.tsx b/src/assets/icons/Icon32PlayCircle.tsx new file mode 100644 index 00000000..9fbb83e2 --- /dev/null +++ b/src/assets/icons/Icon32PlayCircle.tsx @@ -0,0 +1,24 @@ +import { defineComponent, useId } from 'vue' + +type Props = { + withUnlistenedDot?: boolean +} + +export const Icon32PlayCircle = defineComponent((props) => { + const id = useId() + + return () => ( + + {!props.withUnlistenedDot && ( + + + + + )} + + {!props.withUnlistenedDot && } + + ) +}, { + props: ['withUnlistenedDot'] +}) diff --git a/src/assets/icons/index.ts b/src/assets/icons/index.ts index 0e16aa1b..d3295c97 100644 --- a/src/assets/icons/index.ts +++ b/src/assets/icons/index.ts @@ -28,7 +28,9 @@ export { default as Icon24ViewOutline } from './Icon24ViewOutline.svg' export { default as Icon24VolumeOutline } from './Icon24VolumeOutline.svg' export { default as Icon28DeleteOutline } from './Icon28DeleteOutline.svg' export { default as Icon32DonutCircleFillYellow } from './Icon32DonutCircleFillYellow.svg' -export { default as Icon32PauseCircle } from './Icon32PauseCircle.svg' -export { default as Icon32PlayCircle } from './Icon32PlayCircle.svg' + +export { Icon32PauseCircle } from './Icon32PauseCircle' +export { Icon32PlayCircle } from './Icon32PlayCircle' + export { default as Icon32Spinner } from './Icon32Spinner.svg' export { default as Icon44Spinner } from './Icon44Spinner.svg' diff --git a/src/converters/MessageConverter.ts b/src/converters/MessageConverter.ts index 7663e8a8..ba68ff3d 100644 --- a/src/converters/MessageConverter.ts +++ b/src/converters/MessageConverter.ts @@ -37,6 +37,7 @@ export function fromApiMessage(message: MessagesMessage): Message.Message { return { kind: 'Normal', text: message.text, + wasListened: message.was_listened ?? false, attaches: fromApiAttaches(message.attachments ?? []), replyMessage: message.reply_message && fromApiForeignMessage( message.reply_message, diff --git a/src/model/Message.ts b/src/model/Message.ts index 58a83eb4..531c6372 100644 --- a/src/model/Message.ts +++ b/src/model/Message.ts @@ -20,6 +20,7 @@ export interface Normal extends BaseMessage { kind: 'Normal' text: string attaches: Attach.Attaches + wasListened: boolean replyMessage?: Foreign forwardedMessages?: NonEmptyArray } @@ -33,7 +34,7 @@ export interface Expired extends BaseMessage { kind: 'Expired' } -export interface Foreign extends Omit { +export interface Foreign extends Omit { kind: 'Foreign' peerId?: Peer.Id cmid?: Cmid @@ -42,7 +43,7 @@ export interface Foreign extends Omit { +export interface Pinned extends Omit { kind: 'Pinned' isUnavailable: boolean } diff --git a/src/ui/messenger/ConvoMessage/ConvoMessage.tsx b/src/ui/messenger/ConvoMessage/ConvoMessage.tsx index aa9ab96c..42859e5e 100644 --- a/src/ui/messenger/ConvoMessage/ConvoMessage.tsx +++ b/src/ui/messenger/ConvoMessage/ConvoMessage.tsx @@ -43,7 +43,13 @@ export const ConvoMessage = defineComponent((props) => { )} {message.text && {message.text}} - {hasAttaches && } + {hasAttaches && ( + + )} {isEmpty && ( diff --git a/src/ui/messenger/attaches/AttachVoice/AttachVoice.tsx b/src/ui/messenger/attaches/AttachVoice/AttachVoice.tsx index cf77a26d..ed08a835 100644 --- a/src/ui/messenger/attaches/AttachVoice/AttachVoice.tsx +++ b/src/ui/messenger/attaches/AttachVoice/AttachVoice.tsx @@ -7,6 +7,7 @@ import './AttachVoice.css' type Props = { voice: Attach.Voice + wasListened?: boolean } export const AttachVoice = defineComponent((props) => { @@ -27,7 +28,7 @@ export const AttachVoice = defineComponent((props) => { }) const text = computed(() => { - if (props.voice.transcript && props.voice.transcript.trim() === '') { + if (!props.voice.transcript || props.voice.transcript.trim() === '') { return lang.use('me_voice_transcription_empty') } @@ -91,13 +92,17 @@ export const AttachVoice = defineComponent((props) => {
: } + icon={isPause.value + ? + : } /> +
((props) => {
{!isHiddenCollapse.value && (
-
{text.value}
@@ -133,5 +139,5 @@ export const AttachVoice = defineComponent((props) => {
) }, { - props: ['voice'] + props: ['voice', 'wasListened'] }) diff --git a/src/ui/messenger/attaches/Attaches.tsx b/src/ui/messenger/attaches/Attaches.tsx index 49be565f..b5eeddfd 100644 --- a/src/ui/messenger/attaches/Attaches.tsx +++ b/src/ui/messenger/attaches/Attaches.tsx @@ -1,5 +1,6 @@ import { defineComponent } from 'vue' import * as Attach from 'model/Attach' +import * as Message from 'model/Message' import { useEnv } from 'hooks' import { ClassName } from 'misc/utils' import { AttachVoice } from './AttachVoice/AttachVoice' @@ -11,6 +12,7 @@ import './Attaches.css' type Props = { attaches: Attach.Attaches + message?: Message.Normal class: ClassName } @@ -23,7 +25,9 @@ export const Attaches = defineComponent((props) => { {props.attaches.photos && } {props.attaches.links?.map((link) => )} {props.attaches.wall && } - {props.attaches.voice && } + {props.attaches.voice && ( + + )} {props.attaches.unknown?.map((unknown) => (
{lang.use('me_unknown_attach')} ({unknown.type}) @@ -32,5 +36,5 @@ export const Attaches = defineComponent((props) => {
) }, { - props: ['attaches', 'class'] + props: ['attaches', 'class', 'message'] }) diff --git a/src/ui/ui/ButtonIcon/ButtonIcon.css b/src/ui/ui/ButtonIcon/ButtonIcon.css index 1287c94a..d954cb7f 100644 --- a/src/ui/ui/ButtonIcon/ButtonIcon.css +++ b/src/ui/ui/ButtonIcon/ButtonIcon.css @@ -5,6 +5,7 @@ flex: none; position: relative; border-radius: 6px; + line-height: 0; transition: background-color var(--fastTransition), opacity var(--fastTransition); } diff --git a/vk.zip b/vk.zip new file mode 100644 index 00000000..fff35a5e Binary files /dev/null and b/vk.zip differ