mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-18 18:48:20 +00:00
[Glitch] chore(deps): update dependency typescript to ~5.9.0
Port cc54b33720 to glitch-soc
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: diondiondion <mail@diondiondion.com>
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
@@ -30,9 +30,12 @@ const Blurhash: React.FC<Props> = ({
|
|||||||
try {
|
try {
|
||||||
const pixels = decode(hash, width, height);
|
const pixels = decode(hash, width, height);
|
||||||
const ctx = canvas.getContext('2d');
|
const ctx = canvas.getContext('2d');
|
||||||
const imageData = new ImageData(pixels, width, height);
|
const imageData = ctx?.createImageData(width, height);
|
||||||
|
imageData?.data.set(pixels);
|
||||||
|
|
||||||
|
if (imageData) {
|
||||||
ctx?.putImageData(imageData, 0, 0);
|
ctx?.putImageData(imageData, 0, 0);
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Blurhash decoding failure', { err, hash });
|
console.error('Blurhash decoding failure', { err, hash });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ function isNodeLinkHashtag(element: Node): element is HTMLLinkElement {
|
|||||||
return (
|
return (
|
||||||
element instanceof HTMLAnchorElement &&
|
element instanceof HTMLAnchorElement &&
|
||||||
// it may be a <a> starting with a hashtag
|
// it may be a <a> starting with a hashtag
|
||||||
(element.textContent?.[0] === '#' ||
|
(element.textContent.startsWith('#') ||
|
||||||
// or a #<a>
|
// or a #<a>
|
||||||
element.previousSibling?.textContent?.[
|
element.previousSibling?.textContent?.[
|
||||||
element.previousSibling.textContent.length - 1
|
element.previousSibling.textContent.length - 1
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ export const EmbeddedStatusContent: React.FC<{
|
|||||||
link.setAttribute('title', `@${mention.get('acct')}`);
|
link.setAttribute('title', `@${mention.get('acct')}`);
|
||||||
link.setAttribute('href', `/@${mention.get('acct')}`);
|
link.setAttribute('href', `/@${mention.get('acct')}`);
|
||||||
} else if (
|
} else if (
|
||||||
link.textContent?.[0] === '#' ||
|
link.textContent.startsWith('#') ||
|
||||||
link.previousSibling?.textContent?.endsWith('#')
|
link.previousSibling?.textContent?.endsWith('#')
|
||||||
) {
|
) {
|
||||||
link.addEventListener(
|
link.addEventListener(
|
||||||
|
|||||||
@@ -54,9 +54,7 @@ export const Profile: React.FC<{
|
|||||||
me ? state.accounts.get(me) : undefined,
|
me ? state.accounts.get(me) : undefined,
|
||||||
);
|
);
|
||||||
const [displayName, setDisplayName] = useState(account?.display_name ?? '');
|
const [displayName, setDisplayName] = useState(account?.display_name ?? '');
|
||||||
const [note, setNote] = useState(
|
const [note, setNote] = useState(account ? unescapeHTML(account.note) : '');
|
||||||
account ? (unescapeHTML(account.note) ?? '') : '',
|
|
||||||
);
|
|
||||||
const [avatar, setAvatar] = useState<File>();
|
const [avatar, setAvatar] = useState<File>();
|
||||||
const [header, setHeader] = useState<File>();
|
const [header, setHeader] = useState<File>();
|
||||||
const [discoverable, setDiscoverable] = useState(
|
const [discoverable, setDiscoverable] = useState(
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ const EmbedModal: React.FC<{
|
|||||||
}
|
}
|
||||||
|
|
||||||
iframeDocument.open();
|
iframeDocument.open();
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
||||||
iframeDocument.write(data.html);
|
iframeDocument.write(data.html);
|
||||||
iframeDocument.close();
|
iframeDocument.close();
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ const isMentionClick = (element: HTMLAnchorElement) =>
|
|||||||
!element.classList.contains('hashtag');
|
!element.classList.contains('hashtag');
|
||||||
|
|
||||||
const isHashtagClick = (element: HTMLAnchorElement) =>
|
const isHashtagClick = (element: HTMLAnchorElement) =>
|
||||||
element.textContent?.[0] === '#' ||
|
element.textContent.startsWith('#') ||
|
||||||
element.previousSibling?.textContent?.endsWith('#');
|
element.previousSibling?.textContent?.endsWith('#');
|
||||||
|
|
||||||
export const useLinks = (skipHashtags?: boolean) => {
|
export const useLinks = (skipHashtags?: boolean) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user