@redocly/theme 0.56.0-next.0 → 0.56.0-next.10

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 (346) hide show
  1. package/lib/components/Breadcrumbs/Breadcrumbs.js +1 -1
  2. package/lib/components/Button/Button.js +1 -0
  3. package/lib/components/Catalog/CatalogCardView/CatalogCard.js +9 -4
  4. package/lib/components/Catalog/CatalogEntitiesEmptyState.d.ts +5 -1
  5. package/lib/components/Catalog/CatalogEntitiesEmptyState.js +25 -4
  6. package/lib/components/Catalog/CatalogEntity/CatalogEntity.d.ts +1 -3
  7. package/lib/components/Catalog/CatalogEntity/CatalogEntity.js +17 -13
  8. package/lib/components/Catalog/CatalogEntity/CatalogEntityInfoBar.d.ts +4 -2
  9. package/lib/components/Catalog/CatalogEntity/CatalogEntityInfoBar.js +15 -7
  10. package/lib/components/Catalog/CatalogEntity/CatalogEntityLinks.js +6 -6
  11. package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.js +18 -1
  12. package/lib/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.d.ts +6 -0
  13. package/lib/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.js +47 -0
  14. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ApiDescriptionProperty.js +8 -1
  15. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.js +7 -1
  16. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.d.ts +2 -1
  17. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.js +12 -5
  18. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.js +1 -1
  19. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.js +3 -3
  20. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.js +7 -2
  21. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.d.ts +6 -0
  22. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.js +19 -0
  23. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/GitProperty.js +1 -1
  24. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.js +2 -1
  25. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.d.ts +3 -1
  26. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.js +13 -10
  27. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.d.ts +3 -1
  28. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +33 -12
  29. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.d.ts +3 -3
  30. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.js +5 -5
  31. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.d.ts +2 -1
  32. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js +11 -5
  33. package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.d.ts +6 -0
  34. package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +55 -0
  35. package/lib/components/Catalog/CatalogEntityIcon.d.ts +2 -1
  36. package/lib/components/Catalog/CatalogEntityIcon.js +22 -23
  37. package/lib/components/Catalog/CatalogEntityTypeIcon.d.ts +2 -1
  38. package/lib/components/Catalog/CatalogEntityTypeIcon.js +11 -23
  39. package/lib/components/Catalog/CatalogEntityTypeTag.d.ts +7 -0
  40. package/lib/components/Catalog/CatalogEntityTypeTag.js +40 -0
  41. package/lib/components/Catalog/CatalogPageDescription.js +3 -3
  42. package/lib/components/Catalog/CatalogSortButton.js +6 -6
  43. package/lib/components/Catalog/CatalogTableView/CatalogDomainsCell.js +1 -0
  44. package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.d.ts +6 -4
  45. package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.js +3 -15
  46. package/lib/components/Catalog/CatalogTableView/CatalogEntityRelationCell.d.ts +3 -0
  47. package/lib/components/Catalog/CatalogTableView/CatalogEntityRelationCell.js +11 -0
  48. package/lib/components/Catalog/CatalogTableView/CatalogOwnersCell.js +1 -0
  49. package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.d.ts +1 -1
  50. package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.js +1 -5
  51. package/lib/components/Catalog/CatalogTableView/CatalogTableView.d.ts +3 -3
  52. package/lib/components/Catalog/CatalogTableView/CatalogTableView.js +5 -28
  53. package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.d.ts +0 -2
  54. package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.js +12 -33
  55. package/lib/components/Catalog/CatalogTableView/CatalogTagsCell.js +1 -0
  56. package/lib/components/Catalog/CatalogTableView/CatalogUserEntityCell.js +8 -4
  57. package/lib/components/Catalog/CatalogTagsWithTooltip.d.ts +1 -1
  58. package/lib/components/Catalog/CatalogTagsWithTooltip.js +6 -7
  59. package/lib/components/Catalog/variables.js +44 -10
  60. package/lib/components/CodeBlock/CodeBlock.d.ts +16 -6
  61. package/lib/components/CodeBlock/CodeBlock.js +3 -2
  62. package/lib/components/CodeBlock/CodeBlockControls.d.ts +4 -3
  63. package/lib/components/CodeBlock/CodeBlockControls.js +35 -8
  64. package/lib/components/CodeBlock/CodeBlockDropdown.d.ts +3 -0
  65. package/lib/components/CodeBlock/CodeBlockDropdown.js +35 -0
  66. package/lib/components/CodeBlock/CodeBlockTabs.d.ts +2 -2
  67. package/lib/components/CodeBlock/CodeBlockTabs.js +18 -9
  68. package/lib/components/CodeBlock/variables.js +1 -1
  69. package/lib/components/Feedback/Feedback.js +1 -1
  70. package/lib/components/Filter/FilterCheckboxes.js +5 -2
  71. package/lib/components/Image/Image.js +2 -0
  72. package/lib/components/Markdown/Markdown.js +2 -2
  73. package/lib/components/Menu/variables.js +2 -0
  74. package/lib/components/Navbar/Navbar.js +1 -1
  75. package/lib/components/Search/SearchDialog.js +2 -2
  76. package/lib/components/Search/SearchTrigger.js +1 -1
  77. package/lib/components/Tag/Tag.d.ts +2 -1
  78. package/lib/components/Tag/Tag.js +3 -3
  79. package/lib/components/Tag/variables.js +14 -0
  80. package/lib/components/Tags/CounterTag.d.ts +1 -1
  81. package/lib/components/Tags/HttpTag.d.ts +1 -1
  82. package/lib/components/UserMenu/UserMenu.js +1 -1
  83. package/lib/core/constants/catalog.d.ts +3 -0
  84. package/lib/core/constants/catalog.js +55 -1
  85. package/lib/core/constants/index.d.ts +5 -5
  86. package/lib/core/constants/index.js +5 -5
  87. package/lib/core/constants/search.d.ts +1 -1
  88. package/lib/core/contexts/CodeSnippetContext.d.ts +7 -0
  89. package/lib/core/contexts/CodeSnippetContext.js +23 -0
  90. package/lib/core/contexts/CodeWalkthrough/CodeWalkthroughControlsContext.d.ts +1 -1
  91. package/lib/core/contexts/CodeWalkthrough/CodeWalkthroughStepsContext.d.ts +1 -1
  92. package/lib/core/contexts/ThemeDataContext.d.ts +1 -1
  93. package/lib/core/contexts/index.d.ts +4 -3
  94. package/lib/core/contexts/index.js +4 -3
  95. package/lib/core/hoc/index.d.ts +1 -1
  96. package/lib/core/hoc/index.js +1 -1
  97. package/lib/core/hooks/__mocks__/index.d.ts +28 -28
  98. package/lib/core/hooks/__mocks__/index.js +28 -28
  99. package/lib/core/hooks/catalog/useCatalogEntities.d.ts +1 -1
  100. package/lib/core/hooks/catalog/useCatalogTableViewRow.js +2 -2
  101. package/lib/core/hooks/code-walkthrough/use-code-panel.js +6 -5
  102. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-controls.js +8 -5
  103. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.d.ts +1 -1
  104. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.js +9 -9
  105. package/lib/core/hooks/code-walkthrough/use-code-walkthrough.d.ts +2 -2
  106. package/lib/core/hooks/code-walkthrough/use-code-walkthrough.js +4 -3
  107. package/lib/core/hooks/code-walkthrough/use-renderable-files.js +6 -4
  108. package/lib/core/hooks/feedback/use-report-dialog.js +4 -3
  109. package/lib/core/hooks/index.d.ts +42 -42
  110. package/lib/core/hooks/index.js +42 -42
  111. package/lib/core/hooks/menu/use-menu-item-expanded.d.ts +1 -1
  112. package/lib/core/hooks/menu/use-mobile-menu-items.d.ts +1 -1
  113. package/lib/core/hooks/menu/use-mobile-menu-items.js +13 -12
  114. package/lib/core/hooks/menu/use-mobile-menu-levels.d.ts +1 -1
  115. package/lib/core/hooks/menu/use-mobile-menu-levels.js +8 -7
  116. package/lib/core/hooks/menu/use-nested-menu.d.ts +1 -1
  117. package/lib/core/hooks/menu/use-nested-menu.js +8 -6
  118. package/lib/core/hooks/search/use-recent-searches.js +3 -3
  119. package/lib/core/hooks/search/use-search-dialog.js +4 -3
  120. package/lib/core/hooks/search/use-search-filter.d.ts +1 -1
  121. package/lib/core/hooks/search/use-suggested-pages.js +2 -2
  122. package/lib/core/hooks/use-active-page-version.js +2 -2
  123. package/lib/core/hooks/use-active-section-id.d.ts +1 -1
  124. package/lib/core/hooks/use-active-section-id.js +4 -4
  125. package/lib/core/hooks/use-codeblock-tabs-controls.d.ts +2 -2
  126. package/lib/core/hooks/use-codeblock-tabs-controls.js +6 -6
  127. package/lib/core/hooks/use-color-switcher.js +4 -3
  128. package/lib/core/hooks/use-input-key-commands.js +2 -2
  129. package/lib/core/hooks/use-language-picker.d.ts +1 -1
  130. package/lib/core/hooks/use-language-picker.js +4 -4
  131. package/lib/core/hooks/use-local-state.d.ts +1 -0
  132. package/lib/core/hooks/use-local-state.js +32 -0
  133. package/lib/core/hooks/use-mobile-menu.js +2 -2
  134. package/lib/core/hooks/use-navbar-height.js +3 -3
  135. package/lib/core/hooks/use-page-versions.js +2 -2
  136. package/lib/core/hooks/use-product-picker.js +2 -2
  137. package/lib/core/hooks/use-theme-config.js +2 -2
  138. package/lib/core/hooks/use-theme-hooks.d.ts +1 -1
  139. package/lib/core/hooks/use-theme-hooks.js +2 -2
  140. package/lib/core/hooks/use-time-ago.js +2 -2
  141. package/lib/core/hooks/use-user-teams.js +2 -2
  142. package/lib/core/index.d.ts +7 -7
  143. package/lib/core/index.js +7 -7
  144. package/lib/core/openapi/index.d.ts +18 -0
  145. package/lib/core/openapi/index.js +48 -0
  146. package/lib/core/styles/global.js +1 -1
  147. package/lib/core/styles/index.d.ts +2 -2
  148. package/lib/core/styles/index.js +2 -2
  149. package/lib/core/templates/Markdown.d.ts +1 -1
  150. package/lib/core/templates/Markdown.js +8 -6
  151. package/lib/core/types/catalog.d.ts +10 -2
  152. package/lib/core/types/code-walkthrough.d.ts +1 -1
  153. package/lib/core/types/feedback.d.ts +1 -1
  154. package/lib/core/types/filter.d.ts +1 -1
  155. package/lib/core/types/hooks.d.ts +11 -3
  156. package/lib/core/types/index.d.ts +18 -18
  157. package/lib/core/types/index.js +18 -18
  158. package/lib/core/types/l10n.d.ts +1 -1
  159. package/lib/core/types/search.d.ts +1 -1
  160. package/lib/core/types/sidebar.d.ts +1 -1
  161. package/lib/core/types/telemetry.d.ts +5 -20
  162. package/lib/core/utils/download-code-walkthrough.js +33 -11
  163. package/lib/core/utils/get-code-walkthrough-file-text.js +4 -3
  164. package/lib/core/utils/get-file-icon.d.ts +1 -0
  165. package/lib/core/utils/get-file-icon.js +22 -0
  166. package/lib/core/utils/index.d.ts +36 -35
  167. package/lib/core/utils/index.js +36 -35
  168. package/lib/core/utils/lang-to-name.d.ts +1 -0
  169. package/lib/core/utils/lang-to-name.js +27 -0
  170. package/lib/core/utils/load-and-navigate.js +2 -2
  171. package/lib/core/utils/match-code-walkthrough-conditions.js +3 -3
  172. package/lib/core/utils/menu.d.ts +3 -2
  173. package/lib/core/utils/menu.js +12 -12
  174. package/lib/core/utils/{text-transform.js → string.js} +1 -1
  175. package/lib/core/utils/toc.d.ts +1 -1
  176. package/lib/core/utils/type-guards.d.ts +1 -1
  177. package/lib/core/utils/type-guards.js +5 -5
  178. package/lib/core/utils/urls.d.ts +1 -1
  179. package/lib/core/utils/urls.js +2 -2
  180. package/lib/icons/GraphqlIcon/GraphqlIcon.d.ts +9 -0
  181. package/lib/icons/GraphqlIcon/GraphqlIcon.js +36 -0
  182. package/lib/icons/GraphqlIcon/index.d.ts +1 -0
  183. package/lib/icons/GraphqlIcon/index.js +6 -0
  184. package/lib/icons/HexagonIcon/HexagonIcon.d.ts +9 -0
  185. package/lib/icons/HexagonIcon/HexagonIcon.js +22 -0
  186. package/lib/icons/MoleculesIcon/MoleculesIcon.d.ts +9 -0
  187. package/lib/icons/MoleculesIcon/MoleculesIcon.js +22 -0
  188. package/lib/icons/NetworkIcon/NetworkIcon.d.ts +9 -0
  189. package/lib/icons/NetworkIcon/NetworkIcon.js +23 -0
  190. package/lib/icons/NoneIcon/NoneIcon.d.ts +9 -0
  191. package/lib/icons/NoneIcon/NoneIcon.js +17 -0
  192. package/lib/icons/NotesIcon/NotesIcon.d.ts +9 -0
  193. package/lib/icons/NotesIcon/NotesIcon.js +26 -0
  194. package/lib/index.d.ts +1 -0
  195. package/lib/index.js +1 -0
  196. package/lib/layouts/DocumentationLayout.js +14 -10
  197. package/lib/markdoc/components/CodeGroup/CodeGroup.d.ts +4 -0
  198. package/lib/markdoc/components/CodeGroup/CodeGroup.js +73 -0
  199. package/lib/markdoc/components/Tabs/TabList.js +2 -0
  200. package/lib/markdoc/components/default.d.ts +1 -0
  201. package/lib/markdoc/components/default.js +1 -0
  202. package/lib/markdoc/default.js +2 -0
  203. package/lib/markdoc/tags/code-group.d.ts +2 -0
  204. package/lib/markdoc/tags/code-group.js +23 -0
  205. package/lib/markdoc/tags/code-snippet.js +1 -1
  206. package/package.json +5 -5
  207. package/src/components/Breadcrumbs/Breadcrumbs.tsx +1 -1
  208. package/src/components/Button/Button.tsx +1 -0
  209. package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +11 -5
  210. package/src/components/Catalog/CatalogEntitiesEmptyState.tsx +38 -4
  211. package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +25 -17
  212. package/src/components/Catalog/CatalogEntity/CatalogEntityInfoBar.tsx +25 -9
  213. package/src/components/Catalog/CatalogEntity/CatalogEntityLinks.tsx +12 -15
  214. package/src/components/Catalog/CatalogEntity/CatalogEntityMetadata.tsx +39 -2
  215. package/src/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.tsx +61 -0
  216. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/ApiDescriptionProperty.tsx +12 -1
  217. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.tsx +7 -1
  218. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.tsx +15 -4
  219. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.tsx +5 -1
  220. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.tsx +2 -3
  221. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.tsx +11 -3
  222. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.tsx +37 -0
  223. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/GitProperty.tsx +1 -1
  224. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.tsx +2 -0
  225. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.tsx +22 -23
  226. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +13 -8
  227. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +21 -14
  228. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +24 -4
  229. package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +52 -0
  230. package/src/components/Catalog/CatalogEntityIcon.tsx +33 -27
  231. package/src/components/Catalog/CatalogEntityTypeIcon.tsx +23 -28
  232. package/src/components/Catalog/CatalogEntityTypeTag.tsx +49 -0
  233. package/src/components/Catalog/CatalogPageDescription.tsx +5 -4
  234. package/src/components/Catalog/CatalogSortButton.tsx +19 -20
  235. package/src/components/Catalog/CatalogTableView/CatalogDomainsCell.tsx +1 -0
  236. package/src/components/Catalog/CatalogTableView/CatalogEntityCell.tsx +8 -21
  237. package/src/components/Catalog/CatalogTableView/CatalogEntityRelationCell.tsx +19 -0
  238. package/src/components/Catalog/CatalogTableView/CatalogOwnersCell.tsx +1 -0
  239. package/src/components/Catalog/CatalogTableView/CatalogTableHeaderCell.tsx +5 -8
  240. package/src/components/Catalog/CatalogTableView/CatalogTableView.tsx +6 -32
  241. package/src/components/Catalog/CatalogTableView/CatalogTableViewRow.tsx +18 -42
  242. package/src/components/Catalog/CatalogTableView/CatalogTagsCell.tsx +1 -0
  243. package/src/components/Catalog/CatalogTableView/CatalogUserEntityCell.tsx +9 -4
  244. package/src/components/Catalog/CatalogTagsWithTooltip.tsx +16 -20
  245. package/src/components/Catalog/variables.ts +44 -10
  246. package/src/components/CodeBlock/CodeBlock.tsx +15 -5
  247. package/src/components/CodeBlock/CodeBlockControls.tsx +67 -26
  248. package/src/components/CodeBlock/CodeBlockDropdown.tsx +55 -0
  249. package/src/components/CodeBlock/CodeBlockTabs.tsx +29 -20
  250. package/src/components/CodeBlock/variables.ts +1 -1
  251. package/src/components/Feedback/Feedback.tsx +1 -1
  252. package/src/components/Filter/FilterCheckboxes.tsx +9 -2
  253. package/src/components/Image/Image.tsx +2 -0
  254. package/src/components/Markdown/Markdown.tsx +2 -2
  255. package/src/components/Menu/variables.ts +2 -0
  256. package/src/components/Navbar/Navbar.tsx +1 -0
  257. package/src/components/Search/SearchDialog.tsx +2 -2
  258. package/src/components/Search/SearchTrigger.tsx +1 -0
  259. package/src/components/Tag/Tag.tsx +11 -2
  260. package/src/components/Tag/variables.ts +14 -0
  261. package/src/components/UserMenu/UserMenu.tsx +1 -1
  262. package/src/core/constants/catalog.ts +58 -0
  263. package/src/core/constants/index.ts +5 -5
  264. package/src/core/constants/search.ts +1 -1
  265. package/src/core/contexts/CodeSnippetContext.tsx +29 -0
  266. package/src/core/contexts/CodeWalkthrough/CodeWalkthroughControlsContext.tsx +1 -1
  267. package/src/core/contexts/CodeWalkthrough/CodeWalkthroughStepsContext.tsx +1 -1
  268. package/src/core/contexts/ThemeDataContext.tsx +3 -3
  269. package/src/core/contexts/index.ts +4 -3
  270. package/src/core/hoc/index.ts +1 -1
  271. package/src/core/hooks/__mocks__/index.ts +28 -28
  272. package/src/core/hooks/catalog/useCatalogEntities.ts +1 -1
  273. package/src/core/hooks/catalog/useCatalogTableViewRow.ts +1 -1
  274. package/src/core/hooks/code-walkthrough/use-code-panel.ts +3 -5
  275. package/src/core/hooks/code-walkthrough/use-code-walkthrough-controls.ts +4 -6
  276. package/src/core/hooks/code-walkthrough/use-code-walkthrough-steps.ts +4 -3
  277. package/src/core/hooks/code-walkthrough/use-code-walkthrough.ts +3 -3
  278. package/src/core/hooks/code-walkthrough/use-renderable-files.ts +4 -6
  279. package/src/core/hooks/feedback/use-report-dialog.ts +3 -2
  280. package/src/core/hooks/index.ts +42 -42
  281. package/src/core/hooks/menu/use-menu-item-expanded.ts +1 -1
  282. package/src/core/hooks/menu/use-mobile-menu-items.ts +4 -7
  283. package/src/core/hooks/menu/use-mobile-menu-levels.ts +3 -2
  284. package/src/core/hooks/menu/use-nested-menu.ts +5 -3
  285. package/src/core/hooks/search/use-recent-searches.ts +1 -1
  286. package/src/core/hooks/search/use-search-dialog.ts +2 -1
  287. package/src/core/hooks/search/use-search-filter.ts +1 -1
  288. package/src/core/hooks/search/use-suggested-pages.ts +1 -1
  289. package/src/core/hooks/use-active-page-version.ts +1 -1
  290. package/src/core/hooks/use-active-section-id.ts +3 -2
  291. package/src/core/hooks/use-codeblock-tabs-controls.ts +8 -8
  292. package/src/core/hooks/use-color-switcher.ts +2 -1
  293. package/src/core/hooks/use-input-key-commands.ts +1 -1
  294. package/src/core/hooks/use-language-picker.ts +3 -3
  295. package/src/core/hooks/use-local-state.ts +30 -0
  296. package/src/core/hooks/use-mobile-menu.ts +1 -1
  297. package/src/core/hooks/use-navbar-height.ts +1 -1
  298. package/src/core/hooks/use-page-versions.ts +1 -1
  299. package/src/core/hooks/use-product-picker.ts +1 -1
  300. package/src/core/hooks/use-theme-config.ts +2 -2
  301. package/src/core/hooks/use-theme-hooks.ts +2 -2
  302. package/src/core/hooks/use-time-ago.ts +3 -2
  303. package/src/core/hooks/use-user-teams.ts +1 -1
  304. package/src/core/index.ts +7 -7
  305. package/src/core/openapi/index.ts +31 -0
  306. package/src/core/styles/global.ts +2 -1
  307. package/src/core/styles/index.ts +2 -2
  308. package/src/core/templates/Markdown.tsx +8 -4
  309. package/src/core/types/catalog.ts +19 -2
  310. package/src/core/types/code-walkthrough.ts +1 -1
  311. package/src/core/types/feedback.ts +6 -6
  312. package/src/core/types/filter.ts +1 -1
  313. package/src/core/types/hooks.ts +17 -16
  314. package/src/core/types/index.ts +18 -18
  315. package/src/core/types/l10n.ts +9 -0
  316. package/src/core/types/search.ts +1 -1
  317. package/src/core/types/sidebar.ts +1 -1
  318. package/src/core/types/telemetry.ts +5 -13
  319. package/src/core/utils/download-code-walkthrough.ts +8 -9
  320. package/src/core/utils/get-code-walkthrough-file-text.ts +2 -1
  321. package/src/core/utils/get-file-icon.ts +23 -0
  322. package/src/core/utils/index.ts +36 -35
  323. package/src/core/utils/lang-to-name.ts +25 -0
  324. package/src/core/utils/load-and-navigate.ts +1 -1
  325. package/src/core/utils/match-code-walkthrough-conditions.ts +1 -1
  326. package/src/core/utils/menu.ts +4 -3
  327. package/src/core/utils/toc.ts +1 -1
  328. package/src/core/utils/type-guards.ts +2 -2
  329. package/src/core/utils/urls.ts +2 -2
  330. package/src/icons/GraphqlIcon/GraphqlIcon.tsx +81 -0
  331. package/src/icons/GraphqlIcon/index.ts +1 -0
  332. package/src/icons/HexagonIcon/HexagonIcon.tsx +23 -0
  333. package/src/icons/MoleculesIcon/MoleculesIcon.tsx +23 -0
  334. package/src/icons/NetworkIcon/NetworkIcon.tsx +31 -0
  335. package/src/icons/NoneIcon/NoneIcon.tsx +17 -0
  336. package/src/icons/NotesIcon/NotesIcon.tsx +43 -0
  337. package/src/index.ts +1 -0
  338. package/src/layouts/DocumentationLayout.tsx +23 -13
  339. package/src/markdoc/components/CodeGroup/CodeGroup.tsx +76 -0
  340. package/src/markdoc/components/Tabs/TabList.tsx +1 -0
  341. package/src/markdoc/components/default.ts +1 -0
  342. package/src/markdoc/default.ts +2 -0
  343. package/src/markdoc/tags/code-group.ts +21 -0
  344. package/src/markdoc/tags/code-snippet.ts +1 -1
  345. /package/lib/core/utils/{text-transform.d.ts → string.d.ts} +0 -0
  346. /package/src/core/utils/{text-transform.ts → string.ts} +0 -0
@@ -25,7 +25,7 @@ function Breadcrumbs(props) {
25
25
  payload: {
26
26
  link: breadcrumb.link,
27
27
  position: idx + 1,
28
- total_breadcrumbs: breadcrumbs.length,
28
+ totalBreadcrumbs: breadcrumbs.length,
29
29
  },
30
30
  });
31
31
  } }),
@@ -82,6 +82,7 @@ const StyledButton = styled_components_1.default.button.attrs((props) => ({
82
82
  background-color: var(--button-bg-color);
83
83
  border: var(--button-border-width) var(--button-border-style) var(--button-border-color);
84
84
  box-shadow: var(--button-box-shadow);
85
+ backdrop-filter: var(--button-backdrop-filter, none);
85
86
 
86
87
  font-weight: var(--button-font-weight);
87
88
  font-size: var(--button-font-size);
@@ -14,6 +14,7 @@ const ArrowUpRightIcon_1 = require("../../../icons/ArrowUpRightIcon/ArrowUpRight
14
14
  const CatalogTagsWithTooltip_1 = require("../../../components/Catalog/CatalogTagsWithTooltip");
15
15
  const CatalogEntityIcon_1 = require("../../../components/Catalog/CatalogEntityIcon");
16
16
  const core_1 = require("../../../core");
17
+ const Tooltip_1 = require("../../../components/Tooltip/Tooltip");
17
18
  function CatalogCard({ entity, catalogConfig }) {
18
19
  var _a, _b, _c;
19
20
  const { useTelemetry } = (0, hooks_1.useThemeHooks)();
@@ -25,8 +26,9 @@ function CatalogCard({ entity, catalogConfig }) {
25
26
  } },
26
27
  react_1.default.createElement(CardContent, null,
27
28
  react_1.default.createElement(CardHeader, null,
28
- react_1.default.createElement(HeaderIconWrapper, null,
29
- react_1.default.createElement(CatalogEntityIcon_1.CatalogEntityIcon, { entityType: entity.type })),
29
+ react_1.default.createElement(Tooltip_1.TooltipComponent, { tip: entity.type, placement: "bottom", className: "catalog" },
30
+ react_1.default.createElement(HeaderIconWrapper, null,
31
+ react_1.default.createElement(CatalogEntityIcon_1.CatalogEntityIcon, { entityType: entity.type, defaultColor: true }))),
30
32
  react_1.default.createElement(CardTitle, null,
31
33
  react_1.default.createElement(CatalogHighlight_1.CatalogHighlight, null, entity.title))),
32
34
  react_1.default.createElement(CardDescription, null,
@@ -40,6 +42,7 @@ function CatalogCard({ entity, catalogConfig }) {
40
42
  backgroundColor: 'var(--catalog-card-icon-bg-color)',
41
43
  },
42
44
  icon: react_1.default.createElement(GraphIcon_1.GraphIcon, { color: "var(--color-green-8)" }),
45
+ textTransform: 'none',
43
46
  } })),
44
47
  react_1.default.createElement(MetadataColumn, null,
45
48
  react_1.default.createElement(MetadataLabel, null, "Owners:"),
@@ -49,6 +52,7 @@ function CatalogCard({ entity, catalogConfig }) {
49
52
  backgroundColor: 'var(--catalog-card-icon-bg-color)',
50
53
  borderRadius: 'var(--border-radius-xl)',
51
54
  },
55
+ textTransform: 'none',
52
56
  } })))),
53
57
  react_1.default.createElement(Divider, null),
54
58
  react_1.default.createElement(CardFooter, null,
@@ -59,6 +63,7 @@ function CatalogCard({ entity, catalogConfig }) {
59
63
  },
60
64
  borderless: true,
61
65
  color: 'grey',
66
+ textTransform: 'none',
62
67
  }, itemsToShow: 3 }),
63
68
  react_1.default.createElement(ArrowCircle, null,
64
69
  react_1.default.createElement(ArrowRightIcon_1.ArrowRightIcon, { size: "16px" }),
@@ -118,6 +123,7 @@ const CardContent = styled_components_1.default.div `
118
123
  padding: var(--catalog-card-padding-vertical) var(--catalog-card-padding-horizontal);
119
124
  `;
120
125
  const CardFooter = styled_components_1.default.div `
126
+ height: var(--catalog-card-footer-height);
121
127
  display: flex;
122
128
  align-items: center;
123
129
  justify-content: space-between;
@@ -129,8 +135,7 @@ const Divider = styled_components_1.default.div `
129
135
  background-color: var(--catalog-card-divider-color);
130
136
  `;
131
137
  const CatalogCardWrapper = styled_components_1.default.div `
132
- min-height: var(--catalog-card-min-height);
133
- height: 100%;
138
+ height: var(--catalog-card-height);
134
139
  color: var(--catalog-card-text-color);
135
140
  font-size: var(--catalog-card-font-size);
136
141
  font-weight: var(--catalog-card-font-weight);
@@ -1,2 +1,6 @@
1
1
  import { JSX } from 'react';
2
- export declare function CatalogEntitiesEmptyState(): JSX.Element;
2
+ interface CatalogEntitiesEmptyStateProps {
3
+ listType?: 'default' | 'team';
4
+ }
5
+ export declare function CatalogEntitiesEmptyState({ listType, }: CatalogEntitiesEmptyStateProps): JSX.Element;
6
+ export {};
@@ -6,11 +6,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.CatalogEntitiesEmptyState = CatalogEntitiesEmptyState;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const styled_components_1 = __importDefault(require("styled-components"));
9
- function CatalogEntitiesEmptyState() {
9
+ const HexagonIcon_1 = require("../../icons/HexagonIcon/HexagonIcon");
10
+ function CatalogEntitiesEmptyState({ listType = 'default', }) {
11
+ if (listType === 'team') {
12
+ return (react_1.default.createElement(EmptyStateWrapper, { "data-component-name": "Catalog/CatalogEntitiesEmptyState" },
13
+ react_1.default.createElement(EmptyStateIconWrapper, null,
14
+ react_1.default.createElement(HexagonIcon_1.HexagonIcon, { size: "21px", color: "var(--color-warm-grey-7)" })),
15
+ react_1.default.createElement(EmptyStateHeader, null, "No team members yet"),
16
+ react_1.default.createElement(EmptyStateText, null, "Your team members will appear here"),
17
+ react_1.default.createElement(EmptyStateText, null, "once they've been added to the team.")));
18
+ }
10
19
  return (react_1.default.createElement(EmptyStateWrapper, { "data-component-name": "Catalog/CatalogEntitiesEmptyState" },
11
- react_1.default.createElement(EmptyStateHeader, null, "No entities yet"),
12
- react_1.default.createElement(EmptyStateText, null, "Start by adding your first entity to"),
13
- react_1.default.createElement(EmptyStateText, null, "begin building your catalog.")));
20
+ react_1.default.createElement(EmptyStateIconWrapper, null,
21
+ react_1.default.createElement(HexagonIcon_1.HexagonIcon, { size: "21px", color: "var(--color-warm-grey-7)" })),
22
+ react_1.default.createElement(EmptyStateHeader, null, "No entities found"),
23
+ react_1.default.createElement(EmptyStateText, null, "Try adjusting your search criteria or"),
24
+ react_1.default.createElement(EmptyStateText, null, "check back later for new additions.")));
14
25
  }
15
26
  const EmptyStateWrapper = styled_components_1.default.div `
16
27
  display: flex;
@@ -21,6 +32,16 @@ const EmptyStateWrapper = styled_components_1.default.div `
21
32
  text-align: center;
22
33
  min-height: var(--catalog-empty-state-min-height);
23
34
  `;
35
+ const EmptyStateIconWrapper = styled_components_1.default.div `
36
+ display: flex;
37
+ align-items: center;
38
+ justify-content: center;
39
+ background-color: var(--color-warm-grey-2);
40
+ width: 40px;
41
+ height: 40px;
42
+ border-radius: 50%;
43
+ margin-bottom: var(--spacing-xxs);
44
+ `;
24
45
  const EmptyStateHeader = styled_components_1.default.p `
25
46
  color: var(--catalog-empty-state-header-text-color);
26
47
  font-size: var(--catalog-empty-state-header-font-size);
@@ -6,7 +6,5 @@ export type CatalogEntityProps = {
6
6
  entitiesCatalogConfig: EntitiesCatalogConfig;
7
7
  catalogConfig: CatalogEntityConfig;
8
8
  initialRelations: BffCatalogRelatedEntityList;
9
- mainCatalogLabelTranslationKey?: string;
10
- mainCatalogSlug?: string;
11
9
  };
12
- export declare function CatalogEntity({ entity, entitiesCatalogConfig, catalogConfig, initialRelations, mainCatalogLabelTranslationKey, mainCatalogSlug, }: CatalogEntityProps): React.JSX.Element;
10
+ export declare function CatalogEntity({ entity, entitiesCatalogConfig, catalogConfig, initialRelations, }: CatalogEntityProps): React.JSX.Element;
@@ -18,14 +18,26 @@ const Menu_1 = require("../../../components/Menu/Menu");
18
18
  const Button_1 = require("../../../components/Button/Button");
19
19
  const CatalogEntityRelations_1 = require("../../../components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations");
20
20
  const hooks_1 = require("../../../core/hooks");
21
- const SidebarActions_1 = require("../../SidebarActions/SidebarActions");
22
- function CatalogEntity({ entity, entitiesCatalogConfig, catalogConfig, initialRelations, mainCatalogLabelTranslationKey, mainCatalogSlug, }) {
21
+ const SidebarActions_1 = require("../../../components/SidebarActions/SidebarActions");
22
+ const CatalogEntitySchema_1 = require("../../../components/Catalog/CatalogEntity/CatalogEntitySchema");
23
+ const CatalogEntityMethodAndPath_1 = require("../../../components/Catalog/CatalogEntity/CatalogEntityMethodAndPath");
24
+ function CatalogEntity({ entity, entitiesCatalogConfig, catalogConfig, initialRelations, }) {
23
25
  var _a;
24
26
  const { useTranslate, useCatalog } = (0, hooks_1.useThemeHooks)();
25
27
  const { translate } = useTranslate();
26
28
  const linkToMainCatalog = `catalogs/${catalogConfig.slug}`;
27
29
  const linkToMainCatalogLabel = translate(catalogConfig.titleTranslationKey);
28
- const { layout, collapsedSidebar, onChangeViewClick, onChangeCollapseSidebarClick } = useCatalog();
30
+ const { layout, collapsedSidebar, onChangeViewClick, onChangeCollapseSidebarClick, searchQuery, setSearchQuery, } = useCatalog();
31
+ const renderEntityContent = () => {
32
+ switch (entity.type) {
33
+ case 'data-schema':
34
+ return react_1.default.createElement(CatalogEntitySchema_1.CatalogEntitySchema, { entity: entity });
35
+ case 'api-operation':
36
+ return react_1.default.createElement(CatalogEntityMethodAndPath_1.CatalogEntityMethodAndPath, { entity: entity });
37
+ default:
38
+ return react_1.default.createElement(CatalogEntityMetadata_1.CatalogEntityMetadata, { entity: entity });
39
+ }
40
+ };
29
41
  return (react_1.default.createElement(CatalogPageWrapper, { "data-component-name": "Catalog/CatalogEntity/CatalogEntity" },
30
42
  react_1.default.createElement(CatalogSidebar, { collapsed: collapsedSidebar, header: react_1.default.createElement(BackLink, { icon: react_1.default.createElement(ArrowLeftIcon_1.ArrowLeftIcon, null), iconPosition: "left", variant: "ghost", size: "medium", "data-component-name": "Sidebar/BackButton", to: linkToMainCatalog }, collapsedSidebar ? ('') : (react_1.default.createElement("div", { "data-translation-key": "sidebar.menu.backLabel" }, translate('sidebar.menu.backLabel')))), menu: react_1.default.createElement(Menu_1.Menu, { items: [
31
43
  {
@@ -38,14 +50,6 @@ function CatalogEntity({ entity, entitiesCatalogConfig, catalogConfig, initialRe
38
50
  ] }), footer: react_1.default.createElement(SidebarActions_1.SidebarActions, { layout: layout, collapsedSidebar: collapsedSidebar, isApiDocs: false, onChangeViewClick: onChangeViewClick, onChangeCollapseSidebarClick: onChangeCollapseSidebarClick }) }),
39
51
  react_1.default.createElement(CatalogPageContent, null,
40
52
  react_1.default.createElement(Breadcrumbs_1.Breadcrumbs, { additionalBreadcrumbs: [
41
- ...(mainCatalogLabelTranslationKey
42
- ? [
43
- {
44
- label: translate(mainCatalogLabelTranslationKey),
45
- link: `catalogs/${mainCatalogSlug}`,
46
- },
47
- ]
48
- : []),
49
53
  { label: linkToMainCatalogLabel, link: linkToMainCatalog },
50
54
  { label: entity.title },
51
55
  ] }),
@@ -53,9 +57,9 @@ function CatalogEntity({ entity, entitiesCatalogConfig, catalogConfig, initialRe
53
57
  react_1.default.createElement(CatalogPageDescription_1.CatalogPageDescription, { title: entity.title, description: (_a = entity.summary) !== null && _a !== void 0 ? _a : '', tag: entity.key }),
54
58
  react_1.default.createElement(CatalogEntityProperties_1.CatalogEntityProperties, { entity: entity }),
55
59
  react_1.default.createElement(CatalogTwoColumnsSection, null,
56
- react_1.default.createElement(CatalogEntityMetadata_1.CatalogEntityMetadata, { entity: entity }),
60
+ renderEntityContent(),
57
61
  react_1.default.createElement(CatalogEntityLinks_1.CatalogEntityLinks, { entity: entity })),
58
- react_1.default.createElement(CatalogEntityRelations_1.CatalogEntityRelations, { entity: entity, entitiesCatalogConfig: entitiesCatalogConfig, catalogConfig: catalogConfig, initialRelations: initialRelations })))));
62
+ react_1.default.createElement(CatalogEntityRelations_1.CatalogEntityRelations, { entity: entity, entitiesCatalogConfig: entitiesCatalogConfig, catalogConfig: catalogConfig, initialRelations: initialRelations, searchQuery: searchQuery, setSearchQuery: setSearchQuery })))));
59
63
  }
60
64
  const CatalogPageWrapper = styled_components_1.default.div `
61
65
  --sidebar-width: var(--catalog-sidebar-width);
@@ -1,7 +1,9 @@
1
1
  import { ReactNode, JSX } from 'react';
2
2
  export type CatalogEntityInfoBarProps = {
3
3
  leftContent: ReactNode;
4
- rightContent: ReactNode;
4
+ rightContent?: ReactNode;
5
5
  withSeparator?: boolean;
6
+ hoverEffect?: boolean;
7
+ isCodeBlock?: boolean;
6
8
  };
7
- export declare function CatalogEntityInfoBar({ leftContent, rightContent, withSeparator, }: CatalogEntityInfoBarProps): JSX.Element;
9
+ export declare function CatalogEntityInfoBar({ leftContent, rightContent, withSeparator, hoverEffect, isCodeBlock, }: CatalogEntityInfoBarProps): JSX.Element;
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.CatalogEntityInfoBar = CatalogEntityInfoBar;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const styled_components_1 = __importDefault(require("styled-components"));
9
- function CatalogEntityInfoBar({ leftContent, rightContent, withSeparator = true, }) {
10
- return (react_1.default.createElement(InfoBarWrapper, { "data-component-name": "Catalog/CatalogEntity/CatalogEntityInfoBar" },
9
+ function CatalogEntityInfoBar({ leftContent, rightContent, withSeparator = true, hoverEffect = true, isCodeBlock = false, }) {
10
+ return (react_1.default.createElement(InfoBarWrapper, { "data-component-name": "Catalog/CatalogEntity/CatalogEntityInfoBar", hoverEffect: hoverEffect },
11
11
  react_1.default.createElement(LeftColumn, { withSeparator: withSeparator }, leftContent),
12
- react_1.default.createElement(RightColumn, null, rightContent)));
12
+ rightContent && react_1.default.createElement(RightColumn, { isCodeBlock: isCodeBlock }, rightContent)));
13
13
  }
14
14
  const InfoBarWrapper = styled_components_1.default.div `
15
15
  display: grid;
@@ -18,7 +18,7 @@ const InfoBarWrapper = styled_components_1.default.div `
18
18
  align-items: center;
19
19
 
20
20
  color: var(--catalog-card-text-color, inherit);
21
- background-color: var(--catalog-card-bg-color, white);
21
+ background-color: var(--catalog-card-bg-color);
22
22
  border: var(--catalog-card-border-width, 1px) var(--catalog-card-border-style)
23
23
  var(--catalog-card-border-color);
24
24
  border-radius: var(--catalog-card-border-radius);
@@ -26,9 +26,13 @@ const InfoBarWrapper = styled_components_1.default.div `
26
26
  height: 100%;
27
27
  padding: var(--catalog-card-gap);
28
28
 
29
- &:hover {
30
- border-color: var(--catalog-card-border-color-hover);
31
- }
29
+ ${({ hoverEffect }) => hoverEffect &&
30
+ `
31
+ &:hover {
32
+ border-color: var(--catalog-card-border-color-hover);
33
+ background-color: var(--bg-color-active);
34
+ }
35
+ `}
32
36
  `;
33
37
  const LeftColumn = styled_components_1.default.div `
34
38
  font-weight: var(--font-weight-medium);
@@ -38,6 +42,9 @@ const LeftColumn = styled_components_1.default.div `
38
42
  justify-self: start;
39
43
  text-align: left;
40
44
  border-right: ${({ withSeparator }) => withSeparator ? '1px solid var(--border-color-primary)' : 'none'};
45
+ height: 100%;
46
+ display: flex;
47
+ align-items: center;
41
48
  `;
42
49
  const RightColumn = styled_components_1.default.div `
43
50
  color: var(--catalog-metadata-value-color);
@@ -45,5 +52,6 @@ const RightColumn = styled_components_1.default.div `
45
52
  grid-area: right;
46
53
  justify-self: end;
47
54
  text-align: right;
55
+ width: ${({ isCodeBlock }) => (isCodeBlock ? '100%' : 'auto')};
48
56
  `;
49
57
  //# sourceMappingURL=CatalogEntityInfoBar.js.map
@@ -7,7 +7,7 @@ exports.CatalogEntityLinks = CatalogEntityLinks;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const styled_components_1 = __importDefault(require("styled-components"));
9
9
  const LaunchIcon_1 = require("../../../icons/LaunchIcon/LaunchIcon");
10
- const DocumentIcon_1 = require("../../../icons/DocumentIcon/DocumentIcon");
10
+ const LinkIcon_1 = require("../../../icons/LinkIcon/LinkIcon");
11
11
  const CatalogEntityInfoBar_1 = require("../../../components/Catalog/CatalogEntity/CatalogEntityInfoBar");
12
12
  const Link_1 = require("../../../components/Link/Link");
13
13
  function CatalogEntityLinks({ entity }) {
@@ -17,11 +17,11 @@ function CatalogEntityLinks({ entity }) {
17
17
  }
18
18
  return (react_1.default.createElement(LinksWrapper, { "data-component-name": "Catalog/CatalogEntity/CatalogEntityLinks" },
19
19
  react_1.default.createElement(Heading, null, "Links"),
20
- links.map(([key, value]) => (react_1.default.createElement(CatalogEntityInfoBar_1.CatalogEntityInfoBar, { key: key, leftContent: react_1.default.createElement(Label, null,
21
- react_1.default.createElement(DocumentIcon_1.DocumentIcon, null),
22
- " ",
23
- value.label), rightContent: react_1.default.createElement(Link_1.Link, { color: "var(--catalog-metadata-link-color)", to: value.url, target: "_blank" },
24
- react_1.default.createElement(LaunchIcon_1.LaunchIcon, null)), withSeparator: false })))));
20
+ links.map(([key, value]) => (react_1.default.createElement(Link_1.Link, { key: key, color: "var(--catalog-metadata-link-color)", to: value.url, target: "_blank" },
21
+ react_1.default.createElement(CatalogEntityInfoBar_1.CatalogEntityInfoBar, { leftContent: react_1.default.createElement(Label, null,
22
+ react_1.default.createElement(LinkIcon_1.LinkIcon, null),
23
+ " ",
24
+ value.label), rightContent: react_1.default.createElement(LaunchIcon_1.LaunchIcon, null), withSeparator: false }))))));
25
25
  }
26
26
  const LinksWrapper = styled_components_1.default.div `
27
27
  display: flex;
@@ -41,10 +41,20 @@ exports.CatalogEntityMetadata = CatalogEntityMetadata;
41
41
  const react_1 = __importStar(require("react"));
42
42
  const styled_components_1 = __importDefault(require("styled-components"));
43
43
  const ChevronDownIcon_1 = require("../../../icons/ChevronDownIcon/ChevronDownIcon");
44
+ const JsonViewer_1 = require("../../../components/JsonViewer/JsonViewer");
44
45
  const utils_1 = require("../../../core/utils");
45
46
  const hooks_1 = require("../../../core/hooks");
46
47
  const CatalogEntityInfoBar_1 = require("../../../components/Catalog/CatalogEntity/CatalogEntityInfoBar");
47
48
  const MAX_INITIAL_ITEMS = 4;
49
+ function renderMetadataValue(value) {
50
+ if ((0, utils_1.isPlainObject)(value)) {
51
+ return react_1.default.createElement(JsonViewerWrapper, { data: value, expandLevel: 3, hideHeader: true });
52
+ }
53
+ if (Array.isArray(value)) {
54
+ return (react_1.default.createElement(ArrayWrapper, null, value.map((item, index) => (react_1.default.createElement("div", { key: index }, (0, utils_1.isPlainObject)(item) ? (react_1.default.createElement(JsonViewerWrapper, { data: item, expandLevel: 3, hideHeader: true })) : (react_1.default.createElement("span", null, String(item))))))));
55
+ }
56
+ return react_1.default.createElement("span", null, String(value));
57
+ }
48
58
  function CatalogEntityMetadata({ entity }) {
49
59
  const { useTranslate } = (0, hooks_1.useThemeHooks)();
50
60
  const { translate } = useTranslate();
@@ -60,12 +70,15 @@ function CatalogEntityMetadata({ entity }) {
60
70
  react_1.default.createElement(Heading, null, translate('catalog.entity.metadata.title')),
61
71
  visibleMetadata.map(([key, value]) => (react_1.default.createElement(CatalogEntityInfoBar_1.CatalogEntityInfoBar, { key: key, leftContent: react_1.default.createElement(Label, null,
62
72
  (0, utils_1.capitalize)(key),
63
- ":"), rightContent: react_1.default.createElement(Value, null, value) }))),
73
+ ":"), rightContent: react_1.default.createElement(Value, null, renderMetadataValue(value)), hoverEffect: false, isCodeBlock: (0, utils_1.isPlainObject)(value) || Array.isArray(value) }))),
64
74
  hasMoreItems && (react_1.default.createElement(ShowMoreButton, { onClick: () => setIsOn(!isOn) },
65
75
  isOn ? 'Show less' : 'Show more',
66
76
  " ",
67
77
  react_1.default.createElement(ChevronIcon, { "$isExpanded": isOn })))));
68
78
  }
79
+ const JsonViewerWrapper = (0, styled_components_1.default)(JsonViewer_1.JsonViewer) `
80
+ text-align: left;
81
+ `;
69
82
  const MetadataWrapper = styled_components_1.default.div `
70
83
  display: flex;
71
84
  flex-direction: column;
@@ -83,6 +96,10 @@ const Value = styled_components_1.default.span `
83
96
  color: var(--catalog-metadata-value-color);
84
97
  font-weight: var(--font-weight-medium);
85
98
  `;
99
+ const ArrayWrapper = styled_components_1.default.div `
100
+ display: flex;
101
+ flex-direction: column;
102
+ `;
86
103
  const Heading = styled_components_1.default.h2 `
87
104
  margin-bottom: var(--spacing-base);
88
105
  margin-top: 0;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { BffCatalogEntity } from '../../../core/types';
3
+ export type CatalogEntityMethodAndPathProps = {
4
+ entity: BffCatalogEntity;
5
+ };
6
+ export declare function CatalogEntityMethodAndPath({ entity }: CatalogEntityMethodAndPathProps): React.JSX.Element | null;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CatalogEntityMethodAndPath = CatalogEntityMethodAndPath;
7
+ const react_1 = __importDefault(require("react"));
8
+ const styled_components_1 = __importDefault(require("styled-components"));
9
+ const CatalogEntityInfoBar_1 = require("../../../components/Catalog/CatalogEntity/CatalogEntityInfoBar");
10
+ const HttpTag_1 = require("../../../components/Tags/HttpTag");
11
+ function CatalogEntityMethodAndPath({ entity }) {
12
+ var _a, _b;
13
+ const method = (_a = entity.metadata) === null || _a === void 0 ? void 0 : _a.method;
14
+ const path = (_b = entity.metadata) === null || _b === void 0 ? void 0 : _b.path;
15
+ if (!method || !path) {
16
+ return null;
17
+ }
18
+ return (react_1.default.createElement(LinksWrapper, { "data-component-name": "Catalog/CatalogEntity/CatalogEntityMethodAndPath" },
19
+ react_1.default.createElement(Heading, null, "Method & Path"),
20
+ react_1.default.createElement(CatalogEntityInfoBar_1.CatalogEntityInfoBar, { leftContent: react_1.default.createElement(Label, null,
21
+ react_1.default.createElement(MethodTag, { color: method.toLowerCase() }, method),
22
+ path), withSeparator: false })));
23
+ }
24
+ const MethodTag = (0, styled_components_1.default)(HttpTag_1.HttpTag) `
25
+ width: auto;
26
+ justify-content: start;
27
+ margin-right: var(--spacing-xxs);
28
+ `;
29
+ const LinksWrapper = styled_components_1.default.div `
30
+ display: flex;
31
+ flex-direction: column;
32
+ gap: var(--spacing-xs);
33
+ border-radius: var(--border-radius);
34
+ background-color: var(--catalog-metadata-bg-color);
35
+ transition: all 0.2s ease-in-out;
36
+ margin: var(--spacing-lg) 0;
37
+ `;
38
+ const Label = styled_components_1.default.div `
39
+ display: flex;
40
+ `;
41
+ const Heading = styled_components_1.default.h2 `
42
+ margin-bottom: var(--spacing-sm);
43
+ margin-top: 0;
44
+ font-size: var(--font-size-md);
45
+ color: var(--catalog-metadata-heading-color);
46
+ `;
47
+ //# sourceMappingURL=CatalogEntityMethodAndPath.js.map
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ApiDescriptionProperty = ApiDescriptionProperty;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const react_router_dom_1 = require("react-router-dom");
9
+ const styled_components_1 = __importDefault(require("styled-components"));
9
10
  const theme_1 = require("../../../../index.js");
10
11
  const CatalogEntityPropertyCard_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard");
11
12
  function ApiDescriptionProperty({ entity }) {
@@ -18,8 +19,14 @@ function ApiDescriptionProperty({ entity }) {
18
19
  return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogEntity/CatalogEntityProperties/ApiDescriptionProperty" },
19
20
  react_1.default.createElement(CatalogEntityPropertyCard_1.CatalogEntityPropertyCard, { header: react_1.default.createElement(react_1.default.Fragment, null,
20
21
  react_1.default.createElement(theme_1.DocumentIcon, null),
21
- translate('catalog.entity.properties.apiDescription.title')), content: react_1.default.createElement(theme_1.Tag, null, descriptionFile), onClick: () => {
22
+ translate('catalog.entity.properties.apiDescription.title')), content: react_1.default.createElement(theme_1.Tag, { textTransform: "none" },
23
+ react_1.default.createElement(DescriptionFile, null, descriptionFile)), onClick: () => {
22
24
  navigate(`${pathPrefix}/${descriptionFile}`);
23
25
  } })));
24
26
  }
27
+ const DescriptionFile = styled_components_1.default.span `
28
+ word-break: break-all;
29
+ overflow-wrap: break-word;
30
+ white-space: normal;
31
+ `;
25
32
  //# sourceMappingURL=ApiDescriptionProperty.js.map
@@ -14,12 +14,18 @@ const UserEmailProperty_1 = require("../../../../components/Catalog/CatalogEntit
14
14
  const DomainsProperty_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty");
15
15
  const OwnersProperty_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty");
16
16
  const ContactProperty_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty");
17
+ const FormatProperty_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty");
17
18
  const propertyRenderers = [
18
19
  {
19
20
  key: 'type',
20
21
  condition: (entity) => !!entity.type,
21
22
  component: EntityTypeProperty_1.EntityTypeProperty,
22
23
  },
24
+ {
25
+ key: 'format',
26
+ condition: (entity) => { var _a; return entity.type === 'data-schema' && !!((_a = entity.metadata) === null || _a === void 0 ? void 0 : _a.specType); },
27
+ component: FormatProperty_1.FormatProperty,
28
+ },
23
29
  {
24
30
  key: 'contact',
25
31
  condition: (entity) => { var _a, _b; return !!((_b = (_a = entity.contact) === null || _a === void 0 ? void 0 : _a.slack) === null || _b === void 0 ? void 0 : _b.channels); },
@@ -32,7 +38,7 @@ const propertyRenderers = [
32
38
  },
33
39
  {
34
40
  key: 'tags',
35
- condition: (entity) => !!entity.tags,
41
+ condition: (entity) => { var _a; return !!((_a = entity.tags) === null || _a === void 0 ? void 0 : _a.length); },
36
42
  component: TagsProperty_1.TagsProperty,
37
43
  },
38
44
  {
@@ -3,5 +3,6 @@ export type CatalogEntityPropertyCardProps = {
3
3
  header: ReactNode;
4
4
  content: ReactNode;
5
5
  onClick?: () => void;
6
+ hoverEffect?: boolean;
6
7
  };
7
- export declare function CatalogEntityPropertyCard({ header, content, onClick, }: CatalogEntityPropertyCardProps): JSX.Element;
8
+ export declare function CatalogEntityPropertyCard({ header, content, onClick, hoverEffect, }: CatalogEntityPropertyCardProps): JSX.Element;
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.CatalogEntityPropertyCard = CatalogEntityPropertyCard;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const styled_components_1 = __importDefault(require("styled-components"));
9
- function CatalogEntityPropertyCard({ header, content, onClick, }) {
10
- return (react_1.default.createElement(CatalogEntityPropertyWrapper, { "data-component-name": "Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard", onClick: onClick },
9
+ function CatalogEntityPropertyCard({ header, content, onClick, hoverEffect = true, }) {
10
+ return (react_1.default.createElement(CatalogEntityPropertyWrapper, { "data-component-name": "Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard", onClick: onClick, hoverEffect: hoverEffect },
11
11
  react_1.default.createElement(CardHeader, null, header),
12
12
  react_1.default.createElement(CardContent, null, content)));
13
13
  }
@@ -24,9 +24,12 @@ const CatalogEntityPropertyWrapper = styled_components_1.default.div `
24
24
  padding: var(--catalog-card-padding-vertical) var(--catalog-card-padding-horizontal);
25
25
  gap: var(--catalog-card-content-gap-vertical);
26
26
 
27
- &:hover {
28
- border-color: var(--catalog-card-border-color-hover);
29
- }
27
+ ${({ hoverEffect }) => hoverEffect &&
28
+ `
29
+ &:hover {
30
+ border-color: var(--catalog-card-border-color-hover);
31
+ }
32
+ `}
30
33
 
31
34
  ${(props) => props.onClick &&
32
35
  `
@@ -37,6 +40,7 @@ const CardHeader = styled_components_1.default.div `
37
40
  display: flex;
38
41
  align-items: center;
39
42
  gap: var(--catalog-card-content-gap);
43
+ font-weight: var(--font-weight-medium);
40
44
  `;
41
45
  const CardContent = styled_components_1.default.div `
42
46
  flex: 1;
@@ -44,5 +48,8 @@ const CardContent = styled_components_1.default.div `
44
48
  align-items: center;
45
49
  gap: var(--catalog-card-content-gap);
46
50
  flex-wrap: wrap;
51
+ color: var(--text-color-primary);
52
+ font-size: var(--font-size-lg);
53
+ line-height: var(--line-height-lg);
47
54
  `;
48
55
  //# sourceMappingURL=CatalogEntityPropertyCard.js.map
@@ -14,6 +14,6 @@ function ContactProperty({ entity }) {
14
14
  return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty" },
15
15
  react_1.default.createElement(CatalogEntityPropertyCard_1.CatalogEntityPropertyCard, { header: react_1.default.createElement(react_1.default.Fragment, null,
16
16
  react_1.default.createElement(SlackIcon_1.SlackIcon, null),
17
- "Slack channels"), content: react_1.default.createElement(react_1.default.Fragment, null, channels === null || channels === void 0 ? void 0 : channels.map((channel) => (react_1.default.createElement(Tag_1.Tag, { key: channel.name, style: { backgroundColor: 'var(--bg-color)' } }, channel.name)))) })));
17
+ "Slack channels"), content: react_1.default.createElement(react_1.default.Fragment, null, channels === null || channels === void 0 ? void 0 : channels.map((channel) => (react_1.default.createElement(Tag_1.Tag, { key: channel.name, textTransform: "none", style: { backgroundColor: 'var(--bg-color)' } }, channel.name)))) })));
18
18
  }
19
19
  //# sourceMappingURL=ContactProperty.js.map
@@ -6,14 +6,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.DomainsProperty = DomainsProperty;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const GraphIcon_1 = require("../../../../icons/GraphIcon/GraphIcon");
9
- const theme_1 = require("../../../../index.js");
10
- const CatalogEntityPropertyCard_1 = require("./CatalogEntityPropertyCard");
9
+ const Tag_1 = require("../../../../components/Tag/Tag");
10
+ const CatalogEntityPropertyCard_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard");
11
11
  function DomainsProperty({ entity }) {
12
12
  const { domains = [] } = entity;
13
13
  return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty" },
14
14
  react_1.default.createElement(CatalogEntityPropertyCard_1.CatalogEntityPropertyCard, { header: react_1.default.createElement(react_1.default.Fragment, null,
15
15
  react_1.default.createElement(GraphIcon_1.GraphIcon, null),
16
- "Domains"), content: react_1.default.createElement(react_1.default.Fragment, null, domains === null || domains === void 0 ? void 0 : domains.map((domain) => (react_1.default.createElement(theme_1.Tag, { key: domain === null || domain === void 0 ? void 0 : domain.id, style: { backgroundColor: 'var(--bg-color)' } },
16
+ "Domains"), content: react_1.default.createElement(react_1.default.Fragment, null, domains === null || domains === void 0 ? void 0 : domains.map((domain) => (react_1.default.createElement(Tag_1.Tag, { key: domain === null || domain === void 0 ? void 0 : domain.id, style: { backgroundColor: 'var(--bg-color)' } },
17
17
  react_1.default.createElement(GraphIcon_1.GraphIcon, null), domain === null || domain === void 0 ? void 0 :
18
18
  domain.title)))) })));
19
19
  }
@@ -8,13 +8,18 @@ const react_1 = __importDefault(require("react"));
8
8
  const EntityTypeIcon_1 = require("../../../../icons/EntityTypeIcon/EntityTypeIcon");
9
9
  const utils_1 = require("../../../../core/utils");
10
10
  const CatalogEntityTypeIcon_1 = require("../../../../components/Catalog/CatalogEntityTypeIcon");
11
- const CatalogEntityPropertyCard_1 = require("./CatalogEntityPropertyCard");
11
+ const CatalogEntityPropertyCard_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard");
12
+ const formatEntityType = (entityType) => {
13
+ return (0, utils_1.capitalize)(entityType.startsWith('api-')
14
+ ? entityType.replace('api-', 'API-').replace(/-/g, ' ')
15
+ : entityType.replace(/-/g, ' '));
16
+ };
12
17
  function EntityTypeProperty({ entity }) {
13
18
  return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty" },
14
19
  react_1.default.createElement(CatalogEntityPropertyCard_1.CatalogEntityPropertyCard, { header: react_1.default.createElement(react_1.default.Fragment, null,
15
20
  react_1.default.createElement(EntityTypeIcon_1.EntityTypeIcon, null),
16
21
  "Entity type"), content: react_1.default.createElement(react_1.default.Fragment, null,
17
22
  react_1.default.createElement(CatalogEntityTypeIcon_1.CatalogEntityTypeIcon, { entityType: entity.type }),
18
- react_1.default.createElement("strong", null, (0, utils_1.capitalize)(entity.type))) })));
23
+ formatEntityType(entity.type)), hoverEffect: false })));
19
24
  }
20
25
  //# sourceMappingURL=EntityTypeProperty.js.map
@@ -0,0 +1,6 @@
1
+ import { JSX } from 'react';
2
+ import { BffCatalogEntity } from '../../../../core/types';
3
+ export type FormatPropertyProps = {
4
+ entity: BffCatalogEntity;
5
+ };
6
+ export declare function FormatProperty({ entity }: FormatPropertyProps): JSX.Element;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.FormatProperty = FormatProperty;
7
+ const react_1 = __importDefault(require("react"));
8
+ const NotesIcon_1 = require("../../../../icons/NotesIcon/NotesIcon");
9
+ const Tag_1 = require("../../../../components/Tag/Tag");
10
+ const CatalogEntityPropertyCard_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard");
11
+ function FormatProperty({ entity }) {
12
+ var _a, _b;
13
+ return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty" },
14
+ react_1.default.createElement(CatalogEntityPropertyCard_1.CatalogEntityPropertyCard, { header: react_1.default.createElement(react_1.default.Fragment, null,
15
+ react_1.default.createElement(NotesIcon_1.NotesIcon, null),
16
+ "Format"), content: react_1.default.createElement(react_1.default.Fragment, null,
17
+ react_1.default.createElement(Tag_1.Tag, { textTransform: "none", key: (_a = entity.metadata) === null || _a === void 0 ? void 0 : _a.specType, style: { backgroundColor: 'var(--bg-color)' } }, (_b = entity.metadata) === null || _b === void 0 ? void 0 : _b.specType)), hoverEffect: false })));
18
+ }
19
+ //# sourceMappingURL=FormatProperty.js.map
@@ -17,7 +17,7 @@ function GitProperty({ entity }) {
17
17
  "Repositories"), content: react_1.default.createElement(react_1.default.Fragment, null, git === null || git === void 0 ? void 0 : git.map((repo) => {
18
18
  const url = new URL(repo);
19
19
  const repoName = (0, utils_1.removeLeadingSlash)(url.pathname);
20
- return (react_1.default.createElement(Tag_1.Tag, { key: repo, style: { backgroundColor: 'var(--bg-color)' } }, repoName));
20
+ return (react_1.default.createElement(Tag_1.Tag, { key: repo, textTransform: "none", style: { backgroundColor: 'var(--bg-color)' } }, repoName));
21
21
  })) })));
22
22
  }
23
23
  //# sourceMappingURL=GitProperty.js.map
@@ -19,6 +19,7 @@ function TagsProperty({ entity }) {
19
19
  },
20
20
  borderless: true,
21
21
  color: 'grey',
22
- } }) })));
22
+ textTransform: 'none',
23
+ } }), hoverEffect: false })));
23
24
  }
24
25
  //# sourceMappingURL=TagsProperty.js.map