Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ body:
label: Question or Feature?
description: Enter a Question or Feature Request
validations:
required: true
required: true
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
# Changelog

All notable changes to `filament-json-field` will be documented in this file.

## [Unreleased]

## [13.0.0] - 2025-01-15

### Added
- **Filament 4.0 Support**: Updated package to support Filament 4.0
- **Readonly Support**: Added readonly functionality to JSON input fields
- **Enhanced Styling**: Improved styling and visual appearance of components
- **Better CodeMirror Integration**: Enhanced CodeMirror configuration and behavior

### Changed
- **Breaking**: Updated minimum Filament requirements to ^4.0
- **Breaking**: Removed `filament/tables` dependency (no longer required)
- **Breaking**: Updated `filament/forms` dependency to ^4.0
- **Breaking**: Updated `filament/infolists` dependency to ^4.0
- **Breaking**: Updated `filament/support` dependency to ^4.0
- Updated package description to be more descriptive
- Improved component structure and organization

### Fixed
- Various styling issues and visual improvements
- CodeMirror configuration and initialization
- Component rendering and behavior

### Technical
- Updated PHP version support to 8.2.*, 8.3.*, 8.4.*
- Enhanced test coverage and component testing
- Improved build process and asset compilation

## [12.2.0] - Previous Release

### Added
- Initial Filament 3.x support
- JSON input and display components
- CodeMirror integration
- Basic styling and configuration options
60 changes: 37 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@

## 💡 What is Filament Json Field?

Filament Json Field is a Filament wrapper for Codemirror.
Filament Json Field is a Laravel Filament JSON Field integration with CodeMirror support, providing a powerful and feature-rich JSON editor for your Filament forms and infolists.

## 🛠 Requirements

| Package | PHP | Laravel | Filament Infolists | Filament Support | Filament Tables |
|-----------|------------------|---------------|--------------------|------------------|-----------------|
| v12.0 | ^8.2, ^8.3, ^8.4 | ^12.0 | ^3.3 | ^3.3 | ^3.3 |
| v2.0 | ^8.1 | ^11.0 | ^3.2 | ^3.2 | ^3.2 |
| v1.0 | ^8.1 | ^10.45, ^11.0 | ^3.2 | ^3.2 | ^3.2 |
| Package | PHP | Laravel | Filament Forms | Filament Infolists | Filament Support |
|-----------|------------------|---------------|----------------|--------------------|------------------|
| v13.0 | ^8.2, ^8.3, ^8.4 | ^12.0 | ^4.0 | ^4.0 | ^4.0 |
| v12.0 | ^8.2, ^8.3, ^8.4 | ^12.0 | ^3.3 | ^3.3 | ^3.3 |
| v2.0 | ^8.1 | ^11.0 | ^3.2 | ^3.2 | ^3.2 |
| v1.0 | ^8.1 | ^10.45, ^11.0 | ^3.2 | ^3.2 | ^3.2 |


## ⚙️ Installation
Expand All @@ -31,7 +32,8 @@ php artisan filament:assets

## Usage

Forms:
### Forms

```php
use CodebarAg\FilamentJsonField\Forms\Components\JsonInput;

Expand All @@ -42,30 +44,31 @@ public function form(Form $form): Form
return $form
->schema([
JsonInput::make('json')
->label('JSON')
->label('JSON Data')
->lineNumbers(true)
->lineWrapping(true)
->autoCloseBrackets(true)
->darkTheme(true)
->foldingCode(true)
->foldedCode(true), // Folded code will fold the code on form load
->foldedCode(true) // Folded code will fold the code on form load
->readOnly(false), // Set to true to make the field read-only
]);
}
...
````
```

### Infolists

Infolists:
```php
use CodebarAg\FilamentJsonField\Infolists\Components\JsonEntry;

...

public function form(Form $form): Form
public function infolist(Infolist $infolist): Infolist
{
return $form
return $infolist
->schema([
JsonEntry::make('json')
->label('JSON')
->label('JSON Data')
->lineNumbers(true)
->lineWrapping(true)
->autoCloseBrackets(true)
Expand All @@ -74,19 +77,30 @@ public function form(Form $form): Form
->foldedCode(true), // Folded code will fold the code on form load
]);
}
...
````
```

### Options

The following options are currently supported:

| Request | Supported |
|---------------------|:-----------:|
| Line Numbers | ✅ |
| Auto Close Brackets | ✅ |
| Dark Theme | ✅ |
| Folding Code | ✅ |
| Option | Supported | Description |
|---------------------|:---------:|-------------|
| Line Numbers | ✅ | Display line numbers in the editor |
| Line Wrapping | ✅ | Enable line wrapping for long lines |
| Auto Close Brackets | ✅ | Automatically close brackets and quotes |
| Dark Theme | ✅ | Enable dark theme styling |
| Folding Code | ✅ | Enable code folding functionality |
| Folded Code | ✅ | Start with code folded (forms only) |
| Read Only | ✅ | Make the field read-only (forms only) |

### Features

- **CodeMirror Integration**: Powered by CodeMirror 5 for excellent JSON editing experience
- **Syntax Highlighting**: Full JSON syntax highlighting with validation
- **Error Handling**: Built-in JSON validation with user-friendly error messages
- **Responsive Design**: Works seamlessly across different screen sizes
- **Customizable**: Extensive configuration options for different use cases
- **Filament 4.0 Ready**: Fully compatible with the latest Filament version

## 🚧 Testing

Expand Down
5 changes: 3 additions & 2 deletions bin/build.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as esbuild from 'esbuild';

esbuild.build({
// Build JavaScript
await esbuild.build({
entryPoints: ['./resources/js/laravel-filament-json-field.js'],
outfile: './dist/laravel-filament-json-field.js',
bundle: true,
Expand All @@ -9,4 +10,4 @@ esbuild.build({
treeShaking: true,
target: ['es2020'],
minify: true,
});
});
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codebar-ag/laravel-filament-json-field",
"description": "This is my package laravel-filament-json-field",
"description": "A Laravel Filament JSON Field integration with CodeMirror support",
"keywords": [
"CodebarAg",
"laravel",
Expand All @@ -22,9 +22,9 @@
],
"require": {
"php": "8.2.*|8.3.*|8.4.*",
"filament/infolists": "^3.3",
"filament/support": "^3.3",
"filament/tables": "^3.3",
"filament/forms": "^4.0",
"filament/infolists": "^4.0",
"filament/support": "^4.0",
"illuminate/contracts": "^12.0",
"livewire/livewire": "^3.6",
"spatie/laravel-package-tools": "^1.19"
Expand Down
2 changes: 1 addition & 1 deletion dist/laravel-filament-json-field.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading