fix: news feature security, accessibility, performance improvements

- DOMPurify strict allowlist with sandbox on iframes
- safeColor() CSS injection prevention for category_color
- URL validation (http/https) for images and links
- encodeURIComponent for slug in API calls
- Keyboard navigation on news cards (Enter/Space)
- aria-label, aria-pressed, type=button on all buttons
- 44px touch targets on remaining buttons
- memo() wrappers + stable callbacks (fewer re-renders)
- Canvas draw call batching (~75% reduction)
- TipTap extensions useMemo deps fix ([t] -> [])
- Featured image loading=eager fetchPriority=high (LCP)
- Unsafe Number(id) NaN guard
This commit is contained in:
Fringg
2026-03-23 11:09:52 +03:00
parent 99fc33625e
commit 74e6d52fee
11 changed files with 574 additions and 162 deletions

View File

@@ -18,7 +18,7 @@ export const newsApi = {
},
getArticle: async (slug: string): Promise<NewsArticle> => {
const response = await apiClient.get<NewsArticle>(`/cabinet/news/${slug}`);
const response = await apiClient.get<NewsArticle>(`/cabinet/news/${encodeURIComponent(slug)}`);
return response.data;
},