diff --git a/package.json b/package.json index e4436820..8c332ac6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "impro", - "version": "0.14.11", + "version": "0.14.12", "type": "module", "scripts": { "start": "rm -rf build && NODE_ENV=development eleventy --serve", diff --git a/src/css/style.css b/src/css/style.css index b311b13a..ecf58190 100644 --- a/src/css/style.css +++ b/src/css/style.css @@ -7385,13 +7385,27 @@ image-cropper { font-weight: 600; } +.plugin-local-badge { + font-size: 12px; + font-weight: 400; + background: var(--primary-button-muted-color); + padding: 3px 8px; + border-radius: var(--tag-border-radius); + display: inline-block; + min-width: fit-content; + margin-left: 5px; + vertical-align: middle; + margin-bottom: 3px; +} + .plugin-list-item-description { font-size: 14px; opacity: 0.8; margin-top: 2px; } -.plugin-list-item-version { +.plugin-list-item-version, +.plugin-list-item-author { font-size: 12px; opacity: 0.6; margin-top: 4px; diff --git a/src/js/plugins/pluginService.js b/src/js/plugins/pluginService.js index 650fbfbb..6669f24d 100644 --- a/src/js/plugins/pluginService.js +++ b/src/js/plugins/pluginService.js @@ -184,10 +184,10 @@ export class PluginService extends EventEmitter { const installedPluginsPreference = this._getInstalledPluginsPreference(); const results = await Promise.all( installedPluginsPreference.map(async (entry) => { - const manifest = await this.sourceProvider.ensureManifest( - entry.id, - entry.version, - ); + const [manifest, listing] = await Promise.all([ + this.sourceProvider.ensureManifest(entry.id, entry.version), + this.registry.getPluginListing(entry.id).catch(() => null), + ]); if (!manifest) return null; return { id: entry.id, @@ -195,6 +195,7 @@ export class PluginService extends EventEmitter { enabled: entry.enabled === true, loaded: this.pluginBridge.isLoaded(entry.id), hasSettings: this.registries.settingTabs.has(entry.id), + local: listing?.local === true, }; }), ); diff --git a/src/js/views/settings/communityPlugins.view.js b/src/js/views/settings/communityPlugins.view.js index d65b8e0c..742bfeb4 100644 --- a/src/js/views/settings/communityPlugins.view.js +++ b/src/js/views/settings/communityPlugins.view.js @@ -20,14 +20,12 @@ class SettingsCommunityPluginsView extends View { await requireAuth(); const state = { - entries: [], - loading: true, + entries: null, error: null, pending: new Set(), }; async function loadEntries() { - state.loading = true; state.error = null; renderPage(); try { @@ -35,7 +33,6 @@ class SettingsCommunityPluginsView extends View { } catch (error) { state.error = error.message ?? String(error); } - state.loading = false; renderPage(); } @@ -102,8 +99,8 @@ class SettingsCommunityPluginsView extends View { onClickBackButton: () => window.router.go("/settings/plugins"), })}
- ${state.loading - ? html`

Loading…

` + ${!state.entries + ? "" // loading is usually quick, so don't show a loading state : state.error ? html`
Failed to load plugins
@@ -129,6 +126,11 @@ class SettingsCommunityPluginsView extends View {
${entry.name} + ${entry.local + ? html`local` + : ""}
${entry.description ? html`
${plugin.manifest.name} + ${plugin.local + ? html`local` + : ""}
${plugin.manifest.description ? html`
` : ""}
- v${plugin.manifest.version} + Version: ${plugin.manifest.version} +
+
+ By ${plugin.manifest.author}