@@ -140,43 +140,48 @@ def __get_pydantic_core_schema__(
140140 def __str__ (self ) -> str :
141141 """Ensures that the string is correctly quoted."""
142142 if self in ["true" , "false" , "null" ]:
143- return super (). __str__ ()
143+ return self
144144 else :
145145 return f"'{ super ().__str__ ()} '"
146146
147147
148+ class StrEnum (Enum ):
149+ def __str__ (self ) -> str :
150+ return str (self .value )
151+
152+
148153Function = str # Basically, anything
149154
150155
151- class JsTrue (str , Enum ):
156+ class JsTrue (str , StrEnum ):
152157 true = "true"
153158
154159
155- class JsFalse (str , Enum ):
160+ class JsFalse (str , StrEnum ):
156161 false = "false"
157162
158163
159- class JsBool (Str , Enum ): # type: ignore
164+ class JsBool (Str , StrEnum ): # type: ignore
160165 true = "true"
161166 false = "false"
162167
163168
164- class JsNull (Str , Enum ): # type: ignore
169+ class JsNull (Str , StrEnum ): # type: ignore
165170 null = "null"
166171
167172
168- class ControlsLayout (Str , Enum ): # type: ignore
173+ class ControlsLayout (Str , StrEnum ): # type: ignore
169174 edges = "edges"
170175 bottom_right = "bottom-right"
171176
172177
173- class ControlsBackArrows (Str , Enum ): # type: ignore
178+ class ControlsBackArrows (Str , StrEnum ): # type: ignore
174179 faded = "faded"
175180 hidden = "hidden"
176181 visibly = "visibly"
177182
178183
179- class SlideNumber (Str , Enum ): # type: ignore
184+ class SlideNumber (Str , StrEnum ): # type: ignore
180185 true = "true"
181186 false = "false"
182187 hdotv = "h.v"
@@ -185,24 +190,24 @@ class SlideNumber(Str, Enum): # type: ignore
185190 candt = "c/t"
186191
187192
188- class ShowSlideNumber (Str , Enum ): # type: ignore
193+ class ShowSlideNumber (Str , StrEnum ): # type: ignore
189194 all = "all"
190195 print = "print"
191196 speaker = "speaker"
192197
193198
194- class KeyboardCondition (Str , Enum ): # type: ignore
199+ class KeyboardCondition (Str , StrEnum ): # type: ignore
195200 null = "null"
196201 focused = "focused"
197202
198203
199- class NavigationMode (Str , Enum ): # type: ignore
204+ class NavigationMode (Str , StrEnum ): # type: ignore
200205 default = "default"
201206 linear = "linear"
202207 grid = "grid"
203208
204209
205- class AutoPlayMedia (Str , Enum ): # type: ignore
210+ class AutoPlayMedia (Str , StrEnum ): # type: ignore
206211 null = "null"
207212 true = "true"
208213 false = "false"
@@ -211,25 +216,25 @@ class AutoPlayMedia(Str, Enum): # type: ignore
211216PreloadIframes = AutoPlayMedia
212217
213218
214- class AutoAnimateMatcher (Str , Enum ): # type: ignore
219+ class AutoAnimateMatcher (Str , StrEnum ): # type: ignore
215220 null = "null"
216221
217222
218- class AutoAnimateEasing (Str , Enum ): # type: ignore
223+ class AutoAnimateEasing (Str , StrEnum ): # type: ignore
219224 ease = "ease"
220225
221226
222227AutoSlide = Union [PositiveInt , JsFalse ]
223228
224229
225- class AutoSlideMethod (Str , Enum ): # type: ignore
230+ class AutoSlideMethod (Str , StrEnum ): # type: ignore
226231 null = "null"
227232
228233
229234MouseWheel = Union [JsNull , float ]
230235
231236
232- class Transition (Str , Enum ): # type: ignore
237+ class Transition (Str , StrEnum ): # type: ignore
233238 none = "none"
234239 fade = "fade"
235240 slide = "slide"
@@ -238,13 +243,13 @@ class Transition(Str, Enum): # type: ignore
238243 zoom = "zoom"
239244
240245
241- class TransitionSpeed (Str , Enum ): # type: ignore
246+ class TransitionSpeed (Str , StrEnum ): # type: ignore
242247 default = "default"
243248 fast = "fast"
244249 slow = "slow"
245250
246251
247- class BackgroundSize (Str , Enum ): # type: ignore
252+ class BackgroundSize (Str , StrEnum ): # type: ignore
248253 # From: https://developer.mozilla.org/en-US/docs/Web/CSS/background-size
249254 # TODO: support more background size
250255 contain = "contain"
@@ -254,11 +259,11 @@ class BackgroundSize(Str, Enum): # type: ignore
254259BackgroundTransition = Transition
255260
256261
257- class Display (Str , Enum ): # type: ignore
262+ class Display (Str , StrEnum ): # type: ignore
258263 block = "block"
259264
260265
261- class RevealTheme (str , Enum ):
266+ class RevealTheme (str , StrEnum ):
262267 black = "black"
263268 white = "white"
264269 league = "league"
0 commit comments