@cedros/data-react 0.1.0

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.
Files changed (152) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +177 -0
  3. package/dist/admin/api.d.ts +19 -0
  4. package/dist/admin/api.js +108 -0
  5. package/dist/admin/components.d.ts +36 -0
  6. package/dist/admin/components.js +22 -0
  7. package/dist/admin/history.d.ts +17 -0
  8. package/dist/admin/history.js +103 -0
  9. package/dist/admin/icons.d.ts +15 -0
  10. package/dist/admin/icons.js +18 -0
  11. package/dist/admin/index.d.ts +13 -0
  12. package/dist/admin/index.js +12 -0
  13. package/dist/admin/permissions.d.ts +4 -0
  14. package/dist/admin/permissions.js +45 -0
  15. package/dist/admin/plugin.d.ts +4 -0
  16. package/dist/admin/plugin.js +180 -0
  17. package/dist/admin/primitives/ConfirmDialog.d.ts +14 -0
  18. package/dist/admin/primitives/ConfirmDialog.js +7 -0
  19. package/dist/admin/primitives/DataTable.d.ts +14 -0
  20. package/dist/admin/primitives/DataTable.js +7 -0
  21. package/dist/admin/primitives/DiffViewer.d.ts +11 -0
  22. package/dist/admin/primitives/DiffViewer.js +8 -0
  23. package/dist/admin/primitives/FormFieldRow.d.ts +23 -0
  24. package/dist/admin/primitives/FormFieldRow.js +16 -0
  25. package/dist/admin/primitives/JsonCodeEditor.d.ts +10 -0
  26. package/dist/admin/primitives/JsonCodeEditor.js +42 -0
  27. package/dist/admin/primitives/Pagination.d.ts +8 -0
  28. package/dist/admin/primitives/Pagination.js +8 -0
  29. package/dist/admin/primitives/Toolbar.d.ts +23 -0
  30. package/dist/admin/primitives/Toolbar.js +10 -0
  31. package/dist/admin/primitives/alerts.d.ts +21 -0
  32. package/dist/admin/primitives/alerts.js +44 -0
  33. package/dist/admin/sectionIds.d.ts +20 -0
  34. package/dist/admin/sectionIds.js +33 -0
  35. package/dist/admin/sections/CollectionsSection.d.ts +2 -0
  36. package/dist/admin/sections/CollectionsSection.js +125 -0
  37. package/dist/admin/sections/ContractVerifySection.d.ts +11 -0
  38. package/dist/admin/sections/ContractVerifySection.js +98 -0
  39. package/dist/admin/sections/CustomDataSection.d.ts +2 -0
  40. package/dist/admin/sections/CustomDataSection.js +256 -0
  41. package/dist/admin/sections/DataOpsSection.d.ts +26 -0
  42. package/dist/admin/sections/DataOpsSection.js +245 -0
  43. package/dist/admin/sections/HistorySection.d.ts +2 -0
  44. package/dist/admin/sections/HistorySection.js +26 -0
  45. package/dist/admin/sections/MonetizationSection.d.ts +2 -0
  46. package/dist/admin/sections/MonetizationSection.js +140 -0
  47. package/dist/admin/sections/NavigationSection.d.ts +13 -0
  48. package/dist/admin/sections/NavigationSection.js +195 -0
  49. package/dist/admin/sections/PagesSection.d.ts +2 -0
  50. package/dist/admin/sections/PagesSection.js +157 -0
  51. package/dist/admin/sections/SchemaDesignerSection.d.ts +2 -0
  52. package/dist/admin/sections/SchemaDesignerSection.js +167 -0
  53. package/dist/admin/sections/SiteSettingsSection.d.ts +12 -0
  54. package/dist/admin/sections/SiteSettingsSection.js +122 -0
  55. package/dist/admin/sections/TippingSection.d.ts +2 -0
  56. package/dist/admin/sections/TippingSection.js +178 -0
  57. package/dist/admin/sections/media/MediaDetail.d.ts +12 -0
  58. package/dist/admin/sections/media/MediaDetail.js +74 -0
  59. package/dist/admin/sections/media/MediaGrid.d.ts +14 -0
  60. package/dist/admin/sections/media/MediaGrid.js +22 -0
  61. package/dist/admin/sections/media/MediaSection.d.ts +2 -0
  62. package/dist/admin/sections/media/MediaSection.js +97 -0
  63. package/dist/admin/sections/media/MediaUploader.d.ts +7 -0
  64. package/dist/admin/sections/media/MediaUploader.js +72 -0
  65. package/dist/admin/sections/media/types.d.ts +33 -0
  66. package/dist/admin/sections/media/types.js +1 -0
  67. package/dist/admin/styles.css +533 -0
  68. package/dist/admin/types.d.ts +85 -0
  69. package/dist/admin/types.js +1 -0
  70. package/dist/index.d.ts +4 -0
  71. package/dist/index.js +3 -0
  72. package/dist/react/CmsContent.d.ts +20 -0
  73. package/dist/react/CmsContent.js +31 -0
  74. package/dist/react/entries.d.ts +9 -0
  75. package/dist/react/entries.js +25 -0
  76. package/dist/react/fetch.d.ts +11 -0
  77. package/dist/react/fetch.js +32 -0
  78. package/dist/react/index.d.ts +10 -0
  79. package/dist/react/index.js +9 -0
  80. package/dist/react/metadata.d.ts +44 -0
  81. package/dist/react/metadata.js +142 -0
  82. package/dist/react/sanitize.d.ts +17 -0
  83. package/dist/react/sanitize.js +326 -0
  84. package/dist/react/server.d.ts +14 -0
  85. package/dist/react/server.js +13 -0
  86. package/dist/react/sitemap.d.ts +28 -0
  87. package/dist/react/sitemap.js +91 -0
  88. package/dist/react/slugs.d.ts +27 -0
  89. package/dist/react/slugs.js +52 -0
  90. package/dist/react/types.d.ts +85 -0
  91. package/dist/react/types.js +1 -0
  92. package/dist/react/visitor.d.ts +7 -0
  93. package/dist/react/visitor.js +18 -0
  94. package/dist/site-templates/BlogTemplates.d.ts +95 -0
  95. package/dist/site-templates/BlogTemplates.js +64 -0
  96. package/dist/site-templates/ContactPageTemplate.d.ts +14 -0
  97. package/dist/site-templates/ContactPageTemplate.js +5 -0
  98. package/dist/site-templates/DashboardOverviewTemplate.d.ts +29 -0
  99. package/dist/site-templates/DashboardOverviewTemplate.js +17 -0
  100. package/dist/site-templates/DashboardShell.d.ts +28 -0
  101. package/dist/site-templates/DashboardShell.js +10 -0
  102. package/dist/site-templates/DocsSidebar.d.ts +14 -0
  103. package/dist/site-templates/DocsSidebar.js +13 -0
  104. package/dist/site-templates/DocsTemplates.d.ts +60 -0
  105. package/dist/site-templates/DocsTemplates.js +47 -0
  106. package/dist/site-templates/HomePageTemplate.d.ts +15 -0
  107. package/dist/site-templates/HomePageTemplate.js +10 -0
  108. package/dist/site-templates/LegalPageTemplate.d.ts +12 -0
  109. package/dist/site-templates/LegalPageTemplate.js +6 -0
  110. package/dist/site-templates/MarkdownContent.d.ts +7 -0
  111. package/dist/site-templates/MarkdownContent.js +24 -0
  112. package/dist/site-templates/NotFoundTemplate.d.ts +9 -0
  113. package/dist/site-templates/NotFoundTemplate.js +5 -0
  114. package/dist/site-templates/SiteFooter.d.ts +13 -0
  115. package/dist/site-templates/SiteFooter.js +4 -0
  116. package/dist/site-templates/SiteLayout.d.ts +14 -0
  117. package/dist/site-templates/SiteLayout.js +6 -0
  118. package/dist/site-templates/TopNav.d.ts +10 -0
  119. package/dist/site-templates/TopNav.js +8 -0
  120. package/dist/site-templates/blogControls.d.ts +19 -0
  121. package/dist/site-templates/blogControls.js +37 -0
  122. package/dist/site-templates/codeBlock.d.ts +9 -0
  123. package/dist/site-templates/codeBlock.js +31 -0
  124. package/dist/site-templates/content-styles.css +410 -0
  125. package/dist/site-templates/contentIndex.d.ts +65 -0
  126. package/dist/site-templates/contentIndex.js +181 -0
  127. package/dist/site-templates/contentUi.d.ts +14 -0
  128. package/dist/site-templates/contentUi.js +24 -0
  129. package/dist/site-templates/docs-styles.css +259 -0
  130. package/dist/site-templates/docsNavigation.d.ts +18 -0
  131. package/dist/site-templates/docsNavigation.js +50 -0
  132. package/dist/site-templates/index.d.ts +28 -0
  133. package/dist/site-templates/index.js +25 -0
  134. package/dist/site-templates/monetization-styles.css +154 -0
  135. package/dist/site-templates/paywallControls.d.ts +22 -0
  136. package/dist/site-templates/paywallControls.js +9 -0
  137. package/dist/site-templates/routing.d.ts +12 -0
  138. package/dist/site-templates/routing.js +36 -0
  139. package/dist/site-templates/solanaAtaSetup.d.ts +11 -0
  140. package/dist/site-templates/solanaAtaSetup.js +38 -0
  141. package/dist/site-templates/solanaMicropayments.d.ts +65 -0
  142. package/dist/site-templates/solanaMicropayments.js +115 -0
  143. package/dist/site-templates/styles.css +332 -0
  144. package/dist/site-templates/tipControls.d.ts +24 -0
  145. package/dist/site-templates/tipControls.js +43 -0
  146. package/dist/site-templates/tocExtractor.d.ts +16 -0
  147. package/dist/site-templates/tocExtractor.js +58 -0
  148. package/dist/site-templates/tocScrollSpy.d.ts +16 -0
  149. package/dist/site-templates/tocScrollSpy.js +37 -0
  150. package/dist/templates.d.ts +8 -0
  151. package/dist/templates.js +20 -0
  152. package/package.json +58 -0
@@ -0,0 +1,60 @@
1
+ import type { SiteNavigationItem } from "./SiteLayout.js";
2
+ import { type DocsIndexEntry } from "./contentIndex.js";
3
+ import { type DocsSidebarSection } from "./docsNavigation.js";
4
+ export interface DocsIndexItem extends DocsIndexEntry {
5
+ }
6
+ export interface DocsIndexTemplateProps {
7
+ siteTitle: string;
8
+ navigation: SiteNavigationItem[];
9
+ docs: DocsIndexItem[];
10
+ title?: string;
11
+ description?: string;
12
+ basePath?: string;
13
+ currentPath?: string;
14
+ query?: string;
15
+ category?: string;
16
+ tag?: string;
17
+ sort?: "updated-desc" | "updated-asc" | "title-asc" | "title-desc";
18
+ page?: number;
19
+ pageSize?: number;
20
+ categories?: string[];
21
+ tags?: string[];
22
+ sidebarSections?: DocsSidebarSection[];
23
+ sidebarTitle?: string;
24
+ }
25
+ export declare function DocsIndexTemplate({ siteTitle, navigation, docs, title, description, basePath, currentPath, query, category, tag, sort, page, pageSize, categories, tags, sidebarSections, sidebarTitle }: DocsIndexTemplateProps): React.JSX.Element;
26
+ export interface DocArticleTemplateProps {
27
+ siteTitle: string;
28
+ navigation: SiteNavigationItem[];
29
+ title: string;
30
+ bodyMarkdown?: string;
31
+ bodyHtml?: string;
32
+ allowUnsafeHtmlFallback?: boolean;
33
+ lastUpdated?: string;
34
+ readingMinutes?: number;
35
+ basePath?: string;
36
+ currentPath?: string;
37
+ searchQuery?: string;
38
+ docs?: DocsIndexItem[];
39
+ sidebarSections?: DocsSidebarSection[];
40
+ sidebarTitle?: string;
41
+ breadcrumbs?: Array<{
42
+ label: string;
43
+ href: string;
44
+ }>;
45
+ toc?: Array<{
46
+ id: string;
47
+ label: string;
48
+ depth?: 2 | 3 | 4;
49
+ }>;
50
+ previousDoc?: {
51
+ title: string;
52
+ href: string;
53
+ };
54
+ nextDoc?: {
55
+ title: string;
56
+ href: string;
57
+ };
58
+ editHref?: string;
59
+ }
60
+ export declare function DocArticleTemplate({ siteTitle, navigation, title, bodyMarkdown, bodyHtml, allowUnsafeHtmlFallback, lastUpdated, readingMinutes, basePath, currentPath, searchQuery, docs, sidebarSections, sidebarTitle, breadcrumbs, toc, previousDoc, nextDoc, editHref }: DocArticleTemplateProps): React.JSX.Element;
@@ -0,0 +1,47 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { SiteLayout } from "./SiteLayout.js";
3
+ import { buildContentListHref, collectFilterValues, prepareDocsIndex } from "./contentIndex.js";
4
+ import { Breadcrumbs, ContentPagination } from "./contentUi.js";
5
+ import { buildDocsSidebarSections, withActiveDocsSidebar } from "./docsNavigation.js";
6
+ import { DocsSidebar } from "./DocsSidebar.js";
7
+ import { MarkdownContent } from "./MarkdownContent.js";
8
+ import { TocScrollSpy } from "./tocScrollSpy.js";
9
+ export function DocsIndexTemplate({ siteTitle, navigation, docs, title = "Documentation", description = "", basePath = "/docs", currentPath, query = "", category = "", tag = "", sort = "title-asc", page = 1, pageSize = 10, categories, tags, sidebarSections, sidebarTitle = "Docs" }) {
10
+ const normalizedFilters = collectFilterValues(docs);
11
+ const resolvedCategories = categories ?? normalizedFilters.categories;
12
+ const resolvedTags = tags ?? normalizedFilters.tags;
13
+ const activePath = currentPath ?? basePath;
14
+ const resolvedSidebarSections = withActiveDocsSidebar(sidebarSections ?? buildDocsSidebarSections(docs, basePath), activePath);
15
+ const result = prepareDocsIndex(docs, {
16
+ query,
17
+ category,
18
+ tag,
19
+ sort,
20
+ page,
21
+ pageSize
22
+ });
23
+ return (_jsx(SiteLayout, { siteTitle: siteTitle, navigation: navigation, children: _jsxs("section", { className: "cedros-site__docs-page", children: [_jsx(DocsSidebar, { title: sidebarTitle, basePath: basePath, searchQuery: query, sections: resolvedSidebarSections }), _jsxs("div", { className: "cedros-site__docs-main", children: [_jsxs("section", { className: "cedros-site__card", children: [_jsx("span", { className: "cedros-site__pill", children: "docs" }), _jsx("h1", { className: "cedros-site__title", style: { marginTop: "0.6rem" }, children: title }), description && _jsx("p", { className: "cedros-site__subtitle", children: description }), _jsxs("p", { className: "cedros-site__entry-meta", style: { marginTop: "0.6rem" }, children: [result.totalItems, " results"] })] }), _jsx(DocsIndexControls, { basePath: basePath, query: query, category: category, tag: tag, sort: sort, categories: resolvedCategories, tags: resolvedTags }), result.totalItems === 0 && (_jsxs("section", { className: "cedros-site__card cedros-site__empty-state", children: [_jsx("h2", { className: "cedros-site__title", style: { fontSize: "1.25rem" }, children: "No documentation pages found" }), _jsx("p", { className: "cedros-site__subtitle", style: { marginTop: "0.6rem" }, children: "Try a broader query or clear filters." })] })), result.totalItems > 0 && (_jsxs(_Fragment, { children: [_jsx("section", { className: "cedros-site__content-grid cedros-site__content-grid--docs", children: result.items.map((doc) => (_jsxs("article", { className: "cedros-site__card cedros-site__entry-card", children: [_jsx("h2", { className: "cedros-site__entry-title", children: _jsx("a", { href: `${basePath}/${doc.slug}`, children: doc.title }) }), doc.description && _jsx("p", { className: "cedros-site__subtitle", children: doc.description }), (doc.lastUpdated || doc.category) && (_jsx("p", { className: "cedros-site__entry-meta", children: [doc.category, doc.lastUpdated ? `Updated ${doc.lastUpdated}` : ""]
24
+ .filter(Boolean)
25
+ .join(" • ") })), doc.tags && doc.tags.length > 0 && (_jsx("div", { className: "cedros-site__tag-list", children: doc.tags.map((entryTag) => (_jsx("a", { href: buildContentListHref(basePath, {
26
+ q: query,
27
+ category,
28
+ tag: entryTag,
29
+ sort
30
+ }), className: "cedros-site__pill", children: entryTag }, entryTag))) }))] }, doc.slug))) }), _jsx(ContentPagination, { basePath: basePath, page: result.page, totalPages: result.totalPages, query: { q: query, category, tag, sort } })] }))] })] }) }));
31
+ }
32
+ export function DocArticleTemplate({ siteTitle, navigation, title, bodyMarkdown, bodyHtml, allowUnsafeHtmlFallback = false, lastUpdated, readingMinutes, basePath = "/docs", currentPath, searchQuery = "", docs = [], sidebarSections, sidebarTitle = "Docs", breadcrumbs = [], toc = [], previousDoc, nextDoc, editHref }) {
33
+ const activePath = currentPath ?? breadcrumbs[breadcrumbs.length - 1]?.href;
34
+ const resolvedSidebarSections = withActiveDocsSidebar(sidebarSections ?? buildDocsSidebarSections(docs, basePath), activePath);
35
+ return (_jsx(SiteLayout, { siteTitle: siteTitle, navigation: navigation, children: _jsxs("section", { className: "cedros-site__docs-page cedros-site__docs-page--article", children: [_jsx(DocsSidebar, { title: sidebarTitle, basePath: basePath, searchQuery: searchQuery, sections: resolvedSidebarSections }), _jsxs("article", { className: "cedros-site__card cedros-site__article cedros-site__docs-article", children: [_jsx(Breadcrumbs, { trail: breadcrumbs }), _jsxs("div", { className: "cedros-site__article-header", children: [_jsx("span", { className: "cedros-site__pill", children: "docs" }), _jsx("h1", { className: "cedros-site__title", children: title }), (lastUpdated || readingMinutes) && (_jsx("p", { className: "cedros-site__entry-meta", children: [lastUpdated ? `Last updated ${lastUpdated}` : "", readingTime(readingMinutes)]
36
+ .filter(Boolean)
37
+ .join(" • ") }))] }), _jsx(MarkdownContent, { bodyMarkdown: bodyMarkdown, bodyHtml: bodyHtml, allowUnsafeHtmlFallback: allowUnsafeHtmlFallback }), (previousDoc || nextDoc || editHref) && (_jsxs("footer", { className: "cedros-site__doc-footer", children: [previousDoc && (_jsxs("a", { href: previousDoc.href, className: "cedros-site__nav-link", children: ["\u2190 ", previousDoc.title] })), nextDoc && (_jsxs("a", { href: nextDoc.href, className: "cedros-site__nav-link", children: [nextDoc.title, " \u2192"] })), editHref && (_jsx("a", { href: editHref, className: "cedros-site__nav-link", children: "Suggest edit" }))] }))] }), toc.length > 0 && (_jsxs("aside", { className: "cedros-site__card cedros-site__toc", children: [_jsx("h2", { className: "cedros-site__toc-title", children: "On this page" }), _jsx(TocScrollSpy, { entries: toc })] }))] }) }));
38
+ }
39
+ function DocsIndexControls({ basePath, query, category, tag, sort, categories, tags }) {
40
+ return (_jsxs("form", { method: "get", action: basePath, className: "cedros-site__controls cedros-site__card", children: [_jsxs("label", { className: "cedros-site__control", children: [_jsx("span", { children: "Search" }), _jsx("input", { type: "search", name: "q", defaultValue: query, placeholder: "Search docs" })] }), _jsxs("label", { className: "cedros-site__control", children: [_jsx("span", { children: "Category" }), _jsxs("select", { name: "category", defaultValue: category, children: [_jsx("option", { value: "", children: "All" }), categories.map((entry) => (_jsx("option", { value: entry, children: entry }, entry)))] })] }), _jsxs("label", { className: "cedros-site__control", children: [_jsx("span", { children: "Tag" }), _jsxs("select", { name: "tag", defaultValue: tag, children: [_jsx("option", { value: "", children: "All" }), tags.map((entry) => (_jsx("option", { value: entry, children: entry }, entry)))] })] }), _jsxs("label", { className: "cedros-site__control", children: [_jsx("span", { children: "Sort" }), _jsxs("select", { name: "sort", defaultValue: sort, children: [_jsx("option", { value: "title-asc", children: "Title A-Z" }), _jsx("option", { value: "title-desc", children: "Title Z-A" }), _jsx("option", { value: "updated-desc", children: "Recently updated" }), _jsx("option", { value: "updated-asc", children: "Least recently updated" })] })] }), _jsxs("div", { className: "cedros-site__control-actions", children: [_jsx("button", { className: "cedros-site__nav-link", type: "submit", children: "Apply" }), _jsx("a", { className: "cedros-site__nav-link", href: basePath, children: "Clear" })] })] }));
41
+ }
42
+ function readingTime(minutes) {
43
+ if (!minutes) {
44
+ return "";
45
+ }
46
+ return `${minutes} min read`;
47
+ }
@@ -0,0 +1,15 @@
1
+ import type { SiteNavigationItem } from "./SiteLayout.js";
2
+ export interface HomeFeature {
3
+ title: string;
4
+ description: string;
5
+ }
6
+ export interface HomePageTemplateProps {
7
+ siteTitle: string;
8
+ navigation: SiteNavigationItem[];
9
+ headline: string;
10
+ subheadline?: string;
11
+ ctaLabel?: string;
12
+ ctaHref?: string;
13
+ features?: HomeFeature[];
14
+ }
15
+ export declare function HomePageTemplate({ siteTitle, navigation, headline, subheadline, ctaLabel, ctaHref, features }: HomePageTemplateProps): React.JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { SiteLayout } from "./SiteLayout.js";
3
+ export function HomePageTemplate({ siteTitle, navigation, headline, subheadline = "", ctaLabel = "Get Started", ctaHref = "/docs", features = [] }) {
4
+ return (_jsxs(SiteLayout, { siteTitle: siteTitle, navigation: navigation, children: [_jsxs("section", { className: "cedros-site__card", style: { display: "grid", gap: "1rem" }, children: [_jsx("span", { className: "cedros-site__pill", children: "home" }), _jsx("h1", { className: "cedros-site__title", children: headline }), subheadline && _jsx("p", { className: "cedros-site__subtitle", children: subheadline }), _jsx("div", { children: _jsx("a", { className: "cedros-site__nav-link", href: ctaHref, children: ctaLabel }) })] }), features.length > 0 && (_jsx("section", { style: {
5
+ marginTop: "1rem",
6
+ display: "grid",
7
+ gridTemplateColumns: "repeat(auto-fit, minmax(220px, 1fr))",
8
+ gap: "0.85rem"
9
+ }, children: features.map((feature) => (_jsxs("article", { className: "cedros-site__card", children: [_jsx("h2", { style: { margin: "0 0 0.5rem", fontSize: "1rem" }, children: feature.title }), _jsx("p", { className: "cedros-site__subtitle", style: { marginTop: 0 }, children: feature.description })] }, feature.title))) }))] }));
10
+ }
@@ -0,0 +1,12 @@
1
+ import type { SiteNavigationItem } from "./SiteLayout.js";
2
+ export interface LegalPageTemplateProps {
3
+ siteTitle: string;
4
+ navigation: SiteNavigationItem[];
5
+ pageType: "privacy-policy" | "terms-of-service";
6
+ title: string;
7
+ bodyMarkdown?: string;
8
+ bodyHtml?: string;
9
+ allowUnsafeHtmlFallback?: boolean;
10
+ effectiveDate?: string;
11
+ }
12
+ export declare function LegalPageTemplate({ siteTitle, navigation, pageType, title, bodyMarkdown, bodyHtml, allowUnsafeHtmlFallback, effectiveDate }: LegalPageTemplateProps): React.JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { SiteLayout } from "./SiteLayout.js";
3
+ import { MarkdownContent } from "./MarkdownContent.js";
4
+ export function LegalPageTemplate({ siteTitle, navigation, pageType, title, bodyMarkdown, bodyHtml, allowUnsafeHtmlFallback = false, effectiveDate }) {
5
+ return (_jsx(SiteLayout, { siteTitle: siteTitle, navigation: navigation, children: _jsxs("article", { className: "cedros-site__card", children: [_jsx("span", { className: "cedros-site__pill", children: pageType }), _jsx("h1", { className: "cedros-site__title", style: { marginTop: "0.55rem" }, children: title }), effectiveDate && (_jsxs("p", { className: "cedros-site__subtitle", style: { marginTop: "0.45rem" }, children: ["Effective: ", effectiveDate] })), _jsx(MarkdownContent, { bodyMarkdown: bodyMarkdown, bodyHtml: bodyHtml, allowUnsafeHtmlFallback: allowUnsafeHtmlFallback, className: "cedros-site__prose" })] }) }));
6
+ }
@@ -0,0 +1,7 @@
1
+ export interface MarkdownContentProps {
2
+ bodyMarkdown?: string;
3
+ bodyHtml?: string;
4
+ allowUnsafeHtmlFallback?: boolean;
5
+ className?: string;
6
+ }
7
+ export declare function MarkdownContent({ bodyMarkdown, bodyHtml, allowUnsafeHtmlFallback, className }: MarkdownContentProps): React.JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import rehypeAutolinkHeadings from "rehype-autolink-headings";
3
+ import rehypeHighlight from "rehype-highlight";
4
+ import rehypeSlug from "rehype-slug";
5
+ import ReactMarkdown from "react-markdown";
6
+ import remarkGfm from "remark-gfm";
7
+ import remarkAlert from "remark-github-blockquote-alert";
8
+ import { CodeBlock } from "./codeBlock.js";
9
+ export function MarkdownContent({ bodyMarkdown, bodyHtml, allowUnsafeHtmlFallback = false, className = "cedros-site__prose" }) {
10
+ if (bodyMarkdown && bodyMarkdown.trim().length > 0) {
11
+ return (_jsx("div", { className: className, children: _jsx(ReactMarkdown, { remarkPlugins: [remarkGfm, remarkAlert], rehypePlugins: [
12
+ rehypeSlug,
13
+ [rehypeAutolinkHeadings, { behavior: "wrap" }],
14
+ rehypeHighlight,
15
+ ], components: { pre: CodeBlock }, children: bodyMarkdown }) }));
16
+ }
17
+ if (bodyHtml && allowUnsafeHtmlFallback) {
18
+ return _jsx("div", { className: className, dangerouslySetInnerHTML: { __html: bodyHtml } });
19
+ }
20
+ if (bodyHtml) {
21
+ return (_jsx("div", { className: className, children: _jsx("p", { className: "cedros-site__content-warning", children: "Raw HTML rendering is disabled. Provide `bodyMarkdown` or enable `allowUnsafeHtmlFallback`." }) }));
22
+ }
23
+ return _jsx("div", { className: className });
24
+ }
@@ -0,0 +1,9 @@
1
+ import type { SiteNavigationItem } from "./SiteLayout.js";
2
+ export interface NotFoundTemplateProps {
3
+ siteTitle: string;
4
+ navigation: SiteNavigationItem[];
5
+ title?: string;
6
+ message?: string;
7
+ homeHref?: string;
8
+ }
9
+ export declare function NotFoundTemplate({ siteTitle, navigation, title, message, homeHref }: NotFoundTemplateProps): React.JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { SiteLayout } from "./SiteLayout.js";
3
+ export function NotFoundTemplate({ siteTitle, navigation, title = "Page Not Found", message = "The page you requested could not be found.", homeHref = "/" }) {
4
+ return (_jsx(SiteLayout, { siteTitle: siteTitle, navigation: navigation, children: _jsxs("section", { className: "cedros-site__card", style: { textAlign: "center", padding: "2rem 1rem" }, children: [_jsx("span", { className: "cedros-site__pill", children: "404" }), _jsx("h1", { className: "cedros-site__title", style: { marginTop: "0.65rem" }, children: title }), _jsx("p", { className: "cedros-site__subtitle", children: message }), _jsx("div", { style: { marginTop: "1rem" }, children: _jsx("a", { className: "cedros-site__nav-link", href: homeHref, children: "Go Home" }) })] }) }));
5
+ }
@@ -0,0 +1,13 @@
1
+ import type { ReactNode } from "react";
2
+ export interface SiteFooterLink {
3
+ key: string;
4
+ label: string;
5
+ route: string;
6
+ }
7
+ export interface SiteFooterProps {
8
+ siteTitle: string;
9
+ note?: string;
10
+ links?: SiteFooterLink[];
11
+ rightSlot?: ReactNode;
12
+ }
13
+ export declare function SiteFooter({ siteTitle, note, links, rightSlot }: SiteFooterProps): React.JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export function SiteFooter({ siteTitle, note, links = [], rightSlot }) {
3
+ return (_jsx("footer", { className: "cedros-site__footer", children: _jsxs("div", { className: "cedros-site__container cedros-site__footer-inner", children: [_jsxs("div", { className: "cedros-site__footer-brand", children: [_jsx("span", { children: siteTitle }), note && _jsx("span", { children: note })] }), links.length > 0 && (_jsx("nav", { className: "cedros-site__footer-links", "aria-label": "Footer", children: links.map((link) => (_jsx("a", { href: link.route, className: "cedros-site__footer-link", children: link.label }, link.key))) })), rightSlot && _jsx("div", { className: "cedros-site__footer-right", children: rightSlot })] }) }));
4
+ }
@@ -0,0 +1,14 @@
1
+ import type { ReactNode } from "react";
2
+ export interface SiteNavigationItem {
3
+ key: string;
4
+ label: string;
5
+ route: string;
6
+ }
7
+ export interface SiteLayoutProps {
8
+ siteTitle: string;
9
+ navigation: SiteNavigationItem[];
10
+ children: ReactNode;
11
+ brandHref?: string;
12
+ footerNote?: string;
13
+ }
14
+ export declare function SiteLayout({ siteTitle, navigation, children, brandHref, footerNote }: SiteLayoutProps): React.JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { SiteFooter } from "./SiteFooter.js";
3
+ import { TopNav } from "./TopNav.js";
4
+ export function SiteLayout({ siteTitle, navigation, children, brandHref = "/", footerNote = "Powered by cedros-data" }) {
5
+ return (_jsxs("div", { className: "cedros-site", children: [_jsx(TopNav, { siteTitle: siteTitle, navigation: navigation, brandHref: brandHref }), _jsx("main", { className: "cedros-site__main", children: _jsx("div", { className: "cedros-site__container", children: children }) }), _jsx(SiteFooter, { siteTitle: siteTitle, note: footerNote })] }));
6
+ }
@@ -0,0 +1,10 @@
1
+ import type { ReactNode } from "react";
2
+ import type { SiteNavigationItem } from "./SiteLayout.js";
3
+ export interface TopNavProps {
4
+ siteTitle: string;
5
+ navigation: SiteNavigationItem[];
6
+ brandHref?: string;
7
+ rightSlot?: ReactNode;
8
+ currentPath?: string;
9
+ }
10
+ export declare function TopNav({ siteTitle, navigation, brandHref, rightSlot, currentPath }: TopNavProps): React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { withActiveRouteState } from "./routing.js";
3
+ export function TopNav({ siteTitle, navigation, brandHref = "/", rightSlot, currentPath }) {
4
+ const activeNavigation = currentPath
5
+ ? withActiveRouteState(navigation, currentPath)
6
+ : navigation.map((item) => ({ ...item, isActive: false }));
7
+ return (_jsx("header", { className: "cedros-site__header", children: _jsxs("div", { className: "cedros-site__container cedros-site__header-inner", children: [_jsx("a", { href: brandHref, className: "cedros-site__brand", children: siteTitle }), _jsx("nav", { className: "cedros-site__nav", "aria-label": "Primary", children: activeNavigation.map((item) => (_jsx("a", { href: item.route, className: `cedros-site__nav-link${item.isActive ? " cedros-site__nav-link--active" : ""}`, "aria-current": item.isActive ? "page" : undefined, children: item.label }, item.key))) }), rightSlot && _jsx("div", { className: "cedros-site__header-right", children: rightSlot })] }) }));
8
+ }
@@ -0,0 +1,19 @@
1
+ import type { FilterDimension, FilterDimensionValues } from "./contentIndex.js";
2
+ export interface BlogSearchInputProps {
3
+ defaultValue?: string;
4
+ onSearch: (query: string) => void;
5
+ placeholder?: string;
6
+ }
7
+ export declare function BlogSearchInput({ defaultValue, onSearch, placeholder }: BlogSearchInputProps): React.JSX.Element;
8
+ export interface FilterDimensionChipsProps {
9
+ dimensions: FilterDimension[];
10
+ active: FilterDimensionValues;
11
+ onChange: (key: string, value: string) => void;
12
+ }
13
+ export declare function FilterDimensionChips({ dimensions, active, onChange }: FilterDimensionChipsProps): React.JSX.Element;
14
+ export interface BookmarkButtonProps {
15
+ slug: string;
16
+ isBookmarked: boolean;
17
+ onToggle: (slug: string) => void;
18
+ }
19
+ export declare function BookmarkButton({ slug, isBookmarked, onToggle }: BookmarkButtonProps): React.JSX.Element;
@@ -0,0 +1,37 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useCallback, useEffect, useRef } from "react";
4
+ export function BlogSearchInput({ defaultValue = "", onSearch, placeholder = "Search blog posts" }) {
5
+ const inputRef = useRef(null);
6
+ const timerRef = useRef(null);
7
+ const handleChange = useCallback((e) => {
8
+ const value = e.target.value;
9
+ if (timerRef.current)
10
+ clearTimeout(timerRef.current);
11
+ timerRef.current = setTimeout(() => onSearch(value), 300);
12
+ }, [onSearch]);
13
+ useEffect(() => {
14
+ function handleKeydown(e) {
15
+ if ((e.metaKey || e.ctrlKey) && e.key === "k") {
16
+ e.preventDefault();
17
+ inputRef.current?.focus();
18
+ }
19
+ }
20
+ document.addEventListener("keydown", handleKeydown);
21
+ return () => {
22
+ document.removeEventListener("keydown", handleKeydown);
23
+ if (timerRef.current)
24
+ clearTimeout(timerRef.current);
25
+ };
26
+ }, []);
27
+ return (_jsx("input", { ref: inputRef, type: "search", defaultValue: defaultValue, onChange: handleChange, placeholder: placeholder, className: "cedros-site__search-input" }));
28
+ }
29
+ export function FilterDimensionChips({ dimensions, active, onChange }) {
30
+ return (_jsx("div", { className: "cedros-site__filter-dimensions", children: dimensions.map((dim) => (_jsxs("div", { className: "cedros-site__filter-group", children: [_jsx("span", { className: "cedros-site__filter-group-label", children: dim.label }), _jsx("div", { className: "cedros-site__tag-list", children: dim.values.map((value) => {
31
+ const isActive = active[dim.key] === value;
32
+ return (_jsx("button", { type: "button", className: `cedros-site__pill${isActive ? " cedros-site__pill--active" : ""}`, onClick: () => onChange(dim.key, isActive ? "" : value), children: value }, value));
33
+ }) })] }, dim.key))) }));
34
+ }
35
+ export function BookmarkButton({ slug, isBookmarked, onToggle }) {
36
+ return (_jsx("button", { type: "button", className: "cedros-site__bookmark", "aria-label": "Bookmark", "aria-pressed": isBookmarked, onClick: () => onToggle(slug), children: _jsx("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: isBookmarked ? "currentColor" : "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("path", { d: "M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z" }) }) }));
37
+ }
@@ -0,0 +1,9 @@
1
+ import { type ReactNode } from "react";
2
+ export interface CodeBlockProps {
3
+ children?: ReactNode;
4
+ }
5
+ /**
6
+ * `<pre>` replacement for react-markdown that adds a copy-to-clipboard button.
7
+ * Designed to wrap `<code>` elements produced by rehype-highlight.
8
+ */
9
+ export declare function CodeBlock({ children }: CodeBlockProps): React.JSX.Element;
@@ -0,0 +1,31 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useCallback, useState } from "react";
4
+ /** Recursively extracts text content from React children. */
5
+ function extractText(node) {
6
+ if (node == null || typeof node === "boolean")
7
+ return "";
8
+ if (typeof node === "string" || typeof node === "number")
9
+ return String(node);
10
+ if (Array.isArray(node))
11
+ return node.map(extractText).join("");
12
+ if (typeof node === "object" && "props" in node) {
13
+ return extractText(node.props.children);
14
+ }
15
+ return "";
16
+ }
17
+ /**
18
+ * `<pre>` replacement for react-markdown that adds a copy-to-clipboard button.
19
+ * Designed to wrap `<code>` elements produced by rehype-highlight.
20
+ */
21
+ export function CodeBlock({ children }) {
22
+ const [copied, setCopied] = useState(false);
23
+ const handleCopy = useCallback(() => {
24
+ const text = extractText(children);
25
+ void navigator.clipboard.writeText(text).then(() => {
26
+ setCopied(true);
27
+ setTimeout(() => setCopied(false), 2000);
28
+ });
29
+ }, [children]);
30
+ return (_jsxs("div", { className: "cedros-site__code-block", children: [_jsx("pre", { children: children }), _jsx("button", { type: "button", className: "cedros-site__code-copy", onClick: handleCopy, "aria-label": "Copy code", children: copied ? "Copied!" : "Copy" })] }));
31
+ }