awcodes / filament-tiptap-editor

A Rich Text Editor plugin for Filament Forms.
MIT License
248 stars 64 forks source link

Wrong event-name if using curator media-action #211

Closed fvanzeijl closed 7 months ago

fvanzeijl commented 7 months ago

Filament Version

v3.0.100

Plugin Version

V3.1

PHP Version

PHP8.2

Problem description

Hey,

If I enable curator as media action no image will be added to tip-tap. I figured out curator-action fires event named "insert-media" while tip-tap listens to event named "insert-content".

I can temporary fix that by listen to "insert-media" and forward it via "insert-content" to tip-tap. With Livewire3's On-attribute on CreateRecord.php/EditRecord.php-Component of the Resource:

  #[On('insert-media')]
  public function insertMedia(string $statePath, array $media)
  {
    $this->dispatch('insert-content', type: 'media', statePath: $statePath, media: $media);
  }

But I think that should be fixed directly in package or am I missing something?

Expected behavior

Forward "insert-media"-Event from curator-action to "insert-content"-Event from this package.

Steps to reproduce

filament-curator src/Components/Modals/CuratorPanel.php

filament-tiptap-editor src/Actions/MediaAction.php

Reproduction repository

No response

Relevant log output

No response

awcodes commented 7 months ago

You're right. I'll get this fixed soon. Thanks.

awcodes commented 7 months ago

This has been fixed in Curator with v3.1.2 of that plugin.

Thanks again.