This is a work in progress. ugh!
awcodes / filament-tiptap-editor Goto Github PK
View Code? Open in Web Editor NEWA Rich Text Editor plugin for Filament Forms.
License: MIT License
A Rich Text Editor plugin for Filament Forms.
License: MIT License
This is a work in progress. ugh!
Hi, is there any setting we can use to set a default class for the img elements inside the tiptap content?
Regards
Filament Version: 2.16.36
Package Version: 1.0.3
thanks :)
both steps i take, output this error :
and so on with the same message "not defined",
is there any compulsory steps outside the official steps to make this plugin works inside filament? or is it because i use alpine:3.4? Thanks in advance
When using filament/spatie-laravel-translatable-plugin in conjunction with spatie/laravel-translatable, the content of the editor does not update when switching locales using the locale switcher from spatie/laravel-translatable. Specifically, after switching the locale, the content remains the same and does not reflect the updates made for the newly selected locale.
Versions
when clicking links tool the whole parent livewire component goes blank. i cant see to trace where/why this is happening
if $wire.dispatchFormEvent('tiptap::setLinkContent', '{{ $statePath }}', linkProps);
is commented it out in link.blade.php
it obviously doesn't ping the server. but the function which is regiatered to listen on tiptap::setLinkContent
is never run either.
im confused with the event lifecycle and why the page goes blank
i am using this in a form with the filament-tools package
v3.0.93
v3.0.4
v8.1
When using asymmetric grids, column span validation fails min. Should be 1 instead of 2.
Column span should accept 1
No response
No response
Hi , Its good package and I like it so far but I have an issue. I can't add any ul or li class when im in source code.
<ul class="IT WILL DISAPPEAR AFTER SAVE"><li ><p><a class="text-blue-500" href="www.asda.com" target="_blank" as_button="false" button_theme="">Alanya Pamukkale Tour</a></p></li></ul>
When editor output set to Json editor returns on save:
Column 'content' cannot be null
If set migration column to nullable, after save - the column is null
Migration column was set to json
Model casted to array. Also tried with json, same error.
Environment:
Filament panel 3.0.39
tiptap 3.0.0 beta-1
Component example:
TiptapEditor::make('content')
->output(TiptapOutput::Json)
->required()
->columnSpan(2),
when using two links on the same line both redirect to the same url. it happened as i placed the second link that i noticed the first link i had introduced suddenly changed to the last link i added.
edit:
nevermind. it's the display of the URL that doesn't get updated. the links do work when placed within the same line, but it appears that you need to click on something else, like a word below to have it show the correct link.
v3.0.91
v3.1.0
PHP 8.2
When editing the source of a field, the source action
throws an exception:
Too few arguments to function FilamentTiptapEditor\TiptapEditor::renderBlockPreviews(), 1 passed in /Users/sjardim/Herd/filament-flexible/vendor/awcodes/filament-tiptap-editor/src/Actions/SourceAction.php on line 36 and exactly 2 expected
Change the method renderBlockPreviews()
inside /src/TipTapEditor.php to expect the component instance as null for default, as such:
public function renderBlockPreviews(array $document, ?TiptapEditor $component = null): array
{
$content = $document['content'];
$component ?? $component = $this;
...rest of function body
The sourceAction
class should return the edited state to the field.
Click on the "source" button on the editor, make some changes to the source HTML, and submit these changes.
No response
No response
After upgrading to 2.x
, I'm getting errors in the javascript console:
Uncaught ReferenceError: fullScreenMode is not defined
Uncaught ReferenceError: isActive is not defined
Are there any changes that I should make to upgrade to 2.x
? Is there an upgrade guide available?
v3.0.100
V3.1
PHP8.2
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?
Forward "insert-media"-Event from curator-action to "insert-content"-Event from this package.
filament-curator
src/Components/Modals/CuratorPanel.php
filament-tiptap-editor
src/Actions/MediaAction.php
No response
No response
We discussed this yesterday in the Filament Discord. This package doesn't work anymore in environments with PHP below 8.1 since the 'output' feature update, because the enum class is always getting loaded.
v3.1.8
^v3.1.10
PHP 8.2.13
Im getting this error when using TipTap Editor in a form:
Call to a member function getGridLayouts() on null
It's caused by the v3.1.10 Update.
This file causes the error:
resources/views/components/tools/grid.blade.php
Link to file
Not getting an error.
Update filament-tiptap-editor to version v3.1.10 or higher.
Use the Editor in a form.
No response
No response
Like the title says, there's no background colour set in the tiptap-content div for lightmode.
<div class="tiptap-content max-h-[40rem] h-auto overflow-scroll rounded-b-md dark:bg-gray-700" x-ref="element">
Needs a bg-white, or it the editor becomes transparent when going fullscreen ;)
I have output set to OUTPUT_JSON
in the config file.
When I click the "Source Code" button on the editor I am just shown [object Object]
instead of the code.
Here is the form resource code:
TiptapEditor::make('body')
->profile('default')
->required()
->maxLength(65535)
->extraInputAttributes(['style' => 'min-height: 12rem;'])
->columnSpanFull(),
Plugin version: 2.5.0
Filament version: 2.17.47
Laravel version: 10.13.5
Hello, i use filamentphp admin with this field.
My model has field hero
- json and same cast
I attach video how it looks like. After i click save changes
i do refresh page
edit: bold
works as expected
PHP 8.2.0
laravel/framework v9.48.0
filament/filament v2.16.65
awcodes/filament-tiptap-editor v2.0.6
When creating resources the TiptapEditor
field throws a JS error when there is no default value specified.
class PageResource extends Resource
{
public static function form(Form $form): Form
{
return $form
->schema([
TiptapEditor::make('text'),
]);
}
}
Produces the following in the console when creating a new Page resource:
Uncaught TypeError: can't access property "length", e.initialValue is null
init https://www.localhost/filament/assets/filament-tiptap-editor-scripts.js:98
I believe the bug was introduced in 2.2.3. Specifically #84. I've confirmed this by downgrading to 2.2.2 or doing the following:
class PageResource extends Resource
{
public static function form(Form $form): Form
{
return $form
->schema([
TiptapEditor::make('text')
->default('some content'),
]);
}
}
v3.0.97
v3.1.2
PHP 8.1
I have a simple Filament resource, with a TipTap editor. Creating a new resource was working fine earlier but upon upgrading to 3.1.2, no matter what output
parameter I select it always returns an array
. I have tried editing both the config option and using ->output(\FilamentTiptapEditor\Enums\TiptapOutput::Html)
Can you please help out?
Expected it to return valid HTML instead.
No response
None
line 52 in TiptapEditor.php:
ray($component->getHTML());
Thank you for this great implementation of TipTap.
I wonder if you are planning to implement some of the basic textArea properties (min & max length + maybe rows/min-height).
Keep up the great work ! 🎉
Hi,
It happens randomly but the only way I found to reproduce this is to have a builder with several tip tap editor.
Then add a link -> save -> remove link.
The others editor will keep their content visible but for a weird reason the state of other editors are synced to "[object Object]"
The content is still is visible in the form but when saving it is set to null.
Thank you for your help
Hi there,
Thank you for the great efforts put into this package. I really find it awesome. However I experienced a minor bug whether I am doing something wrong or it is an actual problem with the editor.
I am trying to build a small Filament hint next to the editor that would show the characters left as the user type in
TiptapEditor::make(name: 'short_description')
->required()
->maxLength(self::$model::$shortDescriptionTextLimit)
->reactive()
->hint(
fn($state, $component) =>
'left: ' . ($component->getMaxLength() - strlen(str_replace(' ', '', strip_tags($state)))) . ' characters'
)
->columnSpan(span: 'full');
However, the hint shows perfect fine on page load. But, as I start typing in nothing is updating. I believe the $state
is not being updated. Therefore, it does not update the hint.
When the output type is set to anything other than TiptapEditor::OUTPUT_HTML
the cursor jumps to the end of the field anytime a key is pressed:
TiptapEditor::make('text')
->output(TiptapEditor::OUTPUT_JSON)
Given the following code:
Resources/TestResource.php
class TestResource extends Resource
{
protected static ?string $model = Test::class;
public static function form(Form $form): Form
{
return $form
->schema([
TiptapEditor::make('test')
->output(TiptapEditor::OUTPUT_JSON),
]);
}
//...
}
Models/Test.php
class Test extends Model
{
protected $fillable = [
'test',
];
public $casts = [
'test' => 'json',
];
}
When text is entered and you press save the JSON data is persisted to the database as expected. If you refresh the page and without changing the value press save null
is persisted rather than the displayed value.
Additionally, and I suspect this is related, if you enter text and press save and then without refreshing the page press save again an error is thrown:
Inspecting the value of $state
on the first save gives:
On the second save:
In the RTL version, aligning text left doesn't work, but it works fine in the LTR.
Hello. First of all, thank you for your big work.
I edit the source code and use the tag after it automatically replaced the mark tag with the p tag.
What can I do in this situation?
Unfortunately, when I try to paste an image from my clipboard, the image is not displayed because the img-src points to my local appdata folder.
I get that when I try to save
I can't select text and make it bold, each time i click bold cursor moved to start position
plugin version v2.2.5
I attach video
But the remove link button from the floating UI is still working.
Here's a quick demo:
When adding a link i can only choose other window, and it automaticly adds noopener etc. i dont want that
How would I go about porting over the color utility from tiptap? Or is this available as is in the package? Thanks!
v3.0.79
v3.0.2
PHP 8.2.6
When you add the Tiptap Editor to a sortable repeater, the prosemirror div gets duplicated. After saving it's correct again, so I don't know yet if this is an issue caused by this package or in tiptap itself.
To keep the original content
Forms\Components\Repeater::make('items')
->schema([
TiptapEditor::make('text'),
]),
https://github.com/jyrkidn/filament-tiptap-test
See the video I made: https://github.com/jyrkidn/filament-tiptap-test/blob/master/Screen%20Recording%202023-10-18%20at%2015.33.08.mov
What the title says, Packagist is still on 0.2.20. And thanks for all your work on this (and other packages), it's saving me tons of time!
v3.0.73
v3.0.2
8.1.16
when you select text and click the 'add link' button from the tippy tooltip, the tooltip is visualized above the filament modal.
The filament modal is above the tippy tooltip.
No response
No response
Hi, when I attempted to insert a YouTube video into the tiptap editor, it appeared on the editor. However, when I save the post, the video does not appear. The source code contains a broken iframe tag.
Here is the video :
And here is the repo:
https://github.com/misbahansori/tiptap-reproduce-issue
During every input editor send request to server which cause a freeze for ~1 sec. Thats make it unusable.
https://youtu.be/s0hDSGIRU_Q
v3.0.93
v3.0.4
PHP 8.2.11
When using the "Insert Media" function to add an video it gets inserted but after reloading the form there's an error:
Call to undefined method DOMText::getAttribute()
Maybe it's caused by the encoded iframe:
<div data-vimeo-video="" class="responsive"><iframe src="https://player.vimeo.com/video/12345?rel=0&amp;" width="1600" height="900" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" data-aspect-width="16" data-aspect-height="9"></iframe></div>
Error should not appear :)
Insert any video by URL from YouTube or Vimeo.
No response
No response
Sorry, it's me again 😄
seems to be related to #85
There is an issue with locale switcher (Custom one but with the same behavior than the original). When I switch the first time, nothing happens and the form is not filled with translated content , then when switching locales, translations are reversed.
this.$watch('locale', () => {
setTimeout(() => {
editors[this.id].destroy();
this.initEditor(this.state);
}, 1000);
});
I increased the timeout to 1000ms and everything is ok.
I think that the timeout is a bit too short and then the editor is filled with the previous state. Only happen when the field is not used in Builder or Repeater.
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.