igniteui-astro-components 1.3.0 → 1.4.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.
- package/README.md +112 -2
- package/package.json +22 -20
- package/src/chrome/contract.d.mts +12 -0
- package/src/chrome/contract.mjs +92 -0
- package/src/chrome/integration.ts +173 -0
- package/src/components/DocsSidebar/DocsSidebar.astro +21 -1
- package/src/components/DocsSidebar/DocsSidebar.scss +31 -2
- package/src/components/DocsSidebar/README.md +12 -0
- package/src/components/DocsSidebar/SidebarLabel.astro +1 -1
- package/src/components/DocsSidebar/sidebar-tooltip.ts +174 -0
- package/src/components/DocsTree/DocsTreeItem.astro +9 -3
- package/src/components/DocsTree/README.md +13 -12
- package/src/components/DocsTree/docs-tree.scss +106 -39
- package/src/integration.ts +14 -1
- package/src/layouts/DocsLayout/DocsLayout.astro +56 -8
- package/src/layouts/DocsLayout/README.md +17 -0
- package/src/platform.ts +39 -11
- package/src/virtual-modules.d.ts +7 -0
package/src/platform.ts
CHANGED
|
@@ -60,6 +60,18 @@ export interface NavConfig {
|
|
|
60
60
|
navUrl: string | null;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
/** The legacy fetched chrome's own CSS. Kept last in IG_STYLES, as before. */
|
|
64
|
+
const IG_LEGACY_CHROME_STYLES: HeadEntry[] = [
|
|
65
|
+
{
|
|
66
|
+
tag: 'link',
|
|
67
|
+
attrs: { rel: 'stylesheet', href: 'https://www.infragistics.com/css/navigation.css' },
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
tag: 'link',
|
|
71
|
+
attrs: { rel: 'stylesheet', href: 'https://www.infragistics.com/css/footer.css' },
|
|
72
|
+
},
|
|
73
|
+
];
|
|
74
|
+
|
|
63
75
|
// ---------------------------------------------------------------------------
|
|
64
76
|
// Shared IG styles — used by: angular, react, blazor, web-components, slingshot
|
|
65
77
|
// ---------------------------------------------------------------------------
|
|
@@ -95,18 +107,12 @@ const IG_STYLES: HeadEntry[] = [
|
|
|
95
107
|
tag: 'link',
|
|
96
108
|
attrs: { rel: 'stylesheet', href: 'https://fonts.googleapis.com/icon?family=Material+Icons' },
|
|
97
109
|
},
|
|
98
|
-
|
|
99
|
-
tag: 'link',
|
|
100
|
-
attrs: { rel: 'stylesheet', href: 'https://www.infragistics.com/css/navigation.css' },
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
tag: 'link',
|
|
104
|
-
attrs: { rel: 'stylesheet', href: 'https://www.infragistics.com/css/footer.css' },
|
|
105
|
-
},
|
|
110
|
+
...IG_LEGACY_CHROME_STYLES,
|
|
106
111
|
];
|
|
107
112
|
|
|
108
113
|
// ---------------------------------------------------------------------------
|
|
109
114
|
// Shared IG scripts — used by: angular, react, blazor, web-components, slingshot
|
|
115
|
+
// All three belong to the legacy fetched chrome.
|
|
110
116
|
// ---------------------------------------------------------------------------
|
|
111
117
|
const IG_SCRIPTS: HeadEntry[] = [
|
|
112
118
|
{
|
|
@@ -380,23 +386,45 @@ export const IGDOCS_PLATFORMS: Record<string, PlatformMeta> = {
|
|
|
380
386
|
},
|
|
381
387
|
};
|
|
382
388
|
|
|
389
|
+
/**
|
|
390
|
+
* The legacy fetched chrome's own CSS and JS: navigation.css, footer.css,
|
|
391
|
+
* jQuery 3.1, plugins.nav.js and navigation.js. Only needed where that chrome
|
|
392
|
+
* renders: a site without igChrome(), or a Japanese build. Matched by entry,
|
|
393
|
+
* not by URL, so a changed URL or a cache-busting query cannot slip past it.
|
|
394
|
+
*/
|
|
395
|
+
const LEGACY_CHROME = new Set<HeadEntry>([...IG_LEGACY_CHROME_STYLES, ...IG_SCRIPTS]);
|
|
396
|
+
|
|
397
|
+
export interface PlatformHeadOptions {
|
|
398
|
+
/**
|
|
399
|
+
* Include the legacy fetched chrome's CSS/JS. Default `true`. Pass `false`
|
|
400
|
+
* when the build renders the synced chrome (igChrome) instead.
|
|
401
|
+
*/
|
|
402
|
+
legacyChrome?: boolean;
|
|
403
|
+
}
|
|
404
|
+
|
|
383
405
|
/**
|
|
384
406
|
* Returns an array of head entries for the given platform.
|
|
385
407
|
* Pass the result to `createDocsSite({ head: getPlatformHead(...) })`.
|
|
386
408
|
*
|
|
387
409
|
* @param platform - Platform identifier.
|
|
388
410
|
* @param lang - Locale — not currently used but kept for API completeness.
|
|
411
|
+
* @param options - See PlatformHeadOptions.
|
|
389
412
|
*/
|
|
390
|
-
export function getPlatformHead(
|
|
413
|
+
export function getPlatformHead(
|
|
414
|
+
platform: string,
|
|
415
|
+
_lang = 'en',
|
|
416
|
+
{ legacyChrome = true }: PlatformHeadOptions = {},
|
|
417
|
+
): HeadEntry[] {
|
|
391
418
|
const def = PLATFORM_DEFS[platform as PlatformKey];
|
|
392
419
|
if (!def) {
|
|
393
420
|
console.warn(`[docs-template] Unknown platform "${platform}" — no head entries injected.`);
|
|
394
421
|
return [];
|
|
395
422
|
}
|
|
423
|
+
const keep = (entry: HeadEntry) => legacyChrome || !LEGACY_CHROME.has(entry);
|
|
396
424
|
return [
|
|
397
425
|
{ tag: 'meta', attrs: { property: 'docs:platform', content: platform } },
|
|
398
|
-
...def.styles,
|
|
399
|
-
...def.scripts,
|
|
426
|
+
...def.styles.filter(keep),
|
|
427
|
+
...def.scripts.filter(keep),
|
|
400
428
|
];
|
|
401
429
|
}
|
|
402
430
|
|
package/src/virtual-modules.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import type { PlatformContext } from './lib/types.ts';
|
|
2
2
|
|
|
3
3
|
declare global {
|
|
4
|
+
/**
|
|
5
|
+
* The synced marketing chrome, defined at build time by the igChrome()
|
|
6
|
+
* integration (src/chrome/integration.ts). Undeclared when it isn't
|
|
7
|
+
* registered: read it as `typeof __IG_CHROME__ !== 'undefined'`.
|
|
8
|
+
*/
|
|
9
|
+
const __IG_CHROME__: import('./chrome/integration').IgChromeData;
|
|
10
|
+
|
|
4
11
|
namespace App {
|
|
5
12
|
interface Locals {
|
|
6
13
|
platformContext?: PlatformContext;
|