Plugin api improvements (#4935)

* Support hook into App component
* Add hookable PluginSettings component
* Add useSettings to plugin hooks
* Make setting inputs hookable
* Add hooks for performer details panel
* Update docs
This commit is contained in:
WithoutPants
2024-06-11 13:18:45 +10:00
committed by GitHub
parent ed057c971f
commit 845d718c67
7 changed files with 526 additions and 426 deletions

View File

@@ -15,6 +15,7 @@ import { useSpriteInfo } from "./hooks/sprite";
import { useToast } from "./hooks/Toast";
import Event from "./hooks/event";
import { before, instead, after, components, RegisterComponent } from "./patch";
import { useSettings } from "./components/Settings/context";
// due to code splitting, some components may not have been loaded when a plugin
// page is loaded. This function will load all components passed to it.
@@ -92,6 +93,7 @@ export const PluginApi = {
useLoadComponents,
useSpriteInfo,
useToast,
useSettings,
},
patch: {
// intercept the arguments of supported functions