creagia / filament-code-field Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Calling $set()
on the CodeField, has no effect, it will set the value (so it will be saved to the DB), but the codemirror editor will not pickup on the change.
Unsure how to resolve.
Can be reproduced by the following snippet:
CodeField::make('html')
->label('Custom HTML')
->reactive()
->columnSpanFull()
->withLineNumbers()
->htmlField()
->minHeight(400)
->disableAutocompletion()
->hintAction(function (Closure $set) {
return Action::make('make_html_go_brrrr')
->icon('heroicon-o-sparkles')
->label('Go brrrr')
->action(function () use ($set) {
$set("html", "brrrrrrrr");
});
}),
The expected result is for the codemirror editor to now contain "brrrrrrrr", however it is blank "or has whatever value you wrote in before clicking the hintAction button)
Please consider providing a way to specify the height of a code field, either in number of lines or pixels, with a scrollbar for the overflow. Currently the field height is set to the length of the content, which can get to be extremely long. Thanks!
I recently did a composer update and now my codefield looks like this with a lot of \n when displaying json. Previously it looks like a well formatted json. This happen in multiple projects after I update this package to 1.0.2
Update: I could not reproduce this locally but on my staging servers and my production servers, this happens since today for all old and new records in filament admin
Hello,
I'm currently utilizing the \Creagia\FilamentCodeField\CodeField in my project and it's been incredibly useful for our development team. We've been working with a variety of languages and the syntax highlighting functionality has significantly improved our workflow.
However, we've recently encountered a scenario where support for Bash script language within the CodeField would be highly beneficial. Our project involves a considerable amount of shell scripting, and being able to utilize the same syntax highlighting and editing features for Bash scripts would greatly enhance our productivity and the overall developer experience.
As of now, I see that CodeField supports the following languages:
const PHP = 'php';
const JS = 'javascript';
const JSON = 'json';
const HTML = 'html';
const CSS = 'css';
const XML = 'xml';
const SQL = 'sql';
Would it be possible to extend the support to include Bash script language? This addition would not only aid our current project but I believe it would also be a valuable enhancement for the community, catering to a wider range of development needs.
If needed, I'm willing to contribute or assist in any way to make this possible. Looking forward to hearing your thoughts on this.
Thank you for considering my request.
Hey,
thanks a lot for this plugin :)
I'm sure it's a noob mistake, but for some reason I am having issues making it work.
Installed via composer, set up a simple CodeField but I then get the JS error in title...
public array $waterfall_log = [];
public function mount(): void
{
$this->authorize('view', $this->lead);
$this->form->fill([
'waterfall_log' => $this->lead->log->waterfall_log,
]);
}
protected function getFormSchema(): array
{
return [
CodeField::make('waterfall_log')
->disableAutocompletion()
->withLineNumbers()
->disabled(),
];
}
I tried running npm run dev
but the JS error persists.
PS: I'm using the CodeField with Filament Form Builder
When using this plug-in with Filament v3 (v2 of the plugin), I'm seeing the following error message in the console:
I believe this is originating from here:
This is preventing the field from rendering on the page.
Update: this only happens when casting a property to json via the model. When I remove the json casting, it works as expected.
Below is the content of the property I'm trying to display:
[
[
"slug" => "practical-suggestions",
"rating" => 3,
],
[
"slug" => "innovative-material",
"rating" => 4,
],
[
"slug" => "increased-awareness",
"rating" => 3,
],
[
"slug" => "well-organized",
"rating" => 2,
],
[
"slug" => "well-articulated",
"rating" => 4,
],
[
"slug" => "overall",
"rating" => 4,
],
]
Uncaught TypeError: Cannot read properties of undefined (reading '0')
at Proxy.buildExtensionsArray (code-field.js:63:43)
at Proxy.init (code-field.js:34:38)
at module.esm.js:459:23
at oe (module.esm.js:414:12)
at le (module.esm.js:439:3)
at module.esm.js:2131:27
at Function. (module.esm.js:1196:55)
at n (module.esm.js:577:7)
at module.esm.js:582:5
at Ge (module.esm.js:779:3)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.