@mui/internal-docs-infra 0.2.3-canary.9 → 0.3.1-canary.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 (144) hide show
  1. package/README.md +3 -2
  2. package/esm/CodeHighlighter/CodeHighlighter.js +16 -16
  3. package/esm/CodeHighlighter/CodeHighlighterClient.js +33 -33
  4. package/esm/CodeHighlighter/errors.js +3 -3
  5. package/esm/CodeHighlighter/types.d.ts +1 -1
  6. package/esm/CodeProvider/CodeContext.d.ts +4 -4
  7. package/esm/CodeProvider/CodeProvider.js +7 -7
  8. package/esm/cli/index.d.ts +1 -0
  9. package/esm/cli/index.js +6 -0
  10. package/esm/cli/runValidate.d.ts +8 -0
  11. package/esm/cli/runValidate.js +297 -0
  12. package/esm/createSitemap/createSitemap.d.ts +23 -0
  13. package/esm/createSitemap/createSitemap.js +45 -0
  14. package/esm/createSitemap/index.d.ts +1 -0
  15. package/esm/createSitemap/index.js +1 -0
  16. package/esm/createSitemap/types.d.ts +68 -0
  17. package/esm/createSitemap/types.js +1 -0
  18. package/esm/pipeline/getFileConventions/fileConventions.d.ts +4 -0
  19. package/esm/pipeline/getFileConventions/fileConventions.js +4 -0
  20. package/esm/pipeline/getFileConventions/getFileConventions.d.ts +4 -0
  21. package/esm/pipeline/getFileConventions/getFileConventions.js +17 -0
  22. package/esm/pipeline/getFileConventions/index.d.ts +1 -0
  23. package/esm/pipeline/getFileConventions/index.js +1 -0
  24. package/esm/{CodeHighlighter/addPathsToVariant.d.ts → pipeline/loadCodeVariant/addCodeVariantPaths.d.ts} +1 -1
  25. package/esm/{CodeHighlighter/applyTransform.d.ts → pipeline/loadCodeVariant/applyCodeTransform.d.ts} +3 -3
  26. package/esm/{CodeHighlighter/applyTransform.js → pipeline/loadCodeVariant/applyCodeTransform.js} +4 -4
  27. package/esm/{CodeHighlighter → pipeline/loadCodeVariant}/calculateMainFilePath.js +1 -1
  28. package/esm/{CodeHighlighter/transformCode.d.ts → pipeline/loadCodeVariant/computeHastDeltas.d.ts} +9 -5
  29. package/esm/{CodeHighlighter/transformCode.js → pipeline/loadCodeVariant/computeHastDeltas.js} +20 -16
  30. package/esm/pipeline/loadCodeVariant/diffHast.d.ts +3 -0
  31. package/esm/{CodeHighlighter/transformParsedSource.js → pipeline/loadCodeVariant/diffHast.js} +5 -5
  32. package/esm/{CodeHighlighter/examineVariant.d.ts → pipeline/loadCodeVariant/examineCodeVariant.d.ts} +2 -2
  33. package/esm/{CodeHighlighter/examineVariant.js → pipeline/loadCodeVariant/examineCodeVariant.js} +1 -1
  34. package/esm/{useDemo/flattenVariant.d.ts → pipeline/loadCodeVariant/flattenCodeVariant.d.ts} +2 -2
  35. package/esm/{useDemo/flattenVariant.js → pipeline/loadCodeVariant/flattenCodeVariant.js} +3 -3
  36. package/esm/{CodeHighlighter/hasAllVariants.d.ts → pipeline/loadCodeVariant/hasAllCodeVariants.d.ts} +1 -1
  37. package/esm/pipeline/loadCodeVariant/index.d.ts +10 -0
  38. package/esm/pipeline/loadCodeVariant/index.js +17 -0
  39. package/esm/{CodeHighlighter/loadFallbackCode.d.ts → pipeline/loadCodeVariant/loadCodeFallback.d.ts} +2 -2
  40. package/esm/{CodeHighlighter/loadFallbackCode.js → pipeline/loadCodeVariant/loadCodeFallback.js} +180 -106
  41. package/esm/{CodeHighlighter/loadVariant.d.ts → pipeline/loadCodeVariant/loadCodeVariant.d.ts} +2 -2
  42. package/esm/{CodeHighlighter/loadVariant.js → pipeline/loadCodeVariant/loadCodeVariant.js} +122 -49
  43. package/esm/{CodeHighlighter/maybeInitialData.d.ts → pipeline/loadCodeVariant/maybeCodeInitialData.d.ts} +6 -6
  44. package/esm/{CodeHighlighter/maybeInitialData.js → pipeline/loadCodeVariant/maybeCodeInitialData.js} +6 -6
  45. package/esm/{CodeHighlighter/mergeMetadata.d.ts → pipeline/loadCodeVariant/mergeCodeMetadata.d.ts} +3 -3
  46. package/esm/{CodeHighlighter/mergeMetadata.js → pipeline/loadCodeVariant/mergeCodeMetadata.js} +3 -3
  47. package/esm/{CodeHighlighter → pipeline/loadCodeVariant}/parseCode.d.ts +1 -1
  48. package/esm/{CodeHighlighter → pipeline/loadCodeVariant}/transformSource.d.ts +1 -1
  49. package/esm/pipeline/loadPrecomputedCodeHighlighter/loadPrecomputedCodeHighlighter.d.ts +5 -0
  50. package/esm/pipeline/loadPrecomputedCodeHighlighter/loadPrecomputedCodeHighlighter.js +86 -13
  51. package/esm/pipeline/loadPrecomputedCodeHighlighter/performanceLogger.d.ts +30 -0
  52. package/esm/pipeline/loadPrecomputedCodeHighlighter/performanceLogger.js +77 -0
  53. package/esm/pipeline/loadPrecomputedCodeHighlighterClient/loadPrecomputedCodeHighlighterClient.js +7 -7
  54. package/esm/pipeline/loadPrecomputedSitemap/index.d.ts +2 -0
  55. package/esm/pipeline/loadPrecomputedSitemap/index.js +4 -0
  56. package/esm/pipeline/loadPrecomputedSitemap/loadPrecomputedSitemap.d.ts +10 -0
  57. package/esm/pipeline/loadPrecomputedSitemap/loadPrecomputedSitemap.js +213 -0
  58. package/esm/pipeline/loadServerCodeMeta/index.d.ts +2 -1
  59. package/esm/pipeline/loadServerCodeMeta/index.js +2 -1
  60. package/esm/pipeline/loadServerCodeMeta/loadServerCodeMeta.d.ts +1 -1
  61. package/esm/pipeline/loadServerCodeMeta/loadServerCodeMeta.js +2 -2
  62. package/esm/pipeline/{loaderUtils → loadServerCodeMeta}/resolveModulePathWithFs.d.ts +1 -1
  63. package/esm/pipeline/{loaderUtils → loadServerCodeMeta}/resolveModulePathWithFs.js +1 -1
  64. package/esm/pipeline/loadServerPageIndex/index.d.ts +2 -0
  65. package/esm/pipeline/loadServerPageIndex/index.js +1 -0
  66. package/esm/pipeline/loadServerPageIndex/loadServerPageIndex.d.ts +51 -0
  67. package/esm/pipeline/loadServerPageIndex/loadServerPageIndex.js +174 -0
  68. package/esm/pipeline/loadServerSitemap/index.d.ts +2 -0
  69. package/esm/pipeline/loadServerSitemap/index.js +1 -0
  70. package/esm/pipeline/loadServerSitemap/loadServerSitemap.d.ts +39 -0
  71. package/esm/pipeline/loadServerSitemap/loadServerSitemap.js +168 -0
  72. package/esm/pipeline/loadServerSource/loadServerSource.js +1 -1
  73. package/esm/pipeline/loaderUtils/externalsToPackages.js +1 -1
  74. package/esm/pipeline/loaderUtils/processRelativeImports.js +16 -3
  75. package/esm/pipeline/loaderUtils/rewriteImports.d.ts +36 -0
  76. package/esm/pipeline/loaderUtils/rewriteImports.js +139 -8
  77. package/esm/pipeline/syncPageIndex/createMarkdownNodes.d.ts +76 -0
  78. package/esm/pipeline/syncPageIndex/createMarkdownNodes.js +305 -0
  79. package/esm/pipeline/syncPageIndex/index.d.ts +1 -0
  80. package/esm/pipeline/syncPageIndex/index.js +1 -0
  81. package/esm/pipeline/syncPageIndex/mergeMetadataMarkdown.d.ts +58 -0
  82. package/esm/pipeline/syncPageIndex/mergeMetadataMarkdown.js +214 -0
  83. package/esm/pipeline/syncPageIndex/metadataToMarkdown.d.ts +67 -0
  84. package/esm/pipeline/syncPageIndex/metadataToMarkdown.js +1486 -0
  85. package/esm/pipeline/syncPageIndex/syncPageIndex.d.ts +108 -0
  86. package/esm/pipeline/syncPageIndex/syncPageIndex.js +540 -0
  87. package/esm/pipeline/transformHtmlCodePrecomputed/transformHtmlCodePrecomputed.d.ts +2 -2
  88. package/esm/pipeline/transformHtmlCodePrecomputed/transformHtmlCodePrecomputed.js +5 -5
  89. package/esm/pipeline/transformMarkdownBlockquoteCallouts/index.d.ts +2 -0
  90. package/esm/pipeline/transformMarkdownBlockquoteCallouts/index.js +4 -0
  91. package/esm/pipeline/transformMarkdownBlockquoteCallouts/transformMarkdownBlockquoteCallouts.d.ts +16 -0
  92. package/esm/pipeline/transformMarkdownBlockquoteCallouts/transformMarkdownBlockquoteCallouts.js +58 -0
  93. package/esm/pipeline/transformMarkdownDemoLinks/index.d.ts +2 -0
  94. package/esm/pipeline/transformMarkdownDemoLinks/index.js +4 -0
  95. package/esm/pipeline/transformMarkdownDemoLinks/transformMarkdownDemoLinks.d.ts +26 -0
  96. package/esm/pipeline/transformMarkdownDemoLinks/transformMarkdownDemoLinks.js +107 -0
  97. package/esm/pipeline/transformMarkdownMetadata/index.d.ts +2 -0
  98. package/esm/pipeline/transformMarkdownMetadata/index.js +4 -0
  99. package/esm/pipeline/transformMarkdownMetadata/transformMarkdownMetadata.d.ts +3 -0
  100. package/esm/pipeline/transformMarkdownMetadata/transformMarkdownMetadata.js +1010 -0
  101. package/esm/pipeline/transformMarkdownMetadata/types.d.ts +110 -0
  102. package/esm/pipeline/transformMarkdownMetadata/types.js +1 -0
  103. package/esm/pipeline/transformMarkdownRelativePaths/index.d.ts +2 -0
  104. package/esm/pipeline/transformMarkdownRelativePaths/index.js +4 -0
  105. package/esm/pipeline/transformMarkdownRelativePaths/transformMarkdownRelativePaths.d.ts +15 -0
  106. package/esm/pipeline/transformMarkdownRelativePaths/transformMarkdownRelativePaths.js +40 -0
  107. package/esm/useCode/Pre.js +15 -2
  108. package/esm/useCode/useCode.d.ts +15 -2
  109. package/esm/useCode/useCode.js +15 -6
  110. package/esm/useCode/useCodeUtils.js +3 -3
  111. package/esm/useCode/useFileNavigation.d.ts +9 -3
  112. package/esm/useCode/useFileNavigation.js +124 -81
  113. package/esm/useCode/useUIState.d.ts +4 -1
  114. package/esm/useCode/useUIState.js +17 -2
  115. package/esm/useCode/useVariantSelection.d.ts +8 -3
  116. package/esm/useCode/useVariantSelection.js +144 -52
  117. package/esm/useCopier/index.js +5 -4
  118. package/esm/useDemo/createCodeSandbox.d.ts +1 -1
  119. package/esm/useDemo/createStackBlitz.d.ts +1 -1
  120. package/esm/useDemo/exportVariant.js +13 -11
  121. package/esm/useDemo/index.d.ts +1 -1
  122. package/esm/useDemo/index.js +1 -1
  123. package/esm/useDemo/useDemo.d.ts +5 -5
  124. package/esm/useDemo/useDemo.js +6 -6
  125. package/esm/useErrors/useErrors.d.ts +1 -1
  126. package/esm/useErrors/useErrors.js +6 -2
  127. package/esm/useSearch/index.d.ts +1 -0
  128. package/esm/useSearch/index.js +1 -0
  129. package/esm/useSearch/types.d.ts +165 -0
  130. package/esm/useSearch/types.js +1 -0
  131. package/esm/useSearch/useSearch.d.ts +56 -0
  132. package/esm/useSearch/useSearch.js +647 -0
  133. package/esm/withDocsInfra/withDeploymentConfig.js +4 -2
  134. package/esm/withDocsInfra/withDocsInfra.d.ts +39 -0
  135. package/esm/withDocsInfra/withDocsInfra.js +79 -7
  136. package/package.json +105 -5
  137. package/esm/CodeHighlighter/transformParsedSource.d.ts +0 -3
  138. /package/esm/{CodeHighlighter/addPathsToVariant.js → pipeline/loadCodeVariant/addCodeVariantPaths.js} +0 -0
  139. /package/esm/{CodeHighlighter → pipeline/loadCodeVariant}/calculateMainFilePath.d.ts +0 -0
  140. /package/esm/{CodeHighlighter/hasAllVariants.js → pipeline/loadCodeVariant/hasAllCodeVariants.js} +0 -0
  141. /package/esm/{CodeHighlighter → pipeline/loadCodeVariant}/parseCode.js +0 -0
  142. /package/esm/{CodeHighlighter → pipeline/loadCodeVariant}/pathUtils.d.ts +0 -0
  143. /package/esm/{CodeHighlighter → pipeline/loadCodeVariant}/pathUtils.js +0 -0
  144. /package/esm/{CodeHighlighter → pipeline/loadCodeVariant}/transformSource.js +0 -0
@@ -0,0 +1,214 @@
1
+ import _regenerator from "@babel/runtime/helpers/esm/regenerator";
2
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
+ import _extends from "@babel/runtime/helpers/esm/extends";
4
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
+ import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
6
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
7
+ var _excluded = ["descriptionMarkdown"];
8
+ import { markdownToMetadata, metadataToMarkdown } from "./metadataToMarkdown.js";
9
+
10
+ /**
11
+ * Options for mergeMetadataMarkdown
12
+ */
13
+
14
+ /**
15
+ * Merges new page metadata with existing markdown content, preserving the order
16
+ * of pages from the existing markdown when available, unless the file contains
17
+ * only the autogeneration marker (no editable section), in which case pages are
18
+ * sorted alphabetically by title.
19
+ *
20
+ * Pages are matched by their `path` property (e.g., './button/page.mdx'), not by slug.
21
+ * This allows multiple pages to have the same slug (anchor) while still being treated
22
+ * as distinct pages.
23
+ *
24
+ * @param existingMarkdown - The existing markdown content (or undefined if none exists)
25
+ * @param newMetadata - The new metadata to merge in
26
+ * @param options - Optional configuration
27
+ * @param options.preserveUnlisted - If true, pages in existing markdown that aren't in newMetadata will be preserved. If false (default), they are removed.
28
+ * @param options.indexWrapperComponent - Optional component name to wrap the autogenerated content (e.g., 'PagesIndex')
29
+ * @returns The updated markdown content with merged metadata
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * const existingMarkdown = `# Components
34
+ * - [Button](#button) - [Full Docs](./button/page.mdx) - A button
35
+ * - [Checkbox](#checkbox) - [Full Docs](./checkbox/page.mdx) - A checkbox
36
+ * `;
37
+ *
38
+ * const newMetadata = {
39
+ * title: 'Components',
40
+ * pages: [
41
+ * { slug: 'checkbox', path: './checkbox/page.mdx', title: 'Checkbox', description: 'Updated checkbox' },
42
+ * { slug: 'button', path: './button/page.mdx', title: 'Button', description: 'Updated button' },
43
+ * { slug: 'input', path: './input/page.mdx', title: 'Input', description: 'New input' },
44
+ * ],
45
+ * };
46
+ *
47
+ * const result = await mergeMetadataMarkdown(existingMarkdown, newMetadata);
48
+ * // Result preserves Button, Checkbox order from existing markdown, adds Input at the end
49
+ * ```
50
+ */
51
+ export function mergeMetadataMarkdown(_x, _x2) {
52
+ return _mergeMetadataMarkdown.apply(this, arguments);
53
+ }
54
+ function _mergeMetadataMarkdown() {
55
+ _mergeMetadataMarkdown = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(existingMarkdown, newMetadata) {
56
+ var options,
57
+ indexWrapperComponent,
58
+ path,
59
+ existingMetadata,
60
+ effectiveWrapper,
61
+ newPagesMap,
62
+ _iterator,
63
+ _step,
64
+ page,
65
+ pages,
66
+ addedPaths,
67
+ _iterator2,
68
+ _step2,
69
+ existingPage,
70
+ newPage,
71
+ _newPage$openGraph,
72
+ descriptionMarkdown,
73
+ existingPageWithoutDescriptionMarkdown,
74
+ merged,
75
+ _iterator3,
76
+ _step3,
77
+ _newPage,
78
+ pageWithTag,
79
+ alphabeticalSortMarker,
80
+ requestsAlphabeticalSort,
81
+ mergedMetadata,
82
+ _args = arguments;
83
+ return _regenerator().w(function (_context) {
84
+ while (1) switch (_context.n) {
85
+ case 0:
86
+ options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {};
87
+ indexWrapperComponent = options.indexWrapperComponent, path = options.path; // If no existing markdown, just convert the new metadata
88
+ // Use the provided wrapper unless it's null (which means remove)
89
+ if (existingMarkdown) {
90
+ _context.n = 1;
91
+ break;
92
+ }
93
+ return _context.a(2, metadataToMarkdown(newMetadata, {
94
+ indexWrapperComponent: indexWrapperComponent === null ? undefined : indexWrapperComponent,
95
+ path: path
96
+ }));
97
+ case 1:
98
+ _context.n = 2;
99
+ return markdownToMetadata(existingMarkdown);
100
+ case 2:
101
+ existingMetadata = _context.v;
102
+ if (existingMetadata) {
103
+ _context.n = 3;
104
+ break;
105
+ }
106
+ return _context.a(2, metadataToMarkdown(newMetadata, {
107
+ indexWrapperComponent: indexWrapperComponent === null ? undefined : indexWrapperComponent,
108
+ path: path
109
+ }));
110
+ case 3:
111
+ if (indexWrapperComponent === undefined) {
112
+ effectiveWrapper = existingMetadata.indexWrapperComponent;
113
+ } else if (indexWrapperComponent === null) {
114
+ effectiveWrapper = undefined;
115
+ } else {
116
+ effectiveWrapper = indexWrapperComponent;
117
+ }
118
+
119
+ // Create a map of new pages by path for quick lookup
120
+ newPagesMap = new Map();
121
+ _iterator = _createForOfIteratorHelper(newMetadata.pages);
122
+ try {
123
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
124
+ page = _step.value;
125
+ newPagesMap.set(page.path, page);
126
+ }
127
+
128
+ // Build the merged pages array, preserving order from existing markdown
129
+ } catch (err) {
130
+ _iterator.e(err);
131
+ } finally {
132
+ _iterator.f();
133
+ }
134
+ pages = [];
135
+ addedPaths = new Set(); // First, add all pages that exist in the existing markdown, in their original order
136
+ _iterator2 = _createForOfIteratorHelper(existingMetadata.pages);
137
+ try {
138
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
139
+ existingPage = _step2.value;
140
+ newPage = newPagesMap.get(existingPage.path);
141
+ if (newPage) {
142
+ // Page exists in both - merge the metadata, preferring new values
143
+ // Only exclude descriptionMarkdown if newPage provides a new description
144
+ descriptionMarkdown = existingPage.descriptionMarkdown, existingPageWithoutDescriptionMarkdown = _objectWithoutPropertiesLoose(existingPage, _excluded);
145
+ merged = _extends(_extends(_extends({}, newPage.description ? existingPageWithoutDescriptionMarkdown : existingPage), newPage), {}, {
146
+ // Preserve tags from existing (user-managed, program should never delete tags)
147
+ tags: existingPage.tags,
148
+ // Preserve skipDetailSection from existing (user-managed for external links)
149
+ skipDetailSection: existingPage.skipDetailSection,
150
+ // Preserve sections from existing if new doesn't have them
151
+ sections: newPage.sections || existingPage.sections,
152
+ // Merge openGraph, but ensure description comes from newPage if it has one
153
+ openGraph: (_newPage$openGraph = newPage.openGraph) != null ? _newPage$openGraph : newPage.description ? _extends(_extends({}, existingPage.openGraph), {}, {
154
+ description: newPage.description
155
+ }) : existingPage.openGraph
156
+ });
157
+ pages.push(merged);
158
+ addedPaths.add(newPage.path);
159
+ }
160
+ // If page doesn't exist in new metadata, it's been removed - don't include it
161
+ }
162
+
163
+ // Then, add any new pages that weren't in the existing markdown
164
+ } catch (err) {
165
+ _iterator2.e(err);
166
+ } finally {
167
+ _iterator2.f();
168
+ }
169
+ _iterator3 = _createForOfIteratorHelper(newMetadata.pages);
170
+ try {
171
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
172
+ _newPage = _step3.value;
173
+ if (!addedPaths.has(_newPage.path)) {
174
+ // This is a new page - automatically add the [New] tag
175
+ pageWithTag = _extends(_extends({}, _newPage), {}, {
176
+ tags: _newPage.tags ? [].concat(_toConsumableArray(_newPage.tags), ['New']) : ['New']
177
+ });
178
+ pages.push(pageWithTag);
179
+ addedPaths.add(_newPage.path);
180
+ }
181
+ }
182
+
183
+ // If alphabetical sorting is requested, sort pages alphabetically by title
184
+ } catch (err) {
185
+ _iterator3.e(err);
186
+ } finally {
187
+ _iterator3.f();
188
+ }
189
+ alphabeticalSortMarker = "[//]: # 'This file is autogenerated, but the following list can be modified. Automatically sorted alphabetically.'";
190
+ requestsAlphabeticalSort = existingMarkdown.includes(alphabeticalSortMarker);
191
+ if (requestsAlphabeticalSort) {
192
+ pages = pages.sort(function (a, b) {
193
+ var titleA = a.title || a.slug;
194
+ var titleB = b.title || b.slug;
195
+ return titleA.localeCompare(titleB);
196
+ });
197
+ }
198
+
199
+ // Create the final metadata with merged pages
200
+ mergedMetadata = {
201
+ title: newMetadata.title,
202
+ // Always use the new title
203
+ pages: pages
204
+ }; // Preserve the alphabetical sorting marker if it was present
205
+ return _context.a(2, metadataToMarkdown(mergedMetadata, {
206
+ editableMarker: requestsAlphabeticalSort ? alphabeticalSortMarker : undefined,
207
+ indexWrapperComponent: effectiveWrapper,
208
+ path: path
209
+ }));
210
+ }
211
+ }, _callee);
212
+ }));
213
+ return _mergeMetadataMarkdown.apply(this, arguments);
214
+ }
@@ -0,0 +1,67 @@
1
+ import type { Root } from 'mdast';
2
+ import type { ExtractedMetadata } from "../transformMarkdownMetadata/types.js";
3
+ export interface PageMetadata extends ExtractedMetadata {
4
+ /** The slug/path for this page (e.g., 'button', 'checkbox') */
5
+ slug: string;
6
+ /** The relative path to the page's MDX file */
7
+ path: string;
8
+ /** Tags for this entry (e.g., 'New', 'Hot', 'Beta') */
9
+ tags?: string[];
10
+ /** Skip generating detail section for this entry (for external links) */
11
+ skipDetailSection?: boolean;
12
+ /** Component parts with their API metadata (for multi-part components) */
13
+ parts?: Record<string, {
14
+ props?: string[];
15
+ dataAttributes?: string[];
16
+ cssVariables?: string[];
17
+ }>;
18
+ /** Component exports with their API metadata (used for both single and multi-part components) */
19
+ exports?: Record<string, {
20
+ props?: string[];
21
+ dataAttributes?: string[];
22
+ cssVariables?: string[];
23
+ }>;
24
+ }
25
+ export interface PagesMetadata {
26
+ /** The main title for the pages index */
27
+ title: string;
28
+ /** Description below the title (editable, persisted) */
29
+ description?: string;
30
+ /** Array of page metadata */
31
+ pages: PageMetadata[];
32
+ /** Page-level metadata for export (e.g., robots, etc.) */
33
+ pageMetadata?: Record<string, unknown>;
34
+ /** Name of a React component that wraps the autogenerated index content */
35
+ indexWrapperComponent?: string;
36
+ }
37
+ /**
38
+ * Options for metadataToMarkdown and metadataToMarkdownAst functions
39
+ */
40
+ export interface MetadataToMarkdownOptions {
41
+ /**
42
+ * Custom editable section marker comment.
43
+ * If not provided, uses the default marker.
44
+ */
45
+ editableMarker?: string;
46
+ /**
47
+ * Name of a React component to wrap around the autogenerated index content.
48
+ * If provided, the generated markdown will wrap the page list and detail sections
49
+ * in this component (e.g., `<PagesIndex>...</PagesIndex>`).
50
+ * @example 'PagesIndex'
51
+ */
52
+ indexWrapperComponent?: string;
53
+ /**
54
+ * The path to the file being generated. Used in autogenerated comments to help
55
+ * users validate the file.
56
+ */
57
+ path?: string;
58
+ }
59
+ export declare function metadataToMarkdownAst(data: PagesMetadata, options?: MetadataToMarkdownOptions): Root;
60
+ /**
61
+ * Converts an array of page metadata into the markdown format (string)
62
+ */
63
+ export declare function metadataToMarkdown(data: PagesMetadata, options?: MetadataToMarkdownOptions | string): string;
64
+ /**
65
+ * Parses markdown content and extracts page metadata using unified
66
+ */
67
+ export declare function markdownToMetadata(markdown: string): Promise<PagesMetadata | null>;