From c7f73ddde435b89dc618391ecee2ad2eb55d1082 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Wed, 25 Sep 2024 19:25:34 -0400 Subject: [PATCH] =?UTF-8?q?Add=20frog=20protocols=20=F0=9F=90=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/content/ProtocolBadge.tsx | 9 +++++++++ .../sidebar-navigation/WaylandProtocolLinks.tsx | 9 +++++++++ src/model/protocol-source-link-builder.ts | 8 ++++++++ src/model/wayland-protocol-metadata.ts | 1 + 4 files changed, 27 insertions(+) diff --git a/src/components/content/ProtocolBadge.tsx b/src/components/content/ProtocolBadge.tsx index 425c6db..77960a9 100644 --- a/src/components/content/ProtocolBadge.tsx +++ b/src/components/content/ProtocolBadge.tsx @@ -41,6 +41,11 @@ const cosmicProtocolsUnstableBadgeTheme: BadgeTheme = { backgroundColor: 'bg-red-100', } +const frogProtocolsBadgeTheme: BadgeTheme = { + textColor: 'text-red-800', + backgroundColor: 'bg-green-100', +} + const westonProtocolsUnstableBadgeTheme: BadgeTheme = { textColor: 'text-yellow-800', backgroundColor: 'bg-yellow-100', @@ -67,6 +72,8 @@ function badgeThemeFor( return kdeProtocolsUnstableBadgeTheme } else if (source === WaylandProtocolSource.CosmicProtocols) { return cosmicProtocolsUnstableBadgeTheme + } else if (source === WaylandProtocolSource.FrogProtocols) { + return frogProtocolsBadgeTheme } else if (source === WaylandProtocolSource.WestonProtocols) { return westonProtocolsUnstableBadgeTheme } else { @@ -88,6 +95,8 @@ export const ProtocolBadge: React.FC<{ protocol: WaylandProtocolMetadata }> = ({ ? 'kde' : protocol.source === WaylandProtocolSource.CosmicProtocols ? 'cosmic' + : protocol.source === WaylandProtocolSource.FrogProtocols + ? 'frog' : protocol.source === WaylandProtocolSource.WestonProtocols ? 'weston' : protocol.source === WaylandProtocolSource.External diff --git a/src/components/sidebar-navigation/WaylandProtocolLinks.tsx b/src/components/sidebar-navigation/WaylandProtocolLinks.tsx index 114e078..e04c019 100644 --- a/src/components/sidebar-navigation/WaylandProtocolLinks.tsx +++ b/src/components/sidebar-navigation/WaylandProtocolLinks.tsx @@ -131,6 +131,14 @@ function groupProtocolsIntoSections(): Section[] { ), } + const frogProtocols: Section = { + name: 'Frog', + items: protocols.filter( + ({ source }) => + source === WaylandProtocolSource.FrogProtocols + ), + } + const westonProtocolsUnstable: Section = { name: 'Weston unstable', items: protocols.filter( @@ -155,6 +163,7 @@ function groupProtocolsIntoSections(): Section[] { wlrProtocolsUnstable, kdeProtocolsUnstable, cosmicProtocolsUnstable, + frogProtocols, westonProtocolsUnstable, externalProtocols, ] diff --git a/src/model/protocol-source-link-builder.ts b/src/model/protocol-source-link-builder.ts index edeb6a6..ce7ce21 100644 --- a/src/model/protocol-source-link-builder.ts +++ b/src/model/protocol-source-link-builder.ts @@ -58,6 +58,14 @@ const sourceRepositoryUrls: Record< // eslint-disable-next-line no-template-curly-in-string 'https://github.com/pop-os/cosmic-protocols/blob/main/${stability}/${protocol}.xml', }, + [WaylandProtocolSource.FrogProtocols]: { + repositoryUrl: 'https://github.com/misyltoad/frog-protocols', + stabilityUrl: + 'https://github.com/misyltoad/frog-protocols/tree/main/frog-protocols', + protocolUrl: + // eslint-disable-next-line no-template-curly-in-string + 'https://github.com/misyltoad/frog-protocols/blob/main/frog-protocols/${protocol}.xml', + }, [WaylandProtocolSource.WestonProtocols]: { repositoryUrl: 'https://gitlab.freedesktop.org/wayland/weston', stabilityUrl: diff --git a/src/model/wayland-protocol-metadata.ts b/src/model/wayland-protocol-metadata.ts index 13d63d8..a85315e 100644 --- a/src/model/wayland-protocol-metadata.ts +++ b/src/model/wayland-protocol-metadata.ts @@ -10,6 +10,7 @@ export enum WaylandProtocolSource { WlrProtocols = 'wlr-protocols', KDEProtocols = 'kde-protocols', CosmicProtocols = 'cosmic-protocols', + FrogProtocols = 'frog-protocols', WestonProtocols = 'weston-protocols', External = 'external', }