feat: add beta tag to global search plugin

This commit is contained in:
SethBurkart123
2025-05-25 10:21:24 +10:00
parent fc288bdf01
commit f66340cb63
7 changed files with 78 additions and 5 deletions
+9 -1
View File
@@ -33,6 +33,7 @@
pluginId: string;
name: string;
description: string;
beta?: boolean;
settings: Record<string, SettingType>;
}
@@ -194,7 +195,14 @@
{#if (plugin as any).disableToggle}
<div class="flex justify-between items-center px-4 py-3">
<div class="pr-4">
<h2 class="text-sm font-bold">Enable {plugin.name}</h2>
<h2 class="text-sm font-bold flex items-center gap-2">
Enable {plugin.name}
{#if plugin.beta}
<span class="px-2 py-0.5 text-xs font-medium bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-300 rounded-full">
Beta
</span>
{/if}
</h2>
<p class="text-xs">{plugin.description}</p>
</div>
<div>
@@ -93,6 +93,7 @@ const globalSearchPlugin: Plugin<typeof settings> = {
settings: settingsInstance.settings,
disableToggle: true,
defaultEnabled: false,
beta: true,
styles: styles,
run: async (api) => {
+1
View File
@@ -31,6 +31,7 @@ const testPlugin: Plugin<typeof settings> = {
version: "1.0.0",
settings: settingsInstance.settings,
disableToggle: true,
beta: true,
run: async (api) => {
console.log("Test plugin running");
+2
View File
@@ -182,6 +182,7 @@ export class PluginManager {
pluginId: string;
name: string;
description: string;
beta?: boolean;
settings: {
[key: string]:
| (Omit<BooleanSetting, "type"> & { type: "boolean"; id: string })
@@ -235,6 +236,7 @@ export class PluginManager {
pluginId: id,
name: plugin.name,
description: plugin.description,
beta: plugin.beta,
settings: Object.fromEntries(settingsEntries),
disableToggle: plugin.disableToggle,
};
+1
View File
@@ -132,6 +132,7 @@ export interface Plugin<T extends PluginSettings = PluginSettings, S = any> {
styles?: string; // Optional CSS styles for the plugin
disableToggle?: boolean; // Optional flag to show/hide the plugin's enable/disable toggle in settings
defaultEnabled?: boolean; // Optional flag to set the plugin's default enabled state
beta?: boolean; // Optional flag to mark the plugin as beta
run: (
api: PluginAPI<T, S>,
) => void | Promise<void> | (() => void) | Promise<() => void>;