@redocly/theme 0.70.0-next.1 → 0.70.0-next.11

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 (378) hide show
  1. package/lib/components/Buttons/ConnectMCPButton.js +19 -14
  2. package/lib/components/Buttons/variables.d.ts +1 -0
  3. package/lib/components/Buttons/variables.js +4 -1
  4. package/lib/components/Catalog/Catalog.js +3 -3
  5. package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.lazy.d.ts +1 -1
  6. package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.lazy.js +1 -1
  7. package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.js +2 -2
  8. package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +1 -1
  9. package/lib/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.js +30 -11
  10. package/lib/components/Catalog/CatalogFilter/CatalogFilterDateRange.js +2 -1
  11. package/lib/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanel.js +1 -1
  12. package/lib/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanelOverlay.js +2 -2
  13. package/lib/components/CodeBlock/CodeBlockControls.js +3 -5
  14. package/lib/components/Consent/Consent.d.ts +2 -0
  15. package/lib/components/Consent/Consent.js +17 -0
  16. package/lib/components/Consent/ConsentBanner.d.ts +2 -0
  17. package/lib/components/Consent/ConsentBanner.js +120 -0
  18. package/lib/components/Consent/ConsentDialog.d.ts +2 -0
  19. package/lib/components/Consent/ConsentDialog.js +128 -0
  20. package/lib/components/Consent/ConsentSettingsLink.d.ts +2 -0
  21. package/lib/components/Consent/ConsentSettingsLink.js +35 -0
  22. package/lib/components/Consent/variables.d.ts +1 -0
  23. package/lib/components/Consent/variables.js +31 -0
  24. package/lib/components/Dropdown/Dropdown.d.ts +4 -2
  25. package/lib/components/Dropdown/Dropdown.js +31 -9
  26. package/lib/components/Dropdown/DropdownMenu.d.ts +1 -0
  27. package/lib/components/Dropdown/DropdownMenu.js +1 -1
  28. package/lib/components/Feedback/Reasons.js +3 -2
  29. package/lib/components/Filter/FilterCheckboxes.js +30 -11
  30. package/lib/components/Filter/FilterDateRange.js +36 -2
  31. package/lib/components/Footer/Footer.js +4 -1
  32. package/lib/components/Image/Image.js +24 -4
  33. package/lib/components/JsonViewer/Helpers.d.ts +10 -2
  34. package/lib/components/JsonViewer/Helpers.js +32 -36
  35. package/lib/components/JsonViewer/JsonViewer.js +15 -18
  36. package/lib/components/LoadProgressBar/LoadProgressBar.d.ts +8 -0
  37. package/lib/components/LoadProgressBar/LoadProgressBar.js +122 -0
  38. package/lib/components/MCP/McpConnectionTabs.js +9 -2
  39. package/lib/components/Markdown/Markdown.js +3 -2
  40. package/lib/components/Markdown/styles/base-table.js +14 -1
  41. package/lib/components/Markdown/variables.js +1 -0
  42. package/lib/components/Menu/Menu.js +4 -0
  43. package/lib/components/Menu/MenuSelect.d.ts +7 -0
  44. package/lib/components/Menu/MenuSelect.js +129 -0
  45. package/lib/components/Menu/variables.js +43 -4
  46. package/lib/components/Navbar/Navbar.js +44 -5
  47. package/lib/components/Navbar/variables.js +3 -0
  48. package/lib/components/NavigationTabs/NavigationTab.d.ts +7 -0
  49. package/lib/components/NavigationTabs/NavigationTab.js +93 -0
  50. package/lib/components/NavigationTabs/NavigationTabContent.d.ts +7 -0
  51. package/lib/components/NavigationTabs/NavigationTabContent.js +50 -0
  52. package/lib/components/NavigationTabs/NavigationTabMenu.d.ts +7 -0
  53. package/lib/components/NavigationTabs/NavigationTabMenu.js +18 -0
  54. package/lib/components/NavigationTabs/NavigationTabs.d.ts +7 -0
  55. package/lib/components/NavigationTabs/NavigationTabs.js +97 -0
  56. package/lib/components/NavigationTabs/variables.d.ts +1 -0
  57. package/lib/components/NavigationTabs/variables.js +37 -0
  58. package/lib/components/Portal/Portal.js +37 -5
  59. package/lib/components/Product/utils.js +1 -1
  60. package/lib/components/Search/SearchAiActionButtons.js +8 -3
  61. package/lib/components/Search/SearchAiActivity.d.ts +10 -0
  62. package/lib/components/Search/SearchAiActivity.js +278 -0
  63. package/lib/components/Search/SearchAiConversationInput.js +10 -6
  64. package/lib/components/Search/SearchAiDialog.js +13 -2
  65. package/lib/components/Search/SearchAiMessage.d.ts +2 -1
  66. package/lib/components/Search/SearchAiMessage.js +21 -109
  67. package/lib/components/Search/SearchAiResponse.js +1 -0
  68. package/lib/components/Search/SearchDialog.js +10 -0
  69. package/lib/components/Search/SearchItem.js +11 -10
  70. package/lib/components/Search/SearchTrigger.js +37 -6
  71. package/lib/components/Search/variables.js +17 -2
  72. package/lib/components/Segmented/Segmented.js +23 -3
  73. package/lib/components/Select/Select.js +10 -3
  74. package/lib/components/Select/SelectInput.d.ts +1 -0
  75. package/lib/components/Select/SelectInput.js +5 -11
  76. package/lib/components/Sidebar/Sidebar.js +2 -2
  77. package/lib/components/SplitButton/SplitButton.js +37 -3
  78. package/lib/components/TableOfContent/TableOfContent.js +2 -2
  79. package/lib/core/constants/common.d.ts +1 -0
  80. package/lib/core/constants/common.js +1 -0
  81. package/lib/core/constants/consent.d.ts +2 -0
  82. package/lib/core/constants/consent.js +30 -0
  83. package/lib/core/constants/index.d.ts +2 -0
  84. package/lib/core/constants/index.js +2 -0
  85. package/lib/core/constants/mcp.d.ts +2 -2
  86. package/lib/core/constants/mcp.js +3 -8
  87. package/lib/core/constants/prompt.d.ts +9 -0
  88. package/lib/core/constants/prompt.js +33 -0
  89. package/lib/core/constants/search.d.ts +1 -1
  90. package/lib/core/constants/search.js +6 -2
  91. package/lib/core/contexts/PortalContainerContext.d.ts +2 -0
  92. package/lib/core/contexts/PortalContainerContext.js +7 -0
  93. package/lib/core/hooks/code-walkthrough/use-code-panel.d.ts +1 -1
  94. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-controls.d.ts +1 -1
  95. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-controls.js +1 -1
  96. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.d.ts +1 -1
  97. package/lib/core/hooks/code-walkthrough/use-code-walkthrough.d.ts +1 -2
  98. package/lib/core/hooks/code-walkthrough/use-renderable-files.d.ts +1 -1
  99. package/lib/core/hooks/index.d.ts +9 -0
  100. package/lib/core/hooks/index.js +9 -0
  101. package/lib/core/hooks/menu/use-collapse.js +1 -1
  102. package/lib/core/hooks/menu/use-mobile-menu-items.js +75 -51
  103. package/lib/core/hooks/menu/use-mobile-menu-levels.js +12 -7
  104. package/lib/core/hooks/prompt/use-prompt-actions.d.ts +7 -0
  105. package/lib/core/hooks/prompt/use-prompt-actions.js +19 -0
  106. package/lib/core/hooks/prompt/use-prompt-text-limit.d.ts +19 -0
  107. package/lib/core/hooks/prompt/use-prompt-text-limit.js +35 -0
  108. package/lib/core/hooks/search/use-persisted-quick-filter.d.ts +21 -0
  109. package/lib/core/hooks/search/use-persisted-quick-filter.js +92 -0
  110. package/lib/core/hooks/search/use-search-ai-activity.d.ts +11 -0
  111. package/lib/core/hooks/search/use-search-ai-activity.js +15 -0
  112. package/lib/core/hooks/use-connect-mcp-button.js +3 -1
  113. package/lib/core/hooks/use-consent-dialog.d.ts +12 -0
  114. package/lib/core/hooks/use-consent-dialog.js +36 -0
  115. package/lib/core/hooks/use-consent-telemetry.d.ts +1 -0
  116. package/lib/core/hooks/use-consent-telemetry.js +42 -0
  117. package/lib/core/hooks/use-dialog-hotkeys.js +4 -2
  118. package/lib/core/hooks/use-full-height.d.ts +1 -1
  119. package/lib/core/hooks/use-full-height.js +8 -8
  120. package/lib/core/hooks/use-page-actions.d.ts +1 -1
  121. package/lib/core/hooks/use-page-actions.js +10 -8
  122. package/lib/core/hooks/use-pointer-border-highlight.d.ts +7 -0
  123. package/lib/core/hooks/use-pointer-border-highlight.js +29 -0
  124. package/lib/core/hooks/use-scroll-item-into-view.d.ts +2 -0
  125. package/lib/core/hooks/use-scroll-item-into-view.js +16 -0
  126. package/lib/core/hooks/use-tab-list.d.ts +31 -0
  127. package/lib/core/hooks/use-tab-list.js +49 -0
  128. package/lib/core/hooks/use-telemetry-fallback.d.ts +2 -0
  129. package/lib/core/hooks/use-telemetry-fallback.js +2 -0
  130. package/lib/core/hooks/use-theme-hooks.js +16 -0
  131. package/lib/core/styles/dark.js +14 -12
  132. package/lib/core/styles/global.d.ts +2 -0
  133. package/lib/core/styles/global.js +115 -136
  134. package/lib/core/styles/index.d.ts +1 -0
  135. package/lib/core/styles/index.js +3 -1
  136. package/lib/core/styles/search-ai-appear.d.ts +1 -0
  137. package/lib/core/styles/search-ai-appear.js +18 -0
  138. package/lib/core/types/code-walkthrough.d.ts +84 -0
  139. package/lib/core/types/consent.d.ts +54 -0
  140. package/lib/core/types/consent.js +3 -0
  141. package/lib/core/types/dropdown.d.ts +1 -0
  142. package/lib/core/types/dropdown.js +3 -0
  143. package/lib/core/types/hooks.d.ts +8 -1
  144. package/lib/core/types/index.d.ts +4 -0
  145. package/lib/core/types/l10n.d.ts +1 -1
  146. package/lib/core/types/mcp.d.ts +3 -2
  147. package/lib/core/types/navigation-tabs.d.ts +49 -0
  148. package/lib/core/types/navigation-tabs.js +3 -0
  149. package/lib/core/types/prompt.d.ts +9 -0
  150. package/lib/core/types/prompt.js +3 -0
  151. package/lib/core/types/search.d.ts +25 -0
  152. package/lib/core/utils/Dynamic.d.ts +8 -1
  153. package/lib/core/utils/Dynamic.js +34 -3
  154. package/lib/core/utils/assign-ref.d.ts +2 -0
  155. package/lib/core/utils/assign-ref.js +12 -0
  156. package/lib/core/utils/consent-settings-link-placement.d.ts +3 -0
  157. package/lib/core/utils/consent-settings-link-placement.js +15 -0
  158. package/lib/core/utils/content-segments.d.ts +12 -1
  159. package/lib/core/utils/content-segments.js +90 -5
  160. package/lib/core/utils/download-code-walkthrough.d.ts +1 -1
  161. package/lib/core/utils/dropdown.d.ts +2 -0
  162. package/lib/core/utils/dropdown.js +12 -0
  163. package/lib/core/utils/get-ai-prompt-link.d.ts +15 -0
  164. package/lib/core/utils/get-ai-prompt-link.js +29 -0
  165. package/lib/core/utils/get-code-walkthrough-file-text.d.ts +1 -1
  166. package/lib/core/utils/index.d.ts +5 -0
  167. package/lib/core/utils/index.js +5 -0
  168. package/lib/core/utils/match-code-walkthrough-conditions.d.ts +1 -1
  169. package/lib/core/utils/mcp.d.ts +2 -1
  170. package/lib/core/utils/mcp.js +13 -3
  171. package/lib/core/utils/menu.d.ts +4 -0
  172. package/lib/core/utils/menu.js +48 -8
  173. package/lib/core/utils/navigation-tabs.d.ts +8 -0
  174. package/lib/core/utils/navigation-tabs.js +71 -0
  175. package/lib/core/utils/search-ai-activity.d.ts +4 -0
  176. package/lib/core/utils/search-ai-activity.js +83 -0
  177. package/lib/core/utils/urls.js +3 -1
  178. package/lib/core/utils/with-load-progress.d.ts +3 -0
  179. package/lib/core/utils/with-load-progress.js +24 -19
  180. package/lib/ext/configure.d.ts +1 -1
  181. package/lib/ext/configure.js +0 -1
  182. package/lib/icons/ExpandCollapseIcon/ExpandCollapseIcon.d.ts +29 -0
  183. package/lib/icons/ExpandCollapseIcon/ExpandCollapseIcon.js +81 -0
  184. package/lib/icons/LinkIcon/LinkIconSymbol.d.ts +12 -0
  185. package/lib/icons/LinkIcon/LinkIconSymbol.js +41 -0
  186. package/lib/index.d.ts +7 -0
  187. package/lib/index.js +9 -1
  188. package/lib/layouts/PageLayout.js +1 -1
  189. package/lib/layouts/RootLayout.js +2 -2
  190. package/lib/markdoc/components/CodeWalkthrough/CodeFilters.d.ts +1 -1
  191. package/lib/markdoc/components/CodeWalkthrough/CodeFilters.js +1 -1
  192. package/lib/markdoc/components/CodeWalkthrough/CodePanel.d.ts +1 -1
  193. package/lib/markdoc/components/CodeWalkthrough/CodePanel.js +3 -3
  194. package/lib/markdoc/components/CodeWalkthrough/CodePanelHeader.d.ts +1 -1
  195. package/lib/markdoc/components/CodeWalkthrough/CodePanelToolbar.d.ts +1 -1
  196. package/lib/markdoc/components/CodeWalkthrough/CodeStep.d.ts +1 -1
  197. package/lib/markdoc/components/CodeWalkthrough/CodeWalkthrough.d.ts +1 -1
  198. package/lib/markdoc/components/CodeWalkthrough/CodeWalkthrough.js +1 -1
  199. package/lib/markdoc/components/Prompt/Prompt.d.ts +15 -0
  200. package/lib/markdoc/components/Prompt/Prompt.js +163 -0
  201. package/lib/markdoc/components/Prompt/PromptActions.d.ts +13 -0
  202. package/lib/markdoc/components/Prompt/PromptActions.js +43 -0
  203. package/lib/markdoc/components/Prompt/PromptBody.d.ts +14 -0
  204. package/lib/markdoc/components/Prompt/PromptBody.js +99 -0
  205. package/lib/markdoc/components/Prompt/PromptCopyButton.d.ts +10 -0
  206. package/lib/markdoc/components/Prompt/PromptCopyButton.js +28 -0
  207. package/lib/markdoc/components/Prompt/PromptHeader.d.ts +9 -0
  208. package/lib/markdoc/components/Prompt/PromptHeader.js +57 -0
  209. package/lib/markdoc/components/Prompt/PromptShowHideButton.d.ts +7 -0
  210. package/lib/markdoc/components/Prompt/PromptShowHideButton.js +21 -0
  211. package/lib/markdoc/components/Prompt/PromptToggleLabel.d.ts +7 -0
  212. package/lib/markdoc/components/Prompt/PromptToggleLabel.js +28 -0
  213. package/lib/markdoc/components/Prompt/variables.d.ts +1 -0
  214. package/lib/markdoc/components/Prompt/variables.dark.d.ts +1 -0
  215. package/lib/markdoc/components/Prompt/variables.dark.js +8 -0
  216. package/lib/markdoc/components/Prompt/variables.js +44 -0
  217. package/lib/markdoc/components/Tabs/TabList.js +8 -6
  218. package/lib/markdoc/components/default.d.ts +1 -0
  219. package/lib/markdoc/components/default.js +1 -0
  220. package/lib/markdoc/default.d.ts +2 -0
  221. package/lib/markdoc/default.js +2 -0
  222. package/lib/markdoc/tags/code-walkthrough.d.ts +1 -1
  223. package/lib/markdoc/tags/connect-mcp.js +15 -0
  224. package/lib/markdoc/tags/prompt.d.ts +2 -0
  225. package/lib/markdoc/tags/prompt.js +56 -0
  226. package/package.json +4 -8
  227. package/src/components/Buttons/ConnectMCPButton.tsx +21 -16
  228. package/src/components/Buttons/variables.ts +4 -0
  229. package/src/components/Catalog/Catalog.tsx +6 -4
  230. package/src/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.lazy.tsx +3 -1
  231. package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.tsx +2 -2
  232. package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +1 -1
  233. package/src/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.tsx +37 -22
  234. package/src/components/Catalog/CatalogFilter/CatalogFilterDateRange.tsx +3 -2
  235. package/src/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanel.tsx +1 -1
  236. package/src/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanelOverlay.tsx +2 -2
  237. package/src/components/CodeBlock/CodeBlockControls.tsx +4 -7
  238. package/src/components/Consent/Consent.tsx +18 -0
  239. package/src/components/Consent/ConsentBanner.tsx +110 -0
  240. package/src/components/Consent/ConsentDialog.tsx +210 -0
  241. package/src/components/Consent/ConsentSettingsLink.tsx +44 -0
  242. package/src/components/Consent/variables.ts +28 -0
  243. package/src/components/Dropdown/Dropdown.tsx +32 -7
  244. package/src/components/Dropdown/DropdownMenu.tsx +7 -1
  245. package/src/components/Feedback/Reasons.tsx +3 -2
  246. package/src/components/Filter/FilterCheckboxes.tsx +33 -18
  247. package/src/components/Filter/FilterDateRange.tsx +3 -2
  248. package/src/components/Footer/Footer.tsx +2 -0
  249. package/src/components/Image/Image.tsx +26 -5
  250. package/src/components/JsonViewer/Helpers.tsx +51 -54
  251. package/src/components/JsonViewer/JsonViewer.tsx +23 -25
  252. package/src/components/LoadProgressBar/LoadProgressBar.tsx +113 -0
  253. package/src/components/MCP/McpConnectionTabs.tsx +22 -5
  254. package/src/components/Markdown/Markdown.tsx +3 -2
  255. package/src/components/Markdown/styles/base-table.ts +14 -1
  256. package/src/components/Markdown/variables.ts +1 -0
  257. package/src/components/Menu/Menu.tsx +5 -0
  258. package/src/components/Menu/MenuSelect.tsx +198 -0
  259. package/src/components/Menu/variables.ts +43 -4
  260. package/src/components/Navbar/Navbar.tsx +22 -5
  261. package/src/components/Navbar/variables.ts +3 -0
  262. package/src/components/NavigationTabs/NavigationTab.tsx +148 -0
  263. package/src/components/NavigationTabs/NavigationTabContent.tsx +66 -0
  264. package/src/components/NavigationTabs/NavigationTabMenu.tsx +40 -0
  265. package/src/components/NavigationTabs/NavigationTabs.tsx +83 -0
  266. package/src/components/NavigationTabs/variables.ts +34 -0
  267. package/src/components/Portal/Portal.tsx +4 -2
  268. package/src/components/Product/utils.ts +1 -1
  269. package/src/components/Search/SearchAiActionButtons.tsx +31 -19
  270. package/src/components/Search/SearchAiActivity.tsx +318 -0
  271. package/src/components/Search/SearchAiConversationInput.tsx +13 -7
  272. package/src/components/Search/SearchAiDialog.tsx +20 -4
  273. package/src/components/Search/SearchAiMessage.tsx +28 -136
  274. package/src/components/Search/SearchAiResponse.tsx +1 -0
  275. package/src/components/Search/SearchDialog.tsx +11 -0
  276. package/src/components/Search/SearchItem.tsx +19 -10
  277. package/src/components/Search/SearchTrigger.tsx +47 -3
  278. package/src/components/Search/variables.ts +17 -2
  279. package/src/components/Segmented/Segmented.tsx +25 -16
  280. package/src/components/Select/Select.tsx +12 -6
  281. package/src/components/Select/SelectInput.tsx +10 -18
  282. package/src/components/Sidebar/Sidebar.tsx +2 -2
  283. package/src/components/SplitButton/SplitButton.tsx +8 -2
  284. package/src/components/TableOfContent/TableOfContent.tsx +2 -2
  285. package/src/core/constants/common.ts +1 -0
  286. package/src/core/constants/consent.ts +29 -0
  287. package/src/core/constants/index.ts +2 -0
  288. package/src/core/constants/mcp.ts +3 -9
  289. package/src/core/constants/prompt.ts +34 -0
  290. package/src/core/constants/search.ts +6 -2
  291. package/src/core/contexts/PortalContainerContext.tsx +4 -0
  292. package/src/core/hooks/__mocks__/index.ts +5 -0
  293. package/src/core/hooks/__mocks__/use-theme-hooks.ts +20 -0
  294. package/src/core/hooks/code-walkthrough/__mocks__/MockIntersectionObserver.ts +1 -2
  295. package/src/core/hooks/code-walkthrough/__mocks__/mock-intersection-observer.ts +1 -2
  296. package/src/core/hooks/code-walkthrough/use-code-panel.ts +1 -1
  297. package/src/core/hooks/code-walkthrough/use-code-walkthrough-controls.ts +2 -2
  298. package/src/core/hooks/code-walkthrough/use-code-walkthrough-steps.ts +1 -1
  299. package/src/core/hooks/code-walkthrough/use-code-walkthrough.ts +3 -3
  300. package/src/core/hooks/code-walkthrough/use-renderable-files.ts +1 -1
  301. package/src/core/hooks/index.ts +9 -0
  302. package/src/core/hooks/menu/use-collapse.ts +1 -1
  303. package/src/core/hooks/menu/use-mobile-menu-items.ts +91 -56
  304. package/src/core/hooks/menu/use-mobile-menu-levels.ts +14 -6
  305. package/src/core/hooks/prompt/use-prompt-actions.ts +28 -0
  306. package/src/core/hooks/prompt/use-prompt-text-limit.ts +59 -0
  307. package/src/core/hooks/search/use-persisted-quick-filter.ts +125 -0
  308. package/src/core/hooks/search/use-search-ai-activity.ts +31 -0
  309. package/src/core/hooks/use-connect-mcp-button.ts +13 -2
  310. package/src/core/hooks/use-consent-dialog.ts +51 -0
  311. package/src/core/hooks/use-consent-telemetry.ts +56 -0
  312. package/src/core/hooks/use-dialog-hotkeys.ts +11 -5
  313. package/src/core/hooks/use-full-height.ts +8 -8
  314. package/src/core/hooks/use-page-actions.ts +21 -9
  315. package/src/core/hooks/use-pointer-border-highlight.ts +46 -0
  316. package/src/core/hooks/use-scroll-item-into-view.ts +18 -0
  317. package/src/core/hooks/use-tab-list.ts +63 -0
  318. package/src/core/hooks/use-telemetry-fallback.ts +2 -0
  319. package/src/core/hooks/use-theme-hooks.ts +16 -0
  320. package/src/core/styles/dark.ts +2 -0
  321. package/src/core/styles/global.ts +96 -116
  322. package/src/core/styles/index.ts +2 -1
  323. package/src/core/styles/search-ai-appear.ts +16 -0
  324. package/src/core/types/code-walkthrough.ts +103 -0
  325. package/src/core/types/consent.ts +51 -0
  326. package/src/core/types/dropdown.ts +1 -0
  327. package/src/core/types/hooks.ts +8 -0
  328. package/src/core/types/index.ts +4 -0
  329. package/src/core/types/l10n.ts +46 -2
  330. package/src/core/types/mcp.ts +4 -2
  331. package/src/core/types/navigation-tabs.ts +54 -0
  332. package/src/core/types/prompt.ts +11 -0
  333. package/src/core/types/search.ts +23 -0
  334. package/src/core/utils/Dynamic.tsx +67 -35
  335. package/src/core/utils/assign-ref.ts +9 -0
  336. package/src/core/utils/consent-settings-link-placement.ts +18 -0
  337. package/src/core/utils/content-segments.ts +98 -6
  338. package/src/core/utils/download-code-walkthrough.ts +1 -1
  339. package/src/core/utils/dropdown.ts +14 -0
  340. package/src/core/utils/get-ai-prompt-link.ts +30 -0
  341. package/src/core/utils/get-code-walkthrough-file-text.ts +1 -1
  342. package/src/core/utils/index.ts +5 -0
  343. package/src/core/utils/match-code-walkthrough-conditions.ts +1 -1
  344. package/src/core/utils/mcp.ts +16 -4
  345. package/src/core/utils/menu.ts +54 -9
  346. package/src/core/utils/navigation-tabs.ts +99 -0
  347. package/src/core/utils/search-ai-activity.ts +110 -0
  348. package/src/core/utils/urls.ts +3 -1
  349. package/src/core/utils/with-load-progress.ts +23 -18
  350. package/src/ext/configure.ts +1 -1
  351. package/src/icons/CheckboxIcon/CheckboxIcon.tsx +1 -0
  352. package/src/icons/ChevronSortIcon/ChevronSortIcon.tsx +1 -0
  353. package/src/icons/ExpandCollapseIcon/ExpandCollapseIcon.tsx +56 -0
  354. package/src/icons/LinkIcon/LinkIconSymbol.tsx +51 -0
  355. package/src/index.ts +8 -0
  356. package/src/layouts/PageLayout.tsx +1 -1
  357. package/src/layouts/RootLayout.tsx +2 -2
  358. package/src/markdoc/components/CodeWalkthrough/CodeFilters.tsx +2 -2
  359. package/src/markdoc/components/CodeWalkthrough/CodePanel.tsx +4 -4
  360. package/src/markdoc/components/CodeWalkthrough/CodePanelHeader.tsx +1 -1
  361. package/src/markdoc/components/CodeWalkthrough/CodePanelToolbar.tsx +1 -1
  362. package/src/markdoc/components/CodeWalkthrough/CodeStep.tsx +1 -1
  363. package/src/markdoc/components/CodeWalkthrough/CodeWalkthrough.tsx +2 -2
  364. package/src/markdoc/components/Prompt/Prompt.tsx +219 -0
  365. package/src/markdoc/components/Prompt/PromptActions.tsx +104 -0
  366. package/src/markdoc/components/Prompt/PromptBody.tsx +107 -0
  367. package/src/markdoc/components/Prompt/PromptCopyButton.tsx +73 -0
  368. package/src/markdoc/components/Prompt/PromptHeader.tsx +81 -0
  369. package/src/markdoc/components/Prompt/PromptShowHideButton.tsx +43 -0
  370. package/src/markdoc/components/Prompt/PromptToggleLabel.tsx +41 -0
  371. package/src/markdoc/components/Prompt/variables.dark.ts +5 -0
  372. package/src/markdoc/components/Prompt/variables.ts +41 -0
  373. package/src/markdoc/components/Tabs/TabList.tsx +9 -12
  374. package/src/markdoc/components/default.ts +1 -0
  375. package/src/markdoc/default.ts +2 -0
  376. package/src/markdoc/tags/code-walkthrough.ts +1 -1
  377. package/src/markdoc/tags/connect-mcp.ts +16 -1
  378. package/src/markdoc/tags/prompt.ts +58 -0
@@ -15,7 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.configure = configure;
18
- __exportStar(require("../ext/configure-helpers"), exports);
19
18
  __exportStar(require("../ext/helpers/is-direct-configure-request-values"), exports);
20
19
  function configure(_context) {
21
20
  // const exampleDefaultRequestValues: ConfigureRequestValues = {
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import type { IconProps } from '../../icons/types';
3
+ declare const Icon: (props: IconProps) => React.JSX.Element;
4
+ export declare const ExpandCollapseIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components").FastOmit<{
5
+ color?: string;
6
+ size?: string;
7
+ className?: string;
8
+ 'data-component-name'?: string;
9
+ } & React.SVGProps<SVGSVGElement>, "data-component-name" | "size" | keyof React.SVGProps<SVGSVGElement>> & {
10
+ color?: string;
11
+ size?: string;
12
+ className?: string;
13
+ 'data-component-name'?: string;
14
+ } & React.SVGProps<SVGSVGElement>, "$collapse"> & {
15
+ $collapse?: boolean;
16
+ }, "data-component-name"> & Partial<Pick<import("styled-components").FastOmit<import("styled-components").FastOmit<{
17
+ color?: string;
18
+ size?: string;
19
+ className?: string;
20
+ 'data-component-name'?: string;
21
+ } & React.SVGProps<SVGSVGElement>, "data-component-name" | "size" | keyof React.SVGProps<SVGSVGElement>> & {
22
+ color?: string;
23
+ size?: string;
24
+ className?: string;
25
+ 'data-component-name'?: string;
26
+ } & React.SVGProps<SVGSVGElement>, "$collapse"> & {
27
+ $collapse?: boolean;
28
+ }, "data-component-name">>> & string & Omit<typeof Icon, keyof React.Component<any, {}, any>>;
29
+ export {};
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.ExpandCollapseIcon = void 0;
40
+ const react_1 = __importDefault(require("react"));
41
+ const styled_components_1 = __importStar(require("styled-components"));
42
+ const utils_1 = require("../../core/utils");
43
+ const Icon = (props) => (react_1.default.createElement("svg", Object.assign({ viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
44
+ react_1.default.createElement("path", { className: "corner-top", d: "M12.2432 8.70703H11.2461L11.2422 4.75781L7.29297 4.75391V3.75781H12.2432V8.70703Z" }),
45
+ react_1.default.createElement("path", { className: "corner-bottom", d: "M4.75781 11.2422L8.70703 11.2461V12.2432H3.75781V7.29297H4.75391L4.75781 11.2422Z" })));
46
+ exports.ExpandCollapseIcon = (0, styled_components_1.default)(Icon).attrs({
47
+ 'data-component-name': 'icons/ExpandCollapseIcon/ExpandCollapseIcon',
48
+ }) `
49
+ path {
50
+ fill: ${({ color }) => (0, utils_1.getCssColorVariable)(color)};
51
+ transform-box: view-box;
52
+ transition: transform 0.3s ease-in-out;
53
+
54
+ @media (prefers-reduced-motion: reduce) {
55
+ transition: none;
56
+ }
57
+ }
58
+
59
+ .corner-top {
60
+ transform-origin: 10.756px 5.244px;
61
+ }
62
+
63
+ .corner-bottom {
64
+ transform-origin: 5.244px 10.756px;
65
+ }
66
+
67
+ ${({ $collapse }) => $collapse &&
68
+ (0, styled_components_1.css) `
69
+ .corner-top {
70
+ transform: rotate(180deg);
71
+ }
72
+
73
+ .corner-bottom {
74
+ transform: rotate(-180deg);
75
+ }
76
+ `}
77
+
78
+ height: ${({ size }) => size || '16px'};
79
+ width: ${({ size }) => size || '16px'};
80
+ `;
81
+ //# sourceMappingURL=ExpandCollapseIcon.js.map
@@ -0,0 +1,12 @@
1
+ import type { JSX } from 'react';
2
+ import type { IconProps } from '../../icons/types';
3
+ /**
4
+ * The link icon drawing as a hidden SVG symbol, which every `SharedLinkIcon` refers to. Render it
5
+ * once per page that shows a `SharedLinkIcon`; without it the icon is empty.
6
+ */
7
+ export declare function LinkIconSymbol(): JSX.Element;
8
+ /**
9
+ * `LinkIcon` drawn from the page's `LinkIconSymbol`, so a page with many of them carries one copy.
10
+ * `color` fills the glyph; `--link-icon-bg-color` overrides the background.
11
+ */
12
+ export declare function SharedLinkIcon({ color, size, ...props }: IconProps): JSX.Element;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.LinkIconSymbol = LinkIconSymbol;
18
+ exports.SharedLinkIcon = SharedLinkIcon;
19
+ const react_1 = __importDefault(require("react"));
20
+ const utils_1 = require("../../core/utils");
21
+ const LINK_ICON_SYMBOL_ID = 'redocly-link-icon';
22
+ /**
23
+ * The link icon drawing as a hidden SVG symbol, which every `SharedLinkIcon` refers to. Render it
24
+ * once per page that shows a `SharedLinkIcon`; without it the icon is empty.
25
+ */
26
+ function LinkIconSymbol() {
27
+ return (react_1.default.createElement("svg", { "data-component-name": "icons/LinkIcon/LinkIconSymbol", display: "none", "aria-hidden": "true", focusable: "false" },
28
+ react_1.default.createElement("symbol", { id: LINK_ICON_SYMBOL_ID, viewBox: "0 0 20 20" },
29
+ react_1.default.createElement("path", { d: "M0 6C0 2.68629 2.68629 0 6 0H14C17.3137 0 20 2.68629 20 6V14C20 17.3137 17.3137 20 14 20H6C2.68629 20 0 17.3137 0 14V6Z", fill: "var(--link-icon-bg-color, var(--layer-color))" }),
30
+ react_1.default.createElement("path", { d: "M7.37318 9.56229H12.6232C12.7392 9.56229 12.8505 9.60838 12.9325 9.69043C13.0146 9.77247 13.0607 9.88375 13.0607 9.99979C13.0607 10.1158 13.0146 10.2271 12.9325 10.3091C12.8505 10.3912 12.7392 10.4373 12.6232 10.4373H7.37318C7.25714 10.4373 7.14586 10.3912 7.06382 10.3091C6.98177 10.2271 6.93568 10.1158 6.93568 9.99979C6.93568 9.88375 6.98177 9.77247 7.06382 9.69043C7.14586 9.60838 7.25714 9.56229 7.37318 9.56229ZM8.6853 12.1875H6.4978C5.91764 12.1875 5.36124 11.957 4.95101 11.5468C4.54077 11.1366 4.3103 10.5802 4.3103 10C4.3103 9.41984 4.54077 8.86344 4.95101 8.4532C5.36124 8.04297 5.91764 7.8125 6.4978 7.8125H8.6853C8.80133 7.8125 8.91262 7.76641 8.99466 7.68436C9.07671 7.60231 9.1228 7.49103 9.1228 7.375C9.1228 7.25897 9.07671 7.14769 8.99466 7.06564C8.91262 6.98359 8.80133 6.9375 8.6853 6.9375H6.4978C5.68558 6.9375 4.90662 7.26016 4.33229 7.83449C3.75796 8.40882 3.4353 9.18777 3.4353 10C3.4353 10.8122 3.75796 11.5912 4.33229 12.1655C4.90662 12.7398 5.68558 13.0625 6.4978 13.0625H8.6853C8.80133 13.0625 8.91262 13.0164 8.99466 12.9344C9.07671 12.8523 9.1228 12.741 9.1228 12.625C9.1228 12.509 9.07671 12.3977 8.99466 12.3156C8.91262 12.2336 8.80133 12.1875 8.6853 12.1875ZM13.4982 6.9375H11.3107C11.1946 6.9375 11.0834 6.98359 11.0013 7.06564C10.9193 7.14769 10.8732 7.25897 10.8732 7.375C10.8732 7.49103 10.9193 7.60231 11.0013 7.68436C11.0834 7.76641 11.1946 7.8125 11.3107 7.8125H13.4982C14.0783 7.8125 14.6347 8.04297 15.045 8.4532C15.4552 8.86344 15.6857 9.41984 15.6857 10C15.6857 10.5802 15.4552 11.1366 15.045 11.5468C14.6347 11.957 14.0783 12.1875 13.4982 12.1875H11.3107C11.1946 12.1875 11.0834 12.2336 11.0013 12.3156C10.9193 12.3977 10.8732 12.509 10.8732 12.625C10.8732 12.741 10.9193 12.8523 11.0013 12.9344C11.0834 13.0164 11.1946 13.0625 11.3107 13.0625H13.4982C14.3104 13.0625 15.0894 12.7398 15.6637 12.1655C16.238 11.5912 16.5607 10.8122 16.5607 10C16.5607 9.18777 16.238 8.40882 15.6637 7.83449C15.0894 7.26016 14.3104 6.9375 13.4982 6.9375Z" }))));
31
+ }
32
+ /**
33
+ * `LinkIcon` drawn from the page's `LinkIconSymbol`, so a page with many of them carries one copy.
34
+ * `color` fills the glyph; `--link-icon-bg-color` overrides the background.
35
+ */
36
+ function SharedLinkIcon(_a) {
37
+ var { color, size = '20px' } = _a, props = __rest(_a, ["color", "size"]);
38
+ return (react_1.default.createElement("svg", Object.assign({ "data-component-name": "icons/LinkIcon/SharedLinkIcon", width: size, height: size, viewBox: "0 0 20 20", fill: (0, utils_1.getCssColorVariable)(color), xmlns: "http://www.w3.org/2000/svg" }, props),
39
+ react_1.default.createElement("use", { href: `#${LINK_ICON_SYMBOL_ID}` })));
40
+ }
41
+ //# sourceMappingURL=LinkIconSymbol.js.map
package/lib/index.d.ts CHANGED
@@ -46,6 +46,11 @@ export * from './components/Navbar/Navbar';
46
46
  export * from './components/Navbar/NavbarItem';
47
47
  export * from './components/Navbar/NavbarLogo';
48
48
  export * from './components/Navbar/NavbarMenu';
49
+ export * from './components/NavigationTabs/NavigationTabs';
50
+ export { NavigationTab } from './components/NavigationTabs/NavigationTab';
51
+ export type { NavigationTabProps } from './components/NavigationTabs/NavigationTab';
52
+ export * from './components/NavigationTabs/NavigationTabMenu';
53
+ export * from './components/NavigationTabs/NavigationTabContent';
49
54
  export * from './components/Footer/Footer';
50
55
  export * from './components/Footer/FooterColumn';
51
56
  export * from './components/Footer/FooterCopyright';
@@ -223,9 +228,11 @@ export * from './icons/MoonIcon/MoonIcon';
223
228
  export * from './icons/SunIcon/SunIcon';
224
229
  export * from './icons/ContrastIcon/ContrastIcon';
225
230
  export * from './icons/LinkIcon/LinkIcon';
231
+ export * from './icons/LinkIcon/LinkIconSymbol';
226
232
  export * from './icons/LaunchIcon/LaunchIcon';
227
233
  export * from './icons/MinimizeIcon/MinimizeIcon';
228
234
  export * from './icons/MaximizeIcon/MaximizeIcon';
235
+ export * from './icons/ExpandCollapseIcon/ExpandCollapseIcon';
229
236
  export * from './icons/MarkdownFullIcon/MarkdownFullIcon';
230
237
  export * from './icons/DocumentBlankIcon/DocumentBlankIcon';
231
238
  export * from './icons/WarningSquareIcon/WarningSquareIcon';
package/lib/index.js CHANGED
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.markdoc = void 0;
39
+ exports.markdoc = exports.NavigationTab = void 0;
40
40
  __exportStar(require("./core"), exports);
41
41
  __exportStar(require("./ext/configure"), exports);
42
42
  /* Components */
@@ -90,6 +90,12 @@ __exportStar(require("./components/Navbar/Navbar"), exports);
90
90
  __exportStar(require("./components/Navbar/NavbarItem"), exports);
91
91
  __exportStar(require("./components/Navbar/NavbarLogo"), exports);
92
92
  __exportStar(require("./components/Navbar/NavbarMenu"), exports);
93
+ /* NavigationTabs */
94
+ __exportStar(require("./components/NavigationTabs/NavigationTabs"), exports);
95
+ var NavigationTab_1 = require("./components/NavigationTabs/NavigationTab");
96
+ Object.defineProperty(exports, "NavigationTab", { enumerable: true, get: function () { return NavigationTab_1.NavigationTab; } });
97
+ __exportStar(require("./components/NavigationTabs/NavigationTabMenu"), exports);
98
+ __exportStar(require("./components/NavigationTabs/NavigationTabContent"), exports);
93
99
  /* Footer */
94
100
  __exportStar(require("./components/Footer/Footer"), exports);
95
101
  __exportStar(require("./components/Footer/FooterColumn"), exports);
@@ -286,9 +292,11 @@ __exportStar(require("./icons/MoonIcon/MoonIcon"), exports);
286
292
  __exportStar(require("./icons/SunIcon/SunIcon"), exports);
287
293
  __exportStar(require("./icons/ContrastIcon/ContrastIcon"), exports);
288
294
  __exportStar(require("./icons/LinkIcon/LinkIcon"), exports);
295
+ __exportStar(require("./icons/LinkIcon/LinkIconSymbol"), exports);
289
296
  __exportStar(require("./icons/LaunchIcon/LaunchIcon"), exports);
290
297
  __exportStar(require("./icons/MinimizeIcon/MinimizeIcon"), exports);
291
298
  __exportStar(require("./icons/MaximizeIcon/MaximizeIcon"), exports);
299
+ __exportStar(require("./icons/ExpandCollapseIcon/ExpandCollapseIcon"), exports);
292
300
  __exportStar(require("./icons/MarkdownFullIcon/MarkdownFullIcon"), exports);
293
301
  __exportStar(require("./icons/DocumentBlankIcon/DocumentBlankIcon"), exports);
294
302
  __exportStar(require("./icons/WarningSquareIcon/WarningSquareIcon"), exports);
@@ -16,7 +16,7 @@ function PageLayout({ sidebar, children, }) {
16
16
  const Container = styled_components_1.default.div `
17
17
  display: flex;
18
18
  flex-direction: row;
19
- min-height: calc(100vh - var(--navbar-height) - var(--banner-height));
19
+ min-height: calc(100vh - var(--navbar-offset));
20
20
 
21
21
  @media screen and (min-width: ${utils_1.breakpoints.max}) {
22
22
  max-width: var(--container-max-width);
@@ -11,8 +11,8 @@ const SkipContent_1 = require("../components/SkipContent/SkipContent");
11
11
  const AIAssistantButton_1 = require("../components/Buttons/AIAssistantButton");
12
12
  const hooks_1 = require("../core/hooks");
13
13
  function RootLayout({ children }) {
14
- const { useSearch } = (0, hooks_1.useThemeHooks)();
15
- const { askAi } = useSearch();
14
+ const { useSearchFeatures } = (0, hooks_1.useThemeHooks)();
15
+ const { askAi } = useSearchFeatures();
16
16
  return (react_1.default.createElement("div", { "data-component-name": "layouts/RootLayout" },
17
17
  react_1.default.createElement(SkipContent_1.SkipContent, null),
18
18
  react_1.default.createElement(Navbar_1.Navbar, null),
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { CodeWalkthroughFilter } from '@redocly/config';
2
+ import type { CodeWalkthroughFilter } from '../../../core/types';
3
3
  export type GetFilterState = (groupId: string) => {
4
4
  value: string;
5
5
  render: boolean;
@@ -41,7 +41,7 @@ const FilterWrapper = styled_components_1.default.div `
41
41
  padding-right: var(--spacing-xl);
42
42
  padding-left: var(--spacing-xl);
43
43
  padding-bottom: var(--spacing-xs);
44
- top: var(--navbar-height);
44
+ top: var(--navbar-stack-height);
45
45
  background-color: var(--bg-color);
46
46
  z-index: var(--z-index-raised);
47
47
  max-width: var(--md-content-max-width);
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { JSX } from 'react';
3
- import type { CodeWalkthroughFile } from '@redocly/config';
3
+ import type { CodeWalkthroughFile } from '../../../core/types';
4
4
  export type CodePanelProps = {
5
5
  files: CodeWalkthroughFile[];
6
6
  downloadAssociatedFiles: CodeWalkthroughFile[];
@@ -68,9 +68,9 @@ const CodePanelWrapper = styled_components_1.default.div `
68
68
  border: 1px solid var(--code-panel-border-color);
69
69
  border-radius: var(--code-panel-border-radius);
70
70
  overflow: clip;
71
- --code-block-max-height: calc(100vh - var(--navbar-height) - 2 * var(--spacing-xl));
72
- height: calc(100vh - var(--navbar-height) - 2 * var(--spacing-xl));
71
+ --code-block-max-height: calc(100vh - var(--navbar-stack-height) - 2 * var(--spacing-xl));
72
+ height: calc(100vh - var(--navbar-stack-height) - 2 * var(--spacing-xl));
73
73
  position: sticky;
74
- top: calc(var(--navbar-height) + var(--spacing-xl));
74
+ top: calc(var(--navbar-stack-height) + var(--spacing-xl));
75
75
  `;
76
76
  //# sourceMappingURL=CodePanel.js.map
@@ -1,5 +1,5 @@
1
1
  import type { JSX } from 'react';
2
- import type { CodeWalkthroughFile } from '@redocly/config';
2
+ import type { CodeWalkthroughFile } from '../../../core/types';
3
3
  export type CodePanelHeaderProps = {
4
4
  files: CodeWalkthroughFile[];
5
5
  handleTabSwitch: (name: string) => void;
@@ -1,5 +1,5 @@
1
1
  import type { JSX } from 'react';
2
- import type { CodeWalkthroughFile } from '@redocly/config';
2
+ import type { CodeWalkthroughFile } from '../../../core/types';
3
3
  export type CodeToolbarProps = {
4
4
  file: CodeWalkthroughFile;
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import React, { type PropsWithChildren } from 'react';
2
- import type { WithConditions } from '@redocly/config';
2
+ import type { WithConditions } from '../../../core/types';
3
3
  export type CodeStepProps = WithConditions<{
4
4
  id: string;
5
5
  heading?: string;
@@ -1,4 +1,4 @@
1
1
  import React, { type PropsWithChildren } from 'react';
2
- import type { CodeWalkthroughAttr } from '@redocly/config';
2
+ import type { CodeWalkthroughAttr } from '../../../core/types';
3
3
  export type CodeWalkthroughProps = PropsWithChildren<CodeWalkthroughAttr>;
4
4
  export declare function CodeWalkthrough({ children, steps, preview, ...attributes }: CodeWalkthroughProps): React.JSX.Element;
@@ -95,7 +95,7 @@ const DocsPanel = styled_components_1.default.div `
95
95
  flex-direction: column;
96
96
 
97
97
  min-height: 0;
98
- min-height: calc(100vh - var(--navbar-height));
98
+ min-height: calc(100vh - var(--navbar-stack-height));
99
99
 
100
100
  padding-top: var(--spacing-xl);
101
101
  padding-right: var(--spacing-xs);
@@ -0,0 +1,15 @@
1
+ import type { JSX } from 'react';
2
+ import type { AiPromptTarget } from '../../../core/types';
3
+ export type PromptProps = {
4
+ /** Raw Markdown source of the prompt; rendered and copied as plain text. */
5
+ prompt: string;
6
+ title?: string;
7
+ icon?: string;
8
+ iconRawContent?: string;
9
+ actions?: AiPromptTarget[];
10
+ hidePrompt?: boolean;
11
+ singleLine?: boolean;
12
+ buttonOnly?: boolean;
13
+ className?: string;
14
+ };
15
+ export declare function Prompt(props: PromptProps): JSX.Element;
@@ -0,0 +1,163 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Prompt = Prompt;
37
+ const react_1 = __importStar(require("react"));
38
+ const styled_components_1 = __importStar(require("styled-components"));
39
+ const constants_1 = require("../../../core/constants");
40
+ const hooks_1 = require("../../../core/hooks");
41
+ const PromptActions_1 = require("../../../markdoc/components/Prompt/PromptActions");
42
+ const PromptBody_1 = require("../../../markdoc/components/Prompt/PromptBody");
43
+ const PromptShowHideButton_1 = require("../../../markdoc/components/Prompt/PromptShowHideButton");
44
+ const PromptCopyButton_1 = require("../../../markdoc/components/Prompt/PromptCopyButton");
45
+ const PromptHeader_1 = require("../../../markdoc/components/Prompt/PromptHeader");
46
+ function Prompt(props) {
47
+ const { prompt, title, icon, iconRawContent, actions = [], hidePrompt = false, singleLine = false, buttonOnly = false, className, } = props;
48
+ const [isPromptVisible, setIsPromptVisible] = (0, react_1.useState)(!hidePrompt);
49
+ const { reportCopy, openIn } = (0, hooks_1.usePromptActions)(prompt);
50
+ const { textRef, textLimit, isExpanded, hasHiddenText, toggleExpanded } = (0, hooks_1.usePromptTextLimit)({
51
+ prompt,
52
+ singleLine,
53
+ isPromptVisible,
54
+ });
55
+ const borderHighlight = (0, hooks_1.usePointerBorderHighlight)();
56
+ if (buttonOnly) {
57
+ const copyButton = (react_1.default.createElement(PromptCopyButton_1.PromptCopyButton, { prompt: prompt, placement: "standalone", onCopy: reportCopy }));
58
+ return (react_1.default.createElement(PromptButtonOnlyWrapper, { "data-component-name": "Markdoc/Prompt/Prompt", className: className }, actions.length > 0 ? (react_1.default.createElement(PromptActions_1.PromptActions, { actions: actions, onOpen: openIn, button: copyButton, alignment: "start" })) : (copyButton)));
59
+ }
60
+ const hasHeader = Boolean(title) || Boolean(icon) || actions.length > 0 || hidePrompt;
61
+ const headerControls = (react_1.default.createElement(react_1.default.Fragment, null,
62
+ hidePrompt ? (react_1.default.createElement(PromptShowHideButton_1.PromptShowHideButton, { isPromptVisible: isPromptVisible, onToggle: () => setIsPromptVisible(!isPromptVisible) })) : null,
63
+ react_1.default.createElement(HeaderCopyWrapper, { $alwaysVisible: hidePrompt },
64
+ react_1.default.createElement(PromptCopyButton_1.PromptCopyButton, { prompt: prompt, placement: "header", onCopy: reportCopy }))));
65
+ return (react_1.default.createElement(PromptWrapper, { "data-component-name": "Markdoc/Prompt/Prompt", className: className },
66
+ react_1.default.createElement(PromptCardWrapper, { ref: borderHighlight.ref, onPointerMove: borderHighlight.onPointerMove, onPointerLeave: borderHighlight.onPointerLeave },
67
+ hasHeader ? (react_1.default.createElement(PromptHeader_1.PromptHeader, { title: title, icon: icon, iconRawContent: iconRawContent, controls: headerControls })) : null,
68
+ actions.length > 0 ? react_1.default.createElement(HeaderActionsWrapper, { actions: actions, onOpen: openIn }) : null,
69
+ isPromptVisible ? (react_1.default.createElement(PromptBody_1.PromptBody, { prompt: prompt, textRef: textRef, textLimit: textLimit, isExpanded: isExpanded, hasHiddenText: hasHiddenText, onToggleExpanded: toggleExpanded, controls: hidePrompt ? null : (react_1.default.createElement(BodyCopyWrapper, { $hiddenWhenNarrow: hasHeader },
70
+ react_1.default.createElement(PromptCopyButton_1.PromptCopyButton, { prompt: prompt, placement: "body", onCopy: reportCopy }))) })) : null)));
71
+ }
72
+ /* The card cannot query its own width, so the container query sits on this wrapper. */
73
+ const PromptWrapper = styled_components_1.default.div `
74
+ container: prompt / inline-size;
75
+ margin: var(--prompt-margin);
76
+ `;
77
+ /* Below 440px the block is a phone screen or a narrow column: the actions get their own
78
+ full-width row under the header, and the copy button moves from the prompt zone to the
79
+ header. The DOM order (header, actions, prompt) is the same in both layouts. */
80
+ const NARROW_BLOCK = `@container prompt (width < ${constants_1.PROMPT_NARROW_BLOCK_MAX_WIDTH})`;
81
+ const PromptCardWrapper = styled_components_1.default.div `
82
+ position: relative;
83
+ display: flex;
84
+ flex-wrap: wrap;
85
+ align-items: center;
86
+ row-gap: var(--prompt-gap);
87
+ column-gap: var(--prompt-header-actions-gap);
88
+ padding: var(--prompt-padding-vertical) var(--prompt-padding-horizontal);
89
+
90
+ > [data-component-name='Markdoc/Prompt/PromptHeader'] {
91
+ flex: 1 1 0;
92
+ min-width: 0;
93
+ }
94
+
95
+ > [data-component-name='Markdoc/Prompt/PromptBody'] {
96
+ flex: 1 1 100%;
97
+ }
98
+ background-color: var(--prompt-bg-color);
99
+ border: var(--prompt-border-width) var(--border-style) var(--prompt-border-color);
100
+ border-radius: var(--prompt-border-radius);
101
+
102
+ /* A gradient ring over the border, lit around the pointer. The mask keeps only the
103
+ border-width frame of the gradient; --pointer-* come from usePointerBorderHighlight. */
104
+ &::before {
105
+ content: '';
106
+ position: absolute;
107
+ inset: calc(-1 * var(--prompt-border-width));
108
+ padding: var(--prompt-border-width);
109
+ border-radius: var(--prompt-border-radius);
110
+ background: radial-gradient(
111
+ var(--prompt-border-highlight-size) circle at var(--pointer-x, 50%) var(--pointer-y, 50%),
112
+ var(--prompt-border-highlight-color-start),
113
+ var(--prompt-border-highlight-color-end) 40%,
114
+ transparent 80%
115
+ );
116
+ mask:
117
+ linear-gradient(currentColor 0 0) content-box,
118
+ linear-gradient(currentColor 0 0);
119
+ mask-composite: exclude;
120
+ opacity: var(--pointer-edge-proximity, 0);
121
+ transition: var(--prompt-border-highlight-transition);
122
+ pointer-events: none;
123
+ }
124
+ `;
125
+ const HeaderActionsWrapper = (0, styled_components_1.default)(PromptActions_1.PromptActions) `
126
+ flex: 0 0 auto;
127
+
128
+ ${NARROW_BLOCK} {
129
+ flex-basis: 100%;
130
+ display: flex;
131
+
132
+ [data-component-name='SplitButton/SplitButton'],
133
+ [data-component-name='Button/ButtonGroup'] {
134
+ width: 100%;
135
+ }
136
+
137
+ [data-component-name='Button/ButtonGroup'] > .button:first-child {
138
+ flex: 1;
139
+ }
140
+ }
141
+ `;
142
+ const HeaderCopyWrapper = styled_components_1.default.div `
143
+ display: ${({ $alwaysVisible }) => ($alwaysVisible ? 'flex' : 'none')};
144
+
145
+ ${NARROW_BLOCK} {
146
+ display: flex;
147
+ }
148
+ `;
149
+ const BodyCopyWrapper = styled_components_1.default.div `
150
+ display: flex;
151
+
152
+ ${({ $hiddenWhenNarrow }) => $hiddenWhenNarrow &&
153
+ (0, styled_components_1.css) `
154
+ ${NARROW_BLOCK} {
155
+ display: none;
156
+ }
157
+ `}
158
+ `;
159
+ const PromptButtonOnlyWrapper = styled_components_1.default.div `
160
+ display: flex;
161
+ margin: var(--prompt-margin);
162
+ `;
163
+ //# sourceMappingURL=Prompt.js.map
@@ -0,0 +1,13 @@
1
+ import type { JSX, ReactElement } from 'react';
2
+ import type { ButtonProps } from '../../../components/Button/Button';
3
+ import type { AiPromptTarget } from '../../../core/types';
4
+ export type PromptActionsProps = {
5
+ actions: AiPromptTarget[];
6
+ onOpen: (target: AiPromptTarget) => void;
7
+ /** Main button of the split button; without it, the first action is the main button. */
8
+ button?: ReactElement<ButtonProps>;
9
+ /** Side of the split button the menu lines up with. */
10
+ alignment?: 'start' | 'end';
11
+ className?: string;
12
+ };
13
+ export declare function PromptActions({ actions, onOpen, button, alignment, className, }: PromptActionsProps): JSX.Element | null;
@@ -0,0 +1,43 @@
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.PromptActions = PromptActions;
7
+ const react_1 = __importDefault(require("react"));
8
+ const styled_components_1 = __importDefault(require("styled-components"));
9
+ const Button_1 = require("../../../components/Button/Button");
10
+ const SplitButton_1 = require("../../../components/SplitButton/SplitButton");
11
+ const DropdownMenu_1 = require("../../../components/Dropdown/DropdownMenu");
12
+ const DropdownMenuItem_1 = require("../../../components/Dropdown/DropdownMenuItem");
13
+ const DropdownMenuItemContent_1 = require("../../../components/Dropdown/DropdownMenuItemContent");
14
+ const ChatGptIcon_1 = require("../../../icons/ChatGptIcon/ChatGptIcon");
15
+ const ClaudeIcon_1 = require("../../../icons/ClaudeIcon/ClaudeIcon");
16
+ const CursorIcon_1 = require("../../../icons/CursorIcon/CursorIcon");
17
+ const hooks_1 = require("../../../core/hooks");
18
+ const constants_1 = require("../../../core/constants");
19
+ const ACTION_ICONS = {
20
+ cursor: CursorIcon_1.CursorIcon,
21
+ claude: ClaudeIcon_1.ClaudeIcon,
22
+ chatgpt: ChatGptIcon_1.ChatGptIcon,
23
+ };
24
+ function PromptActions({ actions, onOpen, button, alignment = 'end', className, }) {
25
+ const { useTranslate } = (0, hooks_1.useThemeHooks)();
26
+ const { translate } = useTranslate();
27
+ const [firstAction, ...restActions] = actions;
28
+ if (!firstAction)
29
+ return null;
30
+ const menuActions = button ? actions : restActions;
31
+ const primaryButton = button !== null && button !== void 0 ? button : (react_1.default.createElement(Button_1.Button, { variant: "secondary", size: "small", icon: react_1.default.createElement(PromptActionIcon, { action: firstAction }), onClick: () => onOpen(firstAction) }, translate(constants_1.AI_PROMPT_ACTION_OPTIONS[firstAction].titleTranslationKey, constants_1.AI_PROMPT_ACTION_OPTIONS[firstAction].titleDefault)));
32
+ return (react_1.default.createElement(PromptActionsWrapper, { "data-component-name": "Markdoc/Prompt/PromptActions", className: className },
33
+ react_1.default.createElement(SplitButton_1.SplitButton, { variant: "secondary", size: "small", alignment: alignment, portalled: true, toggleAriaLabel: translate('page.actions.moreActions', 'More actions'), button: primaryButton }, menuActions.length > 0 ? (react_1.default.createElement(DropdownMenu_1.DropdownMenu, null, menuActions.map((action) => (react_1.default.createElement(DropdownMenuItem_1.DropdownMenuItem, { key: action, onAction: () => onOpen(action) },
34
+ react_1.default.createElement(DropdownMenuItemContent_1.DropdownMenuItemContent, { icon: react_1.default.createElement(PromptActionIcon, { action: action }), title: translate(constants_1.AI_PROMPT_ACTION_OPTIONS[action].titleTranslationKey, constants_1.AI_PROMPT_ACTION_OPTIONS[action].titleDefault), description: translate(constants_1.AI_PROMPT_ACTION_OPTIONS[action].descriptionTranslationKey, constants_1.AI_PROMPT_ACTION_OPTIONS[action].descriptionDefault) })))))) : null)));
35
+ }
36
+ function PromptActionIcon({ action }) {
37
+ const Icon = ACTION_ICONS[action];
38
+ return react_1.default.createElement(Icon, null);
39
+ }
40
+ const PromptActionsWrapper = styled_components_1.default.div `
41
+ display: inline-flex;
42
+ `;
43
+ //# sourceMappingURL=PromptActions.js.map
@@ -0,0 +1,14 @@
1
+ import type { JSX, ReactNode, RefObject } from 'react';
2
+ import type { PromptTextLimit } from '../../../core/hooks';
3
+ export type PromptBodyProps = {
4
+ prompt: string;
5
+ textRef: RefObject<HTMLDivElement | null>;
6
+ textLimit: PromptTextLimit;
7
+ isExpanded: boolean;
8
+ hasHiddenText: boolean;
9
+ onToggleExpanded: () => void;
10
+ /** Shown inside the prompt zone; omitted when the header owns the copy button. */
11
+ controls?: ReactNode;
12
+ className?: string;
13
+ };
14
+ export declare function PromptBody({ prompt, textRef, textLimit, isExpanded, hasHiddenText, onToggleExpanded, controls, className, }: PromptBodyProps): JSX.Element;