@dotcraft/plugin 0.7.1 → 0.7.2
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 +9 -52
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# @dotcraft/plugin
|
|
2
2
|
|
|
3
|
-
`@dotcraft/plugin` provides the public contracts,
|
|
3
|
+
`@dotcraft/plugin` provides the public contracts, React runtime bindings, and build command for
|
|
4
|
+
trusted DotCraft Desktop Plugins. Use Node.js 20 or later with React 19 and `react-dom` 19.
|
|
4
5
|
|
|
5
6
|
## Install
|
|
6
7
|
|
|
@@ -8,63 +9,19 @@
|
|
|
8
9
|
npm install --save-dev @dotcraft/plugin
|
|
9
10
|
```
|
|
10
11
|
|
|
11
|
-
React 19 and `react-dom` 19 are peer dependencies. The `$plugin-creator` scaffold supplies them and the required TypeScript setup.
|
|
12
|
-
|
|
13
12
|
## Activate
|
|
14
13
|
|
|
15
14
|
```tsx
|
|
16
|
-
import type { DesktopPluginActivate } from
|
|
15
|
+
import type { DesktopPluginActivate } from '@dotcraft/plugin'
|
|
17
16
|
|
|
18
17
|
export const activate: DesktopPluginActivate = (host) => {
|
|
19
|
-
host.ui.add(
|
|
18
|
+
host.ui.add('composer.toolbar.leading', ({ context }) => (
|
|
20
19
|
context.minimalChrome ? null : <button type="button">Review</button>
|
|
21
|
-
))
|
|
22
|
-
}
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Match Desktop settings and appearance
|
|
26
|
-
|
|
27
|
-
Build settings pages from the exported Host UI Kit, including `SettingsGroup`, `SettingsRow`,
|
|
28
|
-
`SegmentedControl`, and `Slider`. Put plugin-specific visual pickers in a block row or a
|
|
29
|
-
`SettingsGroup` with `flush` rather than reproducing Desktop layout styles.
|
|
30
|
-
|
|
31
|
-
Use `host.appearance` for application-wide theme or backdrop effects. Theme contributions provide
|
|
32
|
-
partial light and dark seed overrides; wallpaper-style plugins render media in `app.background`
|
|
33
|
-
and set the shell surface opacity with `setBackdropPresentation`. Passing `null`, deactivating, or
|
|
34
|
-
reloading the plugin restores the previous Host appearance. Private Desktop CSS variables are not
|
|
35
|
-
part of this API.
|
|
36
|
-
|
|
37
|
-
Use `app.status` for compact persistent diagnostics that share the Host-owned bottom-right status
|
|
38
|
-
rail with Core indicators. Use `app.overlay` for decorative or independently positioned content;
|
|
39
|
-
an `app.status` contribution does not position itself against the viewport.
|
|
40
|
-
|
|
41
|
-
Request an opaque RGB color with `host.ui.pickColor`. Desktop owns the dialog, Hex validation,
|
|
42
|
-
focus handling, and localized controls. The result distinguishes a selected color, a semantic
|
|
43
|
-
reset, and cancellation; plugin disable or reload cancels any request it owns.
|
|
44
|
-
|
|
45
|
-
```ts
|
|
46
|
-
const result = await host.ui.pickColor({
|
|
47
|
-
title: "Choose workspace color",
|
|
48
|
-
initialColor: "#8b5cf6",
|
|
49
|
-
allowReset: true,
|
|
50
|
-
defaultColor: "#4566cc",
|
|
51
|
-
});
|
|
20
|
+
))
|
|
21
|
+
}
|
|
52
22
|
```
|
|
53
23
|
|
|
54
|
-
##
|
|
55
|
-
|
|
56
|
-
The `$plugin-creator` scaffold supplies the source layout and build script. From its `desktop/` directory, run:
|
|
57
|
-
|
|
58
|
-
```shell
|
|
59
|
-
npm run build
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
The build writes the plugin module and imported assets to `dist/` for DotCraft to load.
|
|
63
|
-
|
|
64
|
-
## Links
|
|
24
|
+
## Documentation
|
|
65
25
|
|
|
66
|
-
- [Build a Desktop Plugin](https://
|
|
67
|
-
- [Desktop Plugin API](https://
|
|
68
|
-
- [Source repository](https://github.com/DotHarness/dotcraft)
|
|
69
|
-
- [Issues](https://github.com/DotHarness/dotcraft/issues)
|
|
70
|
-
- [License](./LICENSE)
|
|
26
|
+
- [Build a Desktop Plugin](https://www.dotcraft.net/developing/integrations/desktop-plugins)
|
|
27
|
+
- [Desktop Plugin API](https://www.dotcraft.net/developing/integrations/desktop-plugin-api)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotcraft/plugin",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "TypeScript and React authoring tools for DotCraft Plugin desktop modules",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"test": "npm run typecheck && npm run build && node --test scripts/runtime.test.mjs && node scripts/build-plugin.test.mjs"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@dotcraft/sdk": "0.7.
|
|
41
|
+
"@dotcraft/sdk": "0.7.2",
|
|
42
42
|
"esbuild": "^0.25.11"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|