@apify/ui-library 1.109.2 → 1.109.3-featurereact19upgrade-8b5553.119

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 (88) hide show
  1. package/dist/src/components/badge.d.ts.map +1 -1
  2. package/dist/src/components/badge.js.map +1 -1
  3. package/dist/src/components/button.d.ts +2 -2
  4. package/dist/src/components/button.d.ts.map +1 -1
  5. package/dist/src/components/card_container.d.ts +1 -1
  6. package/dist/src/components/code/code_block/code_block.styled.d.ts +3 -3
  7. package/dist/src/components/code/code_block/code_block.styled.d.ts.map +1 -1
  8. package/dist/src/components/code/inline_code/inline_code.d.ts +1 -1
  9. package/dist/src/components/code/inline_code/inline_code.d.ts.map +1 -1
  10. package/dist/src/components/code/one_line_code/one_line_code.d.ts +1 -1
  11. package/dist/src/components/code/one_line_code/one_line_code.d.ts.map +1 -1
  12. package/dist/src/components/code/prism_highlighter.d.ts +19 -6
  13. package/dist/src/components/code/prism_highlighter.d.ts.map +1 -1
  14. package/dist/src/components/color_wheel_gradient.d.ts +1 -1
  15. package/dist/src/components/color_wheel_gradient.d.ts.map +1 -1
  16. package/dist/src/components/floating/floating_component_base.d.ts +1 -1
  17. package/dist/src/components/floating/floating_component_base.d.ts.map +1 -1
  18. package/dist/src/components/floating/menu_components.d.ts +3 -7
  19. package/dist/src/components/floating/menu_components.d.ts.map +1 -1
  20. package/dist/src/components/floating/tooltip.d.ts +3 -3
  21. package/dist/src/components/floating/tooltip.d.ts.map +1 -1
  22. package/dist/src/components/floating/tooltip.js.map +1 -1
  23. package/dist/src/components/readme_renderer/table_of_contents.d.ts +1 -1
  24. package/dist/src/components/readme_renderer/table_of_contents.d.ts.map +1 -1
  25. package/dist/src/components/readme_renderer/table_of_contents.js +1 -1
  26. package/dist/src/components/readme_renderer/table_of_contents.js.map +1 -1
  27. package/dist/src/components/readme_renderer/utils.d.ts +1 -1
  28. package/dist/src/components/readme_renderer/utils.d.ts.map +1 -1
  29. package/dist/src/components/readme_renderer/utils.js +8 -5
  30. package/dist/src/components/readme_renderer/utils.js.map +1 -1
  31. package/dist/src/components/shortcut.d.ts +2 -1
  32. package/dist/src/components/shortcut.d.ts.map +1 -1
  33. package/dist/src/components/shortcut.js.map +1 -1
  34. package/dist/src/components/simple_markdown/simple_markdown.d.ts +7 -3
  35. package/dist/src/components/simple_markdown/simple_markdown.d.ts.map +1 -1
  36. package/dist/src/components/simple_markdown/simple_markdown.js +25 -14
  37. package/dist/src/components/simple_markdown/simple_markdown.js.map +1 -1
  38. package/dist/src/components/simple_markdown/simple_markdown_components.d.ts +9 -11
  39. package/dist/src/components/simple_markdown/simple_markdown_components.d.ts.map +1 -1
  40. package/dist/src/components/simple_markdown/simple_markdown_components.js +5 -4
  41. package/dist/src/components/simple_markdown/simple_markdown_components.js.map +1 -1
  42. package/dist/src/components/spinner.d.ts +3 -3
  43. package/dist/src/components/spinner.d.ts.map +1 -1
  44. package/dist/src/components/tabs/tab.d.ts.map +1 -1
  45. package/dist/src/components/tabs/tab.js.map +1 -1
  46. package/dist/src/components/tabs/tabs.js +3 -3
  47. package/dist/src/components/tabs/tabs.js.map +1 -1
  48. package/dist/src/components/tag.d.ts.map +1 -1
  49. package/dist/src/components/tag.js.map +1 -1
  50. package/dist/src/components/text/text_content.js.map +1 -1
  51. package/dist/src/components/text/text_marketing.js.map +1 -1
  52. package/dist/src/components/tile/shared.d.ts +1 -1
  53. package/dist/src/components/tile/shared.d.ts.map +1 -1
  54. package/dist/src/components/to_consolidate/card.d.ts +1 -1
  55. package/dist/src/components/to_consolidate/card.d.ts.map +1 -1
  56. package/dist/src/components/to_consolidate/markdown.d.ts +2 -2
  57. package/dist/src/components/to_consolidate/markdown.d.ts.map +1 -1
  58. package/dist/src/components/to_consolidate/markdown.js +60 -50
  59. package/dist/src/components/to_consolidate/markdown.js.map +1 -1
  60. package/dist/src/utils/css_utils.d.ts +1 -1
  61. package/dist/src/utils/css_utils.d.ts.map +1 -1
  62. package/dist/src/utils/index.d.ts +1 -0
  63. package/dist/src/utils/index.d.ts.map +1 -1
  64. package/dist/src/utils/index.js +1 -0
  65. package/dist/src/utils/index.js.map +1 -1
  66. package/dist/src/utils/type_utils.d.ts +3 -0
  67. package/dist/src/utils/type_utils.d.ts.map +1 -0
  68. package/dist/src/utils/type_utils.js +2 -0
  69. package/dist/src/utils/type_utils.js.map +1 -0
  70. package/dist/tsconfig.build.tsbuildinfo +1 -1
  71. package/package.json +15 -15
  72. package/src/components/badge.tsx +2 -1
  73. package/src/components/code/one_line_code/one_line_code.tsx +1 -1
  74. package/src/components/floating/floating_component_base.tsx +1 -1
  75. package/src/components/floating/tooltip.tsx +4 -4
  76. package/src/components/readme_renderer/table_of_contents.tsx +1 -2
  77. package/src/components/readme_renderer/utils.tsx +9 -6
  78. package/src/components/shortcut.tsx +2 -1
  79. package/src/components/simple_markdown/simple_markdown.tsx +50 -28
  80. package/src/components/simple_markdown/simple_markdown_components.tsx +13 -7
  81. package/src/components/tabs/tab.tsx +1 -1
  82. package/src/components/tabs/tabs.tsx +4 -4
  83. package/src/components/tag.tsx +2 -1
  84. package/src/components/text/text_content.tsx +1 -1
  85. package/src/components/text/text_marketing.tsx +1 -1
  86. package/src/components/to_consolidate/markdown.tsx +91 -77
  87. package/src/utils/index.ts +1 -0
  88. package/src/utils/type_utils.ts +3 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apify/ui-library",
3
- "version": "1.109.2",
3
+ "version": "1.109.3-featurereact19upgrade-8b5553.119+12676e2e930",
4
4
  "description": "React UI library used by apify.com",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -26,7 +26,7 @@
26
26
  "It's not nice, but helps us to get around the problem of multiple react instances."
27
27
  ],
28
28
  "dependencies": {
29
- "@apify/ui-icons": "^1.23.0",
29
+ "@apify/ui-icons": "^1.23.1-featurereact19upgrade-8b5553.153+12676e2e930",
30
30
  "@floating-ui/react": "^0.26.2",
31
31
  "@react-hook/resize-observer": "^2.0.2",
32
32
  "clsx": "^2.0.0",
@@ -37,32 +37,32 @@
37
37
  "prism-react-renderer": "^2.4.1",
38
38
  "prismjs": "^1.30.0",
39
39
  "query-string": "^8.1.0",
40
- "react-markdown": "^8.0.5",
41
- "rehype-raw": "^6.1.1",
40
+ "react-markdown": "^10.1.0",
41
+ "rehype-raw": "^7.0.0",
42
42
  "rehype-sanitize": "^6.0.0",
43
- "remark-gfm": "^3.0.1",
44
- "remark-toc": "8.0.1",
43
+ "remark-gfm": "^4.0.1",
44
+ "remark-toc": "9.0.0",
45
45
  "slugify": "^1.6.6",
46
- "unified": "^10.0.0"
46
+ "unist-util-visit": "^5.0.0"
47
47
  },
48
48
  "peerDependencies": {
49
- "react": "17.x || 18.x",
50
- "react-dom": "17.x || 18.x",
51
- "styled-components": "^5.3.3",
52
- "unist-util-visit": "^5.0.0"
49
+ "react": "17.x || 18.x || 19.x",
50
+ "react-dom": "17.x || 18.x || 19.x",
51
+ "styled-components": "^6.1.19"
53
52
  },
54
53
  "devDependencies": {
55
54
  "@storybook/react-vite": "^9.0.16",
55
+ "@types/hast": "^3.0.4",
56
56
  "@types/lodash": "^4.14.200",
57
- "@types/react": "^18.2.74",
58
- "@types/styled-components": "^5.1.34",
57
+ "@types/react": "19.2.2",
59
58
  "recast": "^0.23.9",
60
- "style-dictionary": "^4.4.0"
59
+ "style-dictionary": "^4.4.0",
60
+ "styled-components": "^6.1.19"
61
61
  },
62
62
  "files": [
63
63
  "dist",
64
64
  "src",
65
65
  "style"
66
66
  ],
67
- "gitHead": "a7edf97e472d4cf7b799c8d2e1d6e15d2a613599"
67
+ "gitHead": "12676e2e930ec972e722721878005ad8dc198dbc"
68
68
  }
@@ -1,11 +1,12 @@
1
1
  import type React from 'react';
2
2
  import { forwardRef } from 'react';
3
- import styled, { css, type FlattenSimpleInterpolation } from 'styled-components';
3
+ import styled, { css } from 'styled-components';
4
4
 
5
5
  import type { IconComponent, IconSize } from '@apify/ui-icons';
6
6
 
7
7
  import { theme } from '../design_system/theme.js';
8
8
  import type { WithTransientProps } from '../type_utils.js';
9
+ import type { FlattenSimpleInterpolation } from '../utils/type_utils.js';
9
10
  import { Box, type MarginSpacingProps, type RegularBoxProps } from './box.js';
10
11
  import { Text } from './text/index.js';
11
12
  import type { SharedTextSize, SharedTextType } from './text/text_shared.js';
@@ -147,7 +147,7 @@ export type OneLineCodeTrackingBundle = Record<
147
147
  TrackingBundleDataObject
148
148
  >;
149
149
 
150
- export type OneLineCodeProps = BoxProps & {
150
+ export type OneLineCodeProps = Omit<BoxProps, 'children'> & {
151
151
  children: string;
152
152
  language?: string;
153
153
  size?: SharedTextSize;
@@ -49,7 +49,7 @@ export interface FloatingComponentBaseProps {
49
49
  placement?: FloatingPlacement;
50
50
  autoPlacements?: FloatingPlacement[];
51
51
  strategy?: Strategy;
52
- content?: ReactNode | string;
52
+ content?: ReactNode;
53
53
  children?: ReactNode;
54
54
  isOpen?: boolean;
55
55
  triggerRef?: RefObject<HTMLDivElement>;
@@ -3,7 +3,7 @@ import {
3
3
  useHover,
4
4
  useInteractions,
5
5
  } from '@floating-ui/react';
6
- import { type ComponentType, forwardRef, useState } from 'react';
6
+ import { type ComponentType, type ElementType, forwardRef, type ReactNode, useState } from 'react';
7
7
  import styled, { css } from 'styled-components';
8
8
 
9
9
  import { theme } from '../../design_system/theme.js';
@@ -29,7 +29,7 @@ export const TOOLTIP_SIZES = {
29
29
  export type TooltipSize = typeof TOOLTIP_SIZES[keyof typeof TOOLTIP_SIZES];
30
30
 
31
31
  export interface TooltipProps extends Omit<FloatingComponentBaseProps, 'isOpen' | 'size'> {
32
- as?: keyof JSX.IntrinsicElements | ComponentType<unknown>;
32
+ as?: ElementType;
33
33
  className?: string;
34
34
  delayShow?: number;
35
35
  delayHide?: number;
@@ -72,7 +72,7 @@ export const Tooltip = ({
72
72
  size = TOOLTIP_SIZES.SMALL,
73
73
  textAlign = TOOLTIP_TEXT_ALIGNS.LEFT,
74
74
  ...rest
75
- }: TooltipProps) => {
75
+ }: TooltipProps): ReactNode => {
76
76
  const { uiTheme, tooltipSafeHtml } = useSharedUiDependencies();
77
77
  const [open, setOpen] = useState(false);
78
78
 
@@ -107,7 +107,7 @@ export const Tooltip = ({
107
107
 
108
108
  return (
109
109
  <TooltipFocusArea
110
- as={as as keyof JSX.IntrinsicElements}
110
+ as={as}
111
111
  className={className}
112
112
  ref={refs.setReference}
113
113
  {...getReferenceProps()}
@@ -3,8 +3,7 @@ import React, {
3
3
  useCallback,
4
4
  useMemo,
5
5
  } from 'react';
6
- import ReactMarkdown from 'react-markdown';
7
- import type { AllowElement } from 'react-markdown/lib/rehype-filter.js';
6
+ import ReactMarkdown, { type AllowElement } from 'react-markdown';
8
7
  import remarkToc from 'remark-toc';
9
8
  import styled from 'styled-components';
10
9
 
@@ -1,5 +1,5 @@
1
- import React, { useCallback } from 'react';
2
- import type { AllowElement } from 'react-markdown/lib/rehype-filter.js';
1
+ import React, { type ReactElement, type ReactNode, useCallback } from 'react';
2
+ import type { AllowElement } from 'react-markdown';
3
3
  import slugify from 'slugify';
4
4
 
5
5
  export const slugifyHeadingChildren = (
@@ -11,9 +11,12 @@ export const slugifyHeadingChildren = (
11
11
  React.Children.forEach(headingChildren, (child) => {
12
12
  if (typeof child === 'string') {
13
13
  slugs.push(slugify(child, { lower: true, strict: true }));
14
- } else if (React.isValidElement(child) && child.props.children) {
15
- const nestedSlugs = slugifyHeadingChildren(child.props.children);
16
- if (nestedSlugs) slugs.push(nestedSlugs);
14
+ } else if (React.isValidElement(child)) {
15
+ const element = child as ReactElement<{ children?: ReactNode }>;
16
+ if (element.props.children) {
17
+ const nestedSlugs = slugifyHeadingChildren(element.props.children);
18
+ if (nestedSlugs) slugs.push(nestedSlugs);
19
+ }
17
20
  }
18
21
  });
19
22
 
@@ -35,7 +38,7 @@ export const cleanMarkdown = (markdown: string, removeFirstH1?: boolean): string
35
38
  // This removes the first element if it's a `h1` containing exactly the Actor title
36
39
  export const useActorTitleHeadingFilter = (actorTitle: string): AllowElement => {
37
40
  return useCallback((element, index, parent) => {
38
- if (parent.type === 'root'
41
+ if (parent?.type === 'root'
39
42
  && index === 0
40
43
  && element.tagName === 'h1'
41
44
  && element.children.length === 1
@@ -1,10 +1,11 @@
1
+ import type { ElementType } from 'react';
1
2
  import styled, { css } from 'styled-components';
2
3
 
3
4
  import { theme } from '../design_system/theme.js';
4
5
  import { Text } from './text/index.js';
5
6
 
6
7
  interface ShortcutProps {
7
- as?: keyof JSX.IntrinsicElements;
8
+ as?: ElementType;
8
9
  className?: string;
9
10
  children: React.ReactNode;
10
11
  /* If true, always use dark mode colors */
@@ -1,14 +1,12 @@
1
1
  import type { Element, Root, Text as TextNode } from 'hast';
2
2
  import type React from 'react';
3
3
  import { useCallback, useMemo, useRef } from 'react';
4
- import type { Components } from 'react-markdown';
5
- import ReactMarkdown, { uriTransformer } from 'react-markdown';
6
- import type { ReactMarkdownOptions } from 'react-markdown/lib/react-markdown.js';
4
+ import type { Components, Options as ReactMarkdownOptions, UrlTransform } from 'react-markdown';
5
+ import ReactMarkdown from 'react-markdown';
7
6
  import rehypeRaw from 'rehype-raw';
8
7
  import rehypeSanitize from 'rehype-sanitize';
9
8
  import remarkGfm from 'remark-gfm';
10
9
  import styled from 'styled-components';
11
- import type { Pluggable, PluggableList } from 'unified';
12
10
  import { visit } from 'unist-util-visit';
13
11
 
14
12
  import { theme } from '../../design_system/theme.js';
@@ -61,7 +59,7 @@ export const defaultAllowedElements = [
61
59
  'ul',
62
60
  ];
63
61
 
64
- const StyledMarkdown = styled(ReactMarkdown)`
62
+ const StyledMarkdownWrapper = styled(Box)`
65
63
  scroll-margin-top: 10px;
66
64
 
67
65
  overflow: auto;
@@ -101,7 +99,7 @@ const unwrapUnsupportedElement = (node: Element): (Element | TextNode)[] => {
101
99
 
102
100
  const getUnsupportedRehypeTagsSanitationPlugIn = (
103
101
  allowedElements: string[],
104
- ): Pluggable<unknown[]> => () => (tree: Root) => {
102
+ ) => () => (tree: Root) => {
105
103
  visit(tree, 'element', (node, index, parent) => {
106
104
  if (!allowedElements.includes(node.tagName) && parent && typeof index === 'number') {
107
105
  // Replace unsupported element with its valid children
@@ -153,7 +151,7 @@ const regularMarkdownSizeComponents: Components = {
153
151
  ol: ({ children, start }) => <TextContent as='ol' pl='space32' start={start}>{children}</TextContent>,
154
152
  li: ({ children }) => <TextContent as='li' mt='space4'>{children}</TextContent>,
155
153
  a: ({ children, href }) => <MarkdownLink to={href}>{children}</MarkdownLink>,
156
- code: ({ children, inline }) => <MarkdownCode inline={inline} size='regular'>{children}</MarkdownCode>,
154
+ code: ({ children, node }) => <MarkdownCode node={node} size='regular'>{children}</MarkdownCode>,
157
155
  img: ({ src, alt, height, width }) => <MarkdownImage src={src} alt={alt} height={height} width={width} />,
158
156
  };
159
157
 
@@ -174,17 +172,23 @@ const smallMarkdownSizeComponents: Components = {
174
172
  ol: ({ children, start }) => <Text as='ol' pl='space32' start={start}>{children}</Text>,
175
173
  li: ({ children }) => <Text as='li' mt='space4'>{children}</Text>,
176
174
  a: ({ children, href }) => <MarkdownLink to={href}>{children}</MarkdownLink>,
177
- code: ({ children, inline }) => <MarkdownCode inline={inline} size='small'>{children}</MarkdownCode>,
175
+ code: ({ children, node }) => <MarkdownCode node={node} size='small'>{children}</MarkdownCode>,
178
176
  img: ({ src, alt, height, width }) => <MarkdownImage src={src} alt={alt} height={height} width={width} />,
179
177
  };
180
178
 
181
179
  type MarkdownSize = 'regular' | 'small';
182
180
 
183
- export type SimpleMarkdownProps = ReactMarkdownOptions & {
181
+ export type SimpleMarkdownProps = Omit<ReactMarkdownOptions, 'urlTransform' | 'children'> & {
182
+ // @deprecated use urlTransform instead
183
+ transformLinkUri?: UrlTransform,
184
+ // @deprecated use urlTransform instead
185
+ transformImageUri?: UrlTransform,
184
186
  size?: MarkdownSize,
187
+ children: string,
188
+ className?: string,
185
189
  }
186
190
 
187
- const useDefaultUrlTransform = () => {
191
+ export const useDefaultUrlTransform = () => {
188
192
  const { windowLocationHost } = useSharedUiDependencies();
189
193
 
190
194
  return useCallback((url: string) => {
@@ -204,7 +208,9 @@ export const SimpleMarkdown: React.FC<SimpleMarkdownProps> = ({
204
208
  rehypePlugins,
205
209
  remarkPlugins,
206
210
  transformLinkUri,
211
+ transformImageUri,
207
212
  allowedElements,
213
+ className,
208
214
  ...rest
209
215
  }) => {
210
216
  const cleanedMarkdown = useMemo(() => cleanMarkdown(markdown), [markdown]);
@@ -216,26 +222,42 @@ export const SimpleMarkdown: React.FC<SimpleMarkdownProps> = ({
216
222
  ...components,
217
223
  });
218
224
 
219
- const rehypePluginsRef = useRef<PluggableList>([
220
- ...(rehypePlugins || [...defaultRehypePlugins, getUnsupportedRehypeTagsSanitationPlugIn(effectiveAllowedElements.current)]),
221
- rehypeSanitize, // lets always sanitize the output
222
- ]);
223
-
224
225
  const defaultUrlTransform = useDefaultUrlTransform();
225
226
 
227
+ const effectiveRehypePlugins = useMemo(() => {
228
+ const plugins = rehypePlugins ?? [
229
+ ...defaultRehypePlugins,
230
+ getUnsupportedRehypeTagsSanitationPlugIn(effectiveAllowedElements.current as string[]),
231
+ ];
232
+
233
+ return [
234
+ ...plugins,
235
+ rehypeSanitize,
236
+ ];
237
+ }, [rehypePlugins]);
238
+
226
239
  return (
227
- <StyledMarkdown
228
- components={effectiveComponents.current}
229
- rehypePlugins={rehypePluginsRef.current}
230
- remarkPlugins={remarkPlugins || defaultRemarkPlugins}
231
- allowedElements={effectiveAllowedElements.current}
232
- transformLinkUri={(href, children, title) => {
233
- const transformed = transformLinkUri ? transformLinkUri(href, children, title) : defaultUrlTransform(href);
234
- return uriTransformer(transformed);
235
- }}
236
- {...rest}
237
- >
238
- {cleanedMarkdown}
239
- </StyledMarkdown>
240
+ <StyledMarkdownWrapper className={className}>
241
+ <ReactMarkdown
242
+ components={effectiveComponents.current}
243
+ rehypePlugins={effectiveRehypePlugins}
244
+ remarkPlugins={remarkPlugins || defaultRemarkPlugins}
245
+ allowedElements={effectiveAllowedElements.current}
246
+ urlTransform={(href, children, node) => {
247
+ if (node.tagName === 'img') {
248
+ return transformImageUri ? transformImageUri(href, children, node) : href;
249
+ }
250
+
251
+ if (node.tagName === 'a') {
252
+ return transformLinkUri ? transformLinkUri(href, children, node) : defaultUrlTransform(href);
253
+ }
254
+
255
+ return href;
256
+ }}
257
+ {...rest}
258
+ >
259
+ {cleanedMarkdown}
260
+ </ReactMarkdown>
261
+ </StyledMarkdownWrapper>
240
262
  );
241
263
  };
@@ -1,6 +1,6 @@
1
1
  import qs from 'query-string';
2
2
  import type React from 'react';
3
- import type { CodeProps, ReactMarkdownProps } from 'react-markdown/lib/ast-to-react.js';
3
+ import type { ExtraProps as MarkdownComponentExtraProps } from 'react-markdown';
4
4
  import styled from 'styled-components';
5
5
 
6
6
  import { CheckIcon, LinkIcon } from '@apify/ui-icons';
@@ -121,15 +121,21 @@ const StyledInlineCode = styled(InlineCode)`
121
121
  }
122
122
  `;
123
123
 
124
- type MarkdownCodeProps = Pick<CodeProps, 'inline' | 'className' | 'children'>
124
+ type MarkdownCodeProps = {
125
+ size: SharedTextSize,
126
+ className?: string,
127
+ children: React.ReactNode,
128
+ } & MarkdownComponentExtraProps;
125
129
 
126
- export const MarkdownCode: React.FC<MarkdownCodeProps & { size: SharedTextSize }> = ({
127
- inline,
130
+ export const MarkdownCode: React.FC<MarkdownCodeProps> = ({
128
131
  className,
129
132
  children,
130
133
  size,
134
+ node,
131
135
  }) => {
132
- if (inline) {
136
+ const isInline = node?.position?.start?.line === node?.position?.end?.line;
137
+
138
+ if (isInline) {
133
139
  return <StyledInlineCode size={size} className={className}>{children}</StyledInlineCode>;
134
140
  }
135
141
 
@@ -276,11 +282,11 @@ export const MarkdownTable = styled.table`
276
282
  `;
277
283
 
278
284
  // TODO: This should be used for readmes
279
- export const MarkdownParagraphContent: React.FC<SharedTextProps & Pick<ReactMarkdownProps, 'node'>> = ({
285
+ export const MarkdownParagraphContent: React.FC<SharedTextProps & MarkdownComponentExtraProps> = async ({
280
286
  children,
281
287
  node,
282
288
  }) => {
283
- const child = node.children[0];
289
+ const child = node?.children[0];
284
290
  const isText = child?.type === 'text';
285
291
 
286
292
  const videoSrc = isText && getVideoSrc(child.value);
@@ -1,13 +1,13 @@
1
1
  import clsx from 'clsx';
2
2
  import { createPath } from 'history';
3
3
  import type React from 'react';
4
- import type { FlattenSimpleInterpolation } from 'styled-components';
5
4
  import styled, { css } from 'styled-components';
6
5
 
7
6
  import type { IconComponent } from '@apify/ui-icons';
8
7
 
9
8
  import { theme } from '../../design_system/theme.js';
10
9
  import type { WithTransientProps } from '../../type_utils.js';
10
+ import type { FlattenSimpleInterpolation } from '../../utils/type_utils.js';
11
11
  import type { BadgeSize } from '../badge.js';
12
12
  import { Badge } from '../badge.js';
13
13
  import type { MarginSpacingProps, RegularBoxProps } from '../box.js';
@@ -1,11 +1,11 @@
1
1
  import type React from 'react';
2
2
  import { useCallback, useRef, useState } from 'react';
3
- import type { FlattenSimpleInterpolation } from 'styled-components';
4
3
  import styled, { css } from 'styled-components';
5
4
 
6
5
  import { theme } from '../../design_system/theme.js';
7
6
  import type { WithTransientProps } from '../../type_utils.js';
8
7
  import { useResizeObserverSsr } from '../../utils/resize_observer.js';
8
+ import type { FlattenSimpleInterpolation } from '../../utils/type_utils.js';
9
9
  import type { MarginSpacingProps, RegularBoxProps } from '../box.js';
10
10
  import { Box } from '../box.js';
11
11
  import type { TabData, TabVariant } from './tab.js';
@@ -77,7 +77,7 @@ const TabsWrapper = styled(Box)<TabsWrapperProps>`
77
77
  /* Scrollbar */
78
78
  -ms-overflow-style: none;
79
79
  scrollbar-width: none;
80
-
80
+
81
81
  &::-webkit-scrollbar {
82
82
  display: none; /* Chrome, Safari, Opera */
83
83
  }
@@ -107,7 +107,7 @@ const TabsWrapper = styled(Box)<TabsWrapperProps>`
107
107
 
108
108
  &:first-of-type {
109
109
  left: 0;
110
-
110
+
111
111
  &::after {
112
112
  left: 0;
113
113
  background: linear-gradient(90deg, ${theme.color.neutral.background} 0%, rgba(255, 255, 255, 0) 100%);
@@ -116,7 +116,7 @@ const TabsWrapper = styled(Box)<TabsWrapperProps>`
116
116
 
117
117
  &:last-of-type {
118
118
  right: 0;
119
-
119
+
120
120
  &::after {
121
121
  right: 0;
122
122
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, ${theme.color.neutral.background} 100%);
@@ -1,11 +1,12 @@
1
1
  import type React from 'react';
2
2
  import { type ForwardedRef, forwardRef } from 'react';
3
- import styled, { css, type FlattenSimpleInterpolation } from 'styled-components';
3
+ import styled, { css } from 'styled-components';
4
4
 
5
5
  import type { IconComponent, IconSize } from '@apify/ui-icons';
6
6
 
7
7
  import { theme } from '../design_system/theme.js';
8
8
  import type { WithTransientProps } from '../type_utils.js';
9
+ import type { FlattenSimpleInterpolation } from '../utils/type_utils.js';
9
10
  import { Box, type MarginSpacingProps, type RegularBoxProps } from './box.js';
10
11
  import type { RegularButtonProps } from './button.js';
11
12
  import { Link, type RegularLinkProps } from './link.js';
@@ -1,9 +1,9 @@
1
1
  import { forwardRef } from 'react';
2
- import type { FlattenSimpleInterpolation } from 'styled-components';
3
2
  import styled, { css } from 'styled-components';
4
3
 
5
4
  import { theme } from '../../design_system/theme.js';
6
5
  import type { WithTransientProps } from '../../type_utils.js';
6
+ import type { FlattenSimpleInterpolation } from '../../utils/type_utils.js';
7
7
  import type { TextBaseProps } from './text_base.js';
8
8
  import { TextBaseComponent } from './text_base.js';
9
9
 
@@ -1,9 +1,9 @@
1
1
  import { forwardRef } from 'react';
2
- import type { FlattenSimpleInterpolation } from 'styled-components';
3
2
  import styled, { css } from 'styled-components';
4
3
 
5
4
  import { theme } from '../../design_system/theme.js';
6
5
  import type { WithTransientProps } from '../../type_utils.js';
6
+ import type { FlattenSimpleInterpolation } from '../../utils/type_utils.js';
7
7
  import type { TextBaseProps } from './text_base.js';
8
8
  import { TextBaseComponent } from './text_base.js';
9
9