-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 477138a
Showing
27 changed files
with
14,414 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Changelog | ||
|
||
All notable changes to `filament-code-editor` will be documented in this file. | ||
|
||
## 1.0.0 - 202X-XX-XX | ||
|
||
- initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) dotswan <tech@dotswan.com> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# Filament Code Editor | ||
|
||
[![Latest Version on Packagist][ico-version]][link-packagist] | ||
[![Total Downloads][ico-downloads]][link-downloads] | ||
[![Software License][ico-license]][link-license] | ||
|
||
|
||
## Introduction | ||
|
||
The Filament Code Editor package enhances Filament with a specialized field type, allowing seamless code editing powered by the CodeMirror JavaScript library within Filament components. This integration provides users with a dedicated environment for editing various code languages such as CSS, HTML, JavaScript, JSON, and PHP directly within Filament forms. | ||
|
||
* Key Features: | ||
* Integration of the CodeMirror JavaScript library into Filament components. | ||
* Support for multiple code languages including CSS, HTML, JavaScript, JSON, and PHP. | ||
* Effortless editing of code within the familiar Filament interface. | ||
|
||
## Installation | ||
|
||
To integrate the Filament Code Editor package into your project, use Composer: | ||
|
||
```bash | ||
composer require dotswan/filament-code-editor | ||
``` | ||
|
||
## Basic Usage | ||
|
||
To implement the code editor field within Filament forms, use the `CodeEditor` field type: | ||
|
||
```php | ||
use Dotswan\FilamentCodeEditor\Fields\CodeEditor; | ||
|
||
CodeEditor::make('codes') | ||
// Additional configuration goes here, if needed | ||
->id('unique_field_id'); | ||
``` | ||
|
||
## Supported Languages | ||
|
||
The Filament Code Editor supports the following languages: | ||
|
||
* CSS | ||
* HTML | ||
* JavaScript | ||
* JSON | ||
* PHP | ||
|
||
Customize and manage code for these languages effortlessly within your Filament forms. | ||
|
||
## License | ||
|
||
This package is distributed under the [MIT License](link-to-your-license). | ||
|
||
## Security | ||
|
||
Security is a priority for us. If you encounter any security-related issues or vulnerabilities, please report them via our [GitHub issue tracker][link-github-issue]. For direct communication, reach out to [tech@dotswan.com](mailto:tech@dotswan.com). | ||
|
||
## Contribution | ||
|
||
Contributions are welcome and valued. Enhancements, suggestions, and bug reports help improve this package for everyone. Here's how you can contribute: | ||
|
||
1. Fork the Project | ||
2. Create a Feature Branch (`git checkout -b feature/AmazingFeature`) | ||
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`) | ||
4. Push to the Branch (`git push origin feature/AmazingFeature`) | ||
5. Open a Pull Request | ||
|
||
Thank you for considering contributing to the Filament Code Editor! | ||
|
||
[ico-version]: https://img.shields.io/packagist/v/dotswan/filament-code-editor.svg?style=flat-square | ||
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square | ||
[ico-downloads]: https://img.shields.io/packagist/dt/dotswan/filament-code-editor.svg?style=flat-square | ||
|
||
[link-packagist]: https://packagist.org/packages/dotswan/filament-code-editor | ||
[link-license]: https://github.com/dotswan/filament-code-editor/blob/master/LICENSE.md | ||
[link-downloads]: https://packagist.org/packages/dotswan/filament-code-editor | ||
[link-github-issue]: https://github.com/dotswan/filament-code-editor/issues |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import esbuild from 'esbuild' | ||
|
||
const isDev = process.argv.includes('--dev') | ||
|
||
async function compile(options) { | ||
const context = await esbuild.context(options) | ||
|
||
if (isDev) { | ||
await context.watch() | ||
} else { | ||
await context.rebuild() | ||
await context.dispose() | ||
} | ||
} | ||
|
||
const defaultOptions = { | ||
define: { | ||
'process.env.NODE_ENV': isDev ? `'development'` : `'production'`, | ||
}, | ||
bundle: true, | ||
mainFields: ['module', 'main'], | ||
platform: 'neutral', | ||
sourcemap: isDev ? 'inline' : false, | ||
sourcesContent: isDev, | ||
treeShaking: true, | ||
target: ['es2020'], | ||
minify: !isDev, | ||
plugins: [{ | ||
name: 'watchPlugin', | ||
setup: function (build) { | ||
build.onStart(() => { | ||
console.log(`Build started at ${new Date(Date.now()).toLocaleTimeString()}: ${build.initialOptions.outfile}`) | ||
}) | ||
|
||
build.onEnd((result) => { | ||
if (result.errors.length > 0) { | ||
console.log(`Build failed at ${new Date(Date.now()).toLocaleTimeString()}: ${build.initialOptions.outfile}`, result.errors) | ||
} else { | ||
console.log(`Build finished at ${new Date(Date.now()).toLocaleTimeString()}: ${build.initialOptions.outfile}`) | ||
} | ||
}) | ||
} | ||
}], | ||
} | ||
|
||
compile({ | ||
...defaultOptions, | ||
entryPoints: ['./resources/js/index.js'], | ||
outfile: './resources/dist/js/filament-code-editor.js', | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
{ | ||
"name": "dotswan/filament-code-editor", | ||
"description": "", | ||
"keywords": [ | ||
"dotswan", | ||
"laravel", | ||
"filament-code-editor" | ||
], | ||
"homepage": "https://github.com/dotswan/filament-code-editor", | ||
"support": { | ||
"issues": "https://github.com/dotswan/filament-code-editor/issues", | ||
"source": "https://github.com/dotswan/filament-code-editor" | ||
}, | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Dotswan", | ||
"email": "tech@dotswan.com", | ||
"role": "Developer" | ||
} | ||
], | ||
"require": { | ||
"php": "^8.1", | ||
"filament/filament": "^3.0", | ||
"spatie/laravel-package-tools": "^1.15.0", | ||
"illuminate/contracts": "^10.0" | ||
}, | ||
"require-dev": { | ||
"laravel/pint": "^1.0", | ||
"nunomaduro/collision": "^7.9", | ||
"nunomaduro/larastan": "^2.0.1", | ||
"orchestra/testbench": "^8.0", | ||
"pestphp/pest": "^2.0", | ||
"pestphp/pest-plugin-arch": "^2.0", | ||
"pestphp/pest-plugin-laravel": "^2.0", | ||
"phpstan/extension-installer": "^1.1", | ||
"phpstan/phpstan-deprecation-rules": "^1.0", | ||
"phpstan/phpstan-phpunit": "^1.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Dotswan\\FilamentCodeEditor\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Dotswan\\FilamentCodeEditor\\Tests\\": "tests/" | ||
} | ||
}, | ||
"scripts": { | ||
"post-autoload-dump": "@php ./vendor/bin/testbench package:discover --ansi", | ||
"analyse": "vendor/bin/phpstan analyse", | ||
"test": "vendor/bin/pest", | ||
"test-coverage": "vendor/bin/pest --coverage", | ||
"format": "vendor/bin/pint" | ||
}, | ||
"config": { | ||
"sort-packages": true, | ||
"allow-plugins": { | ||
"pestphp/pest-plugin": true, | ||
"phpstan/extension-installer": true | ||
} | ||
}, | ||
"extra": { | ||
"laravel": { | ||
"providers": [ | ||
"Dotswan\\FilamentCodeEditor\\FilamentCodeEditorServiceProvider" | ||
], | ||
"aliases": { | ||
"FilamentCodeEditor": "Dotswan\\FilamentCodeEditor\\Facades\\FilamentCodeEditor" | ||
} | ||
} | ||
}, | ||
"minimum-stability": "dev", | ||
"prefer-stable": true | ||
} |
Oops, something went wrong.