Expand kitchen sink plugin demos

This commit is contained in:
Dotta
2026-03-14 09:26:45 -05:00
parent 6fa1dd2197
commit cb5d7e76fb
19 changed files with 1602 additions and 116 deletions

View File

@@ -1,4 +1,10 @@
import type { PluginDataResult, PluginActionFn, PluginHostContext, PluginStreamResult } from "./types.js";
import type {
PluginDataResult,
PluginActionFn,
PluginHostContext,
PluginStreamResult,
PluginToastFn,
} from "./types.js";
import { getSdkUiRuntimeValue } from "./runtime.js";
// ---------------------------------------------------------------------------
@@ -151,3 +157,18 @@ export function usePluginStream<T = unknown>(
>("usePluginStream");
return impl(channel, options);
}
// ---------------------------------------------------------------------------
// usePluginToast
// ---------------------------------------------------------------------------
/**
* Trigger a host toast notification from plugin UI.
*
* This lets plugin pages and widgets surface user-facing feedback through the
* same toast system as the host app without reaching into host internals.
*/
export function usePluginToast(): PluginToastFn {
const impl = getSdkUiRuntimeValue<() => PluginToastFn>("usePluginToast");
return impl();
}