refactor: Make `preconditionFn` part of all context menu items by gonfunko · Pull Request #9558 · RaspberryPiFoundation/blockly

The basics

The details

Resolves

Fixes #9179

Proposed Changes

This PR updates the ContextMenuRegistry interfaces such that CoreRegistryItem includes an optional preconditionFn, which is required for ActionRegistryItem, and optional for SeparatorRegistryItem. Previously, SeparatorRegistryItem did not have it at all, so there was no way to restrict separators to particular scopes other than the soft-deprecated and less-flexible scopeType field.