open-scd
open-scd copied to clipboard
Update the plugin loading functionality so it uses core's API
Currently we are supporting both the legacy API for plugins and core's API for the same thing. We only want to support core's API.
Legacy API:
export type Plugin = {
name: string;
src: string;
icon?: string;
default?: boolean;
kind: PluginKind;
requireDoc?: boolean;
position?: MenuPosition;
installed: boolean;
official?: boolean;
content?: TemplateResult;
};
Core's API:
export type Plugin = {
name: string;
translations?: Record<(typeof targetLocales)[number], string>;
src: string;
icon: string;
requireDoc?: boolean;
active?: boolean;
position: 'top' | 'middle' | 'bottom';
};
export type PluginSet = { menu: Plugin[]; editor: Plugin[] };
Acceptance criteria:
- Legacy Plugin API is removed
- All current code that relies on that legacy API is updated and uses Core's API (including plugins.js which has the list of official plugins)
- Plugins should continue working exactly the same as before