Release v0.1.2

This commit is contained in:
2026-06-25 19:58:20 +02:00
parent 15794e920e
commit 02564047e9
73 changed files with 4073 additions and 478 deletions

View File

@@ -0,0 +1,21 @@
import { createContext, type ReactNode, useContext } from "react";
import type { PlatformWebModule } from "../types";
import { moduleInstalled, uiCapability } from "./modules";
const PlatformModulesContext = createContext<PlatformWebModule[]>([]);
export function PlatformModulesProvider({ modules, children }: { modules: PlatformWebModule[]; children: ReactNode }) {
return <PlatformModulesContext.Provider value={modules}>{children}</PlatformModulesContext.Provider>;
}
export function usePlatformModules(): PlatformWebModule[] {
return useContext(PlatformModulesContext);
}
export function usePlatformModuleInstalled(moduleId: string): boolean {
return moduleInstalled(moduleId, usePlatformModules());
}
export function usePlatformUiCapability<T = unknown>(capabilityName: string): T | null {
return uiCapability<T>(capabilityName, usePlatformModules());
}