xote 6.1.0 → 6.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/XoteJSX.res CHANGED
@@ -243,48 +243,7 @@ module Elements = {
243
243
  }
244
244
 
245
245
  /* Convert props to attrs array */
246
- let propsToAttrs = (
247
- props: props<
248
- _,
249
- _,
250
- _,
251
- _,
252
- _,
253
- _,
254
- _,
255
- _,
256
- _,
257
- _,
258
- _,
259
- _,
260
- _,
261
- _,
262
- _,
263
- _,
264
- _,
265
- _,
266
- _,
267
- _,
268
- _,
269
- _,
270
- _,
271
- _,
272
- _,
273
- _,
274
- _,
275
- _,
276
- _,
277
- _,
278
- _,
279
- _,
280
- _,
281
- _,
282
- _,
283
- _,
284
- _,
285
- _,
286
- >,
287
- ): array<(string, Node.attrValue)> => {
246
+ let propsToAttrs = (props): array<(string, Node.attrValue)> => {
288
247
  let attrs = []
289
248
 
290
249
  /* Standard attributes */
@@ -368,48 +327,7 @@ module Elements = {
368
327
  }
369
328
 
370
329
  /* Convert props to events array */
371
- let propsToEvents = (
372
- props: props<
373
- _,
374
- _,
375
- _,
376
- _,
377
- _,
378
- _,
379
- _,
380
- _,
381
- _,
382
- _,
383
- _,
384
- _,
385
- _,
386
- _,
387
- _,
388
- _,
389
- _,
390
- _,
391
- _,
392
- _,
393
- _,
394
- _,
395
- _,
396
- _,
397
- _,
398
- _,
399
- _,
400
- _,
401
- _,
402
- _,
403
- _,
404
- _,
405
- _,
406
- _,
407
- _,
408
- _,
409
- _,
410
- _,
411
- >,
412
- ): array<(string, Dom.event => unit)> => {
330
+ let propsToEvents = (props): array<(string, Dom.event => unit)> => {
413
331
  let events = []
414
332
 
415
333
  addEvent(events, props.onClick, "click")
@@ -438,48 +356,7 @@ module Elements = {
438
356
  }
439
357
 
440
358
  /* Extract children from props */
441
- let getChildren = (
442
- props: props<
443
- _,
444
- _,
445
- _,
446
- _,
447
- _,
448
- _,
449
- _,
450
- _,
451
- _,
452
- _,
453
- _,
454
- _,
455
- _,
456
- _,
457
- _,
458
- _,
459
- _,
460
- _,
461
- _,
462
- _,
463
- _,
464
- _,
465
- _,
466
- _,
467
- _,
468
- _,
469
- _,
470
- _,
471
- _,
472
- _,
473
- _,
474
- _,
475
- _,
476
- _,
477
- _,
478
- _,
479
- _,
480
- _,
481
- >,
482
- ): array<element> => {
359
+ let getChildren = (props): array<element> => {
483
360
  switch props.children {
484
361
  | Some(Fragment(children)) => children
485
362
  | Some(child) => [child]
@@ -488,49 +365,7 @@ module Elements = {
488
365
  }
489
366
 
490
367
  /* Create an element from a tag string and props */
491
- let createElement = (
492
- tag: string,
493
- props: props<
494
- _,
495
- _,
496
- _,
497
- _,
498
- _,
499
- _,
500
- _,
501
- _,
502
- _,
503
- _,
504
- _,
505
- _,
506
- _,
507
- _,
508
- _,
509
- _,
510
- _,
511
- _,
512
- _,
513
- _,
514
- _,
515
- _,
516
- _,
517
- _,
518
- _,
519
- _,
520
- _,
521
- _,
522
- _,
523
- _,
524
- _,
525
- _,
526
- _,
527
- _,
528
- _,
529
- _,
530
- _,
531
- _,
532
- >,
533
- ): element => {
368
+ let createElement = (tag: string, props): element => {
534
369
  Node.Element({
535
370
  tag,
536
371
  attrs: propsToAttrs(props),
@@ -540,97 +375,11 @@ module Elements = {
540
375
  }
541
376
 
542
377
  /* JSX functions for HTML elements - all delegate to createElement */
543
- let jsx = (
544
- tag: string,
545
- props: props<
546
- _,
547
- _,
548
- _,
549
- _,
550
- _,
551
- _,
552
- _,
553
- _,
554
- _,
555
- _,
556
- _,
557
- _,
558
- _,
559
- _,
560
- _,
561
- _,
562
- _,
563
- _,
564
- _,
565
- _,
566
- _,
567
- _,
568
- _,
569
- _,
570
- _,
571
- _,
572
- _,
573
- _,
574
- _,
575
- _,
576
- _,
577
- _,
578
- _,
579
- _,
580
- _,
581
- _,
582
- _,
583
- _,
584
- >,
585
- ): element => createElement(tag, props)
378
+ let jsx = (tag: string, props): element => createElement(tag, props)
586
379
 
587
380
  let jsxs = jsx
588
381
 
589
- let jsxKeyed = (
590
- tag: string,
591
- props: props<
592
- _,
593
- _,
594
- _,
595
- _,
596
- _,
597
- _,
598
- _,
599
- _,
600
- _,
601
- _,
602
- _,
603
- _,
604
- _,
605
- _,
606
- _,
607
- _,
608
- _,
609
- _,
610
- _,
611
- _,
612
- _,
613
- _,
614
- _,
615
- _,
616
- _,
617
- _,
618
- _,
619
- _,
620
- _,
621
- _,
622
- _,
623
- _,
624
- _,
625
- _,
626
- _,
627
- _,
628
- _,
629
- _,
630
- >,
631
- ~key: option<string>=?,
632
- _: unit,
633
- ): element => {
382
+ let jsxKeyed = (tag: string, props, ~key: option<string>=?, _: unit): element => {
634
383
  let _ = key
635
384
  jsx(tag, props)
636
385
  }
@@ -66,7 +66,7 @@ function convertBoolAttrValue(key, value) {
66
66
  } else {
67
67
  return "false";
68
68
  }
69
- }, undefined);
69
+ }, undefined, undefined);
70
70
  return Node$Xote.signalAttr(key, strSignal);
71
71
  }
72
72
  if (typeof value === "function") {
@@ -87,7 +87,7 @@ function convertBoolAttrValue(key, value) {
87
87
  } else {
88
88
  return "false";
89
89
  }
90
- }, undefined);
90
+ }, undefined, undefined);
91
91
  return Node$Xote.signalAttr(key, strSignal$1);
92
92
  }
93
93