2019-04-16 18:23:26 +02:00
|
|
|
import pluginPkg from '../../package.json';
|
2020-02-11 17:15:53 +01:00
|
|
|
import pluginLogo from './assets/images/logo.svg';
|
2020-02-13 09:01:32 +01:00
|
|
|
import App from './containers/App';
|
2020-02-27 09:53:50 +01:00
|
|
|
import SettingsPage from './containers/SettingsPage';
|
2020-03-03 16:40:02 +01:00
|
|
|
import InputMedia from './components/InputMedia';
|
2020-02-24 15:45:00 +01:00
|
|
|
|
2020-02-13 07:44:57 +01:00
|
|
|
import trads from './translations';
|
2019-04-18 01:10:38 +02:00
|
|
|
import pluginId from './pluginId';
|
2020-02-19 16:37:35 +01:00
|
|
|
import getTrad from './utils/getTrad';
|
2019-04-16 18:23:26 +02:00
|
|
|
|
2020-01-23 16:46:50 +01:00
|
|
|
export default strapi => {
|
2020-03-02 15:18:08 +01:00
|
|
|
const pluginDescription = pluginPkg.strapi.description || pluginPkg.description;
|
2020-01-23 16:46:50 +01:00
|
|
|
const plugin = {
|
|
|
|
blockerComponent: null,
|
|
|
|
blockerComponentProps: {},
|
|
|
|
description: pluginDescription,
|
|
|
|
icon: pluginPkg.strapi.icon,
|
|
|
|
id: pluginId,
|
2020-02-12 21:55:56 +01:00
|
|
|
initializer: null,
|
2020-01-23 16:46:50 +01:00
|
|
|
injectedComponents: [],
|
2020-02-12 21:55:56 +01:00
|
|
|
isReady: true,
|
2020-02-28 11:40:55 +01:00
|
|
|
isRequired: pluginPkg.strapi.required || false,
|
2020-01-23 16:46:50 +01:00
|
|
|
layout: null,
|
2020-02-12 21:55:56 +01:00
|
|
|
lifecycles: null,
|
2020-01-23 16:46:50 +01:00
|
|
|
leftMenuLinks: [],
|
|
|
|
leftMenuSections: [],
|
2020-02-13 09:01:32 +01:00
|
|
|
mainComponent: App,
|
2020-01-23 16:46:50 +01:00
|
|
|
name: pluginPkg.strapi.name,
|
2020-02-11 17:15:53 +01:00
|
|
|
pluginLogo,
|
2020-01-23 16:46:50 +01:00
|
|
|
preventComponentRendering: false,
|
2020-02-19 16:37:35 +01:00
|
|
|
settings: {
|
|
|
|
global: [
|
|
|
|
{
|
|
|
|
title: {
|
2020-02-27 09:53:50 +01:00
|
|
|
id: getTrad('plugin.name'),
|
2020-02-19 16:37:35 +01:00
|
|
|
defaultMessage: 'Media Library',
|
|
|
|
},
|
|
|
|
name: 'media-library',
|
|
|
|
to: `${strapi.settingsBaseURL}/media-library`,
|
|
|
|
// TODO
|
2020-02-27 09:53:50 +01:00
|
|
|
Component: SettingsPage,
|
2020-02-19 16:37:35 +01:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2020-02-13 07:44:57 +01:00
|
|
|
trads,
|
2020-01-23 16:46:50 +01:00
|
|
|
};
|
2019-04-16 18:23:26 +02:00
|
|
|
|
2020-03-05 14:43:00 +01:00
|
|
|
strapi.registerField({ type: 'media', Component: InputMedia });
|
|
|
|
|
2020-01-23 16:46:50 +01:00
|
|
|
return strapi.registerPlugin(plugin);
|
2019-04-16 18:23:26 +02:00
|
|
|
};
|