fix: restore content compatibility checks
This commit is contained in:
@@ -2,19 +2,29 @@
|
||||
// named exports. Import its ESM entry directly until upstream ships a valid
|
||||
// TypeScript declaration; the selected runtime exports remain tree-shakeable.
|
||||
import {
|
||||
siAuthelia,
|
||||
siCpanel,
|
||||
siDocker,
|
||||
siDrizzle,
|
||||
siDotnet,
|
||||
siFlutter,
|
||||
siFastify,
|
||||
siGit,
|
||||
siGithub,
|
||||
siGitlab,
|
||||
siJavascript,
|
||||
siLinux,
|
||||
siNginx,
|
||||
siNextcloud,
|
||||
siOpenjdk,
|
||||
siOpencv,
|
||||
siPostgresql,
|
||||
siProxmox,
|
||||
siPython,
|
||||
siPytorch,
|
||||
siSqlite,
|
||||
siTypescript,
|
||||
siUltralytics,
|
||||
siVuedotjs,
|
||||
siWordpress,
|
||||
// @ts-expect-error simple-icons 16.29.0 has no declaration for this ESM file.
|
||||
@@ -29,16 +39,25 @@ export type BrandIconLabel =
|
||||
| 'Linux'
|
||||
| 'Docker'
|
||||
| 'Nginx'
|
||||
| 'Proxmox / KVM'
|
||||
| 'cPanel'
|
||||
| 'Authelia'
|
||||
| 'Nextcloud'
|
||||
| 'Proxmox/KVM'
|
||||
| 'Git'
|
||||
| 'Python'
|
||||
| 'TypeScript/JavaScript'
|
||||
| 'Vue.js'
|
||||
| 'JavaScript'
|
||||
| 'C# / .NET'
|
||||
| 'Flutter / Dart'
|
||||
| 'PostgreSQL / SQL'
|
||||
| 'Flutter/Dart'
|
||||
| 'Fastify'
|
||||
| 'C#/.NET'
|
||||
| 'Headless WordPress'
|
||||
| 'Java'
|
||||
| 'PostgreSQL'
|
||||
| 'Drift/SQLite'
|
||||
| 'Drizzle ORM'
|
||||
| 'PyTorch'
|
||||
| 'Ultralytics/YOLO'
|
||||
| 'OpenCV'
|
||||
| 'GitHub'
|
||||
| 'GitLab'
|
||||
| 'LinkedIn';
|
||||
@@ -95,24 +114,33 @@ const linkedIn: BrandIconDefinition = {
|
||||
|
||||
/**
|
||||
* One canonical icon per visible toolkit/social label. Composite labels use
|
||||
* the most representative official mark (for example, PostgreSQL for SQL).
|
||||
* the most representative official mark (for example, SQLite for Drift/SQLite).
|
||||
*/
|
||||
export const brandIcons: Readonly<Record<BrandIconLabel, BrandIconDefinition>> = {
|
||||
Linux: fromSimpleIcons(siLinux),
|
||||
Docker: fromSimpleIcons(siDocker),
|
||||
Nginx: fromSimpleIcons(siNginx),
|
||||
'Proxmox / KVM': fromSimpleIcons(siProxmox),
|
||||
cPanel: fromSimpleIcons(siCpanel),
|
||||
Authelia: fromSimpleIcons(siAuthelia),
|
||||
Nextcloud: fromSimpleIcons(siNextcloud),
|
||||
'Proxmox/KVM': fromSimpleIcons(siProxmox),
|
||||
Git: fromSimpleIcons(siGit),
|
||||
Python: fromSimpleIcons(siPython),
|
||||
'TypeScript/JavaScript': fromSimpleIcons(siTypescript),
|
||||
'Vue.js': fromSimpleIcons(siVuedotjs),
|
||||
JavaScript: fromSimpleIcons(siJavascript),
|
||||
'C# / .NET': fromSimpleIcons(siDotnet),
|
||||
'Flutter / Dart': fromSimpleIcons(siFlutter),
|
||||
'PostgreSQL / SQL': fromSimpleIcons(siPostgresql),
|
||||
'Flutter/Dart': fromSimpleIcons(siFlutter),
|
||||
Fastify: fromSimpleIcons(siFastify),
|
||||
'C#/.NET': fromSimpleIcons(siDotnet),
|
||||
'Headless WordPress': fromSimpleIcons(siWordpress),
|
||||
// Simple Icons does not currently publish a Java export; OpenJDK is the
|
||||
// official open Java platform mark and is the closest canonical asset.
|
||||
Java: fromSimpleIcons(siOpenjdk),
|
||||
PostgreSQL: fromSimpleIcons(siPostgresql),
|
||||
'Drift/SQLite': fromSimpleIcons(siSqlite),
|
||||
'Drizzle ORM': fromSimpleIcons(siDrizzle),
|
||||
PyTorch: fromSimpleIcons(siPytorch),
|
||||
'Ultralytics/YOLO': fromSimpleIcons(siUltralytics),
|
||||
OpenCV: fromSimpleIcons(siOpencv),
|
||||
GitHub: fromSimpleIcons(siGithub),
|
||||
GitLab: fromSimpleIcons(siGitlab),
|
||||
LinkedIn: linkedIn,
|
||||
@@ -120,9 +148,14 @@ export const brandIcons: Readonly<Record<BrandIconLabel, BrandIconDefinition>> =
|
||||
|
||||
export const brandIconLabels = Object.freeze(Object.keys(brandIcons) as BrandIconLabel[]);
|
||||
|
||||
/** Whether a visible toolkit label has a suitable official icon. */
|
||||
export function brandIconAvailable(label: string): label is BrandIconLabel {
|
||||
return Object.prototype.hasOwnProperty.call(brandIcons, label);
|
||||
}
|
||||
|
||||
/** Resolve a validated content label, failing loudly for an unregistered mark. */
|
||||
export function brandIconFor(label: string): BrandIconDefinition {
|
||||
if (!Object.prototype.hasOwnProperty.call(brandIcons, label)) {
|
||||
if (!brandIconAvailable(label)) {
|
||||
throw new Error(`No official brand icon registered for: ${label}`);
|
||||
}
|
||||
return brandIcons[label as BrandIconLabel];
|
||||
|
||||
Reference in New Issue
Block a user