Merge commit '0219b7cad7d9ef800f82cc561571b70da040433f' into glitch-soc/merge-upstream
This commit is contained in:
commit
ee88f8550c
11 files changed
+224
-8
No files matched your search
@@ -1,6 +1,7 @@
|
||||
import { createRoot } from 'react-dom/client';
|
||||
|
||||
import Rails from '@rails/ujs';
|
||||
import { decode, ValidationError } from 'blurhash';
|
||||
|
||||
import ready from '../mastodon/ready';
|
||||
|
||||
@@ -362,6 +363,46 @@ ready(() => {
|
||||
document.querySelectorAll('[data-admin-component]').forEach((element) => {
|
||||
void mountReactComponent(element);
|
||||
});
|
||||
|
||||
document
|
||||
.querySelectorAll<HTMLCanvasElement>('canvas[data-blurhash]')
|
||||
.forEach((canvas) => {
|
||||
const blurhash = canvas.dataset.blurhash;
|
||||
if (blurhash) {
|
||||
try {
|
||||
// decode returns a Uint8ClampedArray<ArrayBufferLike> not Uint8ClampedArray<ArrayBuffer>
|
||||
const pixels = decode(
|
||||
blurhash,
|
||||
32,
|
||||
32,
|
||||
) as Uint8ClampedArray<ArrayBuffer>;
|
||||
const ctx = canvas.getContext('2d');
|
||||
const imageData = new ImageData(pixels, 32, 32);
|
||||
|
||||
ctx?.putImageData(imageData, 0, 0);
|
||||
} catch (err) {
|
||||
if (err instanceof ValidationError) {
|
||||
// ignore blurhash validation errors
|
||||
return;
|
||||
}
|
||||
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
document
|
||||
.querySelectorAll<HTMLDivElement>('.preview-card')
|
||||
.forEach((previewCard) => {
|
||||
const spoilerButton = previewCard.querySelector('.spoiler-button');
|
||||
if (!spoilerButton) {
|
||||
return;
|
||||
}
|
||||
|
||||
spoilerButton.addEventListener('click', () => {
|
||||
previewCard.classList.toggle('preview-card--image-visible');
|
||||
});
|
||||
});
|
||||
}).catch((reason: unknown) => {
|
||||
throw reason;
|
||||
});
|
||||
@@ -40,6 +40,9 @@
|
||||
"account.featured_tags.last_status_never": "Embann ebet",
|
||||
"account.follow": "Heuliañ",
|
||||
"account.follow_back": "Heuliañ d'ho tro",
|
||||
"account.follow_back_short": "Heuliañ d'ho tro",
|
||||
"account.follow_request": "Reked d'ho heuliañ",
|
||||
"account.follow_request_cancel": "Nullañ ar reked",
|
||||
"account.follow_request_cancel_short": "Nullañ",
|
||||
"account.followers": "Tud koumanantet",
|
||||
"account.followers.empty": "Den na heul an implijer·ez-mañ c'hoazh.",
|
||||
@@ -212,6 +215,7 @@
|
||||
"confirmations.missing_alt_text.secondary": "Embann memes tra",
|
||||
"confirmations.missing_alt_text.title": "Ouzhpennañ an eiltestenn?",
|
||||
"confirmations.mute.confirm": "Kuzhat",
|
||||
"confirmations.quiet_post_quote_info.got_it": "Mat eo",
|
||||
"confirmations.redraft.confirm": "Diverkañ ha skrivañ en-dro",
|
||||
"confirmations.redraft.title": "Diverkañ ha skrivañ an embann en-dro?",
|
||||
"confirmations.remove_from_followers.confirm": "Dilemel an heulier·ez",
|
||||
@@ -246,6 +250,7 @@
|
||||
"domain_block_modal.block_account_instead": "Stankañ @{name} kentoc'h",
|
||||
"domain_block_modal.title": "Stankañ an domani?",
|
||||
"domain_pill.server": "Dafariad",
|
||||
"domain_pill.their_handle": "H·ec'h anaouder:",
|
||||
"domain_pill.username": "Anv-implijer",
|
||||
"domain_pill.whats_in_a_handle": "Petra eo an anaouder?",
|
||||
"domain_pill.your_handle": "Hoc'h anaouder:",
|
||||
@@ -267,6 +272,7 @@
|
||||
"emoji_button.search_results": "Disoc'hoù an enklask",
|
||||
"emoji_button.symbols": "Arouezioù",
|
||||
"emoji_button.travel": "Beajiñ & Lec'hioù",
|
||||
"empty_column.account_featured_other.unknown": "N'eo ket bet lakaet netra en a-raok gant ar gont-mañ.",
|
||||
"empty_column.account_suspended": "Kont astalet",
|
||||
"empty_column.account_timeline": "Embannadur ebet amañ!",
|
||||
"empty_column.account_unavailable": "Profil dihegerz",
|
||||
@@ -493,6 +499,7 @@
|
||||
"notifications.column_settings.admin.sign_up": "Enskrivadurioù nevez :",
|
||||
"notifications.column_settings.alert": "Kemennoù war ar burev",
|
||||
"notifications.column_settings.favourite": "Muiañ-karet:",
|
||||
"notifications.column_settings.filter_bar.advanced": "Diskouez an holl rummadoù",
|
||||
"notifications.column_settings.follow": "Heulierien nevez:",
|
||||
"notifications.column_settings.follow_request": "Rekedoù heuliañ nevez:",
|
||||
"notifications.column_settings.group": "Strollañ",
|
||||
@@ -518,7 +525,7 @@
|
||||
"notifications.group": "{count} a gemennoù",
|
||||
"notifications.mark_as_read": "Merkañ an holl kemennoù evel bezañ lennet",
|
||||
"notifications.permission_denied": "Kemennoù war ar burev n'int ket hegerz rak pedadenn aotren ar merdeer a zo bet nullet araok",
|
||||
"notifications.permission_denied_alert": "Kemennoù wa ar burev na c'hellont ket bezañ lezelet, rak aotre ar merdeer a zo bet nac'het a-raok",
|
||||
"notifications.permission_denied_alert": "Kemennoù war ar burev na c'hellont ket bezañ lezelet, rak aotre ar merdeer a zo bet nac'het a-raok",
|
||||
"notifications.permission_required": "Kemennoù war ar burev n'int ket hegerz abalamour d'an aotre rekis n'eo ket bet roet.",
|
||||
"notifications.policy.accept": "Asantiñ",
|
||||
"notifications.policy.accept_hint": "Diskouez er c’hemennoù",
|
||||
|
||||
@@ -1962,7 +1962,6 @@ a.sparkline {
|
||||
.status__card {
|
||||
padding: 15px;
|
||||
border-radius: 4px;
|
||||
background: $ui-base-color;
|
||||
font-size: 15px;
|
||||
line-height: 20px;
|
||||
word-wrap: break-word;
|
||||
@@ -1981,8 +1980,105 @@ a.sparkline {
|
||||
.status__content {
|
||||
padding-top: 0;
|
||||
|
||||
summary {
|
||||
display: list-item;
|
||||
> details {
|
||||
summary {
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
background: var(--nested-card-background);
|
||||
color: var(--nested-card-text);
|
||||
border: var(--nested-card-border);
|
||||
border-radius: 8px;
|
||||
padding: 8px 13px;
|
||||
position: relative;
|
||||
font-size: 15px;
|
||||
line-height: 22px;
|
||||
cursor: pointer;
|
||||
|
||||
&::after {
|
||||
content: attr(data-show, 'Show more');
|
||||
margin-top: 8px;
|
||||
display: block;
|
||||
font-size: 15px;
|
||||
line-height: 20px;
|
||||
color: $highlight-text-color;
|
||||
cursor: pointer;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
padding: 0;
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
&:hover,
|
||||
&:focus-visible {
|
||||
&::after {
|
||||
text-decoration: underline !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&[open] summary {
|
||||
margin-bottom: 16px;
|
||||
|
||||
&::after {
|
||||
content: attr(data-hide, 'Hide post');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.preview-card {
|
||||
position: relative;
|
||||
max-width: 566px;
|
||||
|
||||
.status-card__image {
|
||||
&--video {
|
||||
aspect-ratio: 16 / 9;
|
||||
}
|
||||
|
||||
&--large {
|
||||
aspect-ratio: 1.91 / 1;
|
||||
}
|
||||
|
||||
aspect-ratio: 1;
|
||||
}
|
||||
|
||||
.spoiler-button__overlay__label {
|
||||
outline: 1px solid var(--media-outline-color);
|
||||
}
|
||||
|
||||
.hide-button {
|
||||
// Toggled to appear when the preview-card is unblurred:
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
right: 5px;
|
||||
color: $white;
|
||||
border: 0;
|
||||
outline: 1px solid var(--media-outline-color);
|
||||
background-color: color.change($black, $alpha: 0.45);
|
||||
backdrop-filter: $backdrop-blur-filter;
|
||||
padding: 3px 12px;
|
||||
border-radius: 99px;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
line-height: 20px;
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
background-color: color.change($black, $alpha: 0.9);
|
||||
}
|
||||
}
|
||||
|
||||
&.preview-card--image-visible {
|
||||
.hide-button {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.spoiler-button__overlay,
|
||||
.status-card__image-preview {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user