2
2
3
3
namespace MarcoRieser \Livewire \Tags ;
4
4
5
+ use Livewire \Features \SupportScriptsAndAssets \SupportScriptsAndAssets ;
6
+ use Livewire \Mechanisms \FrontendAssets \FrontendAssets ;
5
7
use Statamic \Tags \Tags ;
8
+ use function Livewire \store ;
6
9
7
10
class Livewire extends Tags
8
11
{
@@ -37,13 +40,13 @@ public function entangle(): string
37
40
$ modifier = $ this ->params ->get ('modifier ' );
38
41
$ instanceId = $ this ->context ['__livewire ' ]->getId ();
39
42
40
- $ expression = ".entangle(' { $ property} ') " ;
43
+ $ expression = ".entangle(' $ property') " ;
41
44
42
45
if ($ modifier ) {
43
- $ expression .= ". { $ modifier} " ;
46
+ $ expression .= ". $ modifier " ;
44
47
}
45
48
46
- return "window.Livewire.find(' $ instanceId') { $ expression} " ;
49
+ return "window.Livewire.find(' $ instanceId') $ expression " ;
47
50
}
48
51
49
52
/**
@@ -57,14 +60,14 @@ public function this(): string
57
60
$ instanceId = $ this ->context ['__livewire ' ]->getId ();
58
61
59
62
if (! count ($ this ->params )) {
60
- return "window.Livewire.find(' { $ instanceId} ') " ;
63
+ return "window.Livewire.find(' $ instanceId') " ;
61
64
}
62
65
63
66
$ action = $ this ->params ->take (1 )->toArray ();
64
67
$ method = key ($ action );
65
68
$ parameters = reset ($ action );
66
69
67
- return "window.Livewire.find(' { $ instanceId} '). { $ method}{ $ parameters} " ;
70
+ return "window.Livewire.find(' $ instanceId'). $ method$ parameters " ;
68
71
}
69
72
70
73
/**
@@ -74,7 +77,7 @@ public function this(): string
74
77
*/
75
78
public function styles (): string
76
79
{
77
- return \ Livewire \ Mechanisms \ FrontendAssets \ FrontendAssets::styles ();
80
+ return FrontendAssets::styles ();
78
81
}
79
82
80
83
/**
@@ -84,7 +87,7 @@ public function styles(): string
84
87
*/
85
88
public function scripts (): string
86
89
{
87
- return \ Livewire \ Mechanisms \ FrontendAssets \ FrontendAssets::scripts ();
90
+ return FrontendAssets::scripts ();
88
91
}
89
92
90
93
/**
@@ -94,7 +97,7 @@ public function scripts(): string
94
97
*/
95
98
public function scriptConfig (): string
96
99
{
97
- return \ Livewire \ Mechanisms \ FrontendAssets \ FrontendAssets::scriptConfig ();
100
+ return FrontendAssets::scriptConfig ();
98
101
}
99
102
100
103
/**
@@ -108,11 +111,11 @@ public function assets(): void
108
111
109
112
$ key = md5 ($ html );
110
113
111
- if (in_array ($ key , \ Livewire \ Features \ SupportScriptsAndAssets \ SupportScriptsAndAssets::$ alreadyRunAssetKeys )) {
114
+ if (in_array ($ key , SupportScriptsAndAssets::$ alreadyRunAssetKeys )) {
112
115
// Skip it...
113
116
} else {
114
- \ Livewire \ Features \ SupportScriptsAndAssets \ SupportScriptsAndAssets::$ alreadyRunAssetKeys [] = $ key ;
115
- \ Livewire \ store ($ this ->context ['__livewire ' ])->push ('assets ' , $ html , $ key );
117
+ SupportScriptsAndAssets::$ alreadyRunAssetKeys [] = $ key ;
118
+ store ($ this ->context ['__livewire ' ])->push ('assets ' , $ html , $ key );
116
119
}
117
120
}
118
121
@@ -127,6 +130,6 @@ public function script(): void
127
130
128
131
$ key = md5 ($ html );
129
132
130
- \ Livewire \ store ($ this ->context ['__livewire ' ])->push ('scripts ' , $ html , $ key );
133
+ store ($ this ->context ['__livewire ' ])->push ('scripts ' , $ html , $ key );
131
134
}
132
135
}
0 commit comments