igniteui-astro-components 0.0.26 → 0.0.28
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/README.md +82 -74
- package/package.json +16 -9
- package/src/components/CopyCode/CopyCode.astro +21 -7
- package/src/components/DocsBreadcrumb/DocsBreadcrumb.astro +33 -21
- package/src/components/DocsBreadcrumb/DocsBreadcrumb.scss +44 -43
- package/src/components/DocsBreadcrumb/README.md +10 -14
- package/src/components/DocsSidebar/DocsSidebar.astro +47 -45
- package/src/components/DocsSidebar/DocsSidebar.scss +120 -122
- package/src/components/DocsSidebar/README.md +25 -21
- package/src/components/DocsSidebar/SidebarFilterInput.astro +24 -29
- package/src/components/DocsSidebar/SidebarFilterInput.scss +90 -89
- package/src/components/DocsSidebar/SidebarLabel.astro +35 -26
- package/src/components/DocsSidebar/sidebar-filter.ts +93 -56
- package/src/components/DocsSubHeader/DocsSubHeader.astro +256 -185
- package/src/components/DocsSubHeader/DocsSubHeader.scss +181 -169
- package/src/components/DocsSubHeader/README.md +18 -16
- package/src/components/DocsToc/DocsToc.astro +301 -280
- package/src/components/DocsToc/DocsToc.scss +20 -21
- package/src/components/DocsToc/README.md +11 -9
- package/src/components/DocsToc/toTreeNodes.ts +3 -8
- package/src/components/DocsTree/DocsTree.astro +32 -20
- package/src/components/DocsTree/DocsTreeItem.astro +35 -30
- package/src/components/DocsTree/README.md +16 -15
- package/src/components/DocsTree/docs-tree.scss +267 -268
- package/src/components/GlobalFooter/GlobalFooter.astro +10 -10
- package/src/components/GlobalFooter/README.md +3 -2
- package/src/components/GlobalNavBar/GlobalNavBar.astro +4 -2
- package/src/components/GlobalNavBar/GlobalNavBar.module.scss +222 -222
- package/src/components/GlobalNavBar/README.md +3 -2
- package/src/components/LicenseIndicator/LicenseIndicator.astro +7 -5
- package/src/components/LicenseIndicator/LicenseIndicator.scss +3 -3
- package/src/components/MobileSidebarToggle/MobileSidebarToggle.astro +16 -17
- package/src/components/MobileSidebarToggle/README.md +3 -2
- package/src/components/MobileTocToggle/MobileTocToggle.astro +75 -61
- package/src/components/MobileTocToggle/MobileTocToggle.scss +65 -59
- package/src/components/Search/README.md +1 -0
- package/src/components/Search/Search.astro +137 -109
- package/src/components/Search/Search.scss +20 -20
- package/src/components/SearchAdvanced/README.md +21 -15
- package/src/components/SearchAdvanced/SearchAdvanced.astro +220 -133
- package/src/components/SearchAdvanced/SearchAdvanced.scss +152 -153
- package/src/components/mdx/ApiLink/ApiLink.astro +133 -113
- package/src/components/mdx/ApiLink/ApiLink.scss +9 -9
- package/src/components/mdx/ApiLink/README.md +26 -22
- package/src/components/mdx/ApiLink/api-link-index.ts +196 -173
- package/src/components/mdx/ApiRef/ApiRef.astro +54 -51
- package/src/components/mdx/ApiRef/README.md +20 -15
- package/src/components/mdx/Badge/Badge.astro +14 -14
- package/src/components/mdx/Badge/Badge.scss +61 -56
- package/src/components/mdx/Badge/README.md +24 -19
- package/src/components/mdx/DocsAside/DocsAside.astro +30 -37
- package/src/components/mdx/DocsAside/DocsAside.scss +82 -82
- package/src/components/mdx/DocsAside/README.md +22 -22
- package/src/components/mdx/Faq/Faq.astro +86 -0
- package/src/components/mdx/Faq/Faq.scss +105 -0
- package/src/components/mdx/Faq/FaqItem.astro +117 -0
- package/src/components/mdx/Faq/README.md +223 -0
- package/src/components/mdx/Faq/types.ts +34 -0
- package/src/components/mdx/PlatformBlock/PlatformBlock.astro +3 -2
- package/src/components/mdx/PlatformBlock/README.md +6 -8
- package/src/components/mdx/Sample/README.md +21 -16
- package/src/components/mdx/Sample/Sample.astro +97 -74
- package/src/components/mdx/Sample/Sample.scss +132 -132
- package/src/content-helper.ts +71 -72
- package/src/content.config.ts +1 -6
- package/src/integration.ts +566 -512
- package/src/layouts/DocsLayout/DocsLayout.astro +228 -182
- package/src/layouts/DocsLayout/DocsLayout.scss +261 -261
- package/src/layouts/DocsLayout/README.md +24 -35
- package/src/lib/nav-helpers.ts +88 -82
- package/src/lib/types.ts +76 -76
- package/src/llms.ts +205 -166
- package/src/platform.ts +312 -162
- package/src/plugins/rehype-heading-anchors.ts +45 -45
- package/src/plugins/rehype-pagefind-ignore.ts +19 -19
- package/src/plugins/rehype-table-wrapper.ts +30 -30
- package/src/plugins/remark-docfx.ts +12 -0
- package/src/plugins/remark-env-vars.ts +12 -4
- package/src/plugins/remark-md-links.ts +10 -4
- package/src/scripts/icon-manifest.ts +13 -5
- package/src/scripts/sample-widget.ts +557 -501
- package/src/sidebar.ts +103 -97
- package/src/styles/global/_code-blocks.scss +43 -44
- package/src/styles/global/_component-themes.scss +151 -153
- package/src/styles/global/_icon-gallery.scss +81 -81
- package/src/styles/global/_index.scss +0 -1
- package/src/styles/global/_markdown.scss +816 -787
- package/src/styles/global/_palette.scss +456 -110
- package/src/styles/global/_search-shared.scss +402 -398
- package/src/styles/global/_type-scale.scss +127 -127
- package/src/styles/global/_variables.scss +138 -111
- package/src/styles/theme.scss +49 -40
- package/src/virtual-modules.d.ts +11 -2
package/src/content-helper.ts
CHANGED
|
@@ -41,18 +41,18 @@ const SKIP_TITLE = '\x00skip';
|
|
|
41
41
|
*/
|
|
42
42
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
43
43
|
function withTitleFilter(baseLoader: any): any {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
44
|
+
return {
|
|
45
|
+
...baseLoader,
|
|
46
|
+
load: async (ctx: any) => {
|
|
47
|
+
await baseLoader.load(ctx);
|
|
48
|
+
for (const id of ctx.store.keys()) {
|
|
49
|
+
const entry = ctx.store.get(id);
|
|
50
|
+
if (!entry?.data?.title || entry.data.title === SKIP_TITLE) {
|
|
51
|
+
ctx.store.delete(id);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
/**
|
|
@@ -61,41 +61,38 @@ function withTitleFilter(baseLoader: any): any {
|
|
|
61
61
|
* missing one so the glob loader doesn't throw InvalidContentEntryDataError.
|
|
62
62
|
*/
|
|
63
63
|
function makeDocsSchema(extend?: z.ZodObject<z.ZodRawShape>) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
64
|
+
const base = z.object({
|
|
65
|
+
title: z.string(),
|
|
66
|
+
description: z.string().optional().nullable(),
|
|
67
|
+
keywords: z.string().optional().nullable(),
|
|
68
|
+
draft: z.boolean().optional(),
|
|
69
|
+
license: z.string().optional(),
|
|
70
|
+
});
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
const schema = extend ? base.merge(extend) : base;
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
},
|
|
83
|
-
schema,
|
|
84
|
-
);
|
|
74
|
+
return z.preprocess((data: unknown) => {
|
|
75
|
+
if (typeof data === 'object' && data !== null) {
|
|
76
|
+
const d = data as Record<string, unknown>;
|
|
77
|
+
if (d['description'] === null) delete d['description'];
|
|
78
|
+
if (!d['title']) return { ...d, title: SKIP_TITLE };
|
|
79
|
+
}
|
|
80
|
+
return data;
|
|
81
|
+
}, schema);
|
|
85
82
|
}
|
|
86
83
|
|
|
87
84
|
interface CreateDocsCollectionOptions {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
85
|
+
/**
|
|
86
|
+
* Glob patterns to exclude (relative to `sourceDir`). A leading `!` is
|
|
87
|
+
* added automatically when missing, so `'internal/**'` and
|
|
88
|
+
* `'!internal/**'` are both accepted.
|
|
89
|
+
*/
|
|
90
|
+
exclude?: string[];
|
|
91
|
+
/**
|
|
92
|
+
* Additional Zod object fields merged into the docs schema.
|
|
93
|
+
* Useful for repo-specific frontmatter fields.
|
|
94
|
+
*/
|
|
95
|
+
extendSchema?: z.ZodObject<z.ZodRawShape>;
|
|
99
96
|
}
|
|
100
97
|
|
|
101
98
|
/**
|
|
@@ -107,38 +104,40 @@ interface CreateDocsCollectionOptions {
|
|
|
107
104
|
* @param options - Optional exclude patterns and schema extension.
|
|
108
105
|
*/
|
|
109
106
|
export function createDocsCollection(
|
|
110
|
-
|
|
111
|
-
|
|
107
|
+
sourceDir?: string,
|
|
108
|
+
{ exclude = [], extendSchema }: CreateDocsCollectionOptions = {},
|
|
112
109
|
) {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
110
|
+
const dir = sourceDir ?? process.env.DOCS_SOURCE_PATH;
|
|
111
|
+
if (!dir) {
|
|
112
|
+
throw new Error(
|
|
113
|
+
'[docs-template] createDocsCollection: no source directory provided. ' +
|
|
114
|
+
'Pass a path as the first argument or set the DOCS_SOURCE_PATH env variable.',
|
|
115
|
+
);
|
|
116
|
+
}
|
|
120
117
|
|
|
121
|
-
|
|
118
|
+
const excludePatterns = exclude.map((p) => (p.startsWith('!') ? p : `!${p}`));
|
|
122
119
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
120
|
+
return defineCollection({
|
|
121
|
+
loader: withTitleFilter(
|
|
122
|
+
glob({
|
|
123
|
+
base: pathToFileURL(dir.endsWith('/') ? dir : dir + '/'),
|
|
124
|
+
pattern: [
|
|
125
|
+
'*.{md,mdx}',
|
|
126
|
+
'**/*.{md,mdx}',
|
|
127
|
+
'!**/_*.{md,mdx}',
|
|
128
|
+
'!**/toc.yml',
|
|
129
|
+
'!**/*.json',
|
|
130
|
+
'!readme.md',
|
|
131
|
+
'!README.md',
|
|
132
|
+
'!CHANGELOG.md',
|
|
133
|
+
'!LICENSE.md',
|
|
134
|
+
...excludePatterns,
|
|
135
|
+
],
|
|
136
|
+
}),
|
|
137
|
+
),
|
|
138
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
139
|
+
schema: makeDocsSchema(extendSchema) as any,
|
|
140
|
+
});
|
|
142
141
|
}
|
|
143
142
|
|
|
144
143
|
// ---------------------------------------------------------------------------
|
|
@@ -155,5 +154,5 @@ export function createDocsCollection(
|
|
|
155
154
|
* export { collections };
|
|
156
155
|
*/
|
|
157
156
|
export const collections = {
|
|
158
|
-
|
|
157
|
+
docs: createDocsCollection(process.env.DOCS_SOURCE_PATH),
|
|
159
158
|
};
|
package/src/content.config.ts
CHANGED
|
@@ -7,11 +7,6 @@ import { createDocsCollection } from './content-helper.ts';
|
|
|
7
7
|
// proper frontmatter to these files (no `title` → fail schema).
|
|
8
8
|
export const collections = {
|
|
9
9
|
docs: createDocsCollection(process.env.DOCS_SOURCE_PATH, {
|
|
10
|
-
exclude: [
|
|
11
|
-
'grids_templates/**',
|
|
12
|
-
'style-guide.md',
|
|
13
|
-
'themes/sass/presets/**',
|
|
14
|
-
'themes.md',
|
|
15
|
-
],
|
|
10
|
+
exclude: ['grids_templates/**', 'style-guide.md', 'themes/sass/presets/**', 'themes.md'],
|
|
16
11
|
}),
|
|
17
12
|
};
|