Code Monkey home page Code Monkey logo

filament-code-field's Issues

Ability to $set() value of CodeField and have that change reflected in Codemirror editor

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)

Specify height of code field

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!

After update to 1.0.2 json not properly formatted?

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

CleanShot 2023-01-18 at 11 41 56@2x

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

Add Bash Script Language Support to CodeField

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.

ReferenceError: Can't find variable: filamentCodeField

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

Field not displayed in Filament v3

When using this plug-in with Filament v3 (v2 of the plugin), I'm seeing the following error message in the console:
2023-08-15 at 16 46 56

I believe this is originating from here:
2023-08-15 at 16 47 08

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,
],
]

The field has disappeared

Screenshot from 2023-05-30 19-21-58

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.