@krak-stack/registry 0.10.19 → 0.10.20

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +18 -0
  3. package/dist/components/ui/code-block.js +7 -7
  4. package/dist/components/ui/copy-button.js +7 -7
  5. package/dist/components/ui/copy-value.js +7 -7
  6. package/dist/components/ui/data-table.d.ts +3 -3
  7. package/dist/components/ui/data-table.js +23 -17
  8. package/dist/components/ui/editing-locale-switcher.js +7 -7
  9. package/dist/components/ui/effect-form.js +8 -8
  10. package/dist/components/ui/email-composer.js +871 -0
  11. package/dist/components/ui/email-editor.d.ts +3 -1
  12. package/dist/components/ui/email-editor.js +294 -471
  13. package/dist/components/ui/error-component.js +7 -7
  14. package/dist/components/ui/form.d.ts +7 -7
  15. package/dist/components/ui/form.js +18 -14
  16. package/dist/components/ui/icon-input.js +1 -1
  17. package/dist/components/ui/map-menu.d.ts +1 -1
  18. package/dist/components/ui/map-menu.js +183 -60
  19. package/dist/components/ui/pagination.js +7 -7
  20. package/dist/components/ui/phone-number-input.js +1 -1
  21. package/dist/components/ui/rich-text-editor.d.ts +15 -13
  22. package/dist/components/ui/rich-text-editor.js +280 -661
  23. package/dist/components/ui/select-with-custom-input.js +7 -7
  24. package/dist/components/ui/select.js +159 -0
  25. package/dist/components/ui/timezone-select.js +1 -1
  26. package/dist/components/ui/virtualized-combobox.js +1 -1
  27. package/dist/lib/docs.js +7 -7
  28. package/dist/lib/email-composer/index.js +110 -0
  29. package/dist/lib/email-composer/schema.js +13 -0
  30. package/dist/lib/email-document/legacy-rich-text/editor.d.ts +70 -0
  31. package/dist/lib/email-document/legacy-rich-text/schema.d.ts +65 -0
  32. package/dist/lib/email-document/legacy-rich-text/tiptap.d.ts +39 -0
  33. package/dist/lib/email-document/model.d.ts +1 -1
  34. package/dist/lib/email-document/model.js +2 -2
  35. package/dist/lib/email-document/render.js +2 -2
  36. package/dist/lib/email-document/schema.js +1 -1
  37. package/dist/lib/rich-text/model.js +79 -111
  38. package/dist/lib/rich-text/schema.d.ts +5 -55
  39. package/dist/lib/rich-text/schema.js +17 -36
  40. package/dist/lib/rich-text/tiptap.d.ts +12 -0
  41. package/dist/services/agent/client/index.js +7 -7
  42. package/dist/services/events/client/audit-log-table.js +23 -17
  43. package/dist/services/webhooks/client/delivery-table.js +30 -24
  44. package/package.json +24 -1
  45. package/dist/lib/rich-text/dom.d.ts +0 -40
  46. /package/dist/lib/{rich-text → email-document/legacy-rich-text}/model.d.ts +0 -0
@@ -1,6 +1,6 @@
1
1
  // ../../src/components/ui/map-menu.tsx
2
2
  import { Dialog as DialogPrimitive2 } from "@base-ui/react/dialog";
3
- import { ChevronDown, LocateFixed as LocateFixed2, MapPin, Search, X } from "lucide-react";
3
+ import { LocateFixed as LocateFixed2, MapPin, Search, X } from "lucide-react";
4
4
  import { useEffect as useEffect2, useId, useRef as useRef2, useState as useState2 } from "react";
5
5
 
6
6
  // ../../src/components/ui/button.tsx
@@ -569,9 +569,125 @@ function Input({ className, type, ...props }) {
569
569
  });
570
570
  }
571
571
 
572
+ // ../../src/components/ui/select.tsx
573
+ import { Select as SelectPrimitive } from "@base-ui/react/select";
574
+ import { ChevronDownIcon, CheckIcon, ChevronUpIcon } from "lucide-react";
575
+ import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
576
+ "use client";
577
+ var Select = SelectPrimitive.Root;
578
+ function SelectValue({ className, ...props }) {
579
+ return /* @__PURE__ */ jsx5(SelectPrimitive.Value, {
580
+ "data-slot": "select-value",
581
+ className: cn("flex flex-1 text-left", className),
582
+ ...props
583
+ });
584
+ }
585
+ function SelectTrigger({
586
+ className,
587
+ size = "default",
588
+ children,
589
+ ...props
590
+ }) {
591
+ return /* @__PURE__ */ jsxs3(SelectPrimitive.Trigger, {
592
+ "data-slot": "select-trigger",
593
+ "data-size": size,
594
+ className: cn("border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 flex w-fit items-center justify-between gap-1.5 rounded-md border bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
595
+ ...props,
596
+ children: [
597
+ children,
598
+ /* @__PURE__ */ jsx5(SelectPrimitive.Icon, {
599
+ render: /* @__PURE__ */ jsx5(ChevronDownIcon, {
600
+ className: "text-muted-foreground pointer-events-none size-4"
601
+ })
602
+ })
603
+ ]
604
+ });
605
+ }
606
+ function SelectContent({
607
+ className,
608
+ children,
609
+ side = "bottom",
610
+ sideOffset = 4,
611
+ align = "start",
612
+ alignOffset = 0,
613
+ alignItemWithTrigger = false,
614
+ ...props
615
+ }) {
616
+ return /* @__PURE__ */ jsx5(SelectPrimitive.Portal, {
617
+ children: /* @__PURE__ */ jsx5(SelectPrimitive.Positioner, {
618
+ side,
619
+ sideOffset,
620
+ align,
621
+ alignOffset,
622
+ alignItemWithTrigger,
623
+ className: "isolate z-50",
624
+ children: /* @__PURE__ */ jsxs3(SelectPrimitive.Popup, {
625
+ "data-slot": "select-content",
626
+ "data-align-trigger": alignItemWithTrigger,
627
+ className: cn("bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-0 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md shadow-md ring-1 duration-100 data-[align-trigger=true]:animate-none", className),
628
+ ...props,
629
+ children: [
630
+ /* @__PURE__ */ jsx5(SelectScrollUpButton, {}),
631
+ /* @__PURE__ */ jsx5(SelectPrimitive.List, {
632
+ children
633
+ }),
634
+ /* @__PURE__ */ jsx5(SelectScrollDownButton, {})
635
+ ]
636
+ })
637
+ })
638
+ });
639
+ }
640
+ function SelectItem({
641
+ className,
642
+ children,
643
+ ...props
644
+ }) {
645
+ return /* @__PURE__ */ jsxs3(SelectPrimitive.Item, {
646
+ "data-slot": "select-item",
647
+ className: cn("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
648
+ ...props,
649
+ children: [
650
+ /* @__PURE__ */ jsx5(SelectPrimitive.ItemText, {
651
+ className: "flex flex-1 shrink-0 gap-2 whitespace-nowrap",
652
+ children
653
+ }),
654
+ /* @__PURE__ */ jsx5(SelectPrimitive.ItemIndicator, {
655
+ render: /* @__PURE__ */ jsx5("span", {
656
+ className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center"
657
+ }),
658
+ children: /* @__PURE__ */ jsx5(CheckIcon, {
659
+ className: "pointer-events-none"
660
+ })
661
+ })
662
+ ]
663
+ });
664
+ }
665
+ function SelectScrollUpButton({
666
+ className,
667
+ ...props
668
+ }) {
669
+ return /* @__PURE__ */ jsx5(SelectPrimitive.ScrollUpArrow, {
670
+ "data-slot": "select-scroll-up-button",
671
+ className: cn("bg-popover top-0 z-10 flex w-full cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4", className),
672
+ ...props,
673
+ children: /* @__PURE__ */ jsx5(ChevronUpIcon, {})
674
+ });
675
+ }
676
+ function SelectScrollDownButton({
677
+ className,
678
+ ...props
679
+ }) {
680
+ return /* @__PURE__ */ jsx5(SelectPrimitive.ScrollDownArrow, {
681
+ "data-slot": "select-scroll-down-button",
682
+ className: cn("bg-popover bottom-0 z-10 flex w-full cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4", className),
683
+ ...props,
684
+ children: /* @__PURE__ */ jsx5(ChevronDownIcon, {})
685
+ });
686
+ }
687
+
572
688
  // ../../src/components/ui/map-menu.tsx
573
689
  import { useKrakstackLocale as useKrakstackLocale2 } from "@krak-stack/registry/krakstack-provider";
574
- import { jsx as jsx5, jsxs as jsxs3, Fragment as Fragment2 } from "react/jsx-runtime";
690
+ import { jsx as jsx6, jsxs as jsxs4, Fragment as Fragment2 } from "react/jsx-runtime";
575
691
  var MapMenuMode;
576
692
  ((MapMenuMode) => {
577
693
  MapMenuMode["Point"] = "point";
@@ -582,7 +698,7 @@ var MapMenuPresentation;
582
698
  MapMenuPresentation["Dialog"] = "dialog";
583
699
  MapMenuPresentation["Inline"] = "inline";
584
700
  })(MapMenuPresentation ||= {});
585
- var mapMenuRadiiKm = [1, 2, 5, 10, 20, 40, 60, 80, 100, 250, 500];
701
+ var mapMenuRadiiKm = [1, 2, 5, 10, 20, 40, 50, 60, 80, 100, 250, 500];
586
702
  var defaultMessages2 = {
587
703
  en: {
588
704
  title: "Choose your location",
@@ -729,16 +845,16 @@ var MapMenu = (props) => {
729
845
  setApplying(false);
730
846
  }
731
847
  };
732
- const content = /* @__PURE__ */ jsxs3(Fragment2, {
848
+ const content = /* @__PURE__ */ jsxs4(Fragment2, {
733
849
  children: [
734
- !inline ? /* @__PURE__ */ jsxs3(DialogHeader, {
850
+ !inline ? /* @__PURE__ */ jsxs4(DialogHeader, {
735
851
  className: "shrink-0 px-5 pt-6 pr-16 pb-5 text-left sm:px-7 sm:pt-[25px] sm:pb-[22px] [@media(max-height:599px)]:py-4",
736
852
  children: [
737
- /* @__PURE__ */ jsx5(DialogTitle, {
853
+ /* @__PURE__ */ jsx6(DialogTitle, {
738
854
  className: "text-2xl font-semibold",
739
855
  children: labels.title
740
856
  }),
741
- /* @__PURE__ */ jsx5(Button, {
857
+ /* @__PURE__ */ jsx6(Button, {
742
858
  type: "button",
743
859
  variant: "ghost",
744
860
  size: "icon",
@@ -746,38 +862,38 @@ var MapMenu = (props) => {
746
862
  disabled: applying,
747
863
  "aria-label": labels.close,
748
864
  onClick: () => changeOpen(false),
749
- children: /* @__PURE__ */ jsx5(X, {})
865
+ children: /* @__PURE__ */ jsx6(X, {})
750
866
  })
751
867
  ]
752
868
  }) : null,
753
- /* @__PURE__ */ jsxs3("div", {
869
+ /* @__PURE__ */ jsxs4("div", {
754
870
  className: inline ? "flex min-w-0 flex-col gap-4" : "flex min-h-0 min-w-0 flex-1 flex-col gap-[18px] overflow-y-auto px-5 pb-6 sm:px-7 [@media(max-height:599px)]:pb-3",
755
871
  children: [
756
- /* @__PURE__ */ jsxs3("fieldset", {
872
+ /* @__PURE__ */ jsxs4("fieldset", {
757
873
  disabled: applying,
758
874
  "data-slot": "map-menu-toolbar",
759
875
  className: cn("grid min-w-0 shrink-0 grid-cols-1 items-end gap-3", onUseCurrentLocation && "sm:grid-cols-[minmax(0,1fr)_max-content]"),
760
876
  children: [
761
- /* @__PURE__ */ jsxs3("div", {
877
+ /* @__PURE__ */ jsxs4("div", {
762
878
  className: "relative flex min-w-0 flex-col gap-2",
763
879
  onBlur: (event) => {
764
880
  if (!event.currentTarget.contains(event.relatedTarget))
765
881
  setDropdownOpen(false);
766
882
  },
767
883
  children: [
768
- /* @__PURE__ */ jsx5("label", {
884
+ /* @__PURE__ */ jsx6("label", {
769
885
  htmlFor: `${id}-input`,
770
886
  className: "text-sm font-medium",
771
887
  children: labels.location
772
888
  }),
773
- /* @__PURE__ */ jsxs3("div", {
889
+ /* @__PURE__ */ jsxs4("div", {
774
890
  className: "relative",
775
891
  children: [
776
- /* @__PURE__ */ jsx5(Search, {
892
+ /* @__PURE__ */ jsx6(Search, {
777
893
  "aria-hidden": "true",
778
894
  className: "text-muted-foreground pointer-events-none absolute top-1/2 left-3.5 size-4 -translate-y-1/2"
779
895
  }),
780
- /* @__PURE__ */ jsx5(Input, {
896
+ /* @__PURE__ */ jsx6(Input, {
781
897
  ref: inputRef,
782
898
  id: `${id}-input`,
783
899
  value: input,
@@ -819,7 +935,7 @@ var MapMenu = (props) => {
819
935
  }
820
936
  }
821
937
  }),
822
- input ? /* @__PURE__ */ jsx5("button", {
938
+ input ? /* @__PURE__ */ jsx6("button", {
823
939
  type: "button",
824
940
  "aria-label": labels.clear,
825
941
  className: "text-muted-foreground absolute top-[3px] right-1 grid size-11 cursor-pointer place-items-center rounded focus-visible:outline-2 focus-visible:outline-offset-2",
@@ -829,20 +945,20 @@ var MapMenu = (props) => {
829
945
  setActiveIndex(-1);
830
946
  inputRef.current?.focus();
831
947
  },
832
- children: /* @__PURE__ */ jsx5(X, {
948
+ children: /* @__PURE__ */ jsx6(X, {
833
949
  className: "size-4"
834
950
  })
835
951
  }) : null
836
952
  ]
837
953
  }),
838
- dropdownOpen ? /* @__PURE__ */ jsxs3("div", {
954
+ dropdownOpen ? /* @__PURE__ */ jsxs4("div", {
839
955
  id: `${id}-suggestions`,
840
956
  role: "listbox",
841
957
  "aria-label": labels.suggestions,
842
958
  "aria-busy": loadingSuggestions,
843
959
  className: "bg-popover text-popover-foreground absolute inset-x-0 top-full z-30 mt-1 max-h-[min(16rem,35dvh)] overflow-y-auto rounded-md border p-1 shadow-lg",
844
960
  children: [
845
- suggestions.map((location, index) => /* @__PURE__ */ jsxs3("button", {
961
+ suggestions.map((location, index) => /* @__PURE__ */ jsxs4("button", {
846
962
  id: `${id}-option-${index}`,
847
963
  type: "button",
848
964
  role: "option",
@@ -853,19 +969,19 @@ var MapMenu = (props) => {
853
969
  onMouseDown: (event) => event.preventDefault(),
854
970
  onClick: () => select(location),
855
971
  children: [
856
- /* @__PURE__ */ jsx5(MapPin, {
972
+ /* @__PURE__ */ jsx6(MapPin, {
857
973
  "aria-hidden": "true",
858
974
  className: "size-4 shrink-0",
859
975
  style: { color: overlayColor }
860
976
  }),
861
- /* @__PURE__ */ jsxs3("span", {
977
+ /* @__PURE__ */ jsxs4("span", {
862
978
  className: "min-w-0",
863
979
  children: [
864
- /* @__PURE__ */ jsx5("span", {
980
+ /* @__PURE__ */ jsx6("span", {
865
981
  className: "block text-sm font-medium wrap-anywhere",
866
982
  children: location.title ?? location.label
867
983
  }),
868
- location.details ? /* @__PURE__ */ jsx5("span", {
984
+ location.details ? /* @__PURE__ */ jsx6("span", {
869
985
  className: "text-muted-foreground mt-1 block text-xs wrap-anywhere",
870
986
  children: location.details
871
987
  }) : null
@@ -873,15 +989,15 @@ var MapMenu = (props) => {
873
989
  })
874
990
  ]
875
991
  }, location.id)),
876
- loadingSuggestions ? /* @__PURE__ */ jsx5("p", {
992
+ loadingSuggestions ? /* @__PURE__ */ jsx6("p", {
877
993
  role: "status",
878
994
  className: "text-muted-foreground p-3 text-sm",
879
995
  children: labels.loading
880
- }) : suggestionsError ? /* @__PURE__ */ jsx5("p", {
996
+ }) : suggestionsError ? /* @__PURE__ */ jsx6("p", {
881
997
  role: "alert",
882
998
  className: "text-destructive p-3 text-sm",
883
999
  children: suggestionsError
884
- }) : !suggestions.length ? /* @__PURE__ */ jsx5("p", {
1000
+ }) : !suggestions.length ? /* @__PURE__ */ jsx6("p", {
885
1001
  className: "text-muted-foreground p-3 text-sm",
886
1002
  children: labels.noResults
887
1003
  }) : null
@@ -889,7 +1005,7 @@ var MapMenu = (props) => {
889
1005
  }) : null
890
1006
  ]
891
1007
  }),
892
- onUseCurrentLocation ? /* @__PURE__ */ jsxs3(Button, {
1008
+ onUseCurrentLocation ? /* @__PURE__ */ jsxs4(Button, {
893
1009
  type: "button",
894
1010
  variant: "outline",
895
1011
  "data-slot": "map-menu-current",
@@ -897,30 +1013,30 @@ var MapMenu = (props) => {
897
1013
  className: "bg-card h-[50px] w-max gap-[7px] justify-self-start px-3 shadow-none",
898
1014
  onClick: onUseCurrentLocation,
899
1015
  children: [
900
- /* @__PURE__ */ jsx5(LocateFixed2, {
1016
+ /* @__PURE__ */ jsx6(LocateFixed2, {
901
1017
  className: "text-foreground size-[17px]"
902
1018
  }),
903
1019
  labels.currentLocation
904
1020
  ]
905
1021
  }) : null,
906
- /* @__PURE__ */ jsxs3("div", {
1022
+ /* @__PURE__ */ jsxs4("div", {
907
1023
  className: "col-span-full grid text-xs leading-5",
908
1024
  children: [
909
- [labels.ipNotice, labels.browserNotice, labels.searchHint].map((text) => /* @__PURE__ */ jsx5("span", {
1025
+ [labels.ipNotice, labels.browserNotice, labels.searchHint].map((text) => /* @__PURE__ */ jsx6("span", {
910
1026
  "aria-hidden": "true",
911
1027
  className: "invisible col-start-1 row-start-1 pl-6",
912
1028
  children: text
913
1029
  }, text)),
914
- notice ? /* @__PURE__ */ jsxs3("p", {
1030
+ notice ? /* @__PURE__ */ jsxs4("p", {
915
1031
  role: "status",
916
1032
  "data-slot": "map-menu-provenance",
917
1033
  className: "text-muted-foreground col-start-1 row-start-1 flex items-start gap-2",
918
1034
  children: [
919
- /* @__PURE__ */ jsx5(MapPin, {
1035
+ /* @__PURE__ */ jsx6(MapPin, {
920
1036
  "aria-hidden": "true",
921
1037
  className: "text-foreground mt-0.5 size-4 shrink-0"
922
1038
  }),
923
- /* @__PURE__ */ jsx5("span", {
1039
+ /* @__PURE__ */ jsx6("span", {
924
1040
  className: "wrap-anywhere",
925
1041
  children: notice
926
1042
  })
@@ -928,33 +1044,40 @@ var MapMenu = (props) => {
928
1044
  }) : null
929
1045
  ]
930
1046
  }),
931
- radiusEnabled ? /* @__PURE__ */ jsxs3("div", {
1047
+ radiusEnabled ? /* @__PURE__ */ jsxs4("div", {
932
1048
  className: "after:bg-border col-span-full flex flex-wrap items-center gap-3 after:h-px after:flex-1",
933
1049
  children: [
934
- /* @__PURE__ */ jsx5("label", {
1050
+ /* @__PURE__ */ jsx6("label", {
935
1051
  htmlFor: `${id}-radius`,
936
1052
  className: "text-sm font-medium",
937
1053
  children: labels.searchWithin
938
1054
  }),
939
- /* @__PURE__ */ jsxs3("div", {
940
- className: "relative",
1055
+ /* @__PURE__ */ jsxs4(Select, {
1056
+ value: radiusKm,
1057
+ items: radiusOptions.map((radius) => ({
1058
+ value: radius,
1059
+ label: `${radius} Km`
1060
+ })),
1061
+ disabled: applying,
1062
+ onValueChange: (value) => {
1063
+ if (value !== null)
1064
+ props.onRadiusChange(value);
1065
+ },
941
1066
  children: [
942
- /* @__PURE__ */ jsx5("select", {
1067
+ /* @__PURE__ */ jsx6(SelectTrigger, {
943
1068
  id: `${id}-radius`,
944
- value: radiusKm,
945
- className: "bg-card focus-visible:outline-ring h-11 appearance-none rounded border py-2 pr-9 pl-3 text-sm focus-visible:outline-2 focus-visible:outline-offset-2",
946
- onChange: (event) => props.onRadiusChange(Number(event.currentTarget.value)),
947
- children: radiusOptions.map((radius) => /* @__PURE__ */ jsxs3("option", {
1069
+ className: "bg-card min-w-24 shadow-none data-[size=default]:h-11",
1070
+ children: /* @__PURE__ */ jsx6(SelectValue, {})
1071
+ }),
1072
+ /* @__PURE__ */ jsx6(SelectContent, {
1073
+ "data-map-menu-radius-popup": "",
1074
+ children: radiusOptions.map((radius) => /* @__PURE__ */ jsxs4(SelectItem, {
948
1075
  value: radius,
949
1076
  children: [
950
1077
  radius,
951
- " km"
1078
+ " Km"
952
1079
  ]
953
1080
  }, radius))
954
- }),
955
- /* @__PURE__ */ jsx5(ChevronDown, {
956
- "aria-hidden": "true",
957
- className: "pointer-events-none absolute top-1/2 right-3 size-4 -translate-y-1/2"
958
1081
  })
959
1082
  ]
960
1083
  })
@@ -962,11 +1085,11 @@ var MapMenu = (props) => {
962
1085
  }) : null
963
1086
  ]
964
1087
  }),
965
- /* @__PURE__ */ jsxs3("div", {
1088
+ /* @__PURE__ */ jsxs4("div", {
966
1089
  "data-slot": "map-menu-map",
967
1090
  className: inline ? "relative h-80 min-w-0 sm:h-96" : "relative min-h-56 min-w-0 flex-[1_0_14rem] [@media(max-height:599px)]:min-h-[182px] [@media(max-height:599px)]:basis-[182px]",
968
1091
  children: [
969
- /* @__PURE__ */ jsx5(MapMenuMap, {
1092
+ /* @__PURE__ */ jsx6(MapMenuMap, {
970
1093
  apiKey,
971
1094
  center: selectedLocation?.center ?? { lat: 0, lng: 0 },
972
1095
  zoom: !radiusEnabled && selectedLocation ? 15 : 4,
@@ -987,7 +1110,7 @@ var MapMenu = (props) => {
987
1110
  className: "h-full min-h-0 w-full rounded-md",
988
1111
  controlsClassName: "bg-card rounded-md shadow-md"
989
1112
  }),
990
- radiusEnabled && selectedLocation ? /* @__PURE__ */ jsx5("p", {
1113
+ radiusEnabled && selectedLocation ? /* @__PURE__ */ jsx6("p", {
991
1114
  className: "bg-card text-muted-foreground pointer-events-none absolute bottom-[25px] left-3 m-0 max-w-[calc(100%-24px)] rounded px-2.5 py-[7px] text-xs shadow-sm",
992
1115
  children: labels.radiusHint
993
1116
  }) : null
@@ -995,18 +1118,18 @@ var MapMenu = (props) => {
995
1118
  })
996
1119
  ]
997
1120
  }),
998
- /* @__PURE__ */ jsxs3(DialogFooter, {
1121
+ /* @__PURE__ */ jsxs4(DialogFooter, {
999
1122
  className: inline ? "gap-3 border-0 bg-transparent p-0" : "shrink-0 gap-3 border-0 bg-transparent px-5 pt-[18px] pb-[max(18px,env(safe-area-inset-bottom))] sm:px-7 [@media(max-height:599px)]:pt-3 [@media(max-height:599px)]:pb-[max(12px,env(safe-area-inset-bottom))]",
1000
1123
  children: [
1001
- error || confirmFailed ? /* @__PURE__ */ jsx5("p", {
1124
+ error || confirmFailed ? /* @__PURE__ */ jsx6("p", {
1002
1125
  role: "alert",
1003
1126
  className: "text-destructive w-full self-center text-sm sm:mr-auto sm:w-auto",
1004
1127
  children: error ?? labels.confirmError
1005
1128
  }) : null,
1006
- /* @__PURE__ */ jsxs3("div", {
1129
+ /* @__PURE__ */ jsxs4("div", {
1007
1130
  className: "flex gap-2",
1008
1131
  children: [
1009
- /* @__PURE__ */ jsx5(Button, {
1132
+ /* @__PURE__ */ jsx6(Button, {
1010
1133
  type: "button",
1011
1134
  variant: "outline",
1012
1135
  className: "bg-card min-h-11 flex-1",
@@ -1014,7 +1137,7 @@ var MapMenu = (props) => {
1014
1137
  onClick: () => changeOpen(false),
1015
1138
  children: labels.cancel
1016
1139
  }),
1017
- /* @__PURE__ */ jsx5(Button, {
1140
+ /* @__PURE__ */ jsx6(Button, {
1018
1141
  type: "button",
1019
1142
  "data-slot": "map-menu-confirm",
1020
1143
  className: cn("min-h-11 flex-[2] bg-[oklch(0.9247_0.0524_66.1732)] text-zinc-950 hover:bg-[oklch(0.9247_0.0524_66.1732)] hover:brightness-95", confirmClassName),
@@ -1029,7 +1152,7 @@ var MapMenu = (props) => {
1029
1152
  ]
1030
1153
  });
1031
1154
  if (inline) {
1032
- return /* @__PURE__ */ jsx5("section", {
1155
+ return /* @__PURE__ */ jsx6("section", {
1033
1156
  role: "group",
1034
1157
  "aria-label": labels.title,
1035
1158
  "data-slot": "map-menu",
@@ -1038,13 +1161,13 @@ var MapMenu = (props) => {
1038
1161
  children: content
1039
1162
  });
1040
1163
  }
1041
- return /* @__PURE__ */ jsx5(Dialog, {
1164
+ return /* @__PURE__ */ jsx6(Dialog, {
1042
1165
  open,
1043
1166
  onOpenChange: changeOpen,
1044
- children: /* @__PURE__ */ jsxs3(DialogPortal, {
1167
+ children: /* @__PURE__ */ jsxs4(DialogPortal, {
1045
1168
  children: [
1046
- /* @__PURE__ */ jsx5(DialogOverlay, {}),
1047
- /* @__PURE__ */ jsx5(DialogPrimitive2.Popup, {
1169
+ /* @__PURE__ */ jsx6(DialogOverlay, {}),
1170
+ /* @__PURE__ */ jsx6(DialogPrimitive2.Popup, {
1048
1171
  ref: popupRef,
1049
1172
  initialFocus: inputRef,
1050
1173
  "aria-describedby": undefined,
@@ -88,7 +88,7 @@ function SelectTrigger({
88
88
  return /* @__PURE__ */ jsxs(SelectPrimitive.Trigger, {
89
89
  "data-slot": "select-trigger",
90
90
  "data-size": size,
91
- className: cn("flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
91
+ className: cn("border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 flex w-fit items-center justify-between gap-1.5 rounded-md border bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
92
92
  ...props,
93
93
  children: [
94
94
  children,
@@ -105,9 +105,9 @@ function SelectContent({
105
105
  children,
106
106
  side = "bottom",
107
107
  sideOffset = 4,
108
- align = "center",
108
+ align = "start",
109
109
  alignOffset = 0,
110
- alignItemWithTrigger = true,
110
+ alignItemWithTrigger = false,
111
111
  ...props
112
112
  }) {
113
113
  return /* @__PURE__ */ jsx3(SelectPrimitive.Portal, {
@@ -121,7 +121,7 @@ function SelectContent({
121
121
  children: /* @__PURE__ */ jsxs(SelectPrimitive.Popup, {
122
122
  "data-slot": "select-content",
123
123
  "data-align-trigger": alignItemWithTrigger,
124
- className: cn("relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
124
+ className: cn("bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-0 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md shadow-md ring-1 duration-100 data-[align-trigger=true]:animate-none", className),
125
125
  ...props,
126
126
  children: [
127
127
  /* @__PURE__ */ jsx3(SelectScrollUpButton, {}),
@@ -141,7 +141,7 @@ function SelectItem({
141
141
  }) {
142
142
  return /* @__PURE__ */ jsxs(SelectPrimitive.Item, {
143
143
  "data-slot": "select-item",
144
- className: cn("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
144
+ className: cn("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
145
145
  ...props,
146
146
  children: [
147
147
  /* @__PURE__ */ jsx3(SelectPrimitive.ItemText, {
@@ -165,7 +165,7 @@ function SelectScrollUpButton({
165
165
  }) {
166
166
  return /* @__PURE__ */ jsx3(SelectPrimitive.ScrollUpArrow, {
167
167
  "data-slot": "select-scroll-up-button",
168
- className: cn("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4", className),
168
+ className: cn("bg-popover top-0 z-10 flex w-full cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4", className),
169
169
  ...props,
170
170
  children: /* @__PURE__ */ jsx3(ChevronUpIcon, {})
171
171
  });
@@ -176,7 +176,7 @@ function SelectScrollDownButton({
176
176
  }) {
177
177
  return /* @__PURE__ */ jsx3(SelectPrimitive.ScrollDownArrow, {
178
178
  "data-slot": "select-scroll-down-button",
179
- className: cn("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4", className),
179
+ className: cn("bg-popover bottom-0 z-10 flex w-full cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4", className),
180
180
  ...props,
181
181
  children: /* @__PURE__ */ jsx3(ChevronDownIcon, {})
182
182
  });
@@ -341,7 +341,7 @@ var defaultClear = (label) => /* @__PURE__ */ jsx4(ComboboxPrimitive.Clear, {
341
341
  })
342
342
  });
343
343
  var selectedLabel = (value, placeholder) => {
344
- if (Array.isArray(value)) {
344
+ if (value && !("label" in value)) {
345
345
  return value.length > 0 ? value.map(({ label }) => label).join(", ") : placeholder;
346
346
  }
347
347
  return value && "label" in value ? value.label : placeholder;
@@ -1,5 +1,6 @@
1
- import { type CSSProperties } from "react";
2
- import { RichTextDocument, type RichTextVariable } from "../../lib/rich-text/schema.js";
1
+ import type { Editor, Extensions, JSONContent } from "@tiptap/core";
2
+ import { type CSSProperties, type ReactNode } from "react";
3
+ import { RichTextVariable } from "../../lib/rich-text/schema.js";
3
4
  declare const labels: {
4
5
  en: {
5
6
  bold: string;
@@ -11,6 +12,7 @@ declare const labels: {
11
12
  unlink: string;
12
13
  linkUrl: string;
13
14
  apply: string;
15
+ cancel: string;
14
16
  variable: string;
15
17
  paragraph: string;
16
18
  heading: string;
@@ -19,7 +21,6 @@ declare const labels: {
19
21
  toolbar: string;
20
22
  invalid: string;
21
23
  invalidLink: string;
22
- cancel: string;
23
24
  };
24
25
  fr: {
25
26
  bold: string;
@@ -31,6 +32,7 @@ declare const labels: {
31
32
  unlink: string;
32
33
  linkUrl: string;
33
34
  apply: string;
35
+ cancel: string;
34
36
  variable: string;
35
37
  paragraph: string;
36
38
  heading: string;
@@ -39,15 +41,15 @@ declare const labels: {
39
41
  toolbar: string;
40
42
  invalid: string;
41
43
  invalidLink: string;
42
- cancel: string;
43
44
  };
44
45
  };
45
46
  export type RichTextEditorMessages = {
46
47
  [K in keyof typeof labels.en]: string;
47
48
  };
48
49
  export type RichTextEditorProps = {
49
- value: RichTextDocument;
50
- onChange: (value: RichTextDocument) => void;
50
+ /** Native Tiptap JSON: { type: "doc", content: [...] }. */
51
+ value: JSONContent;
52
+ onChange: (value: JSONContent) => void;
51
53
  label: string;
52
54
  variables?: readonly RichTextVariable[];
53
55
  disabled?: boolean;
@@ -55,16 +57,16 @@ export type RichTextEditorProps = {
55
57
  messages?: Partial<Record<string, Partial<RichTextEditorMessages>>>;
56
58
  className?: string;
57
59
  contentStyle?: CSSProperties;
58
- /** Plain single-line text with atomic variables, suitable for email headers. */
59
- singleLine?: boolean;
60
- /** Limit serialized text, including {{variable}} tokens. */
61
60
  maxLength?: number;
61
+ /** Replace the default extension set, e.g. with React Email's StarterKit. */
62
+ extensions?: Extensions;
63
+ onReady?: (editor: Editor) => void;
62
64
  };
65
+ /** Tiptap's static React renderer, not a KrakStack document renderer. */
63
66
  export declare const RichTextContent: ({ value, variables, values, }: {
64
- value: RichTextDocument;
67
+ value: JSONContent;
65
68
  variables?: readonly RichTextVariable[];
66
69
  values?: Readonly<Record<string, string>>;
67
- }) => import("react").JSX.Element;
68
- /** Native editable DOM is normalized into a constrained, HTML-free document. */
69
- export declare const RichTextEditor: ({ value, onChange, label, variables, disabled, locale: override, messages, className, contentStyle, singleLine, maxLength, }: RichTextEditorProps) => import("react").JSX.Element;
70
+ }) => ReactNode;
71
+ export declare const RichTextEditor: ({ value, onChange, label, variables, disabled, locale: override, messages, className, contentStyle, maxLength, extensions, onReady, }: RichTextEditorProps) => import("react").JSX.Element;
70
72
  export {};