| 1: | <?php |
| 2: | |
| 3: | namespace LaravelUi5\Core\Ui5\Contracts; |
| 4: | |
| 5: | /** |
| 6: | * Allows a module or application to contribute configuration data |
| 7: | * to the global LaravelUi5 Shell layer. |
| 8: | * |
| 9: | * The Shell represents the UI container that wraps all UI5 apps. |
| 10: | * It provides global interactions such as navigation overlays, |
| 11: | * help panels, search interfaces, command palettes, and keyboard |
| 12: | * shortcuts. Unlike app-local UI elements, Shell components are |
| 13: | * rendered independently from the active UI5 component and are |
| 14: | * therefore defined at the platform level. |
| 15: | * |
| 16: | * Manifest fragments contributed through this interface are placed |
| 17: | * under the top-level key LaravelUi5ManifestKeys::SHELL. |
| 18: | * |
| 19: | * Only modules implementing this interface can influence Shell |
| 20: | * configuration. The Core does not impose a schema beyond the |
| 21: | * requirement that the returned data must be serializable to JSON. |
| 22: | * |
| 23: | * Typical use cases include: |
| 24: | * - defining keyboard triggers for Navigation, Search, Help |
| 25: | * - enabling or configuring overlays rendered outside the app root |
| 26: | * - contributing global command-palette entries |
| 27: | * - registering static Shell UI elements (e.g. minimal visual cues) |
| 28: | * - platform-wide availability metadata (enable/disable per module) |
| 29: | * |
| 30: | * The returned array must follow the structure expected by the |
| 31: | * corresponding Shell implementation on the frontend. |
| 32: | */ |
| 33: | interface Ui5ShellFragmentInterface |
| 34: | { |
| 35: | /** |
| 36: | * Builds and returns the Shell fragment for this module. |
| 37: | * |
| 38: | * The returned array is inserted under the "shell" manifest key |
| 39: | * and merged with the standard LaravelUi5 manifest structure. |
| 40: | * Implementations must ensure that the fragment is compatible |
| 41: | * with the Shell's configuration schema and does not contain any |
| 42: | * unknown top-level keys outside the "shell" namespace. |
| 43: | * |
| 44: | * @return array<string, mixed> The Shell fragment to be added to the manifest. |
| 45: | */ |
| 46: | public function buildShellFragment(): array; |
| 47: | } |
| 48: |