-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: inconsistent plugin activation behaviour caused by refactoring (#…
- Loading branch information
Showing
12 changed files
with
1,664 additions
and
2,725 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,28 @@ | ||
import { targetLocales } from '../locales.js'; | ||
|
||
export type Plugin = { | ||
// name defines the name of the plugin | ||
name: string; | ||
translations?: Record<(typeof targetLocales)[number], string>; | ||
// src defines the path to the plugins source file | ||
src: string; | ||
icon: string; | ||
requireDoc?: boolean; | ||
// kind defines the type of the plugin | ||
kind: PluginKind; | ||
// activeByDefault configures if the plugin should be active by default | ||
// this is will be user when users resets the plugins | ||
activeByDefault: boolean; | ||
// icon stores the icon name of the Material Icon | ||
icon?: string; | ||
// active shows if the plugin currently is active | ||
active?: boolean; | ||
position: ('top' | 'middle' | 'bottom') | number; | ||
// requireDoc shows if the plugin requires a document to be loaded | ||
requireDoc?: boolean; | ||
// position defines the position of menu plugins | ||
position?: MenuPosition | ||
translations?: Record<(typeof targetLocales)[number], string>; | ||
}; | ||
|
||
export type PluginSet = { menu: Plugin[]; editor: Plugin[] }; | ||
export type PluginKind = 'editor' | 'menu' | 'validator'; | ||
export const menuPosition = ['top', 'middle', 'bottom'] as const; | ||
export type MenuPosition = (typeof menuPosition)[number]; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.