@prokodo/ui 0.0.52 → 0.0.54

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 (204) hide show
  1. package/README.md +81 -81
  2. package/dist/_virtual/_commonjsHelpers.js +9 -0
  3. package/dist/_virtual/common.js +7 -0
  4. package/dist/components/accordion/Accordion.client.js +3 -1
  5. package/dist/components/accordion/Accordion.view.js +100 -81
  6. package/dist/components/animated/Animated.server.js +3 -1
  7. package/dist/components/animatedText/AnimatedText.client.js +1 -7
  8. package/dist/components/animatedText/AnimatedText.view.js +4 -1
  9. package/dist/components/avatar/Avatar.view.js +2 -2
  10. package/dist/components/base-link/BaseLink.view.js +1 -1
  11. package/dist/components/button/Button.server.js +1 -8
  12. package/dist/components/calendly/Calendly.client.js +63 -54
  13. package/dist/components/calendly/Calendly.server.js +3 -1
  14. package/dist/components/card/Card.client.js +2 -1
  15. package/dist/components/card/Card.effects.client.js +5 -1
  16. package/dist/components/card/Card.view.js +19 -2
  17. package/dist/components/carousel/Carousel.client.js +36 -12
  18. package/dist/components/chip/Chip.view.js +10 -6
  19. package/dist/components/datePicker/DatePicker.client.js +53 -37
  20. package/dist/components/datePicker/DatePicker.view.js +3 -1
  21. package/dist/components/dialog/Dialog.client.js +22 -14
  22. package/dist/components/dialog/Dialog.view.js +10 -2
  23. package/dist/components/drawer/Drawer.client.js +10 -2
  24. package/dist/components/drawer/Drawer.effects.client.js +7 -2
  25. package/dist/components/dynamic-list/DynamicList.client.js +8 -7
  26. package/dist/components/dynamic-list/DynamicList.server.js +10 -4
  27. package/dist/components/dynamic-list/DynamicList.view.js +1 -1
  28. package/dist/components/form/Form.client.js +16 -13
  29. package/dist/components/form/Form.view.js +8 -4
  30. package/dist/components/form/FormField.client.js +5 -5
  31. package/dist/components/form/FormField.server.js +3 -23
  32. package/dist/components/form/FormResponse.js +5 -1
  33. package/dist/components/grid/Grid.js +7 -2
  34. package/dist/components/grid/GridRow.js +12 -2
  35. package/dist/components/headline/Headline.js +3 -1
  36. package/dist/components/icon/Icon.js +8 -4
  37. package/dist/components/image-text/ImageText.js +5 -1
  38. package/dist/components/input/Input.client.js +52 -28
  39. package/dist/components/input/Input.view.js +92 -68
  40. package/dist/components/inputOTP/InputOTP.js +107 -90
  41. package/dist/components/label/Label.js +1 -8
  42. package/dist/components/link/Link.view.js +3 -1
  43. package/dist/components/list/List.js +94 -42
  44. package/dist/components/loading/Loading.client.js +15 -2
  45. package/dist/components/loading/Loading.server.js +8 -1
  46. package/dist/components/loading/Loading.view.js +30 -7
  47. package/dist/components/post-item/PostItem.client.js +17 -0
  48. package/dist/components/post-item/PostItem.js +7 -136
  49. package/dist/components/post-item/PostItem.lazy.js +14 -0
  50. package/dist/components/post-item/PostItem.module.scss.js +3 -1
  51. package/dist/components/post-item/PostItem.server.js +14 -0
  52. package/dist/components/post-item/PostItem.view.js +238 -0
  53. package/dist/components/post-item/PostItemAuthor.js +28 -22
  54. package/dist/components/post-teaser/PostTeaser.client.js +30 -0
  55. package/dist/components/post-teaser/PostTeaser.js +9 -169
  56. package/dist/components/post-teaser/PostTeaser.lazy.js +13 -0
  57. package/dist/components/post-teaser/PostTeaser.module.scss.js +3 -0
  58. package/dist/components/post-teaser/PostTeaser.server.js +22 -0
  59. package/dist/components/post-teaser/PostTeaser.view.js +252 -0
  60. package/dist/components/post-widget/PostWidget.client.js +9 -0
  61. package/dist/components/post-widget/PostWidget.js +11 -156
  62. package/dist/components/post-widget/PostWidget.lazy.js +13 -0
  63. package/dist/components/post-widget/PostWidget.module.scss.js +1 -0
  64. package/dist/components/post-widget/PostWidget.server.js +11 -0
  65. package/dist/components/post-widget/PostWidget.view.js +263 -0
  66. package/dist/components/post-widget-carousel/PostWidgetCarousel.client.js +9 -0
  67. package/dist/components/post-widget-carousel/PostWidgetCarousel.js +9 -160
  68. package/dist/components/post-widget-carousel/PostWidgetCarousel.lazy.js +13 -0
  69. package/dist/components/post-widget-carousel/PostWidgetCarousel.module.scss.js +3 -0
  70. package/dist/components/post-widget-carousel/PostWidgetCarousel.server.js +11 -0
  71. package/dist/components/post-widget-carousel/PostWidgetCarousel.view.js +244 -0
  72. package/dist/components/rich-text/RichText.client.js +182 -12
  73. package/dist/components/rich-text/RichText.module.scss.js +1 -1
  74. package/dist/components/select/Select.view.js +132 -116
  75. package/dist/components/sidenav/SideNav.client.js +19 -18
  76. package/dist/components/sidenav/SideNav.server.js +8 -1
  77. package/dist/components/sidenav/SideNav.view.js +21 -3
  78. package/dist/components/skeleton/Skeleton.effects.client.js +3 -1
  79. package/dist/components/slider/Slider.client.js +56 -38
  80. package/dist/components/slider/Slider.view.js +1 -7
  81. package/dist/components/snackbar/SnackbarProvider.client.js +21 -22
  82. package/dist/components/stepper/Stepper.client.js +1 -8
  83. package/dist/components/switch/Switch.client.js +1 -6
  84. package/dist/components/switch/Switch.server.js +1 -3
  85. package/dist/components/table/Table.js +3 -1
  86. package/dist/components/table/TableCell.js +13 -1
  87. package/dist/components/teaser/Teaser.js +1 -5
  88. package/dist/constants/project.js +1 -1
  89. package/dist/helpers/createIsland.js +3 -1
  90. package/dist/helpers/createLazyWrapper.js +3 -1
  91. package/dist/helpers/date.js +21 -0
  92. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/common.js +5 -0
  93. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/common.js +90 -0
  94. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/core.js +1629 -0
  95. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/bash.js +407 -0
  96. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/c.js +307 -0
  97. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/cpp.js +556 -0
  98. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/csharp.js +413 -0
  99. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/css.js +950 -0
  100. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/diff.js +66 -0
  101. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/go.js +167 -0
  102. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/graphql.js +83 -0
  103. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/ini.js +129 -0
  104. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/java.js +268 -0
  105. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/javascript.js +715 -0
  106. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/json.js +53 -0
  107. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/kotlin.js +268 -0
  108. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/less.js +1031 -0
  109. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/lua.js +74 -0
  110. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/makefile.js +84 -0
  111. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/markdown.js +245 -0
  112. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/objectivec.js +256 -0
  113. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/perl.js +498 -0
  114. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/php-template.js +59 -0
  115. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/php.js +614 -0
  116. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/plaintext.js +25 -0
  117. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/python-repl.js +38 -0
  118. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/python.js +428 -0
  119. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/r.js +223 -0
  120. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/ruby.js +426 -0
  121. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/rust.js +326 -0
  122. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/scss.js +935 -0
  123. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/shell.js +37 -0
  124. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/sql.js +658 -0
  125. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/swift.js +893 -0
  126. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/typescript.js +829 -0
  127. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/vbnet.js +146 -0
  128. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/wasm.js +134 -0
  129. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/xml.js +239 -0
  130. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/languages/yaml.js +214 -0
  131. package/dist/node_modules/.pnpm/marked-highlight@2.2.2_marked@15.0.12/node_modules/marked-highlight/src/index.js +93 -0
  132. package/dist/tsconfig.build.tsbuildinfo +1 -1
  133. package/dist/types/components/accordion/Accordion.model.d.ts +1 -1
  134. package/dist/types/components/animated/Animated.client.d.ts +2 -2
  135. package/dist/types/components/animated/Animated.model.d.ts +1 -1
  136. package/dist/types/components/button/Button.client.d.ts +1 -1
  137. package/dist/types/components/button/Button.d.ts +1 -1
  138. package/dist/types/components/button/Button.lazy.d.ts +1 -1
  139. package/dist/types/components/button/Button.server.d.ts +1 -1
  140. package/dist/types/components/button/Button.view.d.ts +1 -1
  141. package/dist/types/components/card/Card.effects.client.d.ts +1 -1
  142. package/dist/types/components/card/index.d.ts +1 -1
  143. package/dist/types/components/carousel/Carousel.d.ts +3 -0
  144. package/dist/types/components/carousel/Carousel.lazy.d.ts +3 -0
  145. package/dist/types/components/carousel/Carousel.model.d.ts +4 -0
  146. package/dist/types/components/dialog/Dialog.client.d.ts +1 -1
  147. package/dist/types/components/dialog/Dialog.model.d.ts +4 -4
  148. package/dist/types/components/dialog/Dialog.view.d.ts +2 -2
  149. package/dist/types/components/drawer/Drawer.client.d.ts +1 -1
  150. package/dist/types/components/drawer/Drawer.d.ts +1 -1
  151. package/dist/types/components/drawer/Drawer.effects.client.d.ts +1 -1
  152. package/dist/types/components/drawer/Drawer.lazy.d.ts +1 -1
  153. package/dist/types/components/drawer/Drawer.model.d.ts +6 -6
  154. package/dist/types/components/drawer/Drawer.server.d.ts +1 -1
  155. package/dist/types/components/drawer/Drawer.view.d.ts +2 -2
  156. package/dist/types/components/drawer/index.d.ts +1 -1
  157. package/dist/types/components/icon/IconList.d.ts +1 -1
  158. package/dist/types/components/icon/index.d.ts +1 -1
  159. package/dist/types/components/image/Image.model.d.ts +2 -2
  160. package/dist/types/components/link/Link.d.ts +1 -1
  161. package/dist/types/components/link/Link.model.d.ts +1 -1
  162. package/dist/types/components/link/Link.server.d.ts +1 -1
  163. package/dist/types/components/loading/index.d.ts +1 -1
  164. package/dist/types/components/post-item/PostItem.client.d.ts +4 -0
  165. package/dist/types/components/post-item/PostItem.d.ts +3 -2
  166. package/dist/types/components/post-item/PostItem.lazy.d.ts +5 -0
  167. package/dist/types/components/post-item/PostItem.model.d.ts +46 -6
  168. package/dist/types/components/post-item/PostItem.server.d.ts +3 -0
  169. package/dist/types/components/post-item/PostItem.view.d.ts +3 -0
  170. package/dist/types/components/post-item/PostItemAuthor.model.d.ts +5 -8
  171. package/dist/types/components/post-item/index.d.ts +2 -2
  172. package/dist/types/components/post-teaser/PostTeaser.client.d.ts +4 -0
  173. package/dist/types/components/post-teaser/PostTeaser.d.ts +3 -2
  174. package/dist/types/components/post-teaser/PostTeaser.lazy.d.ts +5 -0
  175. package/dist/types/components/post-teaser/PostTeaser.model.d.ts +49 -3
  176. package/dist/types/components/post-teaser/PostTeaser.server.d.ts +3 -0
  177. package/dist/types/components/post-teaser/PostTeaser.view.d.ts +3 -0
  178. package/dist/types/components/post-teaser/index.d.ts +1 -1
  179. package/dist/types/components/post-widget/PostWidget.client.d.ts +4 -0
  180. package/dist/types/components/post-widget/PostWidget.d.ts +13 -3
  181. package/dist/types/components/post-widget/PostWidget.lazy.d.ts +14 -0
  182. package/dist/types/components/post-widget/PostWidget.model.d.ts +53 -3
  183. package/dist/types/components/post-widget/PostWidget.server.d.ts +3 -0
  184. package/dist/types/components/post-widget/PostWidget.view.d.ts +3 -0
  185. package/dist/types/components/post-widget/index.d.ts +1 -1
  186. package/dist/types/components/post-widget-carousel/PostWidgetCarousel.client.d.ts +3 -0
  187. package/dist/types/components/post-widget-carousel/PostWidgetCarousel.d.ts +11 -3
  188. package/dist/types/components/post-widget-carousel/PostWidgetCarousel.lazy.d.ts +12 -0
  189. package/dist/types/components/post-widget-carousel/PostWidgetCarousel.model.d.ts +39 -0
  190. package/dist/types/components/post-widget-carousel/PostWidgetCarousel.server.d.ts +3 -0
  191. package/dist/types/components/post-widget-carousel/PostWidgetCarousel.view.d.ts +3 -0
  192. package/dist/types/components/post-widget-carousel/index.d.ts +1 -1
  193. package/dist/types/components/rich-text/RichText.client.d.ts +1 -1
  194. package/dist/types/components/rich-text/RichText.d.ts +5 -0
  195. package/dist/types/components/rich-text/RichText.lazy.d.ts +5 -0
  196. package/dist/types/components/rich-text/RichText.model.d.ts +5 -0
  197. package/dist/types/components/sidenav/index.d.ts +1 -1
  198. package/dist/types/components/skeleton/Skeleton.effects.client.d.ts +2 -2
  199. package/dist/types/helpers/createIsland.d.ts +1 -1
  200. package/dist/types/helpers/createLazyWrapper.d.ts +1 -1
  201. package/dist/types/helpers/date.d.ts +5 -0
  202. package/dist/ui.css +154 -65
  203. package/package.json +5 -2
  204. package/dist/helpers/calculation.js +0 -6
@@ -0,0 +1,244 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ import { jsxs, jsx } from "react/jsx-runtime";
4
+ import { isValidElement } from "react";
5
+ import { create } from "../../helpers/bem.js";
6
+ import { isString } from "../../helpers/validations.js";
7
+ import styles from "./PostWidgetCarousel.module.scss.js";
8
+ import { Carousel } from "../carousel/Carousel.js";
9
+ import { Card } from "../card/Card.js";
10
+ import { Headline } from "../headline/Headline.js";
11
+ import { Link } from "../link/Link.js";
12
+ import { Image } from "../image/Image.js";
13
+ const bem = create(styles, "PostWidgetCarousel");
14
+ function PostWidgetCarouselView(props) {
15
+ var _a, _b;
16
+ const {
17
+ autoplay = 5e3,
18
+ className,
19
+ title,
20
+ items = [],
21
+ classes,
22
+ componentsProps,
23
+ structuredData = true,
24
+ ...rest
25
+ } = props;
26
+ const cardMerged = {
27
+ animated: true,
28
+ enableShadow: true,
29
+ ...componentsProps == null ? void 0 : componentsProps.card,
30
+ ...rest,
31
+ variant: ((_a = componentsProps == null ? void 0 : componentsProps.card) == null ? void 0 : _a.variant) ?? (rest == null ? void 0 : rest.variant) ?? "white"
32
+ };
33
+ return /* @__PURE__ */ jsxs(
34
+ "section",
35
+ {
36
+ itemScope: true,
37
+ itemType: "https://schema.org/ItemList",
38
+ className: bem(
39
+ void 0,
40
+ void 0,
41
+ [className, classes == null ? void 0 : classes.root].filter(Boolean).join(" ")
42
+ ),
43
+ children: [
44
+ /* @__PURE__ */ jsxs(
45
+ Card,
46
+ {
47
+ ...cardMerged,
48
+ className: bem("card__container", void 0, classes == null ? void 0 : classes.cardContainer),
49
+ contentClassName: bem("card", void 0, classes == null ? void 0 : classes.card),
50
+ children: [
51
+ title && /* @__PURE__ */ jsx(
52
+ Headline,
53
+ {
54
+ highlight: true,
55
+ size: "md",
56
+ type: "h2",
57
+ ...{ ...title, ...(componentsProps == null ? void 0 : componentsProps.title) ?? {} },
58
+ itemProp: "headline",
59
+ className: bem(
60
+ "title",
61
+ void 0,
62
+ [title == null ? void 0 : title.className, classes == null ? void 0 : classes.title].filter(Boolean).join(" ")
63
+ ),
64
+ variant: (title == null ? void 0 : title.variant) ?? ((_b = componentsProps == null ? void 0 : componentsProps.title) == null ? void 0 : _b.variant) ?? "secondary",
65
+ children: title == null ? void 0 : title.content
66
+ }
67
+ ),
68
+ items.length > 0 && /* @__PURE__ */ jsx(
69
+ Carousel,
70
+ {
71
+ enableControl: true,
72
+ autoplay,
73
+ className: bem("carousel", void 0, classes == null ? void 0 : classes.carousel),
74
+ enableDots: false,
75
+ itemsToShow: 1,
76
+ classNameButtons: bem(
77
+ "carousel__button",
78
+ void 0,
79
+ classes == null ? void 0 : classes.carouselButton
80
+ ),
81
+ classNameControls: bem(
82
+ "carousel__buttons",
83
+ void 0,
84
+ classes == null ? void 0 : classes.carouselButtons
85
+ ),
86
+ classNameDots: bem(
87
+ "carousel__dots",
88
+ void 0,
89
+ classes == null ? void 0 : classes.carouselDots
90
+ ),
91
+ classNameItem: bem(
92
+ "carousel__item",
93
+ void 0,
94
+ classes == null ? void 0 : classes.carouselItem
95
+ ),
96
+ classNameWrapper: bem(
97
+ "carousel__wrapper",
98
+ void 0,
99
+ classes == null ? void 0 : classes.carouselWrapper
100
+ ),
101
+ nextButton: {
102
+ variant: "contained",
103
+ color: "primary",
104
+ iconProps: {
105
+ size: "sm"
106
+ }
107
+ },
108
+ prevButton: {
109
+ variant: "contained",
110
+ color: "primary",
111
+ iconProps: {
112
+ size: "sm"
113
+ }
114
+ },
115
+ children: items.map((item, idx) => {
116
+ var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w;
117
+ const key = `carousel-item-${((_a2 = item.title) == null ? void 0 : _a2.content) ?? idx}`;
118
+ const imgBase = item.image;
119
+ const imgMerged = imgBase ? {
120
+ ...imgBase,
121
+ ...(componentsProps == null ? void 0 : componentsProps.image) ?? {},
122
+ ...((_b2 = item.componentsProps) == null ? void 0 : _b2.image) ?? {},
123
+ className: bem(
124
+ "carousel__item__image",
125
+ void 0,
126
+ [
127
+ imgBase.className,
128
+ classes == null ? void 0 : classes.carouselItemImage,
129
+ (_c = item.classes) == null ? void 0 : _c.image
130
+ ].filter(Boolean).join(" ")
131
+ ),
132
+ containerClassName: bem("carousel__item__image__container"),
133
+ decoding: ((_e = (_d = item.componentsProps) == null ? void 0 : _d.image) == null ? void 0 : _e.decoding) ?? ((_f = componentsProps == null ? void 0 : componentsProps.image) == null ? void 0 : _f.decoding) ?? imgBase.decoding ?? "async",
134
+ loading: ((_h = (_g = item.componentsProps) == null ? void 0 : _g.image) == null ? void 0 : _h.loading) ?? ((_i = componentsProps == null ? void 0 : componentsProps.image) == null ? void 0 : _i.loading) ?? imgBase.loading ?? "lazy",
135
+ sizes: ((_k = (_j = item.componentsProps) == null ? void 0 : _j.image) == null ? void 0 : _k.sizes) ?? ((_l = componentsProps == null ? void 0 : componentsProps.image) == null ? void 0 : _l.sizes) ?? imgBase.sizes ?? "(max-width: 960px) 100vw, 100vw",
136
+ ...isValidElement(imgBase == null ? void 0 : imgBase.imageComponent) ? { imageComponent: imgBase.imageComponent } : {}
137
+ } : void 0;
138
+ const linkMerged = {
139
+ ...(componentsProps == null ? void 0 : componentsProps.link) ?? {},
140
+ ...((_m = item.componentsProps) == null ? void 0 : _m.link) ?? {},
141
+ ...item.redirect,
142
+ className: bem(
143
+ "carousel__item__image__link",
144
+ void 0,
145
+ [
146
+ (_n = item.redirect) == null ? void 0 : _n.className,
147
+ classes == null ? void 0 : classes.carouselItemImageLink,
148
+ (_o = item.classes) == null ? void 0 : _o.imageLink
149
+ ].filter(Boolean).join(" ")
150
+ ),
151
+ "aria-label": `Read more about ${item.title.content}`
152
+ };
153
+ return /* @__PURE__ */ jsxs("div", { children: [
154
+ imgMerged && /* @__PURE__ */ jsx(Link, { ...linkMerged, children: /* @__PURE__ */ jsx(
155
+ Image,
156
+ {
157
+ ...imgMerged,
158
+ className: bem(
159
+ "carousel__item__image",
160
+ void 0,
161
+ classes == null ? void 0 : classes.carouselItemImage
162
+ ),
163
+ containerClassName: bem(
164
+ "carousel__item__image__container"
165
+ )
166
+ }
167
+ ) }),
168
+ /* @__PURE__ */ jsx(
169
+ Link,
170
+ {
171
+ ...(componentsProps == null ? void 0 : componentsProps.link) ?? {},
172
+ ...((_p = item.componentsProps) == null ? void 0 : _p.link) ?? {},
173
+ ...item.redirect,
174
+ "aria-label": `Read more about ${item.title.content}`,
175
+ className: bem(
176
+ "carousel__item__link",
177
+ void 0,
178
+ [classes == null ? void 0 : classes.carouselItemLink, (_q = item.classes) == null ? void 0 : _q.link].filter(Boolean).join(" ")
179
+ ),
180
+ children: /* @__PURE__ */ jsx(
181
+ Headline,
182
+ {
183
+ size: "md",
184
+ type: "h3",
185
+ ...item.title,
186
+ ...(componentsProps == null ? void 0 : componentsProps.title) ?? {},
187
+ ...((_r = item.componentsProps) == null ? void 0 : _r.headline) ?? {},
188
+ itemProp: "headline",
189
+ className: bem(
190
+ "headline",
191
+ void 0,
192
+ [
193
+ (_s = item.title) == null ? void 0 : _s.className,
194
+ classes == null ? void 0 : classes.carouselItem,
195
+ (_t = item.classes) == null ? void 0 : _t.headline
196
+ ].filter(Boolean).join(" ")
197
+ ),
198
+ variant: ((_u = item.title) == null ? void 0 : _u.variant) ?? ((_v = componentsProps == null ? void 0 : componentsProps.title) == null ? void 0 : _v.variant) ?? "inherit",
199
+ children: (_w = item.title) == null ? void 0 : _w.content
200
+ }
201
+ )
202
+ }
203
+ )
204
+ ] }, key);
205
+ })
206
+ }
207
+ )
208
+ ]
209
+ }
210
+ ),
211
+ structuredData && items.length > 0 && /* @__PURE__ */ jsx(
212
+ "script",
213
+ {
214
+ type: "application/ld+json",
215
+ dangerouslySetInnerHTML: {
216
+ __html: JSON.stringify({
217
+ "@context": "https://schema.org",
218
+ "@type": "ItemList",
219
+ itemListElement: items.map((item, index) => {
220
+ var _a2, _b2;
221
+ return {
222
+ "@type": "ListItem",
223
+ position: index + 1,
224
+ item: {
225
+ "@type": "BlogPosting",
226
+ headline: (_a2 = item.title) == null ? void 0 : _a2.content,
227
+ image: isString(
228
+ (_b2 = item.image) == null ? void 0 : _b2.src
229
+ ) ? [item.image.src] : void 0
230
+ }
231
+ };
232
+ })
233
+ })
234
+ }
235
+ }
236
+ )
237
+ ]
238
+ }
239
+ );
240
+ }
241
+ __name(PostWidgetCarouselView, "PostWidgetCarouselView");
242
+ export {
243
+ PostWidgetCarouselView
244
+ };
@@ -2,18 +2,79 @@
2
2
  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
- import { marked } from "../../node_modules/.pnpm/marked@15.0.12/node_modules/marked/lib/marked.esm.js";
6
- import { useMemo, Fragment, Children, isValidElement, createElement } from "react";
5
+ import { Marked } from "../../node_modules/.pnpm/marked@15.0.12/node_modules/marked/lib/marked.esm.js";
6
+ import { useRef, useMemo, useState, useEffect, Fragment, Children, isValidElement, createElement } from "react";
7
7
  import { l as libExports } from "../../_virtual/index.js";
8
8
  import { create } from "../../helpers/bem.js";
9
+ import { isString } from "../../helpers/validations.js";
9
10
  import styles from "./RichText.module.scss.js";
10
11
  import { Icon } from "../icon/Icon.js";
11
12
  import { Link } from "../link/Link.js";
12
13
  import { Headline } from "../headline/Headline.js";
13
14
  import { AnimatedText } from "../animatedText/AnimatedText.js";
14
15
  const bem = create(styles, "RichText");
16
+ const xssOptions = (() => {
17
+ const wl = typeof libExports.getDefaultWhiteList === "function" ? libExports.getDefaultWhiteList() : {};
18
+ const add = /* @__PURE__ */ __name((tag) => {
19
+ wl[tag] = Array.from(/* @__PURE__ */ new Set([...wl[tag] ?? [], "class"]));
20
+ }, "add");
21
+ add("pre");
22
+ add("code");
23
+ add("span");
24
+ return {
25
+ whiteList: wl,
26
+ allowList: wl
27
+ };
28
+ })();
15
29
  const normalize = /* @__PURE__ */ __name((nodes) => Children.toArray(nodes), "normalize");
16
30
  const withKey = /* @__PURE__ */ __name((el, key) => isValidElement(el) ? el.key == null ? { ...el, key } : el : el, "withKey");
31
+ const hasCodeBlocks = /* @__PURE__ */ __name((src) => /(^|\n)```/.test(src) || /<pre|<code/i.test(src), "hasCodeBlocks");
32
+ const extractFenceLangs = /* @__PURE__ */ __name((src) => {
33
+ const langs = /* @__PURE__ */ new Set();
34
+ const re = /(^|\n)```([\w+-]+)/g;
35
+ let m;
36
+ while (m = re.exec(src)) {
37
+ const lang = (m[2] ?? "").toLowerCase().trim();
38
+ if (lang) langs.add(lang);
39
+ }
40
+ return langs;
41
+ }, "extractFenceLangs");
42
+ async function prepareHljs(_langs, theme) {
43
+ const hljs = (await import("../../node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/common.js")).default;
44
+ const version = (hljs == null ? void 0 : hljs.versionString) || "11.11.1";
45
+ ensureHljsThemeLoaded(version, theme);
46
+ return hljs;
47
+ }
48
+ __name(prepareHljs, "prepareHljs");
49
+ function ensureHljsThemeLoaded(version, theme) {
50
+ const id = "hljs-theme";
51
+ const existing = document.getElementById(id);
52
+ const {
53
+ href: customHref,
54
+ name: themeName,
55
+ version: themeVersion
56
+ } = theme ?? {};
57
+ let href;
58
+ if (typeof customHref === "string" && customHref.trim().length > 0) {
59
+ href = customHref;
60
+ } else {
61
+ const name = (themeName ?? "github-dark-dimmed").replace(/\.css$/i, "");
62
+ const ver = themeVersion === "auto" || !isString(themeVersion) ? version : themeVersion;
63
+ href = `https://cdnjs.cloudflare.com/ajax/libs/highlight.js/${encodeURIComponent(
64
+ ver
65
+ )}/styles/${name}.min.css`;
66
+ }
67
+ if (existing) {
68
+ if (existing.href !== href) existing.href = href;
69
+ return;
70
+ }
71
+ const link = document.createElement("link");
72
+ link.id = id;
73
+ link.rel = "stylesheet";
74
+ link.href = href;
75
+ document.head.appendChild(link);
76
+ }
77
+ __name(ensureHljsThemeLoaded, "ensureHljsThemeLoaded");
17
78
  function RichTextClient({
18
79
  children,
19
80
  animated,
@@ -24,8 +85,10 @@ function RichTextClient({
24
85
  linkComponent,
25
86
  className,
26
87
  overrideParagraph,
88
+ codeTheme,
27
89
  ...props
28
90
  }) {
91
+ const containerRef = useRef(null);
29
92
  const baseProps = {
30
93
  animated,
31
94
  className: className ?? void 0,
@@ -36,10 +99,78 @@ function RichTextClient({
36
99
  if (!Boolean(animated)) return content;
37
100
  return typeof content === "string" ? /* @__PURE__ */ jsx(AnimatedText, { ...animationProps, children: content }) : content;
38
101
  }, "renderAnimation");
39
- const safeHtml = useMemo(() => {
40
- marked.setOptions({ gfm: true, breaks: true });
41
- return libExports.filterXSS(marked.parse(children ?? ""));
42
- }, [children]);
102
+ const src = String(children ?? "");
103
+ const fastHtml = useMemo(() => {
104
+ const parser2 = new Marked({ gfm: true, breaks: true });
105
+ return libExports.filterXSS(parser2.parse(src), xssOptions);
106
+ }, [src]);
107
+ const [html, setHtml] = useState("");
108
+ useEffect(() => {
109
+ let cancelled = false;
110
+ void (async () => {
111
+ if (!hasCodeBlocks(src)) {
112
+ if (!cancelled) setHtml(fastHtml);
113
+ return;
114
+ }
115
+ const [mhMod, hljs] = await Promise.all([
116
+ import("../../node_modules/.pnpm/marked-highlight@2.2.2_marked@15.0.12/node_modules/marked-highlight/src/index.js"),
117
+ prepareHljs(extractFenceLangs(src), codeTheme)
118
+ ]);
119
+ const markedHighlight = (
120
+ // support both module shapes
121
+ mhMod.markedHighlight ?? mhMod.default
122
+ );
123
+ if (typeof markedHighlight !== "function") {
124
+ console.error(
125
+ "[RichText] marked-highlight not resolved; no code styling will be applied."
126
+ );
127
+ }
128
+ const parser2 = new Marked(
129
+ markedHighlight({
130
+ emptyLangClass: "hljs",
131
+ langPrefix: "hljs language-",
132
+ highlight(code, lang) {
133
+ try {
134
+ if (isString(lang) && hljs.getLanguage(lang)) {
135
+ return hljs.highlight(code, { language: lang }).value;
136
+ }
137
+ return hljs.highlightAuto(code).value;
138
+ } catch {
139
+ return code;
140
+ }
141
+ }
142
+ }),
143
+ { gfm: true, breaks: true }
144
+ );
145
+ const step1 = libExports.filterXSS(parser2.parse(src), xssOptions);
146
+ const hasRawBlocks = /<pre[^>]*>\s*<code[^>]*>/.test(step1) && !/<span[^>]+class="[^"]*hljs-/.test(step1);
147
+ if (!hasRawBlocks) {
148
+ if (!cancelled) setHtml(step1);
149
+ return;
150
+ }
151
+ const doc2 = new DOMParser().parseFromString(step1, "text/html");
152
+ doc2.querySelectorAll("pre code").forEach((codeEl) => {
153
+ var _a;
154
+ try {
155
+ const cls = codeEl.getAttribute("class") ?? "";
156
+ const m = cls.match(/language-([\w+-]+)/);
157
+ const lang = m == null ? void 0 : m[1];
158
+ const text = codeEl.textContent ?? "";
159
+ const html2 = isString(lang) && hljs.getLanguage(lang) ? hljs.highlight(text, { language: lang }).value : hljs.highlightAuto(text).value;
160
+ codeEl.innerHTML = html2;
161
+ codeEl.classList.add("hljs");
162
+ (_a = codeEl.closest("pre")) == null ? void 0 : _a.classList.add("hljs");
163
+ } catch {
164
+ }
165
+ });
166
+ const step2 = doc2.body.innerHTML;
167
+ if (!cancelled) setHtml(step2);
168
+ })();
169
+ return () => {
170
+ cancelled = true;
171
+ };
172
+ }, [src, fastHtml, codeTheme]);
173
+ const safeHtml = html || fastHtml;
43
174
  const VOID_TAGS = /* @__PURE__ */ new Set([
44
175
  "area",
45
176
  "base",
@@ -69,7 +200,9 @@ function RichTextClient({
69
200
  (child, i) => domNodeToReact(child, `${path}.${i}`)
70
201
  );
71
202
  const keyedChildren = normalize(
72
- childReactNodes.map((c, i) => isValidElement(c) ? withKey(c, `${path}.c${i}`) : c)
203
+ childReactNodes.map(
204
+ (c, i) => isValidElement(c) ? withKey(c, `${path}.c${i}`) : c
205
+ )
73
206
  );
74
207
  switch (tagName) {
75
208
  case "h1":
@@ -132,8 +265,22 @@ function RichTextClient({
132
265
  );
133
266
  }
134
267
  case "pre": {
135
- const cls = bem("pre");
136
- return /* @__PURE__ */ jsx("pre", { className: cls, children: keyedChildren });
268
+ const existing = elem.getAttribute("class");
269
+ return /* @__PURE__ */ jsx("pre", { className: [bem("pre"), existing].filter(Boolean).join(" "), children: keyedChildren });
270
+ }
271
+ case "code": {
272
+ const existing = elem.getAttribute("class");
273
+ return /* @__PURE__ */ jsx("code", { className: [bem("code"), existing].filter(Boolean).join(" "), children: keyedChildren });
274
+ }
275
+ case "blockquote": {
276
+ const existing = elem.getAttribute("class");
277
+ return /* @__PURE__ */ jsx(
278
+ "blockquote",
279
+ {
280
+ className: [bem("blockquote"), existing].filter(Boolean).join(" "),
281
+ children: keyedChildren
282
+ }
283
+ );
137
284
  }
138
285
  case "ul": {
139
286
  const cls = bem("ul");
@@ -141,7 +288,23 @@ function RichTextClient({
141
288
  }
142
289
  case "ol": {
143
290
  const cls = bem("ol");
144
- return /* @__PURE__ */ jsx("ol", { className: cls, children: keyedChildren });
291
+ const startAttr = elem.getAttribute("start");
292
+ const start = isString(startAttr) ? parseInt(startAttr, 10) || 1 : 1;
293
+ const liElems = Array.from(elem.children).filter(
294
+ (e) => e.tagName.toLowerCase() === "li"
295
+ );
296
+ return /* @__PURE__ */ jsx("ol", { className: cls, children: liElems.map((liEl, index) => {
297
+ const contentNodes = Array.from(liEl.childNodes).map(
298
+ (child, i) => domNodeToReact(child, `${path}.li${index}.${i}`)
299
+ );
300
+ return (
301
+ // eslint-disable-next-line react/no-array-index-key
302
+ /* @__PURE__ */ jsxs("li", { className: bem("li"), children: [
303
+ /* @__PURE__ */ jsx("i", { className: bem("ol__decimal"), children: start + index }),
304
+ /* @__PURE__ */ jsx("span", { className: bem("li__content"), children: normalize(contentNodes.map(renderAnimation)) })
305
+ ] }, `ol-li-${index}`)
306
+ );
307
+ }) });
145
308
  }
146
309
  case "li": {
147
310
  const cls = bem("li");
@@ -160,7 +323,10 @@ function RichTextClient({
160
323
  ] });
161
324
  }
162
325
  default: {
163
- const props2 = { className: bem(tagName) };
326
+ const existing = elem.getAttribute("class");
327
+ const props2 = {
328
+ className: [bem(tagName), existing].filter(Boolean).join(" ")
329
+ };
164
330
  if (tagName === "img") {
165
331
  props2.src = elem.getAttribute("src") ?? "";
166
332
  props2.alt = elem.getAttribute("alt") ?? "";
@@ -195,10 +361,14 @@ function RichTextClient({
195
361
  return /* @__PURE__ */ jsx(
196
362
  "div",
197
363
  {
364
+ ref: containerRef,
198
365
  className: bem(void 0, void 0, className),
199
366
  ...schema,
200
367
  ...props,
201
- children: topLevelChildren.map((n, i) => /* @__PURE__ */ jsx(Fragment, { children: domNodeToReact(n) }, `top-level-${i}`))
368
+ children: topLevelChildren.map((n, i) => (
369
+ // eslint-disable-next-line react/no-array-index-key
370
+ /* @__PURE__ */ jsx(Fragment, { children: domNodeToReact(n) }, `top-level-${i}`)
371
+ ))
202
372
  }
203
373
  );
204
374
  }
@@ -1,8 +1,8 @@
1
1
  const styles = {
2
2
  "prokodo-RichText__a": "prokodo-RichText__a",
3
- "prokodo-RichText": "prokodo-RichText",
4
3
  "prokodo-RichText__p": "prokodo-RichText__p",
5
4
  "prokodo-RichText__pre": "prokodo-RichText__pre",
5
+ "prokodo-RichText__blockquote": "prokodo-RichText__blockquote",
6
6
  "prokodo-RichText__ul": "prokodo-RichText__ul",
7
7
  "prokodo-RichText__ol": "prokodo-RichText__ol",
8
8
  "prokodo-RichText__li": "prokodo-RichText__li",