@appkit/dek-plugin 0.37.0 → 0.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -2
- package/dist/lib/plugins.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,3 +1,46 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @appkit/dek-plugin
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The plugin SDK for building DEK plugins. Provides type definitions, the `DekApi` implementation, and React hooks for plugin state.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @appkit/dek-plugin
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { DekApi, DekPlugin, DekPluginComponentItem } from '@appkit/dek-plugin';
|
|
15
|
+
|
|
16
|
+
class Plugin implements DekPlugin {
|
|
17
|
+
constructor(config: Record<string, string>) {
|
|
18
|
+
this.config = config;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
async load(api: DekApi) {
|
|
22
|
+
api.trace('Plugin loaded');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async unload() {}
|
|
26
|
+
|
|
27
|
+
get components(): DekPluginComponentItem[] {
|
|
28
|
+
return [
|
|
29
|
+
{
|
|
30
|
+
key: 'my-card',
|
|
31
|
+
element: (props: any) => <MyCard {...props} />,
|
|
32
|
+
schema: {
|
|
33
|
+
title: { type: 'string', title: 'Title', default: 'Hello' }
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export default Plugin;
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Documentation
|
|
44
|
+
|
|
45
|
+
- [API Reference](docs/api-reference.md) — Full DekPlugin interface, DekApi methods, DekRegistry, schema types
|
|
46
|
+
- [Plugin Development Guide](../../docs/plugin-development.md) — Step-by-step guide to building plugins
|
package/dist/lib/plugins.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export type DekPluginSchemaItemOption = {
|
|
|
11
11
|
};
|
|
12
12
|
export type DekPluginSchemaType = 'string' | 'number' | 'boolean' | 'list' | 'color' | 'object' | 'styles';
|
|
13
13
|
export type DekPluginSchemaItem = {
|
|
14
|
-
type:
|
|
14
|
+
type: DekPluginSchemaType;
|
|
15
15
|
title?: string;
|
|
16
16
|
default?: any;
|
|
17
17
|
options?: DekPluginSchemaItemOption[];
|