Skip to content

Commit

Permalink
Merge pull request #135 from lara-zeus/refactor-editors
Browse files Browse the repository at this point in the history
refactor-editors
  • Loading branch information
atmonshi authored Aug 18, 2023
2 parents 986aa68 + 33e1ffd commit cfef326
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ trait Configuration

/**
* the default editor for pages and posts, Available:
* \LaraZeus\Sky\Classes\TipTapEditor::class,
* \LaraZeus\Sky\Classes\TinyEditor::class,
* \LaraZeus\Sky\Classes\MarkdownEditor::class,
* \LaraZeus\Sky\Editors\TipTapEditor::class,
* \LaraZeus\Sky\Editors\TinyEditor::class,
* \LaraZeus\Sky\Editors\MarkdownEditor::class,
*/
protected string $editor = \LaraZeus\Sky\Classes\TipTapEditor::class;
protected string $editor = Editors\TipTapEditor::class;

/**
* parse the content
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php

namespace LaraZeus\Sky\Classes;
namespace LaraZeus\Sky\Editors;

use Filament\Forms\Components\Component;
use Filament\Forms\Components\Textarea;
use LaraZeus\Sky\Classes\ContentEditor;
use Spatie\FilamentMarkdownEditor\MarkdownEditor as MarkdownEditorAlias;

class MarkdownEditor implements ContentEditor
Expand Down
3 changes: 2 additions & 1 deletion src/Classes/TinyEditor.php → src/Editors/TinyEditor.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php

namespace LaraZeus\Sky\Classes;
namespace LaraZeus\Sky\Editors;

use Filament\Forms\Components\Component;
use Filament\Forms\Components\Textarea;
use LaraZeus\Sky\Classes\ContentEditor;
use Mohamedsabil83\FilamentFormsTinyeditor\Components\TinyEditor as TinyEditorAlias;

class TinyEditor implements ContentEditor
Expand Down
8 changes: 4 additions & 4 deletions src/Classes/TipTapEditor.php → src/Editors/TipTapEditor.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php

namespace LaraZeus\Sky\Classes;
namespace LaraZeus\Sky\Editors;

use Filament\Forms\Components\Component;
use Filament\Forms\Components\Textarea;
use FilamentTiptapEditor\Enums\TiptapOutput;
use FilamentTiptapEditor\TiptapEditor as TipTapEditorAlias;
use LaraZeus\Sky\Classes\ContentEditor;

class TipTapEditor implements ContentEditor
{
public static function component(): Component
{
if (class_exists(TipTapEditorAlias::class)) {
if (class_exists(\FilamentTiptapEditor\TiptapEditor::class)) {
return \FilamentTiptapEditor\TiptapEditor::make('content')
->profile('default')
->output(TiptapOutput::Html)
Expand All @@ -24,7 +24,7 @@ public static function component(): Component

public static function render(string $content): string
{
if (class_exists(TipTapEditorAlias::class)) {
if (class_exists(\FilamentTiptapEditor\TiptapEditor::class)) {
return tiptap_converter()->asHTML($content);
}

Expand Down

0 comments on commit cfef326

Please sign in to comment.