import { posts, tags } from '@wix/blog'; import { AsChildChildren } from '@wix/headless-utils/react'; import React from 'react'; import type { PostWithResolvedFields } from '../services/blog-feed-service.js'; import type { members } from '@wix/members'; import { type BlogPostServiceConfig } from '../services/blog-post-service.js'; import type { CommentsServiceConfig } from '../services/comments-service.js'; interface PostContextValue { post: PostWithResolvedFields | null; coverImageUrl?: string; olderPost?: PostWithResolvedFields; newerPost?: PostWithResolvedFields; } export declare function usePostContext(): PostContextValue; export interface BlogPostRootProps { asChild?: boolean; className?: string; children: AsChildChildren<{ post: PostWithResolvedFields; }> | React.ReactNode; post?: PostWithResolvedFields; blogPostServiceConfig?: BlogPostServiceConfig; /** Fallback image url to use when the post cover image is not available */ fallbackImageUrl?: string; /** Content to render when no post is available */ emptyState?: React.ReactNode; } /** * Root container for blog post that provides post context to all child components. * Supports both service-driven and prop-driven post data. * Follows Container Level pattern from architecture rules. * * @component * @example * ```tsx * import { Blog } from '@wix/blog/components'; * import { RicosViewer } from '@/components/ui/ricos-viewer'; * * // Service-driven (gets post from BlogPostService) * function BlogPostPage() { * return ( * Post not found}> * * * * * {RicosViewer} * * * * * * * * * * * * * * ); * } * * // Prop-driven (provide post data directly) * function BlogPostCard({ post }) { * return ( * Post not found}> * * ... same as service-driven example * * * ); * } * ``` */ export declare const Root: React.ForwardRefExoticComponent>; export interface CoverImageProps { asChild?: boolean; className?: string; children?: AsChildChildren<{ imageUrl: string; alt: string; }> | React.ReactNode; } export declare const CoverImage: React.ForwardRefExoticComponent>; export interface LinkProps { asChild?: boolean; className?: string; /** Prepended to the slug to form the full URL */ baseUrl?: string; children?: AsChildChildren<{ href: string; slug: string; }> | React.ReactNode; } /** * Creates a link to the full blog post with customizable rendering. * * @component * @example * ```tsx * // Default link * * * // Custom rendering with asChild * * {({ href }) => ( * * * * * )} * * ``` */ export declare const Link: React.ForwardRefExoticComponent>; export interface ExcerptProps { asChild?: boolean; className?: string; children?: AsChildChildren<{ excerpt: string; }> | React.ReactNode; } /** * Displays the post excerpt within feed context. * * @component * @example * ```tsx * // Default rendering * * * // Custom styling with line clamping * * * // Custom rendering with asChild * * {({ excerpt }) => ( * {excerpt.substring(0, 100)}... * )} * * ``` */ export declare const Excerpt: React.ForwardRefExoticComponent>; export interface TitleProps { asChild?: boolean; className?: string; children?: AsChildChildren<{ title: string; }> | React.ReactNode; } /** * Displays the blog post title with customizable rendering. * * @component * @example * ```tsx * // Default rendering * * * // Custom styling * * * // Custom rendering with asChild * * {({ title }) => {title}} * * ``` */ export declare const Title: React.ForwardRefExoticComponent>; export interface ContentProps { className?: string; children: AsChildChildren<{ content: any; pricingPlanIds: string[]; }> | React.ReactElement<{ content: any; }>; } /** * Exposes blog post rich content, only available if `blogPostServiceConfig` is provided to `Blog.Post.Root`. Use `Blog.Post.Excerpt` to display the post excerpt otherwise. * * @component * @example * ```tsx * import { RicosViewer } from '@/components/ui/ricos-viewer'; * * // Default rendering with built-in Ricos viewer * * {RicosViewer} * * * // Custom styling * * {RicosViewer} * * * // Custom rendering with asChild * * {({ content }) => ( * * * * )} * * ``` */ export declare const Content: React.ForwardRefExoticComponent>; export interface PublishDateProps { asChild?: boolean; className?: string; locale?: Intl.LocalesArgument; children?: AsChildChildren<{ publishDate: string; formattedDate: string; }> | React.ReactNode; } /** * Displays the blog post publish date with localization support. * * @component * @example * ```tsx * // Default rendering * * * // Custom styling and locale * * * // Custom rendering with asChild * * {({ formattedDate, publishDate }) => ( * * Published on {formattedDate} * * )} * * ``` */ export declare const PublishDate: React.ForwardRefExoticComponent>; export interface ReadingTimeProps { asChild?: boolean; className?: string; children?: AsChildChildren<{ readingTime: number; }> | React.ReactNode; } export declare const ReadingTime: React.ForwardRefExoticComponent>; interface PostCategoriesContextValue { categories: posts.Category[]; } export declare function usePostCategoriesContext(): PostCategoriesContextValue; interface CategoryRepeaterContextValue { category: posts.Category; index: number; amount: number; } export declare function useCategoryRepeaterContext(): CategoryRepeaterContextValue; interface PostTagsContextValue { tags: tags.BlogTag[]; } export declare function usePostTagsContext(): PostTagsContextValue; interface TagRepeaterContextValue { tag: tags.BlogTag; index: number; amount: number; } export declare function useTagRepeaterContext(): TagRepeaterContextValue; export interface CategoryItemsProps { className?: string; children: React.ReactNode; } /** * Container for post categories that provides categories context to all child components. * Does not render if no categories are available. * Follows Container Level pattern from architecture rules. * * @component * @example * ```tsx * * * * * * ``` */ export declare const CategoryItems: React.ForwardRefExoticComponent>; export interface TagItemsProps { className?: string; children: React.ReactNode; } /** * Container for post tags that provides tags context to all child components. * Does not render if no tags are available. * Follows Container Level pattern from architecture rules. * * @component * @example * ```tsx * * * * * * ``` */ export declare const TagItems: React.ForwardRefExoticComponent>; export interface TagItemRepeaterProps { children: React.ReactNode; } /** * Repeater component that creates individual tag contexts for each tag. * Follows Repeater Level pattern from architecture rules. * Note: Repeater components do NOT support asChild as per architecture rules. * * @component * @example * ```tsx * * * * * * ``` */ export declare const TagItemRepeater: React.ForwardRefExoticComponent>; export interface AuthorProps { asChild?: boolean; className?: string; children?: AsChildChildren<{ author: members.Member | null | undefined; }> | React.ReactNode; } export declare const Author: React.ForwardRefExoticComponent>; export interface SiblingPostsRootProps { className?: string; children?: React.ReactNode; } export interface SiblingPostNextProps { className?: string; children?: React.ReactNode; } export interface SiblingPostOlderProps { className?: string; children?: React.ReactNode; } export declare const SiblingPosts: { Root: React.ForwardRefExoticComponent>; Newer: React.ForwardRefExoticComponent>; Older: React.ForwardRefExoticComponent>; }; interface CommentsProps { currentMember: unknown; commentsServiceConfig?: Omit; className?: string; children: React.ReactNode; } /** * Renders `Comments.Root` linked to post. Doesn't render anything if post has no comment support (is under a paywall or commenting is disabled). * @example * ```tsx * * * * * * * * ``` */ export declare const Comments: React.ForwardRefExoticComponent>; export {};
{excerpt.substring(0, 100)}...