1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-13 00:10:37 +02:00

Plugins: Add support for promo_tile manifest key

This commit is contained in:
Laurent Cozic
2024-01-22 17:12:40 +00:00
parent a8f6676fb3
commit fd432f928d
3 changed files with 42 additions and 18 deletions

View File

@ -1,4 +1,4 @@
import { PluginManifest, PluginPermission, Screenshot, Icons } from './types';
import { PluginManifest, PluginPermission, Image, Icons } from './types';
import validatePluginId from './validatePluginId';
export default function manifestFromObject(o: any): PluginManifest {
@ -31,11 +31,15 @@ export default function manifestFromObject(o: any): PluginManifest {
return o[name];
};
const getScreenshots = (defaultValue: Screenshot[] = []): Screenshot[] => {
const getScreenshots = (defaultValue: Image[] = []): Image[] => {
if (!o.screenshots) return defaultValue;
return o.screenshots;
};
const getPromoTile = (): Image => {
return o.promo_tile || null;
};
const getIcons = (): Icons => {
if (!o.icons) return null;
for (const size of [16, 32, 48, 128]) {
@ -62,6 +66,7 @@ export default function manifestFromObject(o: any): PluginManifest {
screenshots: getScreenshots(),
permissions: permissions,
icons: getIcons(),
promo_tile: getPromoTile(),
_recommended: getBoolean('_recommended', false, false),
};