@opentf/afw-docs 0.0.0-stage → 0.30.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 (58) hide show
  1. package/build/blog-posts-plugin.js +141 -0
  2. package/build/docs-nav-plugin.js +196 -0
  3. package/build/feed.js +147 -0
  4. package/build/frontmatter.js +45 -0
  5. package/build/host.js +54 -0
  6. package/build/index.js +12 -0
  7. package/build/last-updated-plugin.js +99 -0
  8. package/build/last-updated.js +40 -0
  9. package/build/llms.js +176 -0
  10. package/build/reading-time.js +16 -0
  11. package/build/search.js +27 -0
  12. package/components/BlogLayout.jsx +90 -0
  13. package/components/Breadcrumbs.jsx +71 -0
  14. package/components/Callout.jsx +29 -0
  15. package/components/Card.jsx +21 -0
  16. package/components/Cards.jsx +11 -0
  17. package/components/CodeBlock.jsx +39 -0
  18. package/components/DocsLayout.jsx +106 -0
  19. package/components/Footer.jsx +25 -0
  20. package/components/LastUpdated.jsx +22 -0
  21. package/components/NavIcon.jsx +34 -0
  22. package/components/Navbar.jsx +64 -0
  23. package/components/NavbarLink.jsx +40 -0
  24. package/components/Pagination.jsx +49 -0
  25. package/components/PostBanner.jsx +25 -0
  26. package/components/PostCard.jsx +19 -0
  27. package/components/PostList.jsx +17 -0
  28. package/components/PostMeta.jsx +28 -0
  29. package/components/ReadingTime.jsx +6 -0
  30. package/components/Search.jsx +191 -0
  31. package/components/SearchTrigger.jsx +32 -0
  32. package/components/Sidebar.jsx +199 -0
  33. package/components/SidebarNode.jsx +143 -0
  34. package/components/SidebarToggle.jsx +47 -0
  35. package/components/Steps.jsx +14 -0
  36. package/components/Table.jsx +10 -0
  37. package/components/Tabs.jsx +77 -0
  38. package/components/ThemeToggle.jsx +164 -0
  39. package/components/Toc.jsx +79 -0
  40. package/components/Tooltip.jsx +19 -0
  41. package/components/format.js +21 -0
  42. package/components/post-dates.js +21 -0
  43. package/components/sidebar-collapse.js +38 -0
  44. package/config.js +77 -0
  45. package/index.js +67 -0
  46. package/nav-virtual.js +18 -0
  47. package/package.json +75 -4
  48. package/posts-virtual.js +17 -0
  49. package/search.js +285 -0
  50. package/theme/index.css +1749 -0
  51. package/types/config.d.ts +37 -0
  52. package/types/index.d.ts +66 -0
  53. package/types/nav.d.ts +9 -0
  54. package/types/posts.d.ts +17 -0
  55. package/types/search.d.ts +28 -0
  56. package/types/updated.d.ts +4 -0
  57. package/updated-virtual.js +10 -0
  58. package/README.md +0 -3
@@ -0,0 +1,37 @@
1
+ export interface DocsNavLink {
2
+ label: string;
3
+ href: string;
4
+ icon?: string;
5
+ external?: boolean;
6
+ }
7
+ export interface DocsFooter { text?: string; links?: DocsNavLink[] }
8
+ export type ProxyConfig = Record<string, string | { target: string }>;
9
+ export interface DocsConfig {
10
+ title?: string;
11
+ description?: string;
12
+ version?: string;
13
+ logo?: string;
14
+ homeUrl?: string;
15
+ github?: string;
16
+ repoUrl?: string;
17
+ dir?: string;
18
+ nav?: DocsNavLink[];
19
+ footer?: DocsFooter;
20
+ search?: { provider?: string };
21
+ lastUpdated?: boolean;
22
+ }
23
+ export interface BlogConfig {
24
+ dir?: string;
25
+ title?: string;
26
+ description?: string;
27
+ lastUpdated?: boolean;
28
+ }
29
+ export interface SiteConfig {
30
+ site?: { url?: string };
31
+ docs?: DocsConfig;
32
+ blog?: BlogConfig;
33
+ proxy?: ProxyConfig;
34
+ }
35
+ /** Identity helper; preserves the supplied configuration's inferred shape. */
36
+ export function defineDocsConfig<T extends SiteConfig>(config: T): T;
37
+ export default defineDocsConfig;
@@ -0,0 +1,66 @@
1
+ import type { DocsConfig, DocsNavLink } from "./config.js";
2
+ import type { DocsNavItem, DocsNavMap } from "./nav.js";
3
+ import type { BlogPost } from "./posts.js";
4
+
5
+ export type { DocsConfig, DocsNavLink, DocsFooter, BlogConfig, SiteConfig, ProxyConfig } from "./config.js";
6
+ export type { DocsNavItem, DocsNavMap } from "./nav.js";
7
+ export type { BlogPost } from "./posts.js";
8
+ export { createSearch } from "./search.js";
9
+ export type { SearchOptions, SearchResult, SearchResponse, SearchClient } from "./search.js";
10
+
11
+ export interface ChildrenProps { children?: unknown }
12
+ export interface DocsLayoutProps extends ChildrenProps {
13
+ config?: DocsConfig;
14
+ nav?: DocsNavMap | DocsNavItem[];
15
+ frame?: boolean;
16
+ siteUrl?: string;
17
+ }
18
+ export interface BlogLayoutProps extends ChildrenProps {
19
+ config?: DocsConfig;
20
+ posts?: BlogPost[];
21
+ frame?: boolean;
22
+ indexPath?: string;
23
+ siteUrl?: string;
24
+ }
25
+ export interface NavbarProps {
26
+ config?: DocsConfig;
27
+ id?: string;
28
+ navLabel?: string;
29
+ ariaLabel?: string;
30
+ ariaLabelledby?: string;
31
+ "aria-label"?: string;
32
+ "aria-labelledby"?: string;
33
+ }
34
+ export function DocsLayout(props: DocsLayoutProps): Node;
35
+ export function BlogLayout(props: BlogLayoutProps): Node;
36
+ export function Navbar(props: NavbarProps): Node;
37
+ export function NavbarLink(props: { link?: DocsNavLink }): Node;
38
+ export function SidebarToggle(): Node;
39
+ export function NavIcon(props: { name: string }): Node;
40
+ export function Sidebar(props: { nav?: DocsNavItem[]; config?: DocsConfig }): Node;
41
+ export function Toc(): Node;
42
+ export function Footer(props: { config?: DocsConfig }): Node;
43
+ export function Breadcrumbs(props: { nav?: DocsNavItem[]; siteUrl?: string }): Node;
44
+ export function Pagination(props: { nav?: DocsNavItem[] }): Node;
45
+ export function LastUpdated(props: { date?: string | number | Date | null; label?: string }): Node | null;
46
+ export function ThemeToggle(): Node;
47
+ export function SearchTrigger(): Node;
48
+ export function Search(): Node;
49
+ export function Callout(props: ChildrenProps & { type?: "note" | "tip" | "info" | "warning" | "danger"; title?: string }): Node;
50
+ export function CodeBlock(props: { code: string; lang?: string; name?: string }): Node;
51
+ export function Tabs(props: {
52
+ tabs?: { label: string; content: unknown }[];
53
+ /** Accessible name for the tab list. */
54
+ label?: string;
55
+ }): Node;
56
+ export function Steps(props: ChildrenProps): Node;
57
+ export function Table(props: ChildrenProps): Node;
58
+ export function Cards(props: ChildrenProps): Node;
59
+ export function Card(props: ChildrenProps & { href: string; title: string; desc?: string; external?: boolean }): Node;
60
+ export function Tooltip(props: ChildrenProps & { text: string; placement?: "top" | "bottom" }): Node;
61
+ export function PostList(props: { posts?: BlogPost[] }): Node;
62
+ export function PostCard(props: { post: BlogPost }): Node;
63
+ /** Banner and metadata accept a post object or individual post fields. */
64
+ export function PostBanner(props: { post: BlogPost } | Partial<BlogPost>): Node;
65
+ export function PostMeta(props: { post: BlogPost } | Partial<BlogPost>): Node;
66
+ export function ReadingTime(props: { minutes?: number }): Node;
package/types/nav.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ export interface DocsNavItem {
2
+ title: string;
3
+ path?: string;
4
+ order?: number | string;
5
+ items?: DocsNavItem[];
6
+ }
7
+ export type DocsNavMap = Record<string, DocsNavItem[]>;
8
+ declare const nav: DocsNavMap;
9
+ export default nav;
@@ -0,0 +1,17 @@
1
+ /** A post record emitted by blogPostsPlugin. */
2
+ export interface BlogPost {
3
+ slug: string;
4
+ path: string;
5
+ title: string;
6
+ description?: string;
7
+ date?: string;
8
+ author?: string;
9
+ authorAvatar?: string;
10
+ authorRole?: string;
11
+ cover?: string;
12
+ tags?: string[];
13
+ readingTime: number;
14
+ order?: number;
15
+ }
16
+ export const posts: BlogPost[];
17
+ export default posts;
@@ -0,0 +1,28 @@
1
+ export interface SearchOptions {
2
+ limit?: number;
3
+ maxSectionsPerPage?: number;
4
+ signal?: AbortSignal;
5
+ }
6
+ export interface SearchResult {
7
+ url: string;
8
+ title: string;
9
+ text: string;
10
+ section: string;
11
+ excerpt: string;
12
+ highlights: [number, number][];
13
+ meta: Record<string, string>;
14
+ anchors: { id: string; text: string; pos: number }[];
15
+ score: number;
16
+ }
17
+ export interface SearchResponse {
18
+ results: SearchResult[];
19
+ total: number;
20
+ partial: boolean;
21
+ }
22
+ export interface SearchClient {
23
+ preload(): Promise<void>;
24
+ query(query: string, options?: SearchOptions): Promise<SearchResponse>;
25
+ }
26
+ export function createSearch(options?: { base?: string }): SearchClient;
27
+ export function tokenize(text: string): string[];
28
+ export function excerptParts(excerpt: string, highlights?: [number, number][]): { text: string; match: boolean }[];
@@ -0,0 +1,4 @@
1
+ /** Maps route paths to last-updated ISO timestamps and repository source paths. */
2
+ declare const updated: Record<string, string | undefined>;
3
+ export const editPaths: Record<string, string | undefined>;
4
+ export default updated;
@@ -0,0 +1,10 @@
1
+ // Fallback for `@opentf/afw-docs/updated`.
2
+ //
3
+ // When `lastUpdatedPlugin` is active (registered when a project opts into
4
+ // `docs.lastUpdated` / `blog.lastUpdated`), it intercepts this specifier and replaces
5
+ // it with a build-time map of `{ [routePath]: ISO-8601 }` — the last-updated time of
6
+ // each page, from git or a frontmatter override. This file is loaded only when the
7
+ // plugin is NOT active, in which case the map is empty and the UI omits the line.
8
+
9
+ export const editPaths = {};
10
+ export default {};
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.