@ory/elements-react 1.0.0-next.3 → 1.0.0-next.4

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/dist/index.mjs CHANGED
@@ -552,9 +552,11 @@ function parseDateTimeSkeleton(skeleton) {
552
552
  skeleton.replace(DATE_TIME_REGEX, function(match) {
553
553
  var len = match.length;
554
554
  switch (match[0]) {
555
+ // Era
555
556
  case "G":
556
557
  result.era = len === 4 ? "long" : len === 5 ? "narrow" : "short";
557
558
  break;
559
+ // Year
558
560
  case "y":
559
561
  result.year = len === 2 ? "2-digit" : "numeric";
560
562
  break;
@@ -563,13 +565,16 @@ function parseDateTimeSkeleton(skeleton) {
563
565
  case "U":
564
566
  case "r":
565
567
  throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");
568
+ // Quarter
566
569
  case "q":
567
570
  case "Q":
568
571
  throw new RangeError("`q/Q` (quarter) patterns are not supported");
572
+ // Month
569
573
  case "M":
570
574
  case "L":
571
575
  result.month = ["numeric", "2-digit", "short", "long", "narrow"][len - 1];
572
576
  break;
577
+ // Week
573
578
  case "w":
574
579
  case "W":
575
580
  throw new RangeError("`w/W` (week) patterns are not supported");
@@ -580,6 +585,7 @@ function parseDateTimeSkeleton(skeleton) {
580
585
  case "F":
581
586
  case "g":
582
587
  throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");
588
+ // Weekday
583
589
  case "E":
584
590
  result.weekday = len === 4 ? "short" : len === 5 ? "narrow" : "short";
585
591
  break;
@@ -595,12 +601,15 @@ function parseDateTimeSkeleton(skeleton) {
595
601
  }
596
602
  result.weekday = ["short", "long", "narrow", "short"][len - 4];
597
603
  break;
604
+ // Period
598
605
  case "a":
599
606
  result.hour12 = true;
600
607
  break;
601
608
  case "b":
609
+ // am, pm, noon, midnight
602
610
  case "B":
603
611
  throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");
612
+ // Hour
604
613
  case "h":
605
614
  result.hourCycle = "h12";
606
615
  result.hour = ["numeric", "2-digit"][len - 1];
@@ -621,23 +630,31 @@ function parseDateTimeSkeleton(skeleton) {
621
630
  case "J":
622
631
  case "C":
623
632
  throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");
633
+ // Minute
624
634
  case "m":
625
635
  result.minute = ["numeric", "2-digit"][len - 1];
626
636
  break;
637
+ // Second
627
638
  case "s":
628
639
  result.second = ["numeric", "2-digit"][len - 1];
629
640
  break;
630
641
  case "S":
631
642
  case "A":
632
643
  throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");
644
+ // Zone
633
645
  case "z":
634
646
  result.timeZoneName = len < 4 ? "short" : "long";
635
647
  break;
636
648
  case "Z":
649
+ // 1..3, 4, 5: The ISO8601 varios formats
637
650
  case "O":
651
+ // 1, 4: miliseconds in day short, long
638
652
  case "v":
653
+ // 1, 4: generic non-location format
639
654
  case "V":
655
+ // 1, 2, 3, 4: time zone ID or city
640
656
  case "X":
657
+ // 1, 2, 3, 4: The ISO8601 varios formats
641
658
  case "x":
642
659
  throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead");
643
660
  }
@@ -835,6 +852,7 @@ function parseNumberSkeleton(tokens) {
835
852
  case "notation-simple":
836
853
  result.notation = "standard";
837
854
  continue;
855
+ // https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h
838
856
  case "unit-width-narrow":
839
857
  result.currencyDisplay = "narrowSymbol";
840
858
  result.unitDisplay = "narrow";
@@ -853,6 +871,7 @@ function parseNumberSkeleton(tokens) {
853
871
  case "scale":
854
872
  result.scale = parseFloat(token.options[0]);
855
873
  continue;
874
+ // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width
856
875
  case "integer-width":
857
876
  if (token.options.length > 1) {
858
877
  throw new RangeError("integer-width stems only accept a single optional option");
@@ -2615,6 +2634,7 @@ var Parser = (
2615
2634
  this.bump();
2616
2635
  this.bump();
2617
2636
  return "'";
2637
+ // '{', '<', '>', '}'
2618
2638
  case 123:
2619
2639
  case 60:
2620
2640
  case 62:
@@ -2680,6 +2700,7 @@ var Parser = (
2680
2700
  return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));
2681
2701
  }
2682
2702
  switch (this.char()) {
2703
+ // Simple argument: `{name}`
2683
2704
  case 125: {
2684
2705
  this.bump();
2685
2706
  return {
@@ -2692,6 +2713,7 @@ var Parser = (
2692
2713
  err: null
2693
2714
  };
2694
2715
  }
2716
+ // Argument with options: `{name, format, ...}`
2695
2717
  case 44: {
2696
2718
  this.bump();
2697
2719
  this.bumpSpace();