Skip to content

Commit

Permalink
Merge pull request #270 from awcodes/fix/source-code-editor
Browse files Browse the repository at this point in the history
Fix: source code modal css issues
  • Loading branch information
awcodes authored Dec 20, 2023
2 parents 304bb14 + 8901e12 commit f4c53da
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
23 changes: 23 additions & 0 deletions resources/css/plugin.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
@import './night-owl.css';

[wire\:key*="filament_tiptap_source"] {
.fi-fo-component-ctn {
height: 100%;

> div {
height: 100%;

.fi-fo-field-wrp {
height: 100%;

> div {
height: 100%;
grid-template-rows: auto 1fr;

textarea {
height: 100% !important;
}
}
}
}
}
}

.tiptap-wrapper.tiptap-fullscreen {
position: fixed;
top: 0;
Expand Down
2 changes: 1 addition & 1 deletion resources/dist/filament-tiptap-editor.css

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions src/Actions/SourceAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

namespace FilamentTiptapEditor\Actions;

use Filament\Forms\ComponentContainer;
use Filament\Forms\Components\Actions\Action;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\View;
use FilamentTiptapEditor\TiptapEditor;

class SourceAction extends Action
Expand All @@ -31,7 +29,7 @@ protected function setUp(): void
->modalWidth('screen')
->action(function (TiptapEditor $component, $data) {

$content = $data['source'];
$content = $data['source'] ?? '<p></p>';

if ($component->shouldSupportBlocks()) {
$content = tiptap_converter()->asJSON($content, decoded: true);
Expand Down

0 comments on commit f4c53da

Please sign in to comment.