@@ -140,43 +140,48 @@ def __get_pydantic_core_schema__(
140
140
def __str__ (self ) -> str :
141
141
"""Ensures that the string is correctly quoted."""
142
142
if self in ["true" , "false" , "null" ]:
143
- return super (). __str__ ()
143
+ return self
144
144
else :
145
145
return f"'{ super ().__str__ ()} '"
146
146
147
147
148
+ class StrEnum (Enum ):
149
+ def __str__ (self ) -> str :
150
+ return str (self .value )
151
+
152
+
148
153
Function = str # Basically, anything
149
154
150
155
151
- class JsTrue (str , Enum ):
156
+ class JsTrue (str , StrEnum ):
152
157
true = "true"
153
158
154
159
155
- class JsFalse (str , Enum ):
160
+ class JsFalse (str , StrEnum ):
156
161
false = "false"
157
162
158
163
159
- class JsBool (Str , Enum ): # type: ignore
164
+ class JsBool (Str , StrEnum ): # type: ignore
160
165
true = "true"
161
166
false = "false"
162
167
163
168
164
- class JsNull (Str , Enum ): # type: ignore
169
+ class JsNull (Str , StrEnum ): # type: ignore
165
170
null = "null"
166
171
167
172
168
- class ControlsLayout (Str , Enum ): # type: ignore
173
+ class ControlsLayout (Str , StrEnum ): # type: ignore
169
174
edges = "edges"
170
175
bottom_right = "bottom-right"
171
176
172
177
173
- class ControlsBackArrows (Str , Enum ): # type: ignore
178
+ class ControlsBackArrows (Str , StrEnum ): # type: ignore
174
179
faded = "faded"
175
180
hidden = "hidden"
176
181
visibly = "visibly"
177
182
178
183
179
- class SlideNumber (Str , Enum ): # type: ignore
184
+ class SlideNumber (Str , StrEnum ): # type: ignore
180
185
true = "true"
181
186
false = "false"
182
187
hdotv = "h.v"
@@ -185,24 +190,24 @@ class SlideNumber(Str, Enum): # type: ignore
185
190
candt = "c/t"
186
191
187
192
188
- class ShowSlideNumber (Str , Enum ): # type: ignore
193
+ class ShowSlideNumber (Str , StrEnum ): # type: ignore
189
194
all = "all"
190
195
print = "print"
191
196
speaker = "speaker"
192
197
193
198
194
- class KeyboardCondition (Str , Enum ): # type: ignore
199
+ class KeyboardCondition (Str , StrEnum ): # type: ignore
195
200
null = "null"
196
201
focused = "focused"
197
202
198
203
199
- class NavigationMode (Str , Enum ): # type: ignore
204
+ class NavigationMode (Str , StrEnum ): # type: ignore
200
205
default = "default"
201
206
linear = "linear"
202
207
grid = "grid"
203
208
204
209
205
- class AutoPlayMedia (Str , Enum ): # type: ignore
210
+ class AutoPlayMedia (Str , StrEnum ): # type: ignore
206
211
null = "null"
207
212
true = "true"
208
213
false = "false"
@@ -211,25 +216,25 @@ class AutoPlayMedia(Str, Enum): # type: ignore
211
216
PreloadIframes = AutoPlayMedia
212
217
213
218
214
- class AutoAnimateMatcher (Str , Enum ): # type: ignore
219
+ class AutoAnimateMatcher (Str , StrEnum ): # type: ignore
215
220
null = "null"
216
221
217
222
218
- class AutoAnimateEasing (Str , Enum ): # type: ignore
223
+ class AutoAnimateEasing (Str , StrEnum ): # type: ignore
219
224
ease = "ease"
220
225
221
226
222
227
AutoSlide = Union [PositiveInt , JsFalse ]
223
228
224
229
225
- class AutoSlideMethod (Str , Enum ): # type: ignore
230
+ class AutoSlideMethod (Str , StrEnum ): # type: ignore
226
231
null = "null"
227
232
228
233
229
234
MouseWheel = Union [JsNull , float ]
230
235
231
236
232
- class Transition (Str , Enum ): # type: ignore
237
+ class Transition (Str , StrEnum ): # type: ignore
233
238
none = "none"
234
239
fade = "fade"
235
240
slide = "slide"
@@ -238,13 +243,13 @@ class Transition(Str, Enum): # type: ignore
238
243
zoom = "zoom"
239
244
240
245
241
- class TransitionSpeed (Str , Enum ): # type: ignore
246
+ class TransitionSpeed (Str , StrEnum ): # type: ignore
242
247
default = "default"
243
248
fast = "fast"
244
249
slow = "slow"
245
250
246
251
247
- class BackgroundSize (Str , Enum ): # type: ignore
252
+ class BackgroundSize (Str , StrEnum ): # type: ignore
248
253
# From: https://developer.mozilla.org/en-US/docs/Web/CSS/background-size
249
254
# TODO: support more background size
250
255
contain = "contain"
@@ -254,11 +259,11 @@ class BackgroundSize(Str, Enum): # type: ignore
254
259
BackgroundTransition = Transition
255
260
256
261
257
- class Display (Str , Enum ): # type: ignore
262
+ class Display (Str , StrEnum ): # type: ignore
258
263
block = "block"
259
264
260
265
261
- class RevealTheme (str , Enum ):
266
+ class RevealTheme (str , StrEnum ):
262
267
black = "black"
263
268
white = "white"
264
269
league = "league"
0 commit comments