@apify/ui-library 0.75.0 → 0.76.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apify/ui-library",
3
- "version": "0.75.0",
3
+ "version": "0.76.1",
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": "^0.12.0",
29
+ "@apify/ui-icons": "^0.12.1",
30
30
  "@floating-ui/react": "^0.26.2",
31
31
  "@react-hook/resize-observer": "^2.0.2",
32
32
  "clsx": "^2.0.0",
@@ -66,5 +66,5 @@
66
66
  "typescript": "^5.1.6",
67
67
  "typescript-eslint": "^8.24.0"
68
68
  },
69
- "gitHead": "a4c4ceee13ae2580b5fc2257759fc60eadf010c9"
69
+ "gitHead": "b5c0d6f964f7688d81d8f53cd9c5f5b24ba13a93"
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 = tab.key === currentTab?.key;
204
+ const selected = (optimisticCurrentTabKey ?? currentTabKey) === tab.key;
203
205
 
204
206
  const commonProps = {
205
207
  className: clsx(CODE_BLOCK_WITH_TABS_CLASSNAMES.TAB, { selected }),