mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-06 07:20:29 +03:00
Add support for spoilers on images (MSC4193) (#2212)
* Add support for MSC4193: Spoilers on Media * Clarify variable names and wording * Restore list atom * Improve spoilered image UX with autoload off * Use `aria-pressed` to indicate attachment spoiler state * Improve spoiler button tooltip wording, keep reveal button from conflicting with load errors
This commit is contained in:
parent
7c6ab366af
commit
dd4c1a94e6
9 changed files with 158 additions and 19 deletions
|
|
@ -2,6 +2,8 @@ import { EncryptedAttachmentInfo } from 'browser-encrypt-attachment';
|
|||
import { MsgType } from 'matrix-js-sdk';
|
||||
|
||||
export const MATRIX_BLUR_HASH_PROPERTY_NAME = 'xyz.amorgan.blurhash';
|
||||
export const MATRIX_SPOILER_PROPERTY_NAME = 'page.codeberg.everypizza.msc4193.spoiler';
|
||||
export const MATRIX_SPOILER_REASON_PROPERTY_NAME = 'page.codeberg.everypizza.msc4193.spoiler.reason';
|
||||
|
||||
export type IImageInfo = {
|
||||
w?: number;
|
||||
|
|
@ -47,6 +49,8 @@ export type IImageContent = {
|
|||
url?: string;
|
||||
info?: IImageInfo & IThumbnailContent;
|
||||
file?: IEncryptedFile;
|
||||
[MATRIX_SPOILER_PROPERTY_NAME]?: boolean;
|
||||
[MATRIX_SPOILER_REASON_PROPERTY_NAME]?: string;
|
||||
};
|
||||
|
||||
export type IVideoContent = {
|
||||
|
|
@ -56,6 +60,8 @@ export type IVideoContent = {
|
|||
url?: string;
|
||||
info?: IVideoInfo & IThumbnailContent;
|
||||
file?: IEncryptedFile;
|
||||
[MATRIX_SPOILER_PROPERTY_NAME]?: boolean;
|
||||
[MATRIX_SPOILER_REASON_PROPERTY_NAME]?: string;
|
||||
};
|
||||
|
||||
export type IAudioContent = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue