@@ -116,10 +116,348 @@ export default recipe(false as const satisfies __ctHelpers.JSONSchema, {
116116 return {
117117 [ UI ] : ( < div >
118118 { /* Simple opaque ref with JSX on right - SHOULD use when for short-circuit optimization */ }
119- { __ctHelpers . when ( showPanel , < div > Panel content</ div > ) }
119+ { __ctHelpers . when ( {
120+ type : "boolean" ,
121+ asCell : true
122+ } as const satisfies __ctHelpers . JSONSchema , {
123+ type : "object" ,
124+ properties : {
125+ type : {
126+ type : "string"
127+ } ,
128+ name : {
129+ type : "string"
130+ } ,
131+ props : {
132+ $ref : "#/$defs/Props"
133+ } ,
134+ children : {
135+ $ref : "#/$defs/RenderNode"
136+ } ,
137+ $UI : {
138+ $ref : "#/$defs/VNode"
139+ }
140+ } ,
141+ required : [ "type" , "name" , "props" ] ,
142+ $defs : {
143+ VNode : {
144+ type : "object" ,
145+ properties : {
146+ type : {
147+ type : "string"
148+ } ,
149+ name : {
150+ type : "string"
151+ } ,
152+ props : {
153+ $ref : "#/$defs/Props"
154+ } ,
155+ children : {
156+ $ref : "#/$defs/RenderNode"
157+ } ,
158+ $UI : {
159+ $ref : "#/$defs/VNode"
160+ }
161+ } ,
162+ required : [ "type" , "name" , "props" ]
163+ } ,
164+ RenderNode : {
165+ anyOf : [ {
166+ type : "string"
167+ } , {
168+ type : "number"
169+ } , {
170+ type : "boolean"
171+ } , {
172+ $ref : "#/$defs/VNode"
173+ } , {
174+ type : "object" ,
175+ properties : { }
176+ } , {
177+ type : "array" ,
178+ items : {
179+ $ref : "#/$defs/RenderNode"
180+ }
181+ } ]
182+ } ,
183+ Props : {
184+ type : "object" ,
185+ properties : { } ,
186+ additionalProperties : {
187+ anyOf : [ {
188+ type : "string"
189+ } , {
190+ type : "number"
191+ } , {
192+ type : "boolean"
193+ } , {
194+ type : "object" ,
195+ additionalProperties : true
196+ } , {
197+ type : "array" ,
198+ items : true
199+ } , { } , {
200+ type : "null"
201+ } ]
202+ }
203+ }
204+ }
205+ } as const satisfies __ctHelpers . JSONSchema , {
206+ type : "object" ,
207+ properties : {
208+ type : {
209+ type : "string"
210+ } ,
211+ name : {
212+ type : "string"
213+ } ,
214+ props : {
215+ $ref : "#/$defs/Props"
216+ } ,
217+ children : {
218+ $ref : "#/$defs/RenderNode"
219+ } ,
220+ $UI : {
221+ $ref : "#/$defs/VNode"
222+ }
223+ } ,
224+ required : [ "type" , "name" , "props" ] ,
225+ $defs : {
226+ VNode : {
227+ type : "object" ,
228+ properties : {
229+ type : {
230+ type : "string"
231+ } ,
232+ name : {
233+ type : "string"
234+ } ,
235+ props : {
236+ $ref : "#/$defs/Props"
237+ } ,
238+ children : {
239+ $ref : "#/$defs/RenderNode"
240+ } ,
241+ $UI : {
242+ $ref : "#/$defs/VNode"
243+ }
244+ } ,
245+ required : [ "type" , "name" , "props" ]
246+ } ,
247+ RenderNode : {
248+ anyOf : [ {
249+ type : "string"
250+ } , {
251+ type : "number"
252+ } , {
253+ type : "boolean"
254+ } , {
255+ $ref : "#/$defs/VNode"
256+ } , {
257+ type : "object" ,
258+ properties : { }
259+ } , {
260+ type : "array" ,
261+ items : {
262+ $ref : "#/$defs/RenderNode"
263+ }
264+ } ]
265+ } ,
266+ Props : {
267+ type : "object" ,
268+ properties : { } ,
269+ additionalProperties : {
270+ anyOf : [ {
271+ type : "string"
272+ } , {
273+ type : "number"
274+ } , {
275+ type : "boolean"
276+ } , {
277+ type : "object" ,
278+ additionalProperties : true
279+ } , {
280+ type : "array" ,
281+ items : true
282+ } , { } , {
283+ type : "null"
284+ } ]
285+ }
286+ }
287+ }
288+ } as const satisfies __ctHelpers . JSONSchema , showPanel , < div > Panel content</ div > ) }
120289
121290 { /* Another simple ref */ }
122- { __ctHelpers . when ( userName , < span > Hello { userName } </ span > ) }
291+ { __ctHelpers . when ( {
292+ type : "string" ,
293+ asCell : true
294+ } as const satisfies __ctHelpers . JSONSchema , {
295+ type : "object" ,
296+ properties : {
297+ type : {
298+ type : "string"
299+ } ,
300+ name : {
301+ type : "string"
302+ } ,
303+ props : {
304+ $ref : "#/$defs/Props"
305+ } ,
306+ children : {
307+ $ref : "#/$defs/RenderNode"
308+ } ,
309+ $UI : {
310+ $ref : "#/$defs/VNode"
311+ }
312+ } ,
313+ required : [ "type" , "name" , "props" ] ,
314+ $defs : {
315+ VNode : {
316+ type : "object" ,
317+ properties : {
318+ type : {
319+ type : "string"
320+ } ,
321+ name : {
322+ type : "string"
323+ } ,
324+ props : {
325+ $ref : "#/$defs/Props"
326+ } ,
327+ children : {
328+ $ref : "#/$defs/RenderNode"
329+ } ,
330+ $UI : {
331+ $ref : "#/$defs/VNode"
332+ }
333+ } ,
334+ required : [ "type" , "name" , "props" ]
335+ } ,
336+ RenderNode : {
337+ anyOf : [ {
338+ type : "string"
339+ } , {
340+ type : "number"
341+ } , {
342+ type : "boolean"
343+ } , {
344+ $ref : "#/$defs/VNode"
345+ } , {
346+ type : "object" ,
347+ properties : { }
348+ } , {
349+ type : "array" ,
350+ items : {
351+ $ref : "#/$defs/RenderNode"
352+ }
353+ } ]
354+ } ,
355+ Props : {
356+ type : "object" ,
357+ properties : { } ,
358+ additionalProperties : {
359+ anyOf : [ {
360+ type : "string"
361+ } , {
362+ type : "number"
363+ } , {
364+ type : "boolean"
365+ } , {
366+ type : "object" ,
367+ additionalProperties : true
368+ } , {
369+ type : "array" ,
370+ items : true
371+ } , { } , {
372+ type : "null"
373+ } ]
374+ }
375+ }
376+ }
377+ } as const satisfies __ctHelpers . JSONSchema , {
378+ type : "object" ,
379+ properties : {
380+ type : {
381+ type : "string"
382+ } ,
383+ name : {
384+ type : "string"
385+ } ,
386+ props : {
387+ $ref : "#/$defs/Props"
388+ } ,
389+ children : {
390+ $ref : "#/$defs/RenderNode"
391+ } ,
392+ $UI : {
393+ $ref : "#/$defs/VNode"
394+ }
395+ } ,
396+ required : [ "type" , "name" , "props" ] ,
397+ $defs : {
398+ VNode : {
399+ type : "object" ,
400+ properties : {
401+ type : {
402+ type : "string"
403+ } ,
404+ name : {
405+ type : "string"
406+ } ,
407+ props : {
408+ $ref : "#/$defs/Props"
409+ } ,
410+ children : {
411+ $ref : "#/$defs/RenderNode"
412+ } ,
413+ $UI : {
414+ $ref : "#/$defs/VNode"
415+ }
416+ } ,
417+ required : [ "type" , "name" , "props" ]
418+ } ,
419+ RenderNode : {
420+ anyOf : [ {
421+ type : "string"
422+ } , {
423+ type : "number"
424+ } , {
425+ type : "boolean"
426+ } , {
427+ $ref : "#/$defs/VNode"
428+ } , {
429+ type : "object" ,
430+ properties : { }
431+ } , {
432+ type : "array" ,
433+ items : {
434+ $ref : "#/$defs/RenderNode"
435+ }
436+ } ]
437+ } ,
438+ Props : {
439+ type : "object" ,
440+ properties : { } ,
441+ additionalProperties : {
442+ anyOf : [ {
443+ type : "string"
444+ } , {
445+ type : "number"
446+ } , {
447+ type : "boolean"
448+ } , {
449+ type : "object" ,
450+ additionalProperties : true
451+ } , {
452+ type : "array" ,
453+ items : true
454+ } , { } , {
455+ type : "null"
456+ } ]
457+ }
458+ }
459+ }
460+ } as const satisfies __ctHelpers . JSONSchema , userName , < span > Hello { userName } </ span > ) }
123461 </ div > ) ,
124462 } ;
125463} ) ;
0 commit comments