-
-
Notifications
You must be signed in to change notification settings - Fork 82
/
plugins.ts
83 lines (75 loc) · 2.43 KB
/
plugins.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import {ButtonBladePlugin} from '../blade/button/plugin.js';
import {FolderBladePlugin} from '../blade/folder/plugin.js';
import {BladePlugin} from '../blade/plugin.js';
import {TabBladePlugin} from '../blade/tab/plugin.js';
import {BooleanInputPlugin} from '../input-binding/boolean/plugin.js';
import {NumberColorInputPlugin} from '../input-binding/color/plugin-number.js';
import {ObjectColorInputPlugin} from '../input-binding/color/plugin-object.js';
import {StringColorInputPlugin} from '../input-binding/color/plugin-string.js';
import {NumberInputPlugin} from '../input-binding/number/plugin.js';
import {InputBindingPlugin} from '../input-binding/plugin.js';
import {Point2dInputPlugin} from '../input-binding/point-2d/plugin.js';
import {Point3dInputPlugin} from '../input-binding/point-3d/plugin.js';
import {Point4dInputPlugin} from '../input-binding/point-4d/plugin.js';
import {StringInputPlugin} from '../input-binding/string/plugin.js';
import {BooleanMonitorPlugin} from '../monitor-binding/boolean/plugin.js';
import {NumberMonitorPlugin} from '../monitor-binding/number/plugin.js';
import {MonitorBindingPlugin} from '../monitor-binding/plugin.js';
import {StringMonitorPlugin} from '../monitor-binding/string/plugin.js';
import {BladeApiCache} from './blade-api-cache.js';
import {PluginPool} from './pool.js';
export type TpPlugin =
| BladePlugin<any>
| InputBindingPlugin<any, any, any>
| MonitorBindingPlugin<any, any>;
export type TpPluginBundle =
| {
/**
* The custom CSS for the bundle.
*/
css?: string;
/**
* The identifier of the bundle.
*/
id: string;
plugin: TpPlugin;
}
| {
/**
* The custom CSS for the bundle.
*/
css?: string;
/**
* The identifier of the bundle.
*/
id: string;
plugins: TpPlugin[];
};
// Shared API cache for the default pool allows blade flexibility between different panes.
const sharedCache = new BladeApiCache();
export function createDefaultPluginPool(): PluginPool {
const pool = new PluginPool(sharedCache);
[
// Input
Point2dInputPlugin,
Point3dInputPlugin,
Point4dInputPlugin,
StringInputPlugin,
NumberInputPlugin,
StringColorInputPlugin,
ObjectColorInputPlugin,
NumberColorInputPlugin,
BooleanInputPlugin,
// Monitor
BooleanMonitorPlugin,
StringMonitorPlugin,
NumberMonitorPlugin,
// Blade
ButtonBladePlugin,
FolderBladePlugin,
TabBladePlugin,
].forEach((p) => {
pool.register('core', p);
});
return pool;
}