File tree 2 files changed +23
-2
lines changed
2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change
1
+ @php
2
+ use Illuminate\Support\ Str ;
3
+
4
+ $value = $getState ();
5
+ $validJson = ! is_string ($value ) && Str:: isJson (json_encode ($value ));
6
+ @endphp
7
+
1
8
<x-dynamic-component class =" filament-syntax-entry-component" :component =" $getEntryWrapperView()" :entry =" $entry" wire:ignore >
2
9
<div
3
10
class =" filament-syntax-entry"
@@ -33,7 +40,7 @@ class="filament-syntax-entry"
33
40
x-init =" init()"
34
41
x-on:destroyed =" cleanup"
35
42
>
36
- <pre ><code >{{ json_encode ($getState () , JSON_PRETTY_PRINT ) } } </code ></pre >
43
+ <pre ><code >{{ $validJson ? json_encode ($value , JSON_PRETTY_PRINT ) : $value } } </code ></pre >
37
44
</div >
38
45
</div >
39
46
</x-dynamic-component >
Original file line number Diff line number Diff line change @@ -13,9 +13,23 @@ class SyntaxEntry extends Entry implements HasAffixActions
13
13
14
14
protected string $ view = 'filament-syntax-entry::syntax-entry ' ;
15
15
16
+ protected string | Closure | null $ language = null ;
17
+
16
18
protected string | Closure | null $ theme = 'filament ' ;
17
19
18
- protected string | Closure | null $ darkModeTheme = null ;
20
+ protected string | Closure | null $ darkModeTheme = 'filament-dark ' ;
21
+
22
+ public function language (string | Closure $ language ): static
23
+ {
24
+ $ this ->language = $ language ;
25
+
26
+ return $ this ;
27
+ }
28
+
29
+ public function getLanguage (): string
30
+ {
31
+ return $ this ->evaluate ($ this ->language );
32
+ }
19
33
20
34
public function theme (string | Closure $ theme ): static
21
35
{
You can’t perform that action at this time.
0 commit comments