igniteui-astro-components 0.0.27 → 0.0.29
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 -2
- package/src/assets/images/anatomy-test.png +0 -0
- 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 -195
- package/src/components/DocsSubHeader/DocsSubHeader.scss +181 -178
- 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 +205 -133
- package/src/components/SearchAdvanced/SearchAdvanced.scss +152 -153
- package/src/components/mdx/Anatomy/Anatomy.astro +51 -0
- package/src/components/mdx/Anatomy/Anatomy.scss +40 -0
- 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 +41 -41
- package/src/virtual-modules.d.ts +11 -2
|
@@ -6,11 +6,11 @@ const HEADING_TAGS = new Set(['h2', 'h3', 'h4', 'h5', 'h6']);
|
|
|
6
6
|
// Extract the text content of a hast node (ignores child elements, reads text/raw nodes).
|
|
7
7
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8
8
|
function textContent(node: any): string {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
let text = '';
|
|
10
|
+
visit(node, (child) => {
|
|
11
|
+
if (child.type === 'text' || child.type === 'raw') text += child.value ?? '';
|
|
12
|
+
});
|
|
13
|
+
return text;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
/**
|
|
@@ -25,50 +25,50 @@ function textContent(node: any): string {
|
|
|
25
25
|
* the button href and the heading's id always match.
|
|
26
26
|
*/
|
|
27
27
|
export function rehypeHeadingAnchors() {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
29
|
+
return (tree: any) => {
|
|
30
|
+
const slugger = new Slugger();
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
33
|
+
visit(tree, 'element', (node: any) => {
|
|
34
|
+
if (!HEADING_TAGS.has(node.tagName)) return;
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
node.properties ??= {};
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
// Reuse an existing id or generate one from heading text.
|
|
39
|
+
if (typeof node.properties.id !== 'string') {
|
|
40
|
+
node.properties.id = slugger.slug(textContent(node));
|
|
41
|
+
} else {
|
|
42
|
+
// Keep slugger in sync so it doesn't generate duplicate ids.
|
|
43
|
+
slugger.slug(node.properties.id);
|
|
44
|
+
}
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
const id = node.properties.id as string;
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
48
|
+
const iconButton = {
|
|
49
|
+
type: 'element',
|
|
50
|
+
tagName: 'igc-icon-button',
|
|
51
|
+
properties: {
|
|
52
|
+
class: 'igd-anchor-link',
|
|
53
|
+
href: `#${id}`,
|
|
54
|
+
variant: 'flat',
|
|
55
|
+
'aria-label': 'Link to this section',
|
|
56
|
+
tabIndex: 0,
|
|
57
|
+
},
|
|
58
|
+
children: [
|
|
59
|
+
{
|
|
60
|
+
type: 'element',
|
|
61
|
+
tagName: 'igc-icon',
|
|
62
|
+
properties: {
|
|
63
|
+
name: 'link',
|
|
64
|
+
collection: 'docs',
|
|
65
|
+
},
|
|
66
|
+
children: [],
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
};
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
node.children.push(iconButton);
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
74
|
}
|
|
@@ -12,29 +12,29 @@ import { visit } from 'unist-util-visit';
|
|
|
12
12
|
// Concatenate all descendant text of a HAST node.
|
|
13
13
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
14
|
function textContent(node: any): string {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
if (node.type === 'text') return node.value ?? '';
|
|
16
|
+
if (!node.children) return '';
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
|
+
return node.children.map((c: any) => textContent(c)).join('');
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export function rehypePagefindIgnore() {
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23
|
+
return (tree: any) => {
|
|
22
24
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
node.properties = { ...node.properties, 'data-pagefind-ignore': 'all' };
|
|
28
|
-
};
|
|
25
|
+
visit(tree, 'element', (node: any) => {
|
|
26
|
+
const ignore = () => {
|
|
27
|
+
node.properties = { ...node.properties, 'data-pagefind-ignore': 'all' };
|
|
28
|
+
};
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
// Fenced code blocks (covers their inner <code> via subtree ignore).
|
|
31
|
+
if (node.tagName === 'pre') return ignore();
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
// Inline code that reduces to a single alphanumeric token.
|
|
34
|
+
if (node.tagName === 'code') {
|
|
35
|
+
const token = textContent(node).replace(/[^a-z0-9]/gi, '');
|
|
36
|
+
if (token.length <= 1) ignore();
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
40
|
}
|
|
@@ -11,39 +11,39 @@ let _counter = 0;
|
|
|
11
11
|
* - tabindex="0" makes the scroll region keyboard-focusable
|
|
12
12
|
*/
|
|
13
13
|
export function rehypeTableWrapper() {
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
|
+
return (tree: any) => {
|
|
14
16
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
visit(tree, 'element', (node: any, index: number | undefined, parent: any) => {
|
|
18
|
-
if (node.tagName !== 'table' || !parent || index == null) return;
|
|
17
|
+
visit(tree, 'element', (node: any, index: number | undefined, parent: any) => {
|
|
18
|
+
if (node.tagName !== 'table' || !parent || index == null) return;
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
// Find an existing <caption> to use as the accessible label.
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
|
+
const caption = node.children?.find((c: any) => c.tagName === 'caption');
|
|
23
|
+
let labelId: string;
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
if (caption) {
|
|
26
|
+
// Reuse or assign an id on the caption element.
|
|
27
|
+
labelId = caption.properties?.id || `igd-table-caption-${++_counter}`;
|
|
28
|
+
caption.properties = { ...caption.properties, id: labelId };
|
|
29
|
+
} else {
|
|
30
|
+
// No caption — generate a unique id for the wrapper itself.
|
|
31
|
+
labelId = `igd-table-${++_counter}`;
|
|
32
|
+
}
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
34
|
+
const wrapper = {
|
|
35
|
+
type: 'element',
|
|
36
|
+
tagName: 'div',
|
|
37
|
+
properties: {
|
|
38
|
+
className: ['igd-table-wrapper'],
|
|
39
|
+
role: 'region',
|
|
40
|
+
'aria-labelledby': labelId,
|
|
41
|
+
tabIndex: 0,
|
|
42
|
+
},
|
|
43
|
+
children: [node],
|
|
44
|
+
};
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
parent.children[index] = wrapper;
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
49
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `remark-docfx` was removed — its responsibilities were split into
|
|
3
|
+
* dedicated plugins:
|
|
4
|
+
*
|
|
5
|
+
* - {@link ./remark-env-vars.ts} — `{environment:...}` variable substitution
|
|
6
|
+
* - {@link ./remark-html-transforms.ts} — `<code-view>` / divider HTML transforms
|
|
7
|
+
* - {@link ./remark-md-links.ts} — relative `.md` link rewriting
|
|
8
|
+
*
|
|
9
|
+
* This file is intentionally kept as a placeholder (not re-exported from
|
|
10
|
+
* `package.json`) rather than deleted.
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
@@ -37,7 +37,10 @@ function loadEnv(): Record<string, string> {
|
|
|
37
37
|
_envSourcePath = currentPath;
|
|
38
38
|
_env = null;
|
|
39
39
|
|
|
40
|
-
if (!currentPath) {
|
|
40
|
+
if (!currentPath) {
|
|
41
|
+
_env = {};
|
|
42
|
+
return _env;
|
|
43
|
+
}
|
|
41
44
|
const sourceRoot = path.resolve(currentPath);
|
|
42
45
|
const parent = path.dirname(sourceRoot);
|
|
43
46
|
|
|
@@ -48,7 +51,7 @@ function loadEnv(): Record<string, string> {
|
|
|
48
51
|
path.join(parent, 'en', 'environment.json'),
|
|
49
52
|
];
|
|
50
53
|
|
|
51
|
-
const envPath = candidates.find(c => fs.existsSync(c));
|
|
54
|
+
const envPath = candidates.find((c) => fs.existsSync(c));
|
|
52
55
|
|
|
53
56
|
if (!envPath) {
|
|
54
57
|
try {
|
|
@@ -59,8 +62,13 @@ function loadEnv(): Record<string, string> {
|
|
|
59
62
|
const docConfig = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
|
60
63
|
const demosUrl: string =
|
|
61
64
|
docConfig[platform]?.samplesBrowsers?.[envKey] ??
|
|
62
|
-
docConfig[platform]?.samplesBrowsers?.['development'] ??
|
|
63
|
-
|
|
65
|
+
docConfig[platform]?.samplesBrowsers?.['development'] ??
|
|
66
|
+
'';
|
|
67
|
+
_env = {
|
|
68
|
+
dvDemosBaseUrl: demosUrl,
|
|
69
|
+
demosBaseUrl: demosUrl,
|
|
70
|
+
infragisticsBaseUrl: 'https://www.infragistics.com',
|
|
71
|
+
};
|
|
64
72
|
} else {
|
|
65
73
|
_env = {};
|
|
66
74
|
}
|
|
@@ -18,9 +18,13 @@ import path from 'node:path';
|
|
|
18
18
|
function rewriteMdLink(url: string, filePath: string, docsDir: string): string {
|
|
19
19
|
if (!url) return url;
|
|
20
20
|
if (
|
|
21
|
-
url.startsWith('http://') ||
|
|
22
|
-
url.startsWith('
|
|
23
|
-
|
|
21
|
+
url.startsWith('http://') ||
|
|
22
|
+
url.startsWith('https://') ||
|
|
23
|
+
url.startsWith('/') ||
|
|
24
|
+
url.startsWith('#') ||
|
|
25
|
+
url.startsWith('mailto:')
|
|
26
|
+
)
|
|
27
|
+
return url;
|
|
24
28
|
|
|
25
29
|
const hashIdx = url.indexOf('#');
|
|
26
30
|
const qIdx = url.indexOf('?');
|
|
@@ -46,7 +50,9 @@ export function remarkMdLinks() {
|
|
|
46
50
|
const filePath = (file.path as string) ?? '';
|
|
47
51
|
const docsDir = process.env.DOCS_SOURCE_PATH
|
|
48
52
|
? path.resolve(process.env.DOCS_SOURCE_PATH)
|
|
49
|
-
:
|
|
53
|
+
: filePath
|
|
54
|
+
? path.dirname(filePath)
|
|
55
|
+
: '';
|
|
50
56
|
|
|
51
57
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
52
58
|
visit(tree, (node: any) => {
|
|
@@ -13,15 +13,20 @@ export const DOCS_COLLECTION = 'docs';
|
|
|
13
13
|
* Only needed when the desired name differs from the filename (minus .svg).
|
|
14
14
|
*/
|
|
15
15
|
export const ALIASES: Record<string, string> = {
|
|
16
|
-
|
|
16
|
+
expand: 'expand-icon',
|
|
17
17
|
'react-logo': 'react',
|
|
18
|
-
'wc-logo':
|
|
18
|
+
'wc-logo': 'web-component-logo',
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
/** Icon names that belong to the "brand" category (logos). */
|
|
22
22
|
export const BRAND_ICONS = new Set([
|
|
23
|
-
'angular-logo',
|
|
24
|
-
'
|
|
23
|
+
'angular-logo',
|
|
24
|
+
'blazor-logo',
|
|
25
|
+
'react-logo',
|
|
26
|
+
'wc-logo',
|
|
27
|
+
'github-logo',
|
|
28
|
+
'chatgpt',
|
|
29
|
+
'claude',
|
|
25
30
|
]);
|
|
26
31
|
|
|
27
32
|
// Vite glob — imports raw SVG content at build time.
|
|
@@ -45,7 +50,10 @@ export interface IconEntry {
|
|
|
45
50
|
function buildIconList(): IconEntry[] {
|
|
46
51
|
const stemToSvg = new Map<string, string>();
|
|
47
52
|
for (const [p, svg] of Object.entries(svgModules)) {
|
|
48
|
-
const stem = p
|
|
53
|
+
const stem = p
|
|
54
|
+
.split('/')
|
|
55
|
+
.pop()!
|
|
56
|
+
.replace(/\.svg$/, '');
|
|
49
57
|
stemToSvg.set(stem, svg);
|
|
50
58
|
}
|
|
51
59
|
|