Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: inconsistent plugin activation behaviour caused by refactoring #1626

Merged
merged 19 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 0 additions & 115 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 20 additions & 4 deletions packages/core/foundation/plugin.ts
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];

1 change: 1 addition & 0 deletions packages/openscd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"test:manual": "web-test-runner --manual",
"test:watch": "web-test-runner --watch",
"test:unit": "web-test-runner --watch --group unit",
"test:unit:headless": "web-test-runner --watch --group unit --concurrency 1 --headless",
"test:integration": "web-test-runner --watch --group integration",
"doc:clean": "npx rimraf doc",
"doc:typedoc": "typedoc --plugin none --out doc --entryPointStrategy expand ./src",
Expand Down
Loading
Loading