feat(plugins): 插件管理 - 区分系统与官方插件权限 (#329)

This commit is contained in:
MasterChiefCN
2026-08-27 11:22:00 +08:00
committed by GitHub
parent 23b4628c81
commit f111d57fc6
32 changed files with 1137 additions and 143 deletions

View File

@@ -23,11 +23,10 @@ const roleLabels: Record<PortraitClearanceInputRole, string> = {
export function PortraitClearanceNodeContent({ node }: PortraitClearanceNodeProps) {
const theme = canvasThemes[useThemeStore((state) => state.theme)];
const installations = usePluginStore((state) => state.installations);
const enabled = usePluginStore((state) => state.pluginStates[PORTRAIT_CLEARANCE_PLUGIN_ID]?.effectiveEnabled ?? Boolean(state.installations.find((item) => item.manifest.id === PORTRAIT_CLEARANCE_PLUGIN_ID)?.enabled));
const { openPortraitClearance } = useCanvasNodeActions();
const upstream = useUpstreamNodes(node.id).filter((item) => isPortraitImageInput(item));
const state = node.metadata?.portraitClearance;
const enabled = Boolean(installations.find((item) => item.manifest.id === PORTRAIT_CLEARANCE_PLUGIN_ID)?.enabled);
const bindings = state?.inputBindings || [];
const roleByNodeId = new Map(bindings.map((binding) => [binding.nodeId, binding.role]));
const query = upstream.find((item) => roleByNodeId.get(item.id) === "query") || upstream[0];