@xexr/blog-platform 1.0.10 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { PublishedArticle, PublishedSite, PublishedAuthor, PublishResult, PublishedTopic } from './types/index.js';
1
+ import { PublishedArticle, PublishedSite, PublishedNewsletterSettings, PublishedAuthor, PublishResult, PublishedTopic } from './types/index.js';
2
2
  export { PublishPayload, PublishedAuthorSocialLinks } from './types/index.js';
3
- import * as react_jsx_runtime from 'react/jsx-runtime';
4
3
  import * as React from 'react';
5
4
  import { CSSProperties, ReactElement } from 'react';
5
+ import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import * as class_variance_authority_types from 'class-variance-authority/types';
7
7
  import { VariantProps } from 'class-variance-authority';
8
8
  import { ClassValue } from 'clsx';
@@ -42,61 +42,55 @@ declare function formatArticleDateMeta(publishedAt: string, updatedAt: string):
42
42
  declare function extractTableOfContents(markdown: string): TocItem[];
43
43
 
44
44
  interface BlogHomePageProps {
45
- articles: PublishedArticle[];
46
- siteName?: string;
47
- siteTagline?: string;
48
- className?: string;
49
- /** Site data for structured data generation */
50
- site?: PublishedSite;
51
- /** Whether to include structured data */
52
- includeStructuredData?: boolean;
53
- /** Public path where this blog is mounted, e.g. "/blog" or "/new-blog". */
54
- basePath?: string;
55
- /** Pagination configuration */
56
- pagination?: {
57
- currentPage: number;
58
- totalPages: number;
59
- baseUrl?: string;
60
- };
61
- /** Optional theme values for host-site brand integration. */
62
- theme?: BlogTheme;
45
+ articles: PublishedArticle[];
46
+ siteName?: string;
47
+ siteTagline?: string;
48
+ className?: string;
49
+ site?: PublishedSite;
50
+ includeStructuredData?: boolean;
51
+ basePath?: string;
52
+ pagination?: {
53
+ currentPage: number;
54
+ totalPages: number;
55
+ baseUrl?: string;
56
+ };
57
+ theme?: BlogTheme;
58
+ newsletter?: PublishedNewsletterSettings;
59
+ newsletterPreviewMode?: boolean;
63
60
  }
64
- /**
65
- * Blog home page component that displays a list of published articles.
66
- *
67
- * This component is designed to be used by customers who install the
68
- * @xexr/blog-platform package. It provides a clean, SEO-friendly
69
- * article listing with proper metadata.
70
- */
71
- declare function BlogHomePage({ articles, siteName, siteTagline, className, site, includeStructuredData, basePath, pagination, theme, }: BlogHomePageProps): react_jsx_runtime.JSX.Element;
72
- /**
73
- * Generate metadata for the blog home page for SEO optimization.
74
- * This function should be used in the Next.js metadata API.
75
- */
76
- declare function generateBlogHomeMetadata(siteName?: string, siteDescription?: string, siteUrl?: string, pagination?: {
61
+
62
+ declare function BlogHomePage(props: BlogHomePageProps): ReactElement;
63
+
64
+ declare function generateBlogHomeMetadata(
65
+ siteName?: string,
66
+ siteTagline?: string,
67
+ siteUrl?: string,
68
+ pagination?: {
77
69
  currentPage: number;
78
70
  totalPages: number;
79
- }, basePath?: string): {
71
+ },
72
+ basePath?: string,
73
+ ): {
74
+ title: string;
75
+ description: string;
76
+ openGraph: {
80
77
  title: string;
81
78
  description: string;
82
- openGraph: {
83
- url?: string | undefined;
84
- title: string;
85
- description: string;
86
- type: string;
87
- };
88
- twitter: {
89
- card: string;
90
- title: string;
91
- description: string;
92
- };
93
- alternates: {
94
- canonical?: string | undefined;
95
- };
96
- other: {
97
- next?: string | undefined;
98
- prev?: string | undefined;
99
- };
79
+ type: string;
80
+ url?: string;
81
+ };
82
+ twitter: {
83
+ card: string;
84
+ title: string;
85
+ description: string;
86
+ };
87
+ alternates: {
88
+ canonical?: string;
89
+ };
90
+ other: {
91
+ prev?: string;
92
+ next?: string;
93
+ };
100
94
  };
101
95
 
102
96
  interface ArticlePageProps {
@@ -128,6 +122,8 @@ interface ArticlePageProps {
128
122
  href: string;
129
123
  label: string;
130
124
  };
125
+ newsletter?: PublishedNewsletterSettings;
126
+ newsletterPreviewMode?: boolean;
131
127
  relatedArticles?: PublishedArticle[];
132
128
  showShareLinks?: boolean;
133
129
  }
@@ -419,6 +415,18 @@ interface BlogAuthorsIndexPageProps {
419
415
  }
420
416
  declare function BlogAuthorsIndexPage({ articles, basePath, title, description, className, theme, }: BlogAuthorsIndexPageProps): react_jsx_runtime.JSX.Element;
421
417
 
418
+ declare const NEWSLETTER_SUCCESS_MESSAGE = "Thanks, you're on the list. We'll confirm before sending updates.";
419
+ interface NewsletterSignupProps {
420
+ siteId: string;
421
+ settings: PublishedNewsletterSettings;
422
+ sourceSurface: "blog_home" | "article";
423
+ sourceArticleSlug?: string;
424
+ sourceUrl?: string;
425
+ previewMode?: boolean;
426
+ className?: string;
427
+ }
428
+ declare function NewsletterSignup({ siteId, settings, sourceSurface, sourceArticleSlug, sourceUrl, previewMode, className, }: NewsletterSignupProps): react_jsx_runtime.JSX.Element;
429
+
422
430
  /**
423
431
  * Authentication configuration interface
424
432
  * Customers can implement this to customize authentication behavior
@@ -456,6 +464,7 @@ interface AuthResult {
456
464
  /** Additional user/context information */
457
465
  context?: Record<string, unknown>;
458
466
  }
467
+ declare function createTokenFingerprint(token: string): string;
459
468
  /**
460
469
  * Default token extraction from Authorization header
461
470
  * Supports both "Bearer <token>" and "Token <token>" formats
@@ -2004,4 +2013,4 @@ declare function OPTIONS(request: NextRequest): Promise<NextResponse>;
2004
2013
 
2005
2014
  declare const PACKAGE_VERSION: string;
2006
2015
 
2007
- export { ApiKeyAuth, type AuthConfig, type AuthResult, type AuthorArchive, type AuthorArchiveOptions, ArticlePage as BlogArticlePage, AuthorPage as BlogAuthorPage, BlogAuthorsIndexPage, BlogHomePage, type BlogPlatformConfig, type BlogPlatformStorage, type BlogPostingSchema, type BlogSitemapConfig, type BlogTheme, BlogTopicArchivePage, BlogTopicsIndexPage, type BreadcrumbListSchema, Button, type CanonicalUrlOptions, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, DrizzleStorage, EnvAuth, type GeneratedMetadata, InMemoryStorage, type LinkTag, type MetaTag, type MetadataOptions, type NextjsSitemapEntry, NoAuth, type OrganizationSchema, PACKAGE_VERSION, Pagination$1 as Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, type PersonSchema, PublishResult, PublishedArticle, PublishedAuthor, PublishedSite, PublishedTopic, type RateLimitConfig, type RateLimitResult, Pagination as ShadcnPagination, type SitemapChangeFreq, type SitemapData, type SitemapEntry, type SitemapOptions, StructuredDataError, type StructuredDataOptions, type TopicArchive, UninitializedAuth, type WebSiteSchema, autoConfigureRateLimit, bpArticles, bpOperations, buildAuthorPath, buildBlogPath, buttonVariants, checkRateLimit, cn, configureRateLimit, createBlogSitemapRoute, createDynamicBlogSitemap, createRateLimitErrorResponse, createStructuredDataScript, enforceRateLimit, extractKeywordsFromArticle, extractTableOfContents, extractTokenFromHeader, formatArticleDateMeta, generateArticleMetadata, generateArticleStructuredData, generateAuthorPageMetadata, generateAuthorStructuredData, generateBlogHomeMetadata, generateBlogHomeStructuredData, generateBlogSitemapEntries, generateBreadcrumbStructuredData, generateCanonicalUrl, generateCanonicalUrlFromSlug, generateCompleteArticleStructuredData, generateOrganizationStructuredData, generatePaginationMetadata, generateSiteMetadata, generateSitemap, generateSitemapIndex, generateWebSiteStructuredData, getAllTopics, getArticlePrimaryTopic, getAuthConfig, getAuthorArchive, getAuthorsFromArticles, getBaseUrl, getBlogThemeStyle, getDrizzleAdapterSql, getPathPrefixFromBlogUrl, getRateLimitHeaders, getStorage, getTopicArchive, initBlogPlatform, initBlogPlatformDev, initBlogPlatformOnce, initBlogPlatformProd, initEnvAuth, isValidCanonicalUrl, loadAuthorArchive, metadataToHtml, normalizeBlogBasePath, normalizeDomain, normalizeSlug, POST$1 as publishHandler, safeGenerateArticleStructuredData, setAuthConfig, setStorage, shouldSkipAuth, sitemapToXml, GET as slugExistsHandler, OPTIONS as slugExistsOptionsHandler, structuredDataToJsonLd, POST as unpublishHandler, updateArticleCanonicalUrl, usePagination, validateMetadata, validateSitemap, validateStructuredData, GET$1 as versionHandler };
2016
+ export { ApiKeyAuth, type AuthConfig, type AuthResult, type AuthorArchive, type AuthorArchiveOptions, ArticlePage as BlogArticlePage, AuthorPage as BlogAuthorPage, BlogAuthorsIndexPage, BlogHomePage, type BlogPlatformConfig, type BlogPlatformStorage, type BlogPostingSchema, type BlogSitemapConfig, type BlogTheme, BlogTopicArchivePage, BlogTopicsIndexPage, type BreadcrumbListSchema, Button, type CanonicalUrlOptions, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, DrizzleStorage, EnvAuth, type GeneratedMetadata, InMemoryStorage, type LinkTag, type MetaTag, type MetadataOptions, NEWSLETTER_SUCCESS_MESSAGE, NewsletterSignup, type NewsletterSignupProps, type NextjsSitemapEntry, NoAuth, type OrganizationSchema, PACKAGE_VERSION, Pagination$1 as Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, type PersonSchema, PublishResult, PublishedArticle, PublishedAuthor, PublishedNewsletterSettings, PublishedSite, PublishedTopic, type RateLimitConfig, type RateLimitResult, Pagination as ShadcnPagination, type SitemapChangeFreq, type SitemapData, type SitemapEntry, type SitemapOptions, StructuredDataError, type StructuredDataOptions, type TopicArchive, UninitializedAuth, type WebSiteSchema, autoConfigureRateLimit, bpArticles, bpOperations, buildAuthorPath, buildBlogPath, buttonVariants, checkRateLimit, cn, configureRateLimit, createBlogSitemapRoute, createDynamicBlogSitemap, createRateLimitErrorResponse, createStructuredDataScript, createTokenFingerprint, enforceRateLimit, extractKeywordsFromArticle, extractTableOfContents, extractTokenFromHeader, formatArticleDateMeta, generateArticleMetadata, generateArticleStructuredData, generateAuthorPageMetadata, generateAuthorStructuredData, generateBlogHomeMetadata, generateBlogHomeStructuredData, generateBlogSitemapEntries, generateBreadcrumbStructuredData, generateCanonicalUrl, generateCanonicalUrlFromSlug, generateCompleteArticleStructuredData, generateOrganizationStructuredData, generatePaginationMetadata, generateSiteMetadata, generateSitemap, generateSitemapIndex, generateWebSiteStructuredData, getAllTopics, getArticlePrimaryTopic, getAuthConfig, getAuthorArchive, getAuthorsFromArticles, getBaseUrl, getBlogThemeStyle, getDrizzleAdapterSql, getPathPrefixFromBlogUrl, getRateLimitHeaders, getStorage, getTopicArchive, initBlogPlatform, initBlogPlatformDev, initBlogPlatformOnce, initBlogPlatformProd, initEnvAuth, isValidCanonicalUrl, loadAuthorArchive, metadataToHtml, normalizeBlogBasePath, normalizeDomain, normalizeSlug, POST$1 as publishHandler, safeGenerateArticleStructuredData, setAuthConfig, setStorage, shouldSkipAuth, sitemapToXml, GET as slugExistsHandler, OPTIONS as slugExistsOptionsHandler, structuredDataToJsonLd, POST as unpublishHandler, updateArticleCanonicalUrl, usePagination, validateMetadata, validateSitemap, validateStructuredData, GET$1 as versionHandler };