@xexr/blog-platform 1.0.9 → 1.0.11

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
@@ -894,6 +902,63 @@ declare const bpArticles: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
894
902
  }, {}, {
895
903
  length: number | undefined;
896
904
  }>;
905
+ featuredImageCaption: drizzle_orm_sqlite_core.SQLiteColumn<{
906
+ name: "featured_image_caption";
907
+ tableName: "bp_articles";
908
+ dataType: "string";
909
+ columnType: "SQLiteText";
910
+ data: string;
911
+ driverParam: string;
912
+ notNull: false;
913
+ hasDefault: false;
914
+ isPrimaryKey: false;
915
+ isAutoincrement: false;
916
+ hasRuntimeDefault: false;
917
+ enumValues: [string, ...string[]];
918
+ baseColumn: never;
919
+ identity: undefined;
920
+ generated: undefined;
921
+ }, {}, {
922
+ length: number | undefined;
923
+ }>;
924
+ featuredImageCreditText: drizzle_orm_sqlite_core.SQLiteColumn<{
925
+ name: "featured_image_credit_text";
926
+ tableName: "bp_articles";
927
+ dataType: "string";
928
+ columnType: "SQLiteText";
929
+ data: string;
930
+ driverParam: string;
931
+ notNull: false;
932
+ hasDefault: false;
933
+ isPrimaryKey: false;
934
+ isAutoincrement: false;
935
+ hasRuntimeDefault: false;
936
+ enumValues: [string, ...string[]];
937
+ baseColumn: never;
938
+ identity: undefined;
939
+ generated: undefined;
940
+ }, {}, {
941
+ length: number | undefined;
942
+ }>;
943
+ featuredImageCreditUrl: drizzle_orm_sqlite_core.SQLiteColumn<{
944
+ name: "featured_image_credit_url";
945
+ tableName: "bp_articles";
946
+ dataType: "string";
947
+ columnType: "SQLiteText";
948
+ data: string;
949
+ driverParam: string;
950
+ notNull: false;
951
+ hasDefault: false;
952
+ isPrimaryKey: false;
953
+ isAutoincrement: false;
954
+ hasRuntimeDefault: false;
955
+ enumValues: [string, ...string[]];
956
+ baseColumn: never;
957
+ identity: undefined;
958
+ generated: undefined;
959
+ }, {}, {
960
+ length: number | undefined;
961
+ }>;
897
962
  authorJson: drizzle_orm_sqlite_core.SQLiteColumn<{
898
963
  name: "author_json";
899
964
  tableName: "bp_articles";
@@ -1947,4 +2012,4 @@ declare function OPTIONS(request: NextRequest): Promise<NextResponse>;
1947
2012
 
1948
2013
  declare const PACKAGE_VERSION: string;
1949
2014
 
1950
- 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 };
2015
+ 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, 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 };