@apify/ui-library 0.74.1-fixa11yaudit-b2e9ed.25 → 0.74.2-featCodeBlockWithTabsoptimis-e30911.3
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/CHANGELOG.md +11 -0
- package/dist/src/components/code/code_block/code_block_with_tabs.d.ts +2 -1
- package/dist/src/components/code/code_block/code_block_with_tabs.d.ts.map +1 -1
- package/dist/src/components/code/code_block/code_block_with_tabs.js +2 -2
- package/dist/src/components/code/code_block/code_block_with_tabs.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/components/code/code_block/code_block_with_tabs.tsx +4 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apify/ui-library",
|
|
3
|
-
"version": "0.74.
|
|
3
|
+
"version": "0.74.2-featCodeBlockWithTabsoptimis-e30911.3+cef0941ab85",
|
|
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
|
"typescript": "^5.1.6",
|
|
67
67
|
"typescript-eslint": "^8.24.0"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "cef0941ab85d9a8d282c8e4e7fee14500fb39fe9"
|
|
70
70
|
}
|
|
@@ -74,6 +74,8 @@ type CodeBlockWithTabsProps = SharedBoxProps & {
|
|
|
74
74
|
codeBlockProps: SharedCodeBlockProps;
|
|
75
75
|
currentTabKey: CodeBlockTabKey;
|
|
76
76
|
tabs: CodeBlockTabProps[];
|
|
77
|
+
// Optional prop to set the selected tab, does not influence the content of the code block, used to improve interactivity
|
|
78
|
+
optimisticCurrentTabKey?: CodeBlockTabKey;
|
|
77
79
|
};
|
|
78
80
|
|
|
79
81
|
export const CODE_BLOCK_WITH_TABS_CLASSNAMES = {
|
|
@@ -190,7 +192,7 @@ const IMG_RESIZE = {
|
|
|
190
192
|
height: 20,
|
|
191
193
|
};
|
|
192
194
|
|
|
193
|
-
export const CodeBlockWithTabs = ({ className, codeBlockProps, currentTabKey, tabs, ...props }: CodeBlockWithTabsProps) => {
|
|
195
|
+
export const CodeBlockWithTabs = ({ className, codeBlockProps, currentTabKey, tabs, optimisticCurrentTabKey, ...props }: CodeBlockWithTabsProps) => {
|
|
194
196
|
const { generateProxyImageUrl } = useSharedUiDependencies();
|
|
195
197
|
const currentTab = tabs.find((tab) => tab.key === currentTabKey) ?? tabs[0];
|
|
196
198
|
|
|
@@ -199,7 +201,7 @@ export const CodeBlockWithTabs = ({ className, codeBlockProps, currentTabKey, ta
|
|
|
199
201
|
<div className={CODE_BLOCK_WITH_TABS_CLASSNAMES.TABS}>
|
|
200
202
|
{tabs.map((tab) => {
|
|
201
203
|
const { label, src } = CODE_BLOCK_TAB_CATALOG[tab.key];
|
|
202
|
-
const selected =
|
|
204
|
+
const selected = (optimisticCurrentTabKey ?? currentTabKey) === tab.key;
|
|
203
205
|
|
|
204
206
|
const commonProps = {
|
|
205
207
|
className: clsx(CODE_BLOCK_WITH_TABS_CLASSNAMES.TAB, { selected }),
|