Skip to content

Commit

Permalink
Fix: inconsistent plugin activation behaviour caused by refactoring (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
trusz authored Feb 19, 2025
1 parent 1e50fd9 commit 00c4dc0
Show file tree
Hide file tree
Showing 12 changed files with 1,664 additions and 2,725 deletions.
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

0 comments on commit 00c4dc0

Please sign in to comment.