wire-elements / pro-demo

9 stars 0 forks source link

using the Insert component in Filament Forms RichText Editor #5

Closed andreaskviby closed 1 month ago

andreaskviby commented 1 year ago

We use Filament Admin for our applications and now we bought your excellent package to utilize the Insert Component to have a way to insert codes and mention people. We use the Rich Text editor in Filament which essentially is a Trix Editor. We can't figure out how to implement your component into this.

Forms\Components\RichEditor::make('treatment')
                        ->disableToolbarButtons([
                            'attachFiles',
                            'codeBlock',
                            'redo',
                            'undo',
                            'blockquote',
                            'link',
                            'h2',
                            'h3',
                        ])->extraInputAttributes(['x-data' => 'SupportsWepInsert({ types: ["diagnos"] })', 'x-bind' => 'insertInput'])
                        ->lazy()
                        ->afterStateUpdated(function (Field $component, mixed $state) {
                            if (! $this->selectedJournal) {
                                return;
                            }
                            $this->selectedJournal->update([$component->getName() => $state]);
                        })
                        ->label('Behandling')
                        ->dehydrated(false)
                        ->columnSpan(2)
                        ->disabled(function () {
                            return $this->selectedJournal?->signed_by;
                        }),

We have tested the above but no matter how we do it we can't get it to work. Any ideas?

PhiloNL commented 1 month ago

Sorry for not replying earlier, I don't monitor this repository. You can reach out to support@wire-elements.dev to report any issues.

These kinds of editors are not supported at this time as mentioned in the docs. "This component is not tested on WYSIWYG editors and should be considered as not supported at this time.". I wish I had better news but due to how WYSIWYG editors work It can be difficult/impossible (depending on the specific editor) to implement.