|
1 | | - |
2 | | -# Changelog |
| 1 | +# LibForm Changelog |
3 | 2 |
|
4 | 3 | All notable changes to `LibForm` should be documented in this file. |
5 | 4 |
|
6 | | -The format is inspired by Keep a Changelog and uses semantic versioning where possible. |
| 5 | +The format is inspired by Keep a Changelog and uses semantic versioning where |
| 6 | +possible. |
| 7 | + |
| 8 | +## [2.0.0] - 2026-06-16 |
| 9 | + |
| 10 | +### Release Focus |
| 11 | + |
| 12 | +LibForm 2.0.0 is the form authoring release for the 2.0 core library line. It |
| 13 | +standardizes PocketMine Bedrock forms around reusable classes, fluent builders, |
| 14 | +typed form data, pagination, conditional elements, async loading, history and |
| 15 | +presets. |
7 | 16 |
|
8 | | -## [Unreleased] |
| 17 | +The release is meant to remove the common "array of JSON by hand" pattern from |
| 18 | +plugins. Developers can build simple one-off forms quickly, but still have a |
| 19 | +class-based structure for large menus and multi-step flows. |
9 | 20 |
|
10 | 21 | ### Added |
11 | 22 |
|
12 | | -- Community health files and GitHub templates. |
13 | | -- Quality workflow scaffolding. |
14 | | -- Compatibility and standalone/embedded documentation. |
| 23 | +- Added long, modal and custom form foundations with class-based definitions. |
| 24 | +- Added `FormBuilder::long()`, `FormBuilder::modal()` and |
| 25 | + `FormBuilder::custom()` for concise fluent form creation. |
| 26 | +- Added `FormData` as an array-accessible state container shared between form |
| 27 | + steps. |
| 28 | +- Added `FormResult` to control close, keep-open and flow behavior. |
| 29 | +- Added paginated long forms for large button lists. |
| 30 | +- Added dynamic button generation from runtime data sources. |
| 31 | +- Added `FormChain` for multi-step menus and wizard-like flows. |
| 32 | +- Added conditional custom form elements that can show or hide based on previous |
| 33 | + values. |
| 34 | +- Added async form data loading with a loading form while work is prepared. |
| 35 | +- Added form history so menus can implement back navigation. |
| 36 | +- Added form timeouts for interactions that should expire automatically. |
| 37 | +- Added presets for common dialogs such as confirm, player select, color pick, |
| 38 | + text input and number input. |
| 39 | +- Added validated inputs and searchable dropdown helpers. |
15 | 40 |
|
16 | 41 | ### Changed |
17 | 42 |
|
18 | | -- Quality analysis now uses the real PocketMine-MP 5 API instead of unresolved framework types. |
19 | | -- Form collections now declare their key and value types for static analysis. |
| 43 | +- Changed form collections to declare key and value types for static analysis. |
| 44 | +- Changed the documentation toward component-based usage with examples for each |
| 45 | + major form family. |
| 46 | +- Changed quality analysis to validate against the real PocketMine-MP 5 API |
| 47 | + instead of unresolved framework placeholders. |
| 48 | +- Changed sync workflows to stage files before checking diffs and to retry |
| 49 | + rebased pushes to EasyLibrary. |
20 | 50 |
|
21 | 51 | ### Fixed |
22 | 52 |
|
23 | | -- PHPStan now runs correctly through the Composer quality script on Windows. |
24 | | -- Removed unused persisted constructor state while preserving the public form APIs. |
25 | | -- Sync workflow now stages files before checking diffs and retries/rebases pushes to EasyLibrary. |
| 53 | +- Fixed PHPStan execution on Windows through the Composer quality script. |
| 54 | +- Fixed unused persisted constructor state while preserving public form APIs. |
| 55 | +- Fixed quality coverage around form collection generics and JSON structures. |
| 56 | +- Removed an unused icon resource from the release tree. |
| 57 | + |
| 58 | +### Compatibility Notes |
| 59 | + |
| 60 | +- Requires PocketMine-MP API `5.0.0+`. |
| 61 | +- Requires PHP `8.2+`. |
| 62 | +- The public namespace is `imperazim\form`. |
| 63 | +- Can be used as a standalone plugin or through EasyLibrary's embedded copy. |
| 64 | + |
| 65 | +### Migration Notes |
| 66 | + |
| 67 | +- Prefer builders for small menus and dedicated classes for reusable menus. |
| 68 | +- Use `FormData` instead of passing loose arrays between chained forms. |
| 69 | +- Use `FormResult::KEEP` only when the form should be resent after validation. |
26 | 70 |
|
27 | | -## [2.0.0] - TBD |
| 71 | +### Example |
28 | 72 |
|
29 | | -### Notes |
| 73 | +```php |
| 74 | +use imperazim\form\builder\FormBuilder; |
| 75 | +use imperazim\form\FormResult; |
30 | 76 |
|
31 | | -- Current repository baseline. |
| 77 | +FormBuilder::custom('Profile') |
| 78 | + ->input('nickname', 'Nickname') |
| 79 | + ->toggle('public', 'Public profile', true) |
| 80 | + ->onSubmit(function ($player, $data): FormResult { |
| 81 | + $player->sendMessage('Saved as ' . $data->get('nickname')); |
| 82 | + return FormResult::CLOSE; |
| 83 | + }) |
| 84 | + ->send($player); |
| 85 | +``` |
0 commit comments