@prokodo/ui 0.1.14 → 0.1.15

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 (113) hide show
  1. package/dist/components/RTE/RTE.client.js +0 -1
  2. package/dist/components/RTE/RTE.js +4 -1
  3. package/dist/components/accordion/Accordion.js +8 -2
  4. package/dist/components/accordion/Accordion.view.js +1 -1
  5. package/dist/components/animated/Animated.client.js +13 -5
  6. package/dist/components/animated/Animated.js +8 -2
  7. package/dist/components/animatedText/AnimatedText.client.js +10 -2
  8. package/dist/components/animatedText/AnimatedText.js +8 -2
  9. package/dist/components/autocomplete/Autocomplete.client.js +5 -1
  10. package/dist/components/autocomplete/Autocomplete.js +4 -1
  11. package/dist/components/autocomplete/Autocomplete.view.js +13 -4
  12. package/dist/components/avatar/Avatar.js +4 -1
  13. package/dist/components/avatar/Avatar.view.js +19 -12
  14. package/dist/components/base-link/BaseLink.js +4 -1
  15. package/dist/components/base-link/BaseLink.view.js +3 -0
  16. package/dist/components/button/Button.js +4 -1
  17. package/dist/components/button/Button.view.js +3 -1
  18. package/dist/components/calendly/Calendly.js +8 -2
  19. package/dist/components/card/Card.js +11 -5
  20. package/dist/components/card/Card.view.js +22 -5
  21. package/dist/components/carousel/Carousel.client.js +140 -129
  22. package/dist/components/carousel/Carousel.js +8 -2
  23. package/dist/components/carousel/Carousel.view.js +10 -0
  24. package/dist/components/checkbox/Checkbox.js +4 -1
  25. package/dist/components/checkbox/Checkbox.view.js +4 -1
  26. package/dist/components/checkbox-group/CheckboxGroup.js +4 -1
  27. package/dist/components/checkbox-group/CheckboxGroup.view.js +4 -1
  28. package/dist/components/chip/Chip.js +4 -1
  29. package/dist/components/chip/Chip.view.js +4 -0
  30. package/dist/components/datePicker/DatePicker.js +4 -1
  31. package/dist/components/dialog/Dialog.js +8 -2
  32. package/dist/components/dialog/Dialog.view.js +23 -5
  33. package/dist/components/drawer/Drawer.client.js +0 -1
  34. package/dist/components/drawer/Drawer.js +4 -1
  35. package/dist/components/drawer/Drawer.view.js +14 -3
  36. package/dist/components/dynamic-list/DynamicList.client.js +1 -0
  37. package/dist/components/dynamic-list/DynamicList.js +4 -1
  38. package/dist/components/dynamic-list/DynamicList.view.js +18 -5
  39. package/dist/components/form/Form.client.js +4 -1
  40. package/dist/components/form/Form.js +4 -1
  41. package/dist/components/form/Form.view.js +3 -1
  42. package/dist/components/form/FormField.client.js +8 -2
  43. package/dist/components/form/FormField.js +4 -1
  44. package/dist/components/form/FormResponse.js +4 -1
  45. package/dist/components/headline/Headline.js +8 -2
  46. package/dist/components/icon/Icon.js +8 -2
  47. package/dist/components/image/Image.client.js +9 -5
  48. package/dist/components/image/Image.js +8 -2
  49. package/dist/components/image/Image.server.js +2 -1
  50. package/dist/components/image-text/ImageText.js +18 -8
  51. package/dist/components/input/Input.client.js +15 -2
  52. package/dist/components/input/Input.js +4 -1
  53. package/dist/components/input/Input.view.js +15 -6
  54. package/dist/components/input/InputValidation.js +6 -2
  55. package/dist/components/inputOTP/InputOTP.js +2 -1
  56. package/dist/components/link/Link.js +5 -3
  57. package/dist/components/link/Link.view.js +2 -1
  58. package/dist/components/list/List.js +52 -23
  59. package/dist/components/loading/Loading.js +4 -1
  60. package/dist/components/loading/Loading.view.js +25 -5
  61. package/dist/components/lottie/Lottie.js +9 -5
  62. package/dist/components/map/Map.js +62 -44
  63. package/dist/components/pagination/Pagination.js +4 -1
  64. package/dist/components/pagination/Pagination.view.js +3 -1
  65. package/dist/components/post-item/PostItem.js +4 -1
  66. package/dist/components/post-item/PostItemAuthor.js +4 -1
  67. package/dist/components/post-teaser/PostTeaser.js +4 -1
  68. package/dist/components/post-teaser/PostTeaser.view.js +4 -2
  69. package/dist/components/post-widget/PostWidget.js +5 -3
  70. package/dist/components/post-widget/PostWidget.view.js +9 -3
  71. package/dist/components/post-widget-carousel/PostWidgetCarousel.js +8 -2
  72. package/dist/components/post-widget-carousel/PostWidgetCarousel.view.js +2 -1
  73. package/dist/components/progressBar/ProgressBar.js +8 -2
  74. package/dist/components/progressBar/ProgressBar.view.js +4 -1
  75. package/dist/components/rating/Rating.client.js +6 -1
  76. package/dist/components/rating/Rating.js +4 -1
  77. package/dist/components/rich-text/RichText.client.js +52 -17
  78. package/dist/components/rich-text/RichText.js +8 -2
  79. package/dist/components/rich-text/RichText.server.js +3 -0
  80. package/dist/components/select/Select.client.js +149 -101
  81. package/dist/components/select/Select.js +8 -2
  82. package/dist/components/select/Select.view.js +35 -11
  83. package/dist/components/sidenav/SideNav.js +8 -2
  84. package/dist/components/slider/Slider.client.js +11 -2
  85. package/dist/components/slider/Slider.js +4 -1
  86. package/dist/components/slider/Slider.view.js +43 -5
  87. package/dist/components/snackbar/Snackbar.client.js +5 -1
  88. package/dist/components/snackbar/Snackbar.js +4 -1
  89. package/dist/components/snackbar/SnackbarProvider.js +8 -2
  90. package/dist/components/stepper/Stepper.client.js +6 -3
  91. package/dist/components/stepper/Stepper.js +4 -1
  92. package/dist/components/switch/Switch.js +4 -1
  93. package/dist/components/switch/Switch.view.js +1 -0
  94. package/dist/components/table/Table.js +1 -0
  95. package/dist/components/tabs/Tabs.client.js +1 -0
  96. package/dist/components/tabs/Tabs.js +8 -2
  97. package/dist/components/tabs/Tabs.view.js +8 -2
  98. package/dist/components/tooltip/Tooltip.client.js +126 -91
  99. package/dist/components/tooltip/Tooltip.js +10 -4
  100. package/dist/components/tooltip/Tooltip.view.js +1 -0
  101. package/dist/constants/project.js +1 -1
  102. package/dist/helpers/createIsland.js +1 -0
  103. package/dist/helpers/createLazyWrapper.js +1 -0
  104. package/dist/hooks/useGoogleMaps.js +0 -1
  105. package/dist/tsconfig.build.tsbuildinfo +1 -1
  106. package/dist/types/components/RTE/RTE.d.ts +1 -1
  107. package/dist/types/components/RTE/RTE.lazy.d.ts +1 -1
  108. package/dist/types/components/avatar/Avatar.view.d.ts +1 -1
  109. package/dist/types/components/carousel/Carousel.view.d.ts +1 -1
  110. package/dist/types/components/dynamic-list/DynamicList.model.d.ts +1 -1
  111. package/dist/types/components/headline/Headline.model.d.ts +1 -1
  112. package/dist/types/components/input/Input.view.d.ts +1 -1
  113. package/package.json +19 -5
@@ -8,54 +8,72 @@ const Map = memo(
8
8
  const mapRef = useRef(null);
9
9
  const mapInstanceRef = useRef(null);
10
10
  const [isDark, setIsDark] = useState(
11
- typeof document !== "undefined" ? document.documentElement.getAttribute("data-theme") === "dark" : false
11
+ typeof document !== "undefined" ? document.documentElement.getAttribute("data-theme") === "dark" : (
12
+ /* istanbul ignore next */
13
+ false
14
+ )
12
15
  );
13
- const initMap = useCallback(() => {
14
- if (!(mapRef == null ? void 0 : mapRef.current)) return;
15
- const options = {
16
- center,
17
- zoom,
18
- mapId: isString(mapId) ? mapId : isDark === true ? "c3c70a1ea4c4b0b8" : "e5921eca3f70ade2",
19
- disableDefaultUI: true,
20
- mapTypeControl: false,
21
- fullscreenControl: false,
22
- streetViewControl: false,
23
- zoomControl: true
24
- };
25
- const map = new google.maps.Map(mapRef.current, options);
26
- mapInstanceRef.current = map;
27
- if (!isArray(marker)) return;
28
- marker.forEach((place) => {
29
- var _a, _b;
30
- if (typeof ((_a = place == null ? void 0 : place.position) == null ? void 0 : _a.lat) === "number" || typeof ((_b = place == null ? void 0 : place.position) == null ? void 0 : _b.lng) === "number")
31
- return;
32
- const content = document.createElement("img");
33
- content.src = "/images/prokodo-map-marker.webp";
34
- new google.maps.marker.AdvancedMarkerElement({
35
- map,
36
- content,
37
- ...place
16
+ const initMap = useCallback(
17
+ /* istanbul ignore next */
18
+ () => {
19
+ if (!(mapRef == null ? void 0 : mapRef.current)) return;
20
+ const options = {
21
+ center,
22
+ zoom,
23
+ mapId: isString(mapId) ? mapId : isDark === true ? "c3c70a1ea4c4b0b8" : "e5921eca3f70ade2",
24
+ disableDefaultUI: true,
25
+ mapTypeControl: false,
26
+ fullscreenControl: false,
27
+ streetViewControl: false,
28
+ zoomControl: true
29
+ };
30
+ const map = new google.maps.Map(mapRef.current, options);
31
+ mapInstanceRef.current = map;
32
+ if (!isArray(marker)) return;
33
+ marker.forEach((place) => {
34
+ var _a, _b;
35
+ if (typeof ((_a = place == null ? void 0 : place.position) == null ? void 0 : _a.lat) === "number" || typeof ((_b = place == null ? void 0 : place.position) == null ? void 0 : _b.lng) === "number")
36
+ return;
37
+ const content = document.createElement("img");
38
+ content.src = "/images/prokodo-map-marker.webp";
39
+ new google.maps.marker.AdvancedMarkerElement({
40
+ map,
41
+ content,
42
+ ...place
43
+ });
38
44
  });
39
- });
40
- }, [isDark, mapId, center, marker, zoom]);
45
+ },
46
+ [isDark, mapId, center, marker, zoom]
47
+ );
41
48
  const loaded = useGoogleMaps(apiKey, isDark);
42
- useEffect(() => {
43
- if (!loaded || mapInstanceRef.current) return;
44
- initMap();
45
- }, [loaded, initMap]);
46
- useEffect(() => {
47
- const observer = new MutationObserver(() => {
48
- const theme = document.documentElement.getAttribute("data-theme");
49
- setIsDark(theme === "dark");
50
- mapInstanceRef.current = null;
49
+ useEffect(
50
+ /* istanbul ignore next */
51
+ () => {
52
+ if (!loaded || mapInstanceRef.current) return;
51
53
  initMap();
52
- });
53
- observer.observe(document.documentElement, {
54
- attributes: true,
55
- attributeFilter: ["data-theme"]
56
- });
57
- return () => observer.disconnect();
58
- }, [initMap]);
54
+ },
55
+ [loaded, initMap]
56
+ );
57
+ useEffect(
58
+ /* istanbul ignore next */
59
+ () => {
60
+ const observer = new MutationObserver(
61
+ /* istanbul ignore next */
62
+ () => {
63
+ const theme = document.documentElement.getAttribute("data-theme");
64
+ setIsDark(theme === "dark");
65
+ mapInstanceRef.current = null;
66
+ initMap();
67
+ }
68
+ );
69
+ observer.observe(document.documentElement, {
70
+ attributes: true,
71
+ attributeFilter: ["data-theme"]
72
+ });
73
+ return () => observer.disconnect();
74
+ },
75
+ [initMap]
76
+ );
59
77
  if (!loaded) {
60
78
  return /* @__PURE__ */ jsx(Skeleton, { height: "500px", width: "100%" });
61
79
  }
@@ -5,7 +5,10 @@ import PaginationServer from "./Pagination.server.js";
5
5
  const Pagination = createIsland({
6
6
  name: "Pagination",
7
7
  Server: PaginationServer,
8
- loadLazy: /* @__PURE__ */ __name(() => import("./Pagination.lazy.js"), "loadLazy")
8
+ loadLazy: (
9
+ /* istanbul ignore next */
10
+ /* @__PURE__ */ __name(() => import("./Pagination.lazy.js"), "loadLazy")
11
+ )
9
12
  });
10
13
  export {
11
14
  Pagination
@@ -70,7 +70,9 @@ function PaginationView({
70
70
  disabled: isDisabled || isActive,
71
71
  title: (_a = it.value) == null ? void 0 : _a.toString(),
72
72
  variant: isActive ? "outlined" : "text",
73
- "aria-label": isActive ? ((_b = t == null ? void 0 : t.pageCurrent) == null ? void 0 : _b.replace("{page}", String(it.value))) ?? `Current page ${it.value}` : ((_c = t == null ? void 0 : t.pageGoTo) == null ? void 0 : _c.replace("{page}", String(it.value))) ?? `Go to page ${it.value}`,
73
+ "aria-label": isActive ? ((_b = t == null ? void 0 : t.pageCurrent) == null ? void 0 : _b.replace("{page}", String(it.value))) ?? /* istanbul ignore next */
74
+ `Current page ${it.value}` : ((_c = t == null ? void 0 : t.pageGoTo) == null ? void 0 : _c.replace("{page}", String(it.value))) ?? /* istanbul ignore next */
75
+ `Go to page ${it.value}`,
74
76
  onClick: isDisabled ? void 0 : () => onPageChange == null ? void 0 : onPageChange(it.value)
75
77
  }
76
78
  ) }, it.value);
@@ -5,7 +5,10 @@ import PostItemServer from "./PostItem.server.js";
5
5
  const PostItem = createIsland({
6
6
  name: "PostItem",
7
7
  Server: PostItemServer,
8
- loadLazy: /* @__PURE__ */ __name(() => import("./PostItem.lazy.js"), "loadLazy")
8
+ loadLazy: (
9
+ /* istanbul ignore next */
10
+ /* @__PURE__ */ __name(() => import("./PostItem.lazy.js"), "loadLazy")
11
+ )
9
12
  });
10
13
  export {
11
14
  PostItem
@@ -19,7 +19,10 @@ const PostItemAuthor = memo(
19
19
  /* @__PURE__ */ jsx(
20
20
  Avatar,
21
21
  {
22
- image: (avatar == null ? void 0 : avatar.src) !== void 0 && isString(avatar == null ? void 0 : avatar.src) ? { src: avatar == null ? void 0 : avatar.src, alt: (avatar == null ? void 0 : avatar.alt) ?? authorName ?? "" } : void 0,
22
+ image: (
23
+ /* istanbul ignore next */
24
+ (avatar == null ? void 0 : avatar.src) !== void 0 && isString(avatar == null ? void 0 : avatar.src) ? { src: avatar == null ? void 0 : avatar.src, alt: (avatar == null ? void 0 : avatar.alt) ?? authorName ?? "" } : void 0
25
+ ),
23
26
  ...avatarProps
24
27
  }
25
28
  ),
@@ -5,7 +5,10 @@ import PostTeaserServer from "./PostTeaser.server.js";
5
5
  const PostTeaser = createIsland({
6
6
  name: "PostTeaser",
7
7
  Server: PostTeaserServer,
8
- loadLazy: /* @__PURE__ */ __name(() => import("./PostTeaser.lazy.js"), "loadLazy")
8
+ loadLazy: (
9
+ /* istanbul ignore next */
10
+ /* @__PURE__ */ __name(() => import("./PostTeaser.lazy.js"), "loadLazy")
11
+ )
9
12
  });
10
13
  export {
11
14
  PostTeaser
@@ -145,8 +145,10 @@ function PostTeaserView(props) {
145
145
  Image,
146
146
  {
147
147
  ...imageMerged,
148
- alt: (imageMerged == null ? void 0 : imageMerged.alt) ?? "",
149
- src: (imageMerged == null ? void 0 : imageMerged.src) ?? ""
148
+ alt: (imageMerged == null ? void 0 : imageMerged.alt) ?? /* istanbul ignore next */
149
+ "",
150
+ src: (imageMerged == null ? void 0 : imageMerged.src) ?? /* istanbul ignore next */
151
+ ""
150
152
  }
151
153
  )
152
154
  ]
@@ -5,9 +5,11 @@ import PostWidgetServer from "./PostWidget.server.js";
5
5
  const PostWidget = createIsland({
6
6
  name: "PostWidget",
7
7
  Server: PostWidgetServer,
8
- loadLazy: /* @__PURE__ */ __name(() => import("./PostWidget.lazy.js"), "loadLazy"),
9
- // Only hydrate if the top-level Card gets interactive handlers
10
- isInteractive: /* @__PURE__ */ __name((p) => typeof p.onClick === "function", "isInteractive")
8
+ loadLazy: (
9
+ /* istanbul ignore next */
10
+ /* @__PURE__ */ __name(() => import("./PostWidget.lazy.js"), "loadLazy")
11
+ )
12
+ // Only hydrate if the top-level Card gets interactive handlers isInteractive: /* istanbul ignore next */ p => typeof (p as PostWidgetProps).onClick === "function",
11
13
  });
12
14
  export {
13
15
  PostWidget
@@ -119,7 +119,8 @@ function PostWidgetView({
119
119
  size: "sm",
120
120
  type: "h3",
121
121
  variant: "inherit",
122
- ...item.title ?? {},
122
+ ...item.title ?? /* istanbul ignore next */
123
+ {},
123
124
  ...(componentsProps == null ? void 0 : componentsProps.title) ?? {},
124
125
  ...((_o = item.componentsProps) == null ? void 0 : _o.headline) ?? {},
125
126
  className: bem(
@@ -134,7 +135,11 @@ function PostWidgetView({
134
135
  };
135
136
  let formattedDate;
136
137
  if (isString(item == null ? void 0 : item.date)) {
137
- formattedDate = localizeDate((item == null ? void 0 : item.locale) ?? "en-GB", item == null ? void 0 : item.date);
138
+ formattedDate = localizeDate(
139
+ (item == null ? void 0 : item.locale) ?? /* istanbul ignore next */
140
+ "en-GB",
141
+ item == null ? void 0 : item.date
142
+ );
138
143
  }
139
144
  return /* @__PURE__ */ jsx(
140
145
  "li",
@@ -208,7 +213,8 @@ function PostWidgetView({
208
213
  }
209
214
  )
210
215
  },
211
- `post-widget-item-${((_y = item.title) == null ? void 0 : _y.content) ?? i}`
216
+ `post-widget-item-${((_y = item.title) == null ? void 0 : _y.content) ?? /* istanbul ignore next */
217
+ i}`
212
218
  );
213
219
  })
214
220
  }
@@ -5,9 +5,15 @@ import PostWidgetCarouselServer from "./PostWidgetCarousel.server.js";
5
5
  const PostWidgetCarousel = createIsland({
6
6
  name: "PostWidgetCarousel",
7
7
  Server: PostWidgetCarouselServer,
8
- loadLazy: /* @__PURE__ */ __name(() => import("./PostWidgetCarousel.lazy.js"), "loadLazy"),
8
+ loadLazy: (
9
+ /* istanbul ignore next */
10
+ /* @__PURE__ */ __name(() => import("./PostWidgetCarousel.lazy.js"), "loadLazy")
11
+ ),
9
12
  // Carousel is interactive; render server first then hydrate when visible
10
- isInteractive: /* @__PURE__ */ __name(() => true, "isInteractive")
13
+ isInteractive: (
14
+ /* istanbul ignore next */
15
+ /* @__PURE__ */ __name(() => true, "isInteractive")
16
+ )
11
17
  });
12
18
  export {
13
19
  PostWidgetCarousel
@@ -113,7 +113,8 @@ function PostWidgetCarouselView(props) {
113
113
  },
114
114
  children: items.map((item, idx) => {
115
115
  var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w;
116
- const key = `carousel-item-${((_a2 = item.title) == null ? void 0 : _a2.content) ?? idx}`;
116
+ const key = `carousel-item-${((_a2 = item.title) == null ? void 0 : _a2.content) ?? /* istanbul ignore next */
117
+ idx}`;
117
118
  const imgBase = item.image;
118
119
  const imgMerged = imgBase ? {
119
120
  ...imgBase,
@@ -5,8 +5,14 @@ import ProgressBarServer from "./ProgressBar.server.js";
5
5
  const ProgressBar = createIsland({
6
6
  name: "ProgressBar",
7
7
  Server: ProgressBarServer,
8
- loadLazy: /* @__PURE__ */ __name(() => import("./ProgressBar.lazy.js"), "loadLazy"),
9
- isInteractive: /* @__PURE__ */ __name(() => true, "isInteractive")
8
+ loadLazy: (
9
+ /* istanbul ignore next */
10
+ /* @__PURE__ */ __name(() => import("./ProgressBar.lazy.js"), "loadLazy")
11
+ ),
12
+ isInteractive: (
13
+ /* istanbul ignore next */
14
+ /* @__PURE__ */ __name(() => true, "isInteractive")
15
+ )
10
16
  });
11
17
  export {
12
18
  ProgressBar
@@ -18,10 +18,13 @@ function ProgressBarView({
18
18
  }) {
19
19
  const safeValue = typeof value === "number" ? Math.min(100, Math.max(0, value)) : void 0;
20
20
  const isIndeterminate = safeValue === void 0;
21
+ const { "aria-label": ariaLabelFromRest, ...restWithoutAriaLabel } = domRest;
22
+ const computedAriaLabel = isString(label) ? label : ariaLabelFromRest;
21
23
  return /* @__PURE__ */ jsxs(
22
24
  "div",
23
25
  {
24
- ...domRest,
26
+ ...restWithoutAriaLabel,
27
+ "aria-label": computedAriaLabel,
25
28
  "aria-valuemax": 100,
26
29
  "aria-valuemin": 0,
27
30
  "aria-valuenow": safeValue ?? void 0,
@@ -44,7 +44,12 @@ function RatingClient({
44
44
  }, [value]);
45
45
  const runValidation = useCallback(
46
46
  (newVal) => {
47
- const numeric = isNumber(newVal) ? newVal : isString(newVal) ? Number(newVal) : void 0;
47
+ let numeric;
48
+ if (isNumber(newVal)) {
49
+ numeric = newVal;
50
+ } else {
51
+ numeric = isString(newVal) ? Number(newVal) : void 0;
52
+ }
48
53
  handleRatingValidation(
49
54
  name,
50
55
  numeric,
@@ -5,7 +5,10 @@ import RatingServer from "./Rating.server.js";
5
5
  const Rating = createIsland({
6
6
  name: "Rating",
7
7
  Server: RatingServer,
8
- loadLazy: /* @__PURE__ */ __name(() => import("./Rating.lazy.js"), "loadLazy")
8
+ loadLazy: (
9
+ /* istanbul ignore next */
10
+ /* @__PURE__ */ __name(() => import("./Rating.lazy.js"), "loadLazy")
11
+ )
9
12
  });
10
13
  export {
11
14
  Rating
@@ -3,7 +3,7 @@ var __defProp = Object.defineProperty;
3
3
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { Marked as B } from "../../node_modules/.pnpm/marked@17.0.1/node_modules/marked/lib/marked.esm.js";
6
- import { useRef, useMemo, useState, useEffect, Fragment, Children, isValidElement, createElement } from "react";
6
+ import { useRef, useMemo, useState, useEffect, Fragment, Children, cloneElement, isValidElement, createElement } from "react";
7
7
  import { l as libExports } from "../../_virtual/index.js";
8
8
  import { create } from "../../helpers/bem.js";
9
9
  import { isString } from "../../helpers/validations.js";
@@ -15,9 +15,15 @@ import { Headline } from "../headline/Headline.js";
15
15
  import { AnimatedText } from "../animatedText/AnimatedText.js";
16
16
  const bem = create(styles, "RichText");
17
17
  const xssOptions = (() => {
18
- const wl = typeof libExports.getDefaultWhiteList === "function" ? libExports.getDefaultWhiteList() : {};
18
+ const wl = typeof libExports.getDefaultWhiteList === "function" ? libExports.getDefaultWhiteList() : (
19
+ /* istanbul ignore next */
20
+ {}
21
+ );
19
22
  const add = /* @__PURE__ */ __name((tag) => {
20
- wl[tag] = Array.from(/* @__PURE__ */ new Set([...wl[tag] ?? [], "class"]));
23
+ wl[tag] = Array.from(
24
+ /* @__PURE__ */ new Set([.../* istanbul ignore next */
25
+ wl[tag] ?? [], "class"])
26
+ );
21
27
  }, "add");
22
28
  add("pre");
23
29
  add("code");
@@ -28,7 +34,10 @@ const xssOptions = (() => {
28
34
  };
29
35
  })();
30
36
  const normalize = /* @__PURE__ */ __name((nodes) => Children.toArray(nodes), "normalize");
31
- const withKey = /* @__PURE__ */ __name((el, key) => isValidElement(el) ? el.key == null ? { ...el, key } : el : el, "withKey");
37
+ const withKey = /* @__PURE__ */ __name((el, key) => isValidElement(el) ? el.key == null ? cloneElement(el, { key }) : el : (
38
+ /* istanbul ignore next */
39
+ el
40
+ ), "withKey");
32
41
  const hasCodeBlocks = /* @__PURE__ */ __name((src) => /(^|\n)```/.test(src) || /<pre|<code/i.test(src), "hasCodeBlocks");
33
42
  const extractFenceLangs = /* @__PURE__ */ __name((src) => {
34
43
  const langs = /* @__PURE__ */ new Set();
@@ -97,16 +106,22 @@ function RichTextClient({
97
106
  ...schema
98
107
  };
99
108
  const headlineProps = { animationProps };
100
- const renderAnimation = /* @__PURE__ */ __name((content) => {
109
+ const renderAnimation = /* @__PURE__ */ __name((content, idx) => {
101
110
  if (!Boolean(animated)) return content;
102
- return typeof content === "string" ? /* @__PURE__ */ jsx(AnimatedText, { ...animationProps, children: content }) : content;
111
+ return typeof content === "string" ? /* @__PURE__ */ jsx(AnimatedText, { ...animationProps, children: content }, `anim-${idx}`) : (
112
+ /* istanbul ignore next */
113
+ content
114
+ );
103
115
  }, "renderAnimation");
104
- const src = String(children ?? "");
116
+ const src = String(
117
+ /* istanbul ignore next */
118
+ children ?? ""
119
+ );
105
120
  const fastHtml = useMemo(() => {
106
121
  const parser2 = new B({ gfm: true, breaks: true });
107
122
  return libExports.filterXSS(parser2.parse(src), xssOptions);
108
123
  }, [src]);
109
- const [html, setHtml] = useState("");
124
+ const [html, setHtml] = useState(fastHtml);
110
125
  useEffect(() => {
111
126
  let cancelled = false;
112
127
  void (async () => {
@@ -120,6 +135,7 @@ function RichTextClient({
120
135
  ]);
121
136
  const markedHighlight = (
122
137
  // support both module shapes
138
+ /* istanbul ignore next */
123
139
  mhMod.markedHighlight ?? mhMod.default
124
140
  );
125
141
  if (typeof markedHighlight !== "function") {
@@ -249,7 +265,11 @@ function RichTextClient({
249
265
  }
250
266
  case "a": {
251
267
  const cls = bem("a");
252
- const href = elem.getAttribute("href") ?? "#";
268
+ const href = (
269
+ /* istanbul ignore next */
270
+ elem.getAttribute("href") ?? /* istanbul ignore next */
271
+ "#"
272
+ );
253
273
  const title = elem.getAttribute("title") ?? void 0;
254
274
  const linkText = normalize(keyedChildren.map(renderAnimation));
255
275
  const isHttp = /^https?:\/\//i.test(href);
@@ -263,7 +283,8 @@ function RichTextClient({
263
283
  const htmlTarget = elem.getAttribute("target") ?? void 0;
264
284
  const wantsBlank = htmlTarget === "_blank";
265
285
  target = wantsBlank ? "_blank" : void 0;
266
- rel = wantsBlank ? "noopener" : void 0;
286
+ rel = /* istanbul ignore next */
287
+ wantsBlank ? "noopener" : void 0;
267
288
  }
268
289
  return /* @__PURE__ */ jsx(
269
290
  Link,
@@ -303,13 +324,21 @@ function RichTextClient({
303
324
  const existing = elem.getAttribute("class");
304
325
  const src2 = elem.getAttribute("src");
305
326
  const alt = elem.getAttribute("alt");
306
- return /* @__PURE__ */ jsx("span", { className: bem("image__wrapper"), children: /* @__PURE__ */ jsx(
327
+ const altStr = alt ?? "";
328
+ const srcStr = src2 ?? "";
329
+ return /* @__PURE__ */ jsx("span", { className: bem("image__wrapper"), children: srcStr ? /* @__PURE__ */ jsx(
307
330
  Image,
308
331
  {
309
332
  fill: true,
310
- alt: alt ?? "",
333
+ alt: altStr,
311
334
  className: [bem("image"), existing].filter(Boolean).join(" "),
312
- src: src2 ?? ""
335
+ src: srcStr
336
+ }
337
+ ) : /* @__PURE__ */ jsx(
338
+ "img",
339
+ {
340
+ alt: altStr,
341
+ className: [bem("image"), existing].filter(Boolean).join(" ")
313
342
  }
314
343
  ) });
315
344
  }
@@ -320,7 +349,10 @@ function RichTextClient({
320
349
  case "ol": {
321
350
  const cls = bem("ol");
322
351
  const startAttr = elem.getAttribute("start");
323
- const start = isString(startAttr) ? parseInt(startAttr, 10) || 1 : 1;
352
+ const start = isString(startAttr) ? (
353
+ /* istanbul ignore next */
354
+ parseInt(startAttr, 10) || 1
355
+ ) : 1;
324
356
  const liElems = Array.from(elem.children).filter(
325
357
  (e) => e.tagName.toLowerCase() === "li"
326
358
  );
@@ -359,8 +391,10 @@ function RichTextClient({
359
391
  className: [bem(tagName), existing].filter(Boolean).join(" ")
360
392
  };
361
393
  if (tagName === "img") {
362
- props2.src = elem.getAttribute("src") ?? "";
363
- props2.alt = elem.getAttribute("alt") ?? "";
394
+ props2.src = /* istanbul ignore next */
395
+ elem.getAttribute("src") ?? "";
396
+ props2.alt = /* istanbul ignore next */
397
+ elem.getAttribute("alt") ?? "";
364
398
  props2.loading = "lazy";
365
399
  }
366
400
  if (VOID_TAGS.has(tagName)) {
@@ -407,7 +441,8 @@ function RichTextClient({
407
441
  __name(RichTextClient, "RichTextClient");
408
442
  RichTextClient.displayName = "RichTextClient";
409
443
  function extractText(node) {
410
- if (typeof node === "string" || typeof node === "number") {
444
+ if (typeof node === "string" || /* istanbul ignore next */
445
+ typeof node === "number") {
411
446
  return String(node);
412
447
  }
413
448
  if (Array.isArray(node)) {
@@ -5,8 +5,14 @@ import { RichTextServer } from "./RichText.server.js";
5
5
  const RichText = createIsland({
6
6
  name: "RichText",
7
7
  Server: RichTextServer,
8
- loadLazy: /* @__PURE__ */ __name(() => import("./RichText.lazy.js"), "loadLazy"),
9
- isInteractive: /* @__PURE__ */ __name(() => true, "isInteractive")
8
+ loadLazy: (
9
+ /* istanbul ignore next */
10
+ /* @__PURE__ */ __name(() => import("./RichText.lazy.js"), "loadLazy")
11
+ ),
12
+ isInteractive: (
13
+ /* istanbul ignore next */
14
+ /* @__PURE__ */ __name(() => true, "isInteractive")
15
+ )
10
16
  });
11
17
  export {
12
18
  RichText
@@ -12,6 +12,9 @@ function RichTextServer(props) {
12
12
  children,
13
13
  className,
14
14
  schema = {},
15
+ animated: _animated,
16
+ animationProps: _animationProps,
17
+ variant: _variant,
15
18
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
16
19
  itemProp,
17
20
  // eslint-disable-next-line @typescript-eslint/no-unused-vars