@apify/ui-library 0.57.3 → 0.59.0

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 (265) hide show
  1. package/.eslintrc +1 -0
  2. package/CHANGELOG.md +22 -0
  3. package/dist/src/components/action_link.d.ts +1 -1
  4. package/dist/src/components/action_link.d.ts.map +1 -1
  5. package/dist/src/components/{action_link.jsx → action_link.js} +6 -12
  6. package/dist/src/components/action_link.js.map +1 -0
  7. package/dist/src/components/{actor_template_card.jsx → actor_template_card.js} +5 -13
  8. package/dist/src/components/actor_template_card.js.map +1 -0
  9. package/dist/src/components/badge.d.ts +1 -1
  10. package/dist/src/components/badge.d.ts.map +1 -1
  11. package/dist/src/components/{badge.jsx → badge.js} +5 -7
  12. package/dist/src/components/badge.js.map +1 -0
  13. package/dist/src/components/{banner.jsx → banner.js} +3 -5
  14. package/dist/src/components/banner.js.map +1 -0
  15. package/dist/src/components/blog_article.d.ts +1 -1
  16. package/dist/src/components/blog_article.d.ts.map +1 -1
  17. package/dist/src/components/{blog_article.jsx → blog_article.js} +3 -7
  18. package/dist/src/components/blog_article.js.map +1 -0
  19. package/dist/src/components/{box.jsx → box.js} +4 -3
  20. package/dist/src/components/box.js.map +1 -0
  21. package/dist/src/components/button.d.ts +2 -2
  22. package/dist/src/components/button.d.ts.map +1 -1
  23. package/dist/src/components/{button.jsx → button.js} +12 -19
  24. package/dist/src/components/button.js.map +1 -0
  25. package/dist/src/components/chip.d.ts +1 -1
  26. package/dist/src/components/chip.d.ts.map +1 -1
  27. package/dist/src/components/{chip.jsx → chip.js} +9 -8
  28. package/dist/src/components/chip.js.map +1 -0
  29. package/dist/src/components/code/action_button.d.ts +2 -2
  30. package/dist/src/components/code/action_button.d.ts.map +1 -1
  31. package/dist/src/components/code/{action_button.jsx → action_button.js} +4 -8
  32. package/dist/src/components/code/action_button.js.map +1 -0
  33. package/dist/src/components/code/code_block/code_block.d.ts +2 -2
  34. package/dist/src/components/code/code_block/code_block.d.ts.map +1 -1
  35. package/dist/src/components/code/code_block/code_block.js +69 -0
  36. package/dist/src/components/code/code_block/code_block.js.map +1 -0
  37. package/dist/src/components/code/code_block/code_block.styled.d.ts +2 -2
  38. package/dist/src/components/code/code_block/code_block.styled.d.ts.map +1 -1
  39. package/dist/src/components/code/code_block/{code_block.styled.jsx → code_block.styled.js} +2 -2
  40. package/dist/src/components/code/code_block/code_block.styled.js.map +1 -0
  41. package/dist/src/components/code/index.d.ts +3 -3
  42. package/dist/src/components/code/index.d.ts.map +1 -1
  43. package/dist/src/components/code/index.js +3 -3
  44. package/dist/src/components/code/index.js.map +1 -1
  45. package/dist/src/components/code/inline_code/inline_code.d.ts +2 -2
  46. package/dist/src/components/code/inline_code/inline_code.d.ts.map +1 -1
  47. package/dist/src/components/code/inline_code/{inline_code.jsx → inline_code.js} +3 -7
  48. package/dist/src/components/code/inline_code/inline_code.js.map +1 -0
  49. package/dist/src/components/code/one_line_code/one_line_code.d.ts +3 -4
  50. package/dist/src/components/code/one_line_code/one_line_code.d.ts.map +1 -1
  51. package/dist/src/components/code/one_line_code/{one_line_code.jsx → one_line_code.js} +6 -26
  52. package/dist/src/components/code/one_line_code/one_line_code.js.map +1 -0
  53. package/dist/src/components/code/syntax_highlighter.d.ts +3 -4
  54. package/dist/src/components/code/syntax_highlighter.d.ts.map +1 -1
  55. package/dist/src/components/code/{syntax_highlighter.jsx → syntax_highlighter.js} +7 -8
  56. package/dist/src/components/code/syntax_highlighter.js.map +1 -0
  57. package/dist/src/components/{color_wheel_gradient.jsx → color_wheel_gradient.js} +1 -1
  58. package/dist/src/components/color_wheel_gradient.js.map +1 -0
  59. package/dist/src/components/floating/index.d.ts +3 -3
  60. package/dist/src/components/floating/index.d.ts.map +1 -1
  61. package/dist/src/components/floating/index.js +3 -3
  62. package/dist/src/components/floating/index.js.map +1 -1
  63. package/dist/src/components/floating/menu.d.ts +2 -2
  64. package/dist/src/components/floating/menu.d.ts.map +1 -1
  65. package/dist/src/components/floating/{menu.jsx → menu.js} +22 -34
  66. package/dist/src/components/floating/menu.js.map +1 -0
  67. package/dist/src/components/floating/{menu_common.jsx → menu_common.js} +1 -1
  68. package/dist/src/components/floating/menu_common.js.map +1 -0
  69. package/dist/src/components/floating/menu_components.d.ts +4 -5
  70. package/dist/src/components/floating/menu_components.d.ts.map +1 -1
  71. package/dist/src/components/floating/{menu_components.jsx → menu_components.js} +5 -7
  72. package/dist/src/components/floating/menu_components.js.map +1 -0
  73. package/dist/src/components/image.d.ts +2 -3
  74. package/dist/src/components/image.d.ts.map +1 -1
  75. package/dist/src/components/image.js +9 -0
  76. package/dist/src/components/image.js.map +1 -0
  77. package/dist/src/components/index.d.ts +14 -14
  78. package/dist/src/components/index.d.ts.map +1 -1
  79. package/dist/src/components/index.js +14 -14
  80. package/dist/src/components/index.js.map +1 -1
  81. package/dist/src/components/link.d.ts +1 -1
  82. package/dist/src/components/link.d.ts.map +1 -1
  83. package/dist/src/components/{link.jsx → link.js} +9 -9
  84. package/dist/src/components/link.js.map +1 -0
  85. package/dist/src/components/message.d.ts +5 -5
  86. package/dist/src/components/message.d.ts.map +1 -1
  87. package/dist/src/components/{message.jsx → message.js} +9 -19
  88. package/dist/src/components/message.js.map +1 -0
  89. package/dist/src/components/rating.d.ts +1 -1
  90. package/dist/src/components/rating.d.ts.map +1 -1
  91. package/dist/src/components/{rating.jsx → rating.js} +10 -16
  92. package/dist/src/components/rating.js.map +1 -0
  93. package/dist/src/components/readme_renderer/index.d.ts +2 -2
  94. package/dist/src/components/readme_renderer/index.d.ts.map +1 -1
  95. package/dist/src/components/readme_renderer/index.js +2 -2
  96. package/dist/src/components/readme_renderer/index.js.map +1 -1
  97. package/dist/src/components/readme_renderer/table_of_contents.d.ts +1 -1
  98. package/dist/src/components/readme_renderer/{table_of_contents.jsx → table_of_contents.js} +44 -49
  99. package/dist/src/components/readme_renderer/{table_of_contents.jsx.map → table_of_contents.js.map} +1 -1
  100. package/dist/src/components/readme_renderer/{utils.jsx → utils.js} +1 -1
  101. package/dist/src/components/readme_renderer/utils.js.map +1 -0
  102. package/dist/src/components/simple_markdown/index.d.ts +2 -2
  103. package/dist/src/components/simple_markdown/index.d.ts.map +1 -1
  104. package/dist/src/components/simple_markdown/index.js +2 -2
  105. package/dist/src/components/simple_markdown/index.js.map +1 -1
  106. package/dist/src/components/simple_markdown/simple_markdown.d.ts +1 -1
  107. package/dist/src/components/simple_markdown/simple_markdown.d.ts.map +1 -1
  108. package/dist/src/components/simple_markdown/simple_markdown.js +161 -0
  109. package/dist/src/components/simple_markdown/simple_markdown.js.map +1 -0
  110. package/dist/src/components/simple_markdown/simple_markdown_components.d.ts +4 -4
  111. package/dist/src/components/simple_markdown/simple_markdown_components.d.ts.map +1 -1
  112. package/dist/src/components/simple_markdown/{simple_markdown_components.jsx → simple_markdown_components.js} +13 -26
  113. package/dist/src/components/simple_markdown/simple_markdown_components.js.map +1 -0
  114. package/dist/src/components/tag.d.ts +3 -3
  115. package/dist/src/components/tag.d.ts.map +1 -1
  116. package/dist/src/components/{tag.jsx → tag.js} +6 -9
  117. package/dist/src/components/tag.js.map +1 -0
  118. package/dist/src/components/text/heading_content.d.ts +1 -1
  119. package/dist/src/components/text/heading_content.d.ts.map +1 -1
  120. package/dist/src/components/text/{heading_content.jsx → heading_content.js} +4 -4
  121. package/dist/src/components/text/heading_content.js.map +1 -0
  122. package/dist/src/components/text/heading_marketing.d.ts +1 -1
  123. package/dist/src/components/text/heading_marketing.d.ts.map +1 -1
  124. package/dist/src/components/text/{heading_marketing.jsx → heading_marketing.js} +4 -4
  125. package/dist/src/components/text/heading_marketing.js.map +1 -0
  126. package/dist/src/components/text/heading_shared.d.ts +1 -1
  127. package/dist/src/components/text/heading_shared.d.ts.map +1 -1
  128. package/dist/src/components/text/{heading_shared.jsx → heading_shared.js} +4 -4
  129. package/dist/src/components/text/heading_shared.js.map +1 -0
  130. package/dist/src/components/text/index.d.ts +8 -8
  131. package/dist/src/components/text/index.d.ts.map +1 -1
  132. package/dist/src/components/text/index.js +7 -7
  133. package/dist/src/components/text/index.js.map +1 -1
  134. package/dist/src/components/text/text_base.d.ts +1 -1
  135. package/dist/src/components/text/text_base.d.ts.map +1 -1
  136. package/dist/src/components/text/{text_base.jsx → text_base.js} +4 -4
  137. package/dist/src/components/text/text_base.js.map +1 -0
  138. package/dist/src/components/text/text_content.d.ts +2 -3
  139. package/dist/src/components/text/text_content.d.ts.map +1 -1
  140. package/dist/src/components/text/{text_content.jsx → text_content.js} +10 -9
  141. package/dist/src/components/text/text_content.js.map +1 -0
  142. package/dist/src/components/text/text_marketing.d.ts +2 -3
  143. package/dist/src/components/text/text_marketing.d.ts.map +1 -1
  144. package/dist/src/components/text/{text_marketing.jsx → text_marketing.js} +10 -9
  145. package/dist/src/components/text/text_marketing.js.map +1 -0
  146. package/dist/src/components/text/text_shared.d.ts +2 -3
  147. package/dist/src/components/text/text_shared.d.ts.map +1 -1
  148. package/dist/src/components/text/{text_shared.jsx → text_shared.js} +10 -9
  149. package/dist/src/components/text/text_shared.js.map +1 -0
  150. package/dist/src/components/tile/{horizontal_tile.jsx → horizontal_tile.js} +3 -7
  151. package/dist/src/components/tile/horizontal_tile.js.map +1 -0
  152. package/dist/src/components/tile/index.d.ts +2 -2
  153. package/dist/src/components/tile/index.d.ts.map +1 -1
  154. package/dist/src/components/tile/index.js +2 -2
  155. package/dist/src/components/tile/index.js.map +1 -1
  156. package/dist/src/components/tile/{vertical_tile.jsx → vertical_tile.js} +3 -5
  157. package/dist/src/components/tile/vertical_tile.js.map +1 -0
  158. package/dist/src/components/to_consolidate/card.d.ts +1 -1
  159. package/dist/src/components/to_consolidate/card.d.ts.map +1 -1
  160. package/dist/src/components/to_consolidate/{card.jsx → card.js} +5 -13
  161. package/dist/src/components/to_consolidate/card.js.map +1 -0
  162. package/dist/src/components/to_consolidate/index.d.ts +4 -4
  163. package/dist/src/components/to_consolidate/index.d.ts.map +1 -1
  164. package/dist/src/components/to_consolidate/index.js +4 -4
  165. package/dist/src/components/to_consolidate/index.js.map +1 -1
  166. package/dist/src/components/to_consolidate/markdown.d.ts +1 -1
  167. package/dist/src/components/to_consolidate/markdown.d.ts.map +1 -1
  168. package/dist/src/components/to_consolidate/{markdown.jsx → markdown.js} +21 -33
  169. package/dist/src/components/to_consolidate/markdown.js.map +1 -0
  170. package/dist/src/components/to_consolidate/{pagination.jsx → pagination.js} +14 -27
  171. package/dist/src/components/to_consolidate/pagination.js.map +1 -0
  172. package/dist/src/components/to_consolidate/{tab_number_chip.jsx → tab_number_chip.js} +3 -5
  173. package/dist/src/components/to_consolidate/tab_number_chip.js.map +1 -0
  174. package/dist/src/index.d.ts +1 -1
  175. package/dist/src/index.d.ts.map +1 -1
  176. package/dist/src/index.js +1 -1
  177. package/dist/src/index.js.map +1 -1
  178. package/dist/src/{ui_dependency_provider.jsx → ui_dependency_provider.js} +4 -5
  179. package/dist/src/ui_dependency_provider.js.map +1 -0
  180. package/dist/tsconfig.build.tsbuildinfo +1 -1
  181. package/package.json +5 -3
  182. package/src/components/action_link.tsx +2 -2
  183. package/src/components/actor_template_card.tsx +1 -1
  184. package/src/components/badge.tsx +1 -1
  185. package/src/components/button.tsx +3 -3
  186. package/src/components/chip.tsx +1 -1
  187. package/src/components/code/code_block/code_block.styled.tsx +2 -2
  188. package/src/components/code/code_block/code_block.tsx +6 -6
  189. package/src/components/code/index.ts +3 -3
  190. package/src/components/code/inline_code/inline_code.tsx +2 -2
  191. package/src/components/code/one_line_code/one_line_code.tsx +6 -6
  192. package/src/components/code/syntax_highlighter.tsx +4 -4
  193. package/src/components/floating/index.ts +3 -3
  194. package/src/components/floating/menu.tsx +3 -3
  195. package/src/components/floating/menu_components.tsx +2 -2
  196. package/src/components/image.tsx +3 -3
  197. package/src/components/index.ts +14 -14
  198. package/src/components/link.tsx +2 -2
  199. package/src/components/message.tsx +2 -2
  200. package/src/components/rating.tsx +3 -3
  201. package/src/components/readme_renderer/index.ts +2 -2
  202. package/src/components/readme_renderer/table_of_contents.tsx +2 -2
  203. package/src/components/simple_markdown/index.ts +2 -2
  204. package/src/components/simple_markdown/simple_markdown.tsx +45 -12
  205. package/src/components/simple_markdown/simple_markdown_components.tsx +6 -6
  206. package/src/components/tag.tsx +2 -2
  207. package/src/components/text/heading_content.tsx +2 -2
  208. package/src/components/text/heading_marketing.tsx +2 -2
  209. package/src/components/text/heading_shared.tsx +2 -2
  210. package/src/components/text/index.ts +8 -8
  211. package/src/components/text/text_base.tsx +2 -2
  212. package/src/components/text/text_content.tsx +3 -3
  213. package/src/components/text/text_marketing.tsx +3 -3
  214. package/src/components/text/text_shared.tsx +3 -3
  215. package/src/components/tile/index.ts +2 -2
  216. package/src/components/to_consolidate/card.tsx +2 -2
  217. package/src/components/to_consolidate/index.ts +4 -4
  218. package/src/components/to_consolidate/markdown.tsx +1 -1
  219. package/src/components/to_consolidate/pagination.tsx +3 -3
  220. package/src/index.ts +1 -1
  221. package/tsconfig.build.json +1 -1
  222. package/tsconfig.json +1 -1
  223. package/dist/src/components/action_link.jsx.map +0 -1
  224. package/dist/src/components/actor_template_card.jsx.map +0 -1
  225. package/dist/src/components/badge.jsx.map +0 -1
  226. package/dist/src/components/banner.jsx.map +0 -1
  227. package/dist/src/components/blog_article.jsx.map +0 -1
  228. package/dist/src/components/box.jsx.map +0 -1
  229. package/dist/src/components/button.jsx.map +0 -1
  230. package/dist/src/components/chip.jsx.map +0 -1
  231. package/dist/src/components/code/action_button.jsx.map +0 -1
  232. package/dist/src/components/code/code_block/code_block.jsx +0 -99
  233. package/dist/src/components/code/code_block/code_block.jsx.map +0 -1
  234. package/dist/src/components/code/code_block/code_block.styled.jsx.map +0 -1
  235. package/dist/src/components/code/inline_code/inline_code.jsx.map +0 -1
  236. package/dist/src/components/code/one_line_code/one_line_code.jsx.map +0 -1
  237. package/dist/src/components/code/syntax_highlighter.jsx.map +0 -1
  238. package/dist/src/components/color_wheel_gradient.jsx.map +0 -1
  239. package/dist/src/components/floating/menu.jsx.map +0 -1
  240. package/dist/src/components/floating/menu_common.jsx.map +0 -1
  241. package/dist/src/components/floating/menu_components.jsx.map +0 -1
  242. package/dist/src/components/image.jsx +0 -8
  243. package/dist/src/components/image.jsx.map +0 -1
  244. package/dist/src/components/link.jsx.map +0 -1
  245. package/dist/src/components/message.jsx.map +0 -1
  246. package/dist/src/components/rating.jsx.map +0 -1
  247. package/dist/src/components/readme_renderer/utils.jsx.map +0 -1
  248. package/dist/src/components/simple_markdown/simple_markdown.jsx +0 -137
  249. package/dist/src/components/simple_markdown/simple_markdown.jsx.map +0 -1
  250. package/dist/src/components/simple_markdown/simple_markdown_components.jsx.map +0 -1
  251. package/dist/src/components/tag.jsx.map +0 -1
  252. package/dist/src/components/text/heading_content.jsx.map +0 -1
  253. package/dist/src/components/text/heading_marketing.jsx.map +0 -1
  254. package/dist/src/components/text/heading_shared.jsx.map +0 -1
  255. package/dist/src/components/text/text_base.jsx.map +0 -1
  256. package/dist/src/components/text/text_content.jsx.map +0 -1
  257. package/dist/src/components/text/text_marketing.jsx.map +0 -1
  258. package/dist/src/components/text/text_shared.jsx.map +0 -1
  259. package/dist/src/components/tile/horizontal_tile.jsx.map +0 -1
  260. package/dist/src/components/tile/vertical_tile.jsx.map +0 -1
  261. package/dist/src/components/to_consolidate/card.jsx.map +0 -1
  262. package/dist/src/components/to_consolidate/markdown.jsx.map +0 -1
  263. package/dist/src/components/to_consolidate/pagination.jsx.map +0 -1
  264. package/dist/src/components/to_consolidate/tab_number_chip.jsx.map +0 -1
  265. package/dist/src/ui_dependency_provider.jsx.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apify/ui-library",
3
- "version": "0.57.3",
3
+ "version": "0.59.0",
4
4
  "description": "React UI library used by apify.com",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -41,7 +41,9 @@
41
41
  "rehype-sanitize": "^6.0.0",
42
42
  "remark-gfm": "^3.0.1",
43
43
  "remark-toc": "8.0.1",
44
- "slugify": "^1.6.6"
44
+ "slugify": "^1.6.6",
45
+ "unified": "^10.0.0",
46
+ "unist-util-visit": "^5.0.0"
45
47
  },
46
48
  "peerDependencies": {
47
49
  "react": "17.x || 18.x",
@@ -65,5 +67,5 @@
65
67
  "recast": "^0.23.9",
66
68
  "typescript": "^5.1.6"
67
69
  },
68
- "gitHead": "1bd900e3e849d7be1b4d22470b34bf45b56c3a2f"
70
+ "gitHead": "aff5f2f1a3db4fa021ade9588f4d923e59527e8b"
69
71
  }
@@ -4,8 +4,8 @@ import styled from 'styled-components';
4
4
  import { ArrowLeftIcon, ArrowRightIcon } from '@apify/ui-icons';
5
5
 
6
6
  import { theme } from '../design_system/theme.js';
7
- import { Box } from './box.jsx';
8
- import { Link, type LinkProps } from './link.jsx';
7
+ import { Box } from './box.js';
8
+ import { Link, type LinkProps } from './link.js';
9
9
  import { Heading } from './text/index.js';
10
10
 
11
11
  const StyledGuidepost = styled(Box)<{ $isBackLink: boolean }>`
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import styled from 'styled-components';
3
3
 
4
4
  import { theme } from '../design_system/theme.js';
5
- import { TextBaseComponent } from './text/text_base.jsx';
5
+ import { TextBaseComponent } from './text/text_base.js';
6
6
  import { VerticalTile } from './tile/index.js';
7
7
 
8
8
  interface ActorTemplateCardProps {
@@ -5,7 +5,7 @@ import type { IconComponent, IconSize } from '@apify/ui-icons';
5
5
 
6
6
  import { theme } from '../design_system/theme.js';
7
7
  import type { WithTransientProps } from '../type_utils.js';
8
- import { type RegularBoxProps, type MarginSpacingProps, Box } from './box.jsx';
8
+ import { type RegularBoxProps, type MarginSpacingProps, Box } from './box.js';
9
9
 
10
10
  type BadgeSize = typeof BADGE_SIZES[number];
11
11
 
@@ -5,9 +5,9 @@ import { ExternalLinkIcon } from '@apify/ui-icons';
5
5
 
6
6
  import { theme } from '../design_system/theme.js';
7
7
  import { type WithRequired, type WithTransientProps } from '../type_utils.js';
8
- import { useSharedUiDependencies } from '../ui_dependency_provider.jsx';
9
- import { Box, type RegularBoxProps, type MarginSpacingProps } from './box.jsx';
10
- import { Link, isUrlExternal, type LinkProps } from './link.jsx';
8
+ import { useSharedUiDependencies } from '../ui_dependency_provider.js';
9
+ import { Box, type RegularBoxProps, type MarginSpacingProps } from './box.js';
10
+ import { Link, isUrlExternal, type LinkProps } from './link.js';
11
11
 
12
12
  type ButtonSize = 'medium' | 'small';
13
13
  type ButtonColor = 'default' | 'success' | 'danger';
@@ -6,7 +6,7 @@ import styled, { css } from 'styled-components';
6
6
  import type { ValueOf } from '@apify-packages/types';
7
7
 
8
8
  import { theme } from '../design_system/theme.js';
9
- import type { RegularBoxProps } from './box.jsx';
9
+ import type { RegularBoxProps } from './box.js';
10
10
 
11
11
  const CHIP_SIZES = {
12
12
  SMALL: 'S',
@@ -1,8 +1,8 @@
1
1
  import styled, { css } from 'styled-components';
2
2
 
3
3
  import { theme } from '../../../design_system/theme.js';
4
- import type { SharedTextSize } from '../../text/text_shared.jsx';
5
- import { SyntaxHighlighterBaseStylesWrapper } from '../syntax_highlighter.jsx';
4
+ import type { SharedTextSize } from '../../text/text_shared.js';
5
+ import { SyntaxHighlighterBaseStylesWrapper } from '../syntax_highlighter.js';
6
6
 
7
7
  const HIGHLIGHT_BACKGROUND_COLOR = 'rgba(22, 114, 235, 0.05)';
8
8
 
@@ -2,13 +2,13 @@ import clsx from 'clsx';
2
2
  import React, { useCallback, useMemo, useRef, useState } from 'react';
3
3
 
4
4
  import type { RegularBoxProps } from '../../box.js';
5
- import { ColorWheelGradient } from '../../color_wheel_gradient.jsx';
6
- import { Link } from '../../link.jsx';
5
+ import { ColorWheelGradient } from '../../color_wheel_gradient.js';
6
+ import { Link } from '../../link.js';
7
7
  import { Text } from '../../text/index.js';
8
- import type { SharedTextSize } from '../../text/text_shared.jsx';
9
- import { ActionButton, CopyButton } from '../action_button.jsx';
10
- import SyntaxHighlighter from '../syntax_highlighter.jsx';
11
- import { CodeBlockWrapper } from './code_block.styled.jsx';
8
+ import type { SharedTextSize } from '../../text/text_shared.js';
9
+ import { ActionButton, CopyButton } from '../action_button.js';
10
+ import SyntaxHighlighter from '../syntax_highlighter.js';
11
+ import { CodeBlockWrapper } from './code_block.styled.js';
12
12
  import { mapPrefixToBashLine } from './utils.js';
13
13
 
14
14
  function HeaderDots() {
@@ -1,3 +1,3 @@
1
- export * from './code_block/code_block.jsx';
2
- export * from './one_line_code/one_line_code.jsx';
3
- export * from './inline_code/inline_code.jsx';
1
+ export * from './code_block/code_block.js';
2
+ export * from './one_line_code/one_line_code.js';
3
+ export * from './inline_code/inline_code.js';
@@ -2,9 +2,9 @@ import React from 'react';
2
2
  import styled, { css } from 'styled-components';
3
3
 
4
4
  import { theme } from '../../../design_system/theme.js';
5
- import type { RegularBoxProps } from '../../box.jsx';
5
+ import type { RegularBoxProps } from '../../box.js';
6
6
  import { Text } from '../../text/index.js';
7
- import type { SharedTextSize } from '../../text/text_shared.jsx';
7
+ import type { SharedTextSize } from '../../text/text_shared.js';
8
8
 
9
9
  // TODO: We should not need to export these once we consolidate Markdown
10
10
  export const inlineCodeStyles = css`
@@ -1,15 +1,15 @@
1
- import React, { useMemo, useState } from 'react';
1
+ import { useMemo, useState } from 'react';
2
2
  import styled, { css } from 'styled-components';
3
3
 
4
4
  import { EyeIcon, EyeOffIcon } from '@apify/ui-icons';
5
5
 
6
6
  import { theme } from '../../../design_system/theme.js';
7
- import type { BoxProps } from '../../box.jsx';
7
+ import type { BoxProps } from '../../box.js';
8
8
  import { Text } from '../../text/index.js';
9
- import type { SharedTextSize } from '../../text/text_shared.jsx';
10
- import { ActionButton, CopyButton } from '../action_button.jsx';
11
- import SyntaxHighlighter, { SyntaxHighlighterBaseStylesWrapper } from '../syntax_highlighter.jsx';
12
- import type { SyntaxHighlighterBaseStylesWrapperProps } from '../syntax_highlighter.jsx';
9
+ import type { SharedTextSize } from '../../text/text_shared.js';
10
+ import { ActionButton, CopyButton } from '../action_button.js';
11
+ import SyntaxHighlighter, { SyntaxHighlighterBaseStylesWrapper } from '../syntax_highlighter.js';
12
+ import type { SyntaxHighlighterBaseStylesWrapperProps } from '../syntax_highlighter.js';
13
13
 
14
14
  export const oneLineCodeClassNames = {
15
15
  gradientWrapper: 'OneLineCode-GradientWrapper',
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable @typescript-eslint/ban-ts-comment */
2
- import React, { forwardRef } from 'react';
2
+ import { forwardRef } from 'react';
3
3
  // https://github.com/react-syntax-highlighter/react-syntax-highlighter/issues/228
4
4
  import type { SyntaxHighlighterProps as ReactSyntaxHighlighterProps } from 'react-syntax-highlighter';
5
5
  // @ts-ignore The library is badly typed and does not export the type
@@ -32,10 +32,10 @@ import light from 'react-syntax-highlighter/dist/esm/styles/prism/prism.js';
32
32
  import styled, { css } from 'styled-components';
33
33
 
34
34
  import { theme } from '../../design_system/theme.js';
35
- import { useSharedUiDependencies } from '../../ui_dependency_provider.jsx';
36
- import { Box } from '../box.jsx';
35
+ import { useSharedUiDependencies } from '../../ui_dependency_provider.js';
36
+ import { Box } from '../box.js';
37
37
  import { Text, type SharedTextProps } from '../text/index.js';
38
- import type { SharedTextSize } from '../text/text_shared.jsx';
38
+ import type { SharedTextSize } from '../text/text_shared.js';
39
39
 
40
40
  ReactSyntaxHighlighter.registerLanguage('typescript', ts);
41
41
  ReactSyntaxHighlighter.registerLanguage('javascript', js);
@@ -1,3 +1,3 @@
1
- export * from './menu.jsx';
2
- export * from './menu_components.jsx';
3
- export * from './menu_common.jsx';
1
+ export * from './menu.js';
2
+ export * from './menu_components.js';
3
+ export * from './menu_common.js';
@@ -18,14 +18,14 @@ import React, {
18
18
  import {
19
19
  Box,
20
20
  type BoxProps,
21
- } from '../box.jsx';
21
+ } from '../box.js';
22
22
  import { Text } from '../text/index.js';
23
- import { useFloatingMenu } from './menu_common.jsx';
23
+ import { useFloatingMenu } from './menu_common.js';
24
24
  import {
25
25
  DropdownMenuBaseComponent,
26
26
  ListMenuComponent,
27
27
  ListMenuItemComponent,
28
- } from './menu_components.jsx';
28
+ } from './menu_components.js';
29
29
 
30
30
  export const menuClassNames = {
31
31
  WRAPPER: 'menu-wrapper',
@@ -2,13 +2,13 @@ import {
2
2
  type UseFloatingReturn,
3
3
  type ReferenceType,
4
4
  } from '@floating-ui/react';
5
- import React, { forwardRef } from 'react';
5
+ import { forwardRef } from 'react';
6
6
  import styled, { css } from 'styled-components';
7
7
 
8
8
  import { ChevronDownIcon } from '@apify/ui-icons';
9
9
 
10
10
  import { theme } from '../../design_system/theme.js';
11
- import { Box } from '../box.jsx';
11
+ import { Box } from '../box.js';
12
12
 
13
13
  export type FloatingContext = Pick<UseFloatingReturn<ReferenceType>, 'context'>['context'];
14
14
 
@@ -1,7 +1,7 @@
1
- import React, { forwardRef } from 'react';
1
+ import { forwardRef } from 'react';
2
2
 
3
- import { useSharedUiDependencies } from '../ui_dependency_provider.jsx';
4
- import { Box, type BoxProps } from './box.jsx';
3
+ import { useSharedUiDependencies } from '../ui_dependency_provider.js';
4
+ import { Box, type BoxProps } from './box.js';
5
5
 
6
6
  type ImageProps = {
7
7
  src: string,
@@ -1,21 +1,21 @@
1
1
  export * from './text/index.js';
2
- export * from './box.jsx';
3
- export * from './message.jsx';
2
+ export * from './box.js';
3
+ export * from './message.js';
4
4
  export * from './floating/index.js';
5
- export * from './button.jsx';
6
- export * from './link.jsx';
7
- export * from './action_link.jsx';
5
+ export * from './button.js';
6
+ export * from './link.js';
7
+ export * from './action_link.js';
8
8
  export * from './simple_markdown/index.js';
9
9
  export * from './code/index.js';
10
- export * from './color_wheel_gradient.jsx';
10
+ export * from './color_wheel_gradient.js';
11
11
  export * from './readme_renderer/index.js';
12
12
  export * from './to_consolidate/index.js';
13
13
  export * from './tile/index.js';
14
- export * from './blog_article.jsx';
15
- export * from './banner.jsx';
16
- export * from './actor_template_card.jsx';
17
- export * from './chip.jsx';
18
- export * from './image.jsx';
19
- export * from './rating.jsx';
20
- export * from './badge.jsx';
21
- export * from './tag.jsx';
14
+ export * from './blog_article.js';
15
+ export * from './banner.js';
16
+ export * from './actor_template_card.js';
17
+ export * from './chip.js';
18
+ export * from './image.js';
19
+ export * from './rating.js';
20
+ export * from './badge.js';
21
+ export * from './tag.js';
@@ -6,8 +6,8 @@ import styled from 'styled-components';
6
6
  import { ExternalLinkIcon } from '@apify/ui-icons';
7
7
 
8
8
  import { theme } from '../design_system/theme.js';
9
- import { useSharedUiDependencies } from '../ui_dependency_provider.jsx';
10
- import { Box, type BoxProps } from './box.jsx';
9
+ import { useSharedUiDependencies } from '../ui_dependency_provider.js';
10
+ import { Box, type BoxProps } from './box.js';
11
11
 
12
12
  export type To = string | Partial<Path>;
13
13
  export interface RegularLinkProps {
@@ -5,8 +5,8 @@ import styled from 'styled-components';
5
5
  import { CheckCircleIcon, CrossIcon, InfoIcon, WarningTriangleIcon } from '@apify/ui-icons';
6
6
 
7
7
  import { theme } from '../design_system/theme.js';
8
- import { Box, type BoxProps } from './box.jsx';
9
- import { Button } from './button.jsx';
8
+ import { Box, type BoxProps } from './box.js';
9
+ import { Button } from './button.js';
10
10
  import { Heading } from './text/index.js';
11
11
 
12
12
  export const messageClassNames = {
@@ -1,5 +1,5 @@
1
1
  import type { FC } from 'react';
2
- import React, { Fragment, useMemo } from 'react';
2
+ import { Fragment, useMemo } from 'react';
3
3
  import styled from 'styled-components';
4
4
 
5
5
  import { StarEmptyIcon, StarFullIcon, StarHalfIcon } from '@apify/ui-icons';
@@ -7,8 +7,8 @@ import { StarEmptyIcon, StarFullIcon, StarHalfIcon } from '@apify/ui-icons';
7
7
  import type { ReviewRating } from '@apify-packages/types';
8
8
 
9
9
  import { theme } from '../design_system/theme.js';
10
- import type { BoxProps } from './box.jsx';
11
- import { Box } from './box.jsx';
10
+ import type { BoxProps } from './box.js';
11
+ import { Box } from './box.js';
12
12
  import { Text } from './text/index.js';
13
13
 
14
14
  type RatingStatsProps = {
@@ -1,3 +1,3 @@
1
- export { useActorTitleHeadingFilter } from './utils.jsx';
1
+ export { useActorTitleHeadingFilter } from './utils.js';
2
2
  export { default as pythonizeValue } from './pythonize_value.js';
3
- export { default as TableOfContents } from './table_of_contents.jsx';
3
+ export { default as TableOfContents } from './table_of_contents.js';
@@ -10,9 +10,9 @@ import styled from 'styled-components';
10
10
 
11
11
  import { theme } from '../../design_system/theme.js';
12
12
  import { inlineCodeStyles } from '../code/index.js';
13
- import { Link } from '../link.jsx';
13
+ import { Link } from '../link.js';
14
14
  import { Text } from '../text/index.js';
15
- import { cleanMarkdown, slugifyHeadingChildren } from './utils.jsx';
15
+ import { cleanMarkdown, slugifyHeadingChildren } from './utils.js';
16
16
 
17
17
  const TOC_HEADING_ID = 'Contents';
18
18
 
@@ -1,2 +1,2 @@
1
- export * from './simple_markdown.jsx';
2
- export * from './simple_markdown_components.jsx';
1
+ export * from './simple_markdown.js';
2
+ export * from './simple_markdown_components.js';
@@ -1,3 +1,4 @@
1
+ import type { Root, Element, Text as TextNode } from 'hast';
1
2
  import React, { useCallback, useMemo, useRef } from 'react';
2
3
  import type { Components } from 'react-markdown';
3
4
  import ReactMarkdown, { uriTransformer } from 'react-markdown';
@@ -6,21 +7,23 @@ import rehypeRaw from 'rehype-raw';
6
7
  import rehypeSanitize from 'rehype-sanitize';
7
8
  import remarkGfm from 'remark-gfm';
8
9
  import styled from 'styled-components';
10
+ import type { Pluggable, PluggableList } from 'unified';
11
+ import { visit } from 'unist-util-visit';
9
12
 
10
13
  import { theme } from '../../design_system/theme.js';
11
- import { useSharedUiDependencies } from '../../ui_dependency_provider.jsx';
12
- import { Box } from '../box.jsx';
13
- import { isUrlExternal } from '../link.jsx';
14
- import { cleanMarkdown } from '../readme_renderer/utils.jsx';
15
- import { HeadingContent } from '../text/heading_content.jsx';
14
+ import { useSharedUiDependencies } from '../../ui_dependency_provider.js';
15
+ import { Box } from '../box.js';
16
+ import { isUrlExternal } from '../link.js';
17
+ import { cleanMarkdown } from '../readme_renderer/utils.js';
18
+ import { HeadingContent } from '../text/heading_content.js';
16
19
  import { Heading, Text } from '../text/index.js';
17
- import { TextContent } from '../text/text_content.jsx';
20
+ import { TextContent } from '../text/text_content.js';
18
21
  import {
19
22
  MarkdownBlockQuote,
20
23
  MarkdownCode,
21
24
  MarkdownLink,
22
25
  MarkdownTable,
23
- } from './simple_markdown_components.jsx';
26
+ } from './simple_markdown_components.js';
24
27
 
25
28
  export type SimpleMarkdownComponents = Components;
26
29
 
@@ -43,8 +46,33 @@ const StyledMarkdown = styled(ReactMarkdown)`
43
46
  }
44
47
  `;
45
48
 
46
- export const defaultRehypePlugins = [rehypeRaw];
47
- export const defaultRemarkPlugins = [remarkGfm];
49
+ // Function to recursively process unsupported elements
50
+ const unwrapUnsupportedElement = (node: Element): (Element | TextNode)[] => {
51
+ return node.children.flatMap((child) => {
52
+ if (child.type === 'text') {
53
+ return child; // Keep text as is
54
+ }
55
+ if (child.type === 'element') {
56
+ if (defaultAllowedElements.includes(child.tagName)) {
57
+ return child; // Keep supported elements
58
+ }
59
+ return unwrapUnsupportedElement(child as Element);
60
+ }
61
+ return []; // Ignore other node types
62
+ });
63
+ };
64
+
65
+ const getUnsupportedRehypeTagsSanitationPlugIn = (
66
+ allowedElements: string[],
67
+ ): Pluggable<any[]> => () => (tree: Root) => {
68
+ visit(tree, 'element', (node, index, parent) => {
69
+ if (!allowedElements.includes(node.tagName) && parent && typeof index === 'number') {
70
+ // Replace unsupported element with its valid children
71
+ parent.children.splice(index, 1, ...unwrapUnsupportedElement(node));
72
+ }
73
+ });
74
+ };
75
+
48
76
  export const defaultAllowedElements = [
49
77
  'a',
50
78
  'b',
@@ -79,6 +107,9 @@ export const defaultAllowedElements = [
79
107
  'ul',
80
108
  ];
81
109
 
110
+ export const defaultRehypePlugins = [rehypeRaw];
111
+ export const defaultRemarkPlugins = [remarkGfm];
112
+
82
113
  // TODO: Add Image component
83
114
  const regularMarkdownSizeComponents: Components = {
84
115
  h1: ({ children }) => <HeadingContent mt='space32' mb='space16' type='heading1'>{children}</HeadingContent>,
@@ -151,13 +182,15 @@ export const SimpleMarkdown: React.FC<SimpleMarkdownProps> = ({
151
182
  }) => {
152
183
  const cleanedMarkdown = useMemo(() => cleanMarkdown(markdown), [markdown]);
153
184
 
185
+ const effectiveAllowedElements = useRef(allowedElements || defaultAllowedElements);
186
+
154
187
  const effectiveComponents = useRef({
155
188
  ...(size === 'regular' ? regularMarkdownSizeComponents : smallMarkdownSizeComponents),
156
189
  ...components,
157
190
  });
158
191
 
159
- const rehypePluginsRef = useRef([
160
- ...(rehypePlugins || defaultRehypePlugins),
192
+ const rehypePluginsRef = useRef<PluggableList>([
193
+ ...(rehypePlugins || [...defaultRehypePlugins, getUnsupportedRehypeTagsSanitationPlugIn(effectiveAllowedElements.current)]),
161
194
  rehypeSanitize, // lets always sanitize the output
162
195
  ]);
163
196
 
@@ -168,7 +201,7 @@ export const SimpleMarkdown: React.FC<SimpleMarkdownProps> = ({
168
201
  components={effectiveComponents.current}
169
202
  rehypePlugins={rehypePluginsRef.current}
170
203
  remarkPlugins={remarkPlugins || defaultRemarkPlugins}
171
- allowedElements={allowedElements || defaultAllowedElements}
204
+ allowedElements={effectiveAllowedElements.current}
172
205
  transformLinkUri={(href, children, title) => {
173
206
  const transformed = transformLinkUri ? transformLinkUri(href, children, title) : defaultUrlTransform(href);
174
207
  return uriTransformer(transformed);
@@ -8,14 +8,14 @@ import { CheckIcon, LinkIcon } from '@apify/ui-icons';
8
8
  import { theme } from '../../design_system/theme.js';
9
9
  import type { WithOptional } from '../../type_utils.js';
10
10
  import { useCopyToClipboard } from '../../utils/index.js';
11
- import { Box } from '../box.jsx';
11
+ import { Box } from '../box.js';
12
12
  import { CodeBlock, InlineCode, OneLineCode } from '../code/index.js';
13
- import type { LinkProps } from '../link.jsx';
14
- import { Link } from '../link.jsx';
15
- import { slugifyHeadingChildren } from '../readme_renderer/utils.jsx';
16
- import type { HeadingSharedProps } from '../text/heading_shared.jsx';
13
+ import type { LinkProps } from '../link.js';
14
+ import { Link } from '../link.js';
15
+ import { slugifyHeadingChildren } from '../readme_renderer/utils.js';
16
+ import type { HeadingSharedProps } from '../text/heading_shared.js';
17
17
  import { Heading } from '../text/index.js';
18
- import type { SharedTextProps, SharedTextSize } from '../text/text_shared.jsx';
18
+ import type { SharedTextProps, SharedTextSize } from '../text/text_shared.js';
19
19
 
20
20
  const simpleMarkdownClassNames = {
21
21
  HEADING_ICON_LINK: 'headingIconLink',
@@ -5,8 +5,8 @@ import type { IconComponent, IconSize } from '@apify/ui-icons';
5
5
 
6
6
  import { theme } from '../design_system/theme.js';
7
7
  import type { WithTransientProps } from '../type_utils.js';
8
- import { Box, type MarginSpacingProps, type RegularBoxProps } from './box.jsx';
9
- import { Link, type RegularLinkProps } from './link.jsx';
8
+ import { Box, type MarginSpacingProps, type RegularBoxProps } from './box.js';
9
+ import { Link, type RegularLinkProps } from './link.js';
10
10
 
11
11
  type TagSize = typeof TAG_SIZES[number];
12
12
 
@@ -3,8 +3,8 @@ import styled, { css } from 'styled-components';
3
3
 
4
4
  import { theme } from '../../design_system/theme.js';
5
5
  import type { WithTransientProps } from '../../type_utils.js';
6
- import type { TextBaseProps } from './text_base.jsx';
7
- import { TextBaseComponent } from './text_base.jsx';
6
+ import type { TextBaseProps } from './text_base.js';
7
+ import { TextBaseComponent } from './text_base.js';
8
8
 
9
9
  type HeadingContentType = 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'heading5' | 'heading6';
10
10
 
@@ -3,8 +3,8 @@ import styled from 'styled-components';
3
3
 
4
4
  import { theme } from '../../design_system/theme.js';
5
5
  import type { WithTransientProps } from '../../type_utils.js';
6
- import type { TextBaseProps } from './text_base.jsx';
7
- import { TextBaseComponent } from './text_base.jsx';
6
+ import type { TextBaseProps } from './text_base.js';
7
+ import { TextBaseComponent } from './text_base.js';
8
8
 
9
9
  type HeadingMarketingType = 'titleXs' | 'titleS' | 'titleM' | 'titleL' | 'titleXl' | 'title2xl' | 'title3xl';
10
10
 
@@ -3,8 +3,8 @@ import styled from 'styled-components';
3
3
 
4
4
  import { theme } from '../../design_system/theme.js';
5
5
  import type { WithTransientProps } from '../../type_utils.js';
6
- import type { TextBaseProps } from './text_base.jsx';
7
- import { TextBaseComponent } from './text_base.jsx';
6
+ import type { TextBaseProps } from './text_base.js';
7
+ import { TextBaseComponent } from './text_base.js';
8
8
 
9
9
  type HeadingSharedType = 'titleXs' | 'titleS' | 'titleM' | 'titleL' | 'titleXl' | 'title2xl' | 'title3xl';
10
10
 
@@ -1,12 +1,12 @@
1
- import HeadingShared from './heading_shared.jsx';
2
- import type { SharedTextProps } from './text_shared.jsx';
3
- import TextShared from './text_shared.jsx';
1
+ import HeadingShared from './heading_shared.js';
2
+ import type { SharedTextProps } from './text_shared.js';
3
+ import TextShared from './text_shared.js';
4
4
 
5
- export * from './text_base.jsx';
6
- export * from './text_content.jsx';
7
- export * from './text_marketing.jsx';
8
- export * from './heading_content.jsx';
9
- export * from './heading_marketing.jsx';
5
+ export * from './text_base.js';
6
+ export * from './text_content.js';
7
+ export * from './text_marketing.js';
8
+ export * from './heading_content.js';
9
+ export * from './heading_marketing.js';
10
10
 
11
11
  export {
12
12
  TextShared as Text, // Shared typography is the default
@@ -2,8 +2,8 @@ import React from 'react';
2
2
  import styled, { css } from 'styled-components';
3
3
 
4
4
  import type { WithTransientProps } from '../../type_utils.js';
5
- import type { BoxProps } from '../box.jsx';
6
- import { Box } from '../box.jsx';
5
+ import type { BoxProps } from '../box.js';
6
+ import { Box } from '../box.js';
7
7
 
8
8
  export interface TransientTextBaseProps {
9
9
  italic?: boolean
@@ -1,11 +1,11 @@
1
- import React, { forwardRef } from 'react';
1
+ import { forwardRef } from 'react';
2
2
  import type { FlattenSimpleInterpolation } from 'styled-components';
3
3
  import styled, { css } from 'styled-components';
4
4
 
5
5
  import { theme } from '../../design_system/theme.js';
6
6
  import type { WithTransientProps } from '../../type_utils.js';
7
- import type { TextBaseProps } from './text_base.jsx';
8
- import { TextBaseComponent } from './text_base.jsx';
7
+ import type { TextBaseProps } from './text_base.js';
8
+ import { TextBaseComponent } from './text_base.js';
9
9
 
10
10
  export type ContentTextType = 'paragraph' | 'snippet';
11
11
  export type ContentTextWeight = 'normal' | 'bold';
@@ -1,11 +1,11 @@
1
- import React, { forwardRef } from 'react';
1
+ import { forwardRef } from 'react';
2
2
  import type { FlattenSimpleInterpolation } from 'styled-components';
3
3
  import styled, { css } from 'styled-components';
4
4
 
5
5
  import { theme } from '../../design_system/theme.js';
6
6
  import type { WithTransientProps } from '../../type_utils.js';
7
- import type { TextBaseProps } from './text_base.jsx';
8
- import { TextBaseComponent } from './text_base.jsx';
7
+ import type { TextBaseProps } from './text_base.js';
8
+ import { TextBaseComponent } from './text_base.js';
9
9
 
10
10
  export type MarketingTextSize = 'large' | 'regular' | 'small' | 'extraSmall';
11
11
  export type MarketingTextWeight = 'normal' | 'bold';
@@ -1,10 +1,10 @@
1
- import React, { forwardRef } from 'react';
1
+ import { forwardRef } from 'react';
2
2
  import styled from 'styled-components';
3
3
 
4
4
  import { theme } from '../../design_system/theme.js';
5
5
  import type { WithTransientProps } from '../../type_utils.js';
6
- import type { TextBaseProps } from './text_base.jsx';
7
- import { TextBaseComponent } from './text_base.jsx';
6
+ import type { TextBaseProps } from './text_base.js';
7
+ import { TextBaseComponent } from './text_base.js';
8
8
 
9
9
  export type SharedTextType = 'body' | 'code';
10
10
  export type SharedTextSize = 'regular' | 'small' | 'big';
@@ -1,2 +1,2 @@
1
- export * from './horizontal_tile.jsx';
2
- export * from './vertical_tile.jsx';
1
+ export * from './horizontal_tile.js';
2
+ export * from './vertical_tile.js';
@@ -4,8 +4,8 @@ import styled, { css } from 'styled-components';
4
4
 
5
5
  import { theme } from '../../design_system/theme.js';
6
6
  import type { WithTransientProps } from '../../type_utils.js';
7
- import type { BoxProps } from '../box.jsx';
8
- import { Box } from '../box.jsx';
7
+ import type { BoxProps } from '../box.js';
8
+ import { Box } from '../box.js';
9
9
  import { Text } from '../text/index.js';
10
10
 
11
11
  export const cardClassNames = {