@apify/ui-library 1.93.7 → 1.94.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.
- package/dist/src/components/to_consolidate/markdown.d.ts.map +1 -1
- package/dist/src/components/to_consolidate/markdown.js +39 -9
- package/dist/src/components/to_consolidate/markdown.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/components/to_consolidate/markdown.tsx +40 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apify/ui-library",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.94.0",
|
|
4
4
|
"description": "React UI library used by apify.com",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"src",
|
|
67
67
|
"style"
|
|
68
68
|
],
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "a188fdc8c3bd90313d492bef0ce6856c027b1bae"
|
|
70
70
|
}
|
|
@@ -65,19 +65,50 @@ const StyledMarkdown = styled(ReactMarkdown) <StyledReadmeProps>`
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
.${markdownClassNames.HEADING_COPY_ICON} {
|
|
68
|
-
display:
|
|
69
|
-
|
|
70
|
-
color:
|
|
68
|
+
display: inline;
|
|
69
|
+
left: ${theme.space.space8};
|
|
70
|
+
color: inherit;
|
|
71
|
+
position: relative;
|
|
72
|
+
opacity: 0;
|
|
73
|
+
|
|
74
|
+
&::after {
|
|
75
|
+
top: 50%;
|
|
76
|
+
transform: translateY(-50%);
|
|
77
|
+
left: ${theme.space.space4};
|
|
78
|
+
${theme.typography.shared.desktop.bodyS}
|
|
79
|
+
content: '';
|
|
80
|
+
opacity: 0;
|
|
81
|
+
position: absolute;
|
|
82
|
+
transition: opacity ${theme.transition.fastEaseOut};
|
|
83
|
+
}
|
|
71
84
|
|
|
72
85
|
svg {
|
|
73
|
-
|
|
74
|
-
|
|
86
|
+
top: 50%;
|
|
87
|
+
transform: translateY(-50%);
|
|
88
|
+
left: 0;
|
|
89
|
+
opacity: 1;
|
|
90
|
+
position: absolute;
|
|
91
|
+
transition: opacity ${theme.transition.fastEaseOut};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&.isCopied {
|
|
95
|
+
opacity: 1;
|
|
96
|
+
pointer-events: none;
|
|
97
|
+
|
|
98
|
+
&::after {
|
|
99
|
+
content: 'Copied!';
|
|
100
|
+
opacity: 1;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
svg {
|
|
104
|
+
opacity: 0;
|
|
105
|
+
}
|
|
75
106
|
}
|
|
76
107
|
}
|
|
77
108
|
|
|
78
109
|
&:hover {
|
|
79
110
|
.${markdownClassNames.HEADING_COPY_ICON} {
|
|
80
|
-
|
|
111
|
+
opacity: 1;
|
|
81
112
|
}
|
|
82
113
|
}
|
|
83
114
|
}
|
|
@@ -482,8 +513,7 @@ const HeadingRendererWithAnchor = ({ node, children }: HeadingRendererProps) =>
|
|
|
482
513
|
const Tag = node.tagName;
|
|
483
514
|
const id = slugifyHeadingChildren(children);
|
|
484
515
|
|
|
485
|
-
|
|
486
|
-
const [_isCopied, handleClick] = useCopyToClipboard({
|
|
516
|
+
const [isCopied, handleClick] = useCopyToClipboard({
|
|
487
517
|
text: id ?? '',
|
|
488
518
|
// We want the whole URL to be copied, not just the ID
|
|
489
519
|
transform: (text) => {
|
|
@@ -499,7 +529,8 @@ const HeadingRendererWithAnchor = ({ node, children }: HeadingRendererProps) =>
|
|
|
499
529
|
<a
|
|
500
530
|
onClick={handleClick}
|
|
501
531
|
href={`#${id}`}
|
|
502
|
-
className={
|
|
532
|
+
className={clsx(markdownClassNames.HEADING_COPY_ICON, { isCopied })}
|
|
533
|
+
aria-label="Copy link to clipboard"
|
|
503
534
|
>
|
|
504
535
|
<LinkIcon size="16" />
|
|
505
536
|
</a>
|