Headless helpers for the project's own <Media> (look stays in the project): - mediaImageProps: dimensions from the doc (no CLS), lazy by default, LCP image gets preload + fetchPriority=high + eager (Next 16 replaced 'priority'), focal point → object-position, blur placeholder + dominant colour. - MEDIA_SIZES suggestions for 'sizes' (any string still works). - videoProps: 'background' (muted loop, respects reduced motion) or 'player' (controls, preload=none, poster). - buildMediaPlaceholderHook/Field: tiny WebP blur + dominant colour at upload via the configured sharp (no new dependency). - buildImagesConfig: AVIF/WebP, R2 remotePatterns, 31-day cache. - <YouTubeEmbed> (/client): poster + button, youtube-nocookie iframe on click. - buildCsp youtube allows the i.ytimg.com poster. kod-sekcji Media template uses the helpers. Co-Authored-By: Claude Opus 5.5 <[email protected]>
7 lines
496 B
TypeScript
7 lines
496 B
TypeScript
export { MEDIA_SIZES, mediaImageProps, videoProps } from './mediaProps.js'
|
|
export type { MediaImageOptions, MediaImageProps, VideoMode, VideoProps } from './mediaProps.js'
|
|
export { normalizeFilename, normalizeFilenameHook } from './normalizeFilename.js'
|
|
export { buildOptimizeUploadField, buildOptimizeUploadHook } from './optimizeUpload.js'
|
|
export type { OptimizeUploadOptions } from './optimizeUpload.js'
|
|
export { buildMediaPlaceholderField, buildMediaPlaceholderHook } from './placeholder.js'
|