@redocly/theme 0.69.0-next.0 → 0.69.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 (293) hide show
  1. package/lib/components/Accordion/Accordion.js +5 -1
  2. package/lib/components/Accordion/variables.js +1 -1
  3. package/lib/components/Admonition/Admonition.d.ts +1 -1
  4. package/lib/components/Admonition/Admonition.js +1 -1
  5. package/lib/components/Admonition/variables.dark.js +2 -2
  6. package/lib/components/Admonition/variables.js +10 -10
  7. package/lib/components/Badge/Badge.d.ts +3 -1
  8. package/lib/components/Badge/Badge.js +7 -2
  9. package/lib/components/Banner/variables.dark.js +2 -0
  10. package/lib/components/Banner/variables.js +3 -1
  11. package/lib/components/Breadcrumbs/Breadcrumb.js +1 -1
  12. package/lib/components/Breadcrumbs/variables.js +1 -1
  13. package/lib/components/Button/ButtonGroup.d.ts +3 -5
  14. package/lib/components/Button/ButtonGroup.js +25 -5
  15. package/lib/components/Button/variables.js +27 -4
  16. package/lib/components/Buttons/ConnectMCPButton.js +39 -123
  17. package/lib/components/Buttons/CopyButton.js +12 -1
  18. package/lib/components/Buttons/variables.d.ts +0 -1
  19. package/lib/components/Buttons/variables.js +3 -44
  20. package/lib/components/Catalog/CatalogEntities.js +1 -0
  21. package/lib/components/Catalog/CatalogEntity/CatalogEntityLinks.js +1 -1
  22. package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.js +1 -1
  23. package/lib/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.js +1 -1
  24. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +5 -3
  25. package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +1 -1
  26. package/lib/components/Catalog/CatalogFilter/CatalogFilterSelect.js +1 -0
  27. package/lib/components/Catalog/CatalogViewModeToggle.d.ts +1 -1
  28. package/lib/components/Catalog/CatalogViewModeToggle.js +2 -43
  29. package/lib/components/Catalog/variables.js +5 -5
  30. package/lib/components/CatalogClassic/variables.js +2 -2
  31. package/lib/components/CodeBlock/CodeBlock.js +2 -1
  32. package/lib/components/CodeBlock/CodeBlockContainer.js +1 -0
  33. package/lib/components/Dropdown/Dropdown.d.ts +10 -20
  34. package/lib/components/Dropdown/Dropdown.js +13 -2
  35. package/lib/components/Dropdown/DropdownMenuItemContent.d.ts +9 -0
  36. package/lib/components/Dropdown/DropdownMenuItemContent.js +56 -0
  37. package/lib/components/Dropdown/variables.js +19 -2
  38. package/lib/components/Feedback/Mood.js +18 -14
  39. package/lib/components/Feedback/Rating.js +18 -13
  40. package/lib/components/Feedback/Scale.js +27 -22
  41. package/lib/components/Feedback/Sentiment.js +17 -13
  42. package/lib/components/Filter/FilterInput.js +4 -2
  43. package/lib/components/Filter/FilterSelect.js +1 -0
  44. package/lib/components/Filter/variables.js +2 -2
  45. package/lib/components/Image/variables.js +5 -3
  46. package/lib/components/JsonViewer/Helpers.js +12 -42
  47. package/lib/components/LanguagePicker/variables.js +1 -1
  48. package/lib/components/MCP/McpConnectionTabs.d.ts +7 -0
  49. package/lib/components/MCP/McpConnectionTabs.js +151 -0
  50. package/lib/components/Markdown/Markdown.js +1 -1
  51. package/lib/components/Markdown/styles/base-table.js +8 -0
  52. package/lib/components/Markdown/variables.js +1 -1
  53. package/lib/components/Menu/MenuItem.js +1 -1
  54. package/lib/components/Menu/variables.js +1 -1
  55. package/lib/components/Navbar/variables.js +1 -1
  56. package/lib/components/PageActions/PageActions.js +4 -6
  57. package/lib/components/PageActions/PageActionsMenuItem.d.ts +4 -4
  58. package/lib/components/PageActions/PageActionsMenuItem.js +27 -43
  59. package/lib/components/Panel/Panel.js +5 -1
  60. package/lib/components/Panel/variables.js +1 -1
  61. package/lib/components/Product/variables.js +2 -1
  62. package/lib/components/ReplayGate/ReplayGate.d.ts +1 -0
  63. package/lib/components/Search/FilterFields/SearchFilterFieldSelect.js +22 -32
  64. package/lib/components/Search/SearchAiDialog.js +4 -1
  65. package/lib/components/Search/SearchAiMessage.js +1 -1
  66. package/lib/components/Search/SearchAiNegativeFeedbackForm.js +2 -2
  67. package/lib/components/Search/SearchDialog.js +2 -2
  68. package/lib/components/Search/SearchItem.js +6 -3
  69. package/lib/components/Search/SearchRecent.js +1 -0
  70. package/lib/components/Search/SearchSuggestedPages.js +1 -0
  71. package/lib/components/Search/variables.js +9 -5
  72. package/lib/components/Segmented/Segmented.js +3 -3
  73. package/lib/components/Select/Select.js +30 -23
  74. package/lib/components/Select/variables.js +3 -3
  75. package/lib/components/Sidebar/Sidebar.js +2 -38
  76. package/lib/components/SplitButton/SplitButton.d.ts +21 -0
  77. package/lib/components/SplitButton/SplitButton.js +37 -0
  78. package/lib/components/Switch/variables.dark.js +2 -2
  79. package/lib/components/Switch/variables.js +2 -2
  80. package/lib/components/Tag/variables.js +2 -2
  81. package/lib/components/Tags/variables.js +1 -1
  82. package/lib/components/Toast/variables.js +1 -1
  83. package/lib/components/Tooltip/AnchorTooltip.js +2 -2
  84. package/lib/components/Tooltip/JsTooltip.js +2 -2
  85. package/lib/components/UserMenu/variables.js +1 -1
  86. package/lib/core/constants/accordion.d.ts +3 -0
  87. package/lib/core/constants/accordion.js +7 -0
  88. package/lib/core/constants/index.d.ts +1 -0
  89. package/lib/core/constants/index.js +1 -0
  90. package/lib/core/constants/mcp.d.ts +4 -0
  91. package/lib/core/constants/mcp.js +10 -1
  92. package/lib/core/constants/search.js +2 -2
  93. package/lib/core/contexts/PageActionsContext.d.ts +5 -0
  94. package/lib/core/contexts/PageActionsContext.js +10 -0
  95. package/lib/core/contexts/index.d.ts +1 -0
  96. package/lib/core/contexts/index.js +1 -0
  97. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-controls.js +5 -17
  98. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.js +1 -0
  99. package/lib/core/hooks/menu/use-menu-item-expanded.js +1 -0
  100. package/lib/core/hooks/use-active-heading.js +59 -15
  101. package/lib/core/hooks/use-active-section-id.js +3 -1
  102. package/lib/core/hooks/use-connect-mcp-button.d.ts +1 -1
  103. package/lib/core/hooks/use-connect-mcp-button.js +16 -13
  104. package/lib/core/hooks/use-control.js +3 -0
  105. package/lib/core/hooks/use-local-state.js +1 -0
  106. package/lib/core/hooks/use-mcp-config.d.ts +2 -0
  107. package/lib/core/hooks/use-mcp-config.js +14 -4
  108. package/lib/core/hooks/use-mobile-menu.js +10 -2
  109. package/lib/core/styles/global.js +56 -49
  110. package/lib/core/styles/palette.js +2 -0
  111. package/lib/core/types/button-group.d.ts +2 -0
  112. package/lib/core/types/button-group.js +3 -0
  113. package/lib/core/types/catalog.d.ts +2 -4
  114. package/lib/core/types/common.d.ts +2 -0
  115. package/lib/core/types/hooks.d.ts +1 -0
  116. package/lib/core/types/index.d.ts +1 -0
  117. package/lib/core/types/l10n.d.ts +1 -1
  118. package/lib/core/types/mcp.d.ts +1 -1
  119. package/lib/core/utils/RenderWithLink.d.ts +2 -0
  120. package/lib/core/utils/RenderWithLink.js +20 -0
  121. package/lib/core/utils/index.d.ts +1 -0
  122. package/lib/core/utils/index.js +1 -0
  123. package/lib/core/utils/mcp.d.ts +5 -0
  124. package/lib/core/utils/mcp.js +35 -0
  125. package/lib/icons/CodexIcon/CodexIcon.d.ts +25 -0
  126. package/lib/icons/CodexIcon/CodexIcon.js +22 -0
  127. package/lib/icons/LinkIcon/LinkIcon.js +1 -1
  128. package/lib/index.d.ts +2 -0
  129. package/lib/index.js +2 -0
  130. package/lib/layouts/McpNotAllowed.js +10 -10
  131. package/lib/markdoc/components/Accordion/Accordion.d.ts +9 -0
  132. package/lib/markdoc/components/Accordion/Accordion.js +132 -0
  133. package/lib/markdoc/components/Accordion/AccordionGroup.d.ts +5 -0
  134. package/lib/markdoc/components/Accordion/AccordionGroup.js +29 -0
  135. package/lib/markdoc/components/Accordion/variables.d.ts +1 -0
  136. package/lib/markdoc/components/Accordion/variables.js +40 -0
  137. package/lib/markdoc/components/Cards/Card.d.ts +8 -1
  138. package/lib/markdoc/components/Cards/Card.js +55 -16
  139. package/lib/markdoc/components/Cards/CardBadge.d.ts +9 -0
  140. package/lib/markdoc/components/Cards/CardBadge.js +30 -0
  141. package/lib/markdoc/components/Cards/CardIcon.d.ts +5 -4
  142. package/lib/markdoc/components/Cards/CardIcon.js +6 -3
  143. package/lib/markdoc/components/Cards/variables.dark.js +32 -0
  144. package/lib/markdoc/components/Cards/variables.js +81 -7
  145. package/lib/markdoc/components/CodeWalkthrough/CodePanel.js +1 -0
  146. package/lib/markdoc/components/CodeWalkthrough/CodeStep.js +1 -1
  147. package/lib/markdoc/components/CodeWalkthrough/variables.js +2 -1
  148. package/lib/markdoc/components/Heading/Heading.js +5 -2
  149. package/lib/markdoc/components/Tabs/TabList.js +6 -2
  150. package/lib/markdoc/components/Tabs/Tabs.js +4 -2
  151. package/lib/markdoc/components/Tabs/variables.js +4 -4
  152. package/lib/markdoc/components/default.d.ts +2 -0
  153. package/lib/markdoc/components/default.js +2 -0
  154. package/lib/markdoc/default.d.ts +4 -0
  155. package/lib/markdoc/default.js +4 -0
  156. package/lib/markdoc/tags/accordion-group.d.ts +2 -0
  157. package/lib/markdoc/tags/accordion-group.js +10 -0
  158. package/lib/markdoc/tags/accordion.d.ts +2 -0
  159. package/lib/markdoc/tags/accordion.js +14 -0
  160. package/lib/markdoc/tags/admonition.js +1 -1
  161. package/lib/markdoc/tags/card.js +14 -0
  162. package/lib/markdoc/tags/connect-mcp.js +2 -1
  163. package/package.json +19 -10
  164. package/src/components/Accordion/Accordion.tsx +7 -3
  165. package/src/components/Accordion/variables.ts +1 -1
  166. package/src/components/Admonition/Admonition.tsx +2 -2
  167. package/src/components/Admonition/variables.dark.ts +2 -2
  168. package/src/components/Admonition/variables.ts +10 -10
  169. package/src/components/Badge/Badge.tsx +16 -2
  170. package/src/components/Banner/variables.dark.ts +2 -0
  171. package/src/components/Banner/variables.ts +3 -1
  172. package/src/components/Breadcrumbs/Breadcrumb.tsx +1 -1
  173. package/src/components/Breadcrumbs/variables.ts +1 -1
  174. package/src/components/Button/ButtonGroup.tsx +28 -10
  175. package/src/components/Button/variables.ts +27 -4
  176. package/src/components/Buttons/ConnectMCPButton.tsx +88 -145
  177. package/src/components/Buttons/CopyButton.tsx +14 -2
  178. package/src/components/Buttons/variables.ts +2 -44
  179. package/src/components/Catalog/CatalogEntities.tsx +1 -0
  180. package/src/components/Catalog/CatalogEntity/CatalogEntityLinks.tsx +1 -1
  181. package/src/components/Catalog/CatalogEntity/CatalogEntityMetadata.tsx +1 -1
  182. package/src/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.tsx +1 -1
  183. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +6 -4
  184. package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +1 -1
  185. package/src/components/Catalog/CatalogFilter/CatalogFilterSelect.tsx +1 -0
  186. package/src/components/Catalog/CatalogViewModeToggle.tsx +2 -17
  187. package/src/components/Catalog/variables.ts +5 -5
  188. package/src/components/CatalogClassic/variables.ts +2 -2
  189. package/src/components/CodeBlock/CodeBlock.tsx +2 -1
  190. package/src/components/CodeBlock/CodeBlockContainer.tsx +1 -0
  191. package/src/components/Dropdown/Dropdown.tsx +25 -4
  192. package/src/components/Dropdown/DropdownMenuItemContent.tsx +72 -0
  193. package/src/components/Dropdown/variables.ts +19 -2
  194. package/src/components/Feedback/Mood.tsx +22 -15
  195. package/src/components/Feedback/Rating.tsx +22 -14
  196. package/src/components/Feedback/Scale.tsx +40 -32
  197. package/src/components/Feedback/Sentiment.tsx +21 -14
  198. package/src/components/Filter/FilterInput.tsx +5 -3
  199. package/src/components/Filter/FilterSelect.tsx +1 -0
  200. package/src/components/Filter/variables.ts +2 -2
  201. package/src/components/Image/variables.ts +5 -3
  202. package/src/components/JsonViewer/Helpers.tsx +13 -9
  203. package/src/components/LanguagePicker/variables.ts +1 -1
  204. package/src/components/MCP/McpConnectionTabs.tsx +263 -0
  205. package/src/components/Markdown/Markdown.tsx +2 -1
  206. package/src/components/Markdown/styles/base-table.ts +8 -0
  207. package/src/components/Markdown/variables.ts +1 -1
  208. package/src/components/Menu/MenuItem.tsx +2 -2
  209. package/src/components/Menu/variables.ts +1 -1
  210. package/src/components/Navbar/variables.ts +1 -1
  211. package/src/components/PageActions/PageActions.tsx +22 -23
  212. package/src/components/PageActions/PageActionsMenuItem.tsx +41 -55
  213. package/src/components/Panel/Panel.tsx +7 -3
  214. package/src/components/Panel/variables.ts +1 -1
  215. package/src/components/Product/variables.ts +2 -1
  216. package/src/components/ReplayGate/ReplayGate.tsx +3 -0
  217. package/src/components/Search/FilterFields/SearchFilterFieldSelect.tsx +32 -40
  218. package/src/components/Search/SearchAiDialog.tsx +4 -1
  219. package/src/components/Search/SearchAiMessage.tsx +1 -1
  220. package/src/components/Search/SearchAiNegativeFeedbackForm.tsx +2 -2
  221. package/src/components/Search/SearchDialog.tsx +2 -2
  222. package/src/components/Search/SearchItem.tsx +7 -1
  223. package/src/components/Search/SearchRecent.tsx +1 -0
  224. package/src/components/Search/SearchSuggestedPages.tsx +1 -0
  225. package/src/components/Search/variables.ts +9 -5
  226. package/src/components/Segmented/Segmented.tsx +6 -3
  227. package/src/components/Select/Select.tsx +36 -22
  228. package/src/components/Select/variables.ts +3 -3
  229. package/src/components/Sidebar/Sidebar.tsx +2 -6
  230. package/src/components/SplitButton/SplitButton.tsx +95 -0
  231. package/src/components/Switch/variables.dark.ts +2 -2
  232. package/src/components/Switch/variables.ts +2 -2
  233. package/src/components/Tag/variables.ts +2 -2
  234. package/src/components/Tags/variables.ts +1 -1
  235. package/src/components/Toast/variables.ts +1 -1
  236. package/src/components/Tooltip/AnchorTooltip.tsx +2 -2
  237. package/src/components/Tooltip/JsTooltip.tsx +2 -2
  238. package/src/components/UserMenu/variables.ts +1 -1
  239. package/src/core/constants/accordion.ts +4 -0
  240. package/src/core/constants/index.ts +1 -0
  241. package/src/core/constants/mcp.ts +14 -0
  242. package/src/core/constants/search.ts +2 -2
  243. package/src/core/contexts/PageActionsContext.tsx +7 -0
  244. package/src/core/contexts/index.ts +1 -0
  245. package/src/core/hooks/code-walkthrough/use-code-walkthrough-controls.ts +6 -20
  246. package/src/core/hooks/code-walkthrough/use-code-walkthrough-steps.ts +1 -0
  247. package/src/core/hooks/menu/use-menu-item-expanded.ts +1 -0
  248. package/src/core/hooks/use-active-heading.ts +79 -15
  249. package/src/core/hooks/use-active-section-id.ts +3 -1
  250. package/src/core/hooks/use-connect-mcp-button.ts +23 -15
  251. package/src/core/hooks/use-control.ts +5 -1
  252. package/src/core/hooks/use-local-state.ts +1 -0
  253. package/src/core/hooks/use-mcp-config.ts +15 -4
  254. package/src/core/hooks/use-mobile-menu.ts +11 -3
  255. package/src/core/openapi/index.ts +1 -1
  256. package/src/core/styles/global.ts +19 -12
  257. package/src/core/styles/palette.ts +2 -0
  258. package/src/core/types/button-group.ts +2 -0
  259. package/src/core/types/catalog.ts +2 -4
  260. package/src/core/types/common.ts +3 -0
  261. package/src/core/types/hooks.ts +1 -0
  262. package/src/core/types/index.ts +1 -0
  263. package/src/core/types/l10n.ts +29 -1
  264. package/src/core/types/mcp.ts +1 -1
  265. package/src/core/utils/RenderWithLink.tsx +19 -0
  266. package/src/core/utils/index.ts +1 -0
  267. package/src/core/utils/mcp.ts +39 -0
  268. package/src/icons/CodexIcon/CodexIcon.tsx +23 -0
  269. package/src/icons/LinkIcon/LinkIcon.tsx +1 -1
  270. package/src/index.ts +2 -0
  271. package/src/layouts/McpNotAllowed.tsx +37 -11
  272. package/src/markdoc/components/Accordion/Accordion.tsx +128 -0
  273. package/src/markdoc/components/Accordion/AccordionGroup.tsx +41 -0
  274. package/src/markdoc/components/Accordion/variables.ts +37 -0
  275. package/src/markdoc/components/Cards/Card.tsx +79 -14
  276. package/src/markdoc/components/Cards/CardBadge.tsx +39 -0
  277. package/src/markdoc/components/Cards/CardIcon.tsx +16 -5
  278. package/src/markdoc/components/Cards/variables.dark.ts +32 -0
  279. package/src/markdoc/components/Cards/variables.ts +81 -7
  280. package/src/markdoc/components/CodeWalkthrough/CodePanel.tsx +1 -0
  281. package/src/markdoc/components/CodeWalkthrough/CodeStep.tsx +1 -1
  282. package/src/markdoc/components/CodeWalkthrough/variables.ts +2 -1
  283. package/src/markdoc/components/Heading/Heading.tsx +7 -4
  284. package/src/markdoc/components/Tabs/TabList.tsx +6 -2
  285. package/src/markdoc/components/Tabs/Tabs.tsx +4 -2
  286. package/src/markdoc/components/Tabs/variables.ts +4 -4
  287. package/src/markdoc/components/default.ts +2 -0
  288. package/src/markdoc/default.ts +4 -0
  289. package/src/markdoc/tags/accordion-group.ts +8 -0
  290. package/src/markdoc/tags/accordion.ts +12 -0
  291. package/src/markdoc/tags/admonition.ts +1 -1
  292. package/src/markdoc/tags/card.ts +14 -0
  293. package/src/markdoc/tags/connect-mcp.ts +3 -1
@@ -18,7 +18,7 @@ exports.toast = (0, styled_components_1.css) `
18
18
  --toast-max-width: 360px;
19
19
  --toast-bg-color: var(--layer-color); // @presenter Color
20
20
  --toast-border: var(--border-width) var(--border-style) var(--border-color-secondary); // @presenter Border
21
- --toast-border-radius: var(--border-radius-md); // @presenter BorderRadius
21
+ --toast-border-radius: var(--border-radius-lg); // @presenter BorderRadius
22
22
  --toast-font-family: var(--font-family-base); // @presenter FontFamily
23
23
 
24
24
  /**
@@ -209,7 +209,7 @@ const TooltipBody = styled_components_1.default.span.attrs(({ $anchorName }) =>
209
209
  overflow-wrap: break-word;
210
210
  text-align: left;
211
211
 
212
- border-radius: var(--border-radius-md);
212
+ border-radius: var(--border-radius-lg);
213
213
  transition: opacity 0.3s ease-out;
214
214
 
215
215
  font-size: var(--font-size-base);
@@ -229,7 +229,7 @@ const TooltipBody = styled_components_1.default.span.attrs(({ $anchorName }) =>
229
229
 
230
230
  background: var(--tooltip-bg-color);
231
231
  color: var(--tooltip-text-color);
232
- border: var(--tooltip-border-width, 0) var(--tooltip-border-style, solid)
232
+ border: var(--tooltip-border-width, 2px) var(--tooltip-border-style, solid)
233
233
  var(--tooltip-border-color, transparent);
234
234
  box-shadow: var(--bg-raised-shadow);
235
235
 
@@ -227,7 +227,7 @@ const TooltipBody = styled_components_1.default.span `
227
227
  word-break: normal;
228
228
  overflow-wrap: break-word;
229
229
 
230
- border-radius: var(--border-radius-md);
230
+ border-radius: var(--border-radius-lg);
231
231
  transition: opacity 0.3s ease-out;
232
232
 
233
233
  font-size: var(--font-size-base);
@@ -247,7 +247,7 @@ const TooltipBody = styled_components_1.default.span `
247
247
 
248
248
  background: var(--tooltip-bg-color);
249
249
  color: var(--tooltip-text-color);
250
- border: var(--tooltip-border-width, 0) var(--tooltip-border-style, solid)
250
+ border: var(--tooltip-border-width, 2px) var(--tooltip-border-style, solid)
251
251
  var(--tooltip-border-color, transparent);
252
252
  box-shadow: var(--bg-raised-shadow);
253
253
 
@@ -51,7 +51,7 @@ exports.userMenu = (0, styled_components_1.css) `
51
51
  --user-menu-dropdown-item-padding-vertical: var(--dropdown-menu-item-padding-vertical); // @presenter Spacing
52
52
  --user-menu-dropdown-item-separator-padding-top: var(--dropdown-menu-item-separator-padding-top ); // @presenter Spacing
53
53
  --user-menu-dropdown-item-separator-padding-bottom: var(--dropdown-menu-item-separator-padding-bottom ); // @presenter Spacing
54
- --user-menu-dropdown-item-border-radius: var(--dropdown-menu-item-border-radius ); // @presenter BorderRadius
54
+ --user-menu-dropdown-item-border-radius: var(--dropdown-menu-item-border-radius); // @presenter BorderRadius
55
55
  --user-menu-dropdown-item-bg-color-active: var(--dropdown-menu-item-bg-color-active); // @presenter Color
56
56
  --user-menu-dropdown-item-bg-color-hover: var(--dropdown-menu-item-bg-color-hover); // @presenter Color
57
57
  --user-menu-dropdown-item-bg-color-disabled: var(--dropdown-menu-item-bg-color-disabled); // @presenter Color
@@ -0,0 +1,3 @@
1
+ export declare const ACCORDION_COMPONENT_NAME = "Markdoc/Accordion/Accordion";
2
+ export declare const ACCORDION_GROUP_COMPONENT_NAME = "Markdoc/Accordion/AccordionGroup";
3
+ export declare const ACCORDION_SELECTOR = "[data-component-name='Markdoc/Accordion/Accordion']";
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ACCORDION_SELECTOR = exports.ACCORDION_GROUP_COMPONENT_NAME = exports.ACCORDION_COMPONENT_NAME = void 0;
4
+ exports.ACCORDION_COMPONENT_NAME = 'Markdoc/Accordion/Accordion';
5
+ exports.ACCORDION_GROUP_COMPONENT_NAME = 'Markdoc/Accordion/AccordionGroup';
6
+ exports.ACCORDION_SELECTOR = `[data-component-name='${exports.ACCORDION_COMPONENT_NAME}']`;
7
+ //# sourceMappingURL=accordion.js.map
@@ -1,3 +1,4 @@
1
+ export * from './accordion';
1
2
  export * from './common';
2
3
  export * from './environments';
3
4
  export * from './code-walkthrough';
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./accordion"), exports);
17
18
  __exportStar(require("./common"), exports);
18
19
  __exportStar(require("./environments"), exports);
19
20
  __exportStar(require("./code-walkthrough"), exports);
@@ -1 +1,5 @@
1
+ import type { MCPOption } from '../types/mcp';
1
2
  export declare const DEFAULT_MCP_SERVER_NAME = "mcp-server";
3
+ export declare const MCP_ROUTE = "/mcp";
4
+ export declare const PUBLIC_MCP_ROUTE = "/mcp-public";
5
+ export declare const DEFAULT_MCP_OPTIONS: MCPOption[];
@@ -1,5 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_MCP_SERVER_NAME = void 0;
3
+ exports.DEFAULT_MCP_OPTIONS = exports.PUBLIC_MCP_ROUTE = exports.MCP_ROUTE = exports.DEFAULT_MCP_SERVER_NAME = void 0;
4
4
  exports.DEFAULT_MCP_SERVER_NAME = 'mcp-server';
5
+ exports.MCP_ROUTE = '/mcp';
6
+ exports.PUBLIC_MCP_ROUTE = '/mcp-public';
7
+ exports.DEFAULT_MCP_OPTIONS = [
8
+ 'cursor',
9
+ 'vscode',
10
+ 'claude-code',
11
+ 'codex',
12
+ 'copy',
13
+ ];
5
14
  //# sourceMappingURL=mcp.js.map
@@ -25,13 +25,13 @@ exports.AI_SEARCH_ERROR_CONFIG = {
25
25
  headerKey: 'search.ai.error.header.forbidden',
26
26
  headerDefault: 'Feature Unavailable',
27
27
  messageKey: 'search.ai.error.description.forbidden',
28
- messageDefault: 'AI Search is currently unavailable.',
28
+ messageDefault: 'AI assistant is currently unavailable.',
29
29
  },
30
30
  [AiSearchError.Unauthorized]: {
31
31
  headerKey: 'search.ai.error.header.unauthorized',
32
32
  headerDefault: 'Authentication Required',
33
33
  messageKey: 'search.ai.error.description.unauthorized',
34
- messageDefault: 'You are not authorized to use AI Search.',
34
+ messageDefault: 'You are not authorized to use AI assistant.',
35
35
  },
36
36
  [AiSearchError.HttpRequestFailed]: defaultErrorConfig,
37
37
  [AiSearchError.EmptyResponse]: defaultErrorConfig,
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Whether the first heading inside the enclosing `Markdown` mounts the page actions.
3
+ * Without a provider `Heading` falls back to the page type in the page metadata.
4
+ */
5
+ export declare const PageActionsContext: import("react").Context<boolean | null>;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PageActionsContext = void 0;
4
+ const react_1 = require("react");
5
+ /**
6
+ * Whether the first heading inside the enclosing `Markdown` mounts the page actions.
7
+ * Without a provider `Heading` falls back to the page type in the page metadata.
8
+ */
9
+ exports.PageActionsContext = (0, react_1.createContext)(null);
10
+ //# sourceMappingURL=PageActionsContext.js.map
@@ -1,5 +1,6 @@
1
1
  export * from './ThemeDataContext';
2
2
  export * from './MarkdownLinkContext';
3
+ export * from './PageActionsContext';
3
4
  export * from './CodeWalkthrough/CodeWalkthroughControlsContext';
4
5
  export * from './CodeWalkthrough/CodeWalkthroughStepsContext';
5
6
  export * from './CodeSnippetContext';
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./ThemeDataContext"), exports);
18
18
  __exportStar(require("./MarkdownLinkContext"), exports);
19
+ __exportStar(require("./PageActionsContext"), exports);
19
20
  __exportStar(require("./CodeWalkthrough/CodeWalkthroughControlsContext"), exports);
20
21
  __exportStar(require("./CodeWalkthrough/CodeWalkthroughStepsContext"), exports);
21
22
  __exportStar(require("./CodeSnippetContext"), exports);
@@ -16,9 +16,6 @@ function useCodeWalkthroughControls(filters, inputs, toggles, enableDeepLink) {
16
16
  const location = (0, react_router_1.useLocation)();
17
17
  const navigate = (0, react_router_1.useNavigate)();
18
18
  const searchParams = (0, react_1.useMemo)(() => new URLSearchParams(location.search), [location.search]);
19
- const filtersRef = (0, react_1.useRef)(filters);
20
- const inputsRef = (0, react_1.useRef)(inputs);
21
- const togglesRef = (0, react_1.useRef)(toggles);
22
19
  const getInitialState = () => {
23
20
  var _a, _b;
24
21
  var _c, _d;
@@ -36,18 +33,10 @@ function useCodeWalkthroughControls(filters, inputs, toggles, enableDeepLink) {
36
33
  return state;
37
34
  };
38
35
  const [controlsState, setControlsState] = (0, react_1.useState)(getInitialState);
39
- (0, react_1.useEffect)(() => {
40
- const sameProps = [
41
- JSON.stringify(filters) === JSON.stringify(filtersRef.current),
42
- JSON.stringify(inputs) === JSON.stringify(inputsRef.current),
43
- JSON.stringify(toggles) === JSON.stringify(togglesRef.current),
44
- ];
45
- if (sameProps.every(Boolean)) {
46
- return;
47
- }
48
- filtersRef.current = filters;
49
- inputsRef.current = inputs;
50
- togglesRef.current = toggles;
36
+ const controlsKey = JSON.stringify([filters, inputs, toggles]);
37
+ const [prevControlsKey, setPrevControlsKey] = (0, react_1.useState)(controlsKey);
38
+ if (prevControlsKey !== controlsKey) {
39
+ setPrevControlsKey(controlsKey);
51
40
  const newState = getInitialState();
52
41
  // Preserve existing values where control type hasn't changed
53
42
  Object.entries(newState).forEach(([id, control]) => {
@@ -58,8 +47,7 @@ function useCodeWalkthroughControls(filters, inputs, toggles, enableDeepLink) {
58
47
  }
59
48
  });
60
49
  setControlsState(newState);
61
- // eslint-disable-next-line react-hooks/exhaustive-deps
62
- }, [filters, inputs, toggles, enableDeepLink]);
50
+ }
63
51
  const changeControlState = (id, value) => {
64
52
  setControlsState((prev) => {
65
53
  const control = prev[id];
@@ -171,6 +171,7 @@ function useCodeWalkthroughSteps({ steps, enableDeepLink, root, }) {
171
171
  }
172
172
  const rootTopOffset = (_c = (_a = root.current) === null || _a === void 0 ? void 0 : _a.offsetTop) !== null && _c !== void 0 ? _c : 0;
173
173
  if (!activeStep && rootTopOffset <= options.navbarHeight) {
174
+ // oxlint-disable-next-line react-you-might-not-need-an-effect/no-derived-state -- seeded from root.current.offsetTop, a post-layout measurement
174
175
  setActiveStep(((_b = visibleSteps[0]) === null || _b === void 0 ? void 0 : _b.id) || null);
175
176
  }
176
177
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -11,6 +11,7 @@ function useMenuItemExpanded(item) {
11
11
  // it's important for transitions
12
12
  const [controlledValue, setControlledValue] = (0, react_1.useState)(isItemExpanded(item));
13
13
  (0, react_1.useEffect)(() => {
14
+ // oxlint-disable-next-line react-you-might-not-need-an-effect/no-derived-state -- deferred a commit on purpose so CSS transitions still run
14
15
  setIsExpanded(controlledValue);
15
16
  }, [controlledValue]);
16
17
  (0, react_1.useEffect)(() => {
@@ -5,16 +5,20 @@ const react_1 = require("react");
5
5
  const react_router_1 = require("react-router");
6
6
  const utils_1 = require("../utils");
7
7
  const constants_1 = require("../constants");
8
+ const TARGET_TOLERANCE = 2;
8
9
  function useActiveHeading(contentElement, displayedHeadings) {
9
10
  const [heading, setHeading] = (0, react_1.useState)(undefined);
10
11
  const [headingElements, setHeadingElements] = (0, react_1.useState)([]);
11
12
  const headingElementsRef = (0, react_1.useRef)({});
12
13
  const displayedHeadingsRef = (0, react_1.useRef)(displayedHeadings);
13
14
  const lockObserver = (0, react_1.useRef)(false);
15
+ const clickScroll = (0, react_1.useRef)(null);
14
16
  const location = (0, react_router_1.useLocation)();
15
17
  (0, react_1.useEffect)(() => {
16
18
  setHeading(undefined);
17
19
  headingElementsRef.current = {};
20
+ clickScroll.current = null;
21
+ lockObserver.current = false;
18
22
  }, [location.pathname]);
19
23
  (0, react_1.useEffect)(() => {
20
24
  displayedHeadingsRef.current = displayedHeadings;
@@ -98,13 +102,13 @@ function useActiveHeading(contentElement, displayedHeadings) {
98
102
  }, [calculateVirtualPositions]);
99
103
  const intersectionCallback = (0, react_1.useCallback)((entries) => {
100
104
  var _a, _b, _c;
101
- if (lockObserver.current) {
102
- return;
103
- }
104
105
  headingElementsRef.current = entries.reduce((map, entry) => {
105
106
  map[entry.target.id] = entry;
106
107
  return map;
107
108
  }, headingElementsRef.current);
109
+ if (lockObserver.current) {
110
+ return;
111
+ }
108
112
  if (isTopOfPage()) {
109
113
  const newHeading = ((_a = headingElements[0]) === null || _a === void 0 ? void 0 : _a.id) || undefined;
110
114
  setHeading(newHeading);
@@ -145,18 +149,56 @@ function useActiveHeading(contentElement, displayedHeadings) {
145
149
  }
146
150
  setHeading(visibleHeadings[0].target.id);
147
151
  }, [getIndexFromId, headingElements, getTriggerOffset, findActiveHeaderByVirtualPosition]);
152
+ const releaseClickScroll = (0, react_1.useCallback)(() => {
153
+ clickScroll.current = null;
154
+ lockObserver.current = false;
155
+ }, []);
156
+ const trackClickScroll = (0, react_1.useCallback)(() => {
157
+ const clickScrollState = clickScroll.current;
158
+ if (!clickScrollState) {
159
+ return;
160
+ }
161
+ const { top } = clickScrollState.target.getBoundingClientRect();
162
+ if (clickScrollState.reached) {
163
+ if (top >= 0 && top <= getTriggerOffset()) {
164
+ return;
165
+ }
166
+ }
167
+ else {
168
+ const distance = Math.abs(top - clickScrollState.scrollMargin);
169
+ if (distance <= TARGET_TOLERANCE) {
170
+ clickScrollState.reached = true;
171
+ return;
172
+ }
173
+ if (distance <= clickScrollState.closestDistance + TARGET_TOLERANCE) {
174
+ clickScrollState.closestDistance = Math.min(clickScrollState.closestDistance, distance);
175
+ return;
176
+ }
177
+ }
178
+ releaseClickScroll();
179
+ intersectionCallback([]);
180
+ }, [releaseClickScroll, intersectionCallback, getTriggerOffset]);
148
181
  const handleHeadingClick = (0, react_1.useCallback)((headingId) => {
149
- lockObserver.current = true;
182
+ releaseClickScroll();
150
183
  setHeading(headingId);
151
- const headingElement = headingElements.find((el) => el.id === headingId);
152
- if (headingElement && headingElement.scrollIntoView) {
153
- headingElement.scrollIntoView({ behavior: 'smooth', block: 'start' });
154
- }
155
- setTimeout(() => {
156
- headingElementsRef.current = {};
157
- lockObserver.current = false;
158
- }, 300);
159
- }, [headingElements]);
184
+ const target = document.getElementById(headingId) || headingElements.find((el) => el.id === headingId);
185
+ if (!(target === null || target === void 0 ? void 0 : target.scrollIntoView)) {
186
+ return;
187
+ }
188
+ target.scrollIntoView({ behavior: 'smooth', block: 'start' });
189
+ if (!target.getClientRects().length) {
190
+ return;
191
+ }
192
+ const scrollMargin = parseFloat(getComputedStyle(target).scrollMarginTop) || 0;
193
+ const distance = Math.abs(target.getBoundingClientRect().top - scrollMargin);
194
+ lockObserver.current = true;
195
+ clickScroll.current = {
196
+ target,
197
+ scrollMargin,
198
+ closestDistance: distance,
199
+ reached: distance <= TARGET_TOLERANCE,
200
+ };
201
+ }, [headingElements, releaseClickScroll]);
160
202
  (0, react_1.useEffect)(() => {
161
203
  var _a;
162
204
  if (!contentElement) {
@@ -203,8 +245,10 @@ function useActiveHeading(contentElement, displayedHeadings) {
203
245
  });
204
246
  const handleScroll = () => {
205
247
  var _a;
206
- if (lockObserver.current)
248
+ if (clickScroll.current) {
249
+ trackClickScroll();
207
250
  return;
251
+ }
208
252
  if (isTopOfPage()) {
209
253
  setHeading(((_a = headingElements[0]) === null || _a === void 0 ? void 0 : _a.id) || undefined);
210
254
  }
@@ -214,7 +258,7 @@ function useActiveHeading(contentElement, displayedHeadings) {
214
258
  observer.disconnect();
215
259
  window.removeEventListener('scroll', handleScroll);
216
260
  };
217
- }, [headingElements, intersectionCallback, getTriggerOffset]);
261
+ }, [headingElements, intersectionCallback, getTriggerOffset, trackClickScroll]);
218
262
  return { heading, handleHeadingClick };
219
263
  }
220
264
  //# sourceMappingURL=use-active-heading.js.map
@@ -45,10 +45,12 @@ function useActiveSectionId(location, hasOverviewPage = false, withNavbar = true
45
45
  return;
46
46
  }
47
47
  window.addEventListener('scroll', scrollListener, { capture: false });
48
- setTimeout(() => {
48
+ const initialRead = setTimeout(() => {
49
49
  scrollListener();
50
50
  }, 10);
51
51
  return () => {
52
+ clearTimeout(initialRead);
53
+ scrollListener.cancel();
52
54
  window.removeEventListener('scroll', scrollListener);
53
55
  };
54
56
  }, [location, heightOffset, scrollListener]);
@@ -3,7 +3,7 @@ export type McpButtonOptions = {
3
3
  options?: MCPOption[];
4
4
  };
5
5
  export type McpButtonSettings = {
6
- isCopied: boolean;
6
+ copiedOption: MCPOption | null;
7
7
  cursorUrl: string;
8
8
  vscodeUrl: string;
9
9
  triggerButtonText: string;
@@ -9,24 +9,27 @@ const lodash_debounce_1 = __importDefault(require("lodash.debounce"));
9
9
  const use_theme_hooks_1 = require("./use-theme-hooks");
10
10
  const use_mcp_config_1 = require("./use-mcp-config");
11
11
  const clipboard_service_1 = require("../utils/clipboard-service");
12
+ const mcp_1 = require("../constants/mcp");
13
+ const mcp_2 = require("../utils/mcp");
12
14
  const COPIED_RESET_TIMEOUT = 1000;
13
- function useConnectMCPButton({ options = ['cursor', 'vscode', 'copy'], } = {}) {
15
+ function useConnectMCPButton({ options = mcp_1.DEFAULT_MCP_OPTIONS, } = {}) {
14
16
  const { useTranslate } = (0, use_theme_hooks_1.useThemeHooks)();
15
17
  const { translate } = useTranslate();
16
18
  const { serverName, serverUrl, cursorUrl, vscodeUrl } = (0, use_mcp_config_1.useMCPConfig)();
17
- const [isCopied, setIsCopied] = (0, react_1.useState)(false);
19
+ const [copiedOption, setCopiedOption] = (0, react_1.useState)(null);
18
20
  // eslint-disable-next-line react-hooks/exhaustive-deps
19
- const resetCopied = (0, react_1.useCallback)((0, lodash_debounce_1.default)(() => setIsCopied(false), COPIED_RESET_TIMEOUT), []);
21
+ const resetCopied = (0, react_1.useCallback)((0, lodash_debounce_1.default)(() => setCopiedOption(null), COPIED_RESET_TIMEOUT), []);
20
22
  const handleAction = (0, react_1.useCallback)((action) => {
21
- if (action === 'copy') {
22
- const config = {
23
- [serverName]: {
24
- url: serverUrl,
25
- description: 'MCP Server',
26
- },
27
- };
28
- clipboard_service_1.ClipboardService.copyCustom(JSON.stringify(config, null, 2));
29
- setIsCopied(true);
23
+ const connection = { serverName, url: serverUrl };
24
+ const copyTextMap = {
25
+ copy: JSON.stringify({ [serverName]: { url: serverUrl, description: 'MCP Server' } }, null, 2),
26
+ 'claude-code': (0, mcp_2.generateClaudeCodeCommand)(connection),
27
+ codex: (0, mcp_2.generateCodexCommand)(connection),
28
+ };
29
+ const copyText = copyTextMap[action];
30
+ if (copyText !== undefined) {
31
+ clipboard_service_1.ClipboardService.copyCustom(copyText);
32
+ setCopiedOption(action);
30
33
  resetCopied();
31
34
  return;
32
35
  }
@@ -39,7 +42,7 @@ function useConnectMCPButton({ options = ['cursor', 'vscode', 'copy'], } = {}) {
39
42
  const triggerButtonText = (0, react_1.useMemo)(() => translate('page.actions.connectMcp', 'Connect MCP'), [translate]);
40
43
  const visibleOptions = (0, react_1.useMemo)(() => options.filter(Boolean), [options]);
41
44
  return {
42
- isCopied,
45
+ copiedOption,
43
46
  cursorUrl,
44
47
  vscodeUrl,
45
48
  triggerButtonText,
@@ -11,6 +11,9 @@ const useControl = (initialVal = false) => {
11
11
  clearTimeout(timeoutRef.current);
12
12
  }
13
13
  }, []);
14
+ (0, react_1.useEffect)(() => {
15
+ return clearOpenTimer;
16
+ }, [clearOpenTimer]);
14
17
  const handleOpen = (0, react_1.useCallback)(() => {
15
18
  clearOpenTimer();
16
19
  timeoutRef.current = setTimeout(() => {
@@ -22,6 +22,7 @@ function useLocalState(key, initialValue) {
22
22
  (0, react_1.useEffect)(() => {
23
23
  if (!(0, js_utils_1.isBrowser)())
24
24
  return;
25
+ // oxlint-disable-next-line react-you-might-not-need-an-effect/no-derived-state -- localStorage is read after mount so SSR and client hydrate from the same value
25
26
  setValue(getStoredValue(key, initialValue));
26
27
  // eslint-disable-next-line react-hooks/exhaustive-deps
27
28
  }, [key]);
@@ -5,5 +5,7 @@ export type McpConfig = {
5
5
  cursorUrl: string;
6
6
  vscodeUrl: string;
7
7
  isMcpDisabled: boolean;
8
+ isPublicEndpointPage: boolean;
9
+ alternateServerUrl?: string;
8
10
  };
9
11
  export declare function useMCPConfig(): McpConfig;
@@ -9,13 +9,21 @@ const mcp_1 = require("../utils/mcp");
9
9
  const urls_1 = require("../utils/urls");
10
10
  function useMCPConfig() {
11
11
  var _a;
12
- const { useMcpData } = (0, use_theme_hooks_1.useThemeHooks)();
13
- const { docs: { enabled, name }, } = useMcpData();
12
+ var _b;
13
+ const { useMcpData, usePageData } = (0, use_theme_hooks_1.useThemeHooks)();
14
+ const { docs: { enabled, name, publicEndpoint }, } = useMcpData();
15
+ const pageSlug = (_a = usePageData()) === null || _a === void 0 ? void 0 : _a.slug;
14
16
  const origin = dom_1.IS_BROWSER
15
17
  ? window.location.origin
16
- : ((_a = globalThis['SSR_HOSTNAME']) !== null && _a !== void 0 ? _a : '');
18
+ : ((_b = globalThis['SSR_HOSTNAME']) !== null && _b !== void 0 ? _b : '');
17
19
  const serverName = name || constants_1.DEFAULT_MCP_SERVER_NAME;
18
- const serverUrl = `${origin}${(0, urls_1.withPathPrefix)('/mcp')}`;
20
+ const isPublicEndpointPage = pageSlug === (0, urls_1.withPathPrefix)(constants_1.PUBLIC_MCP_ROUTE);
21
+ const serverUrl = `${origin}${(0, urls_1.withPathPrefix)(isPublicEndpointPage ? constants_1.PUBLIC_MCP_ROUTE : constants_1.MCP_ROUTE)}`;
22
+ const alternateServerUrl = isPublicEndpointPage
23
+ ? `${origin}${(0, urls_1.withPathPrefix)(constants_1.MCP_ROUTE)}`
24
+ : publicEndpoint
25
+ ? `${origin}${(0, urls_1.withPathPrefix)(constants_1.PUBLIC_MCP_ROUTE)}`
26
+ : undefined;
19
27
  const isMcpDisabled = !enabled || false;
20
28
  const cursorUrl = (0, react_1.useMemo)(() => (0, mcp_1.generateMCPDeepLink)('cursor', { serverName, url: serverUrl }), [serverName, serverUrl]);
21
29
  const vscodeUrl = (0, react_1.useMemo)(() => (0, mcp_1.generateMCPDeepLink)('vscode', { serverName, url: serverUrl }), [serverName, serverUrl]);
@@ -26,6 +34,8 @@ function useMCPConfig() {
26
34
  cursorUrl,
27
35
  vscodeUrl,
28
36
  isMcpDisabled,
37
+ isPublicEndpointPage,
38
+ alternateServerUrl,
29
39
  };
30
40
  }
31
41
  //# sourceMappingURL=use-mcp-config.js.map
@@ -7,9 +7,17 @@ const use_modal_scroll_lock_1 = require("./use-modal-scroll-lock");
7
7
  function useMobileMenu(initialState = false) {
8
8
  const location = (0, react_router_1.useLocation)();
9
9
  const [isOpen, setIsOpen] = (0, react_1.useState)(initialState);
10
- (0, react_1.useEffect)(() => setIsOpen(false), [location.pathname, location.hash]);
10
+ const locationKey = `${location.pathname}${location.hash}`;
11
+ const [prevLocationKey, setPrevLocationKey] = (0, react_1.useState)(locationKey);
12
+ if (isOpen && prevLocationKey !== locationKey) {
13
+ setPrevLocationKey(locationKey);
14
+ setIsOpen(false);
15
+ }
11
16
  (0, use_modal_scroll_lock_1.useModalScrollLock)(isOpen);
12
- const openMobileMenu = () => setIsOpen(true);
17
+ const openMobileMenu = () => {
18
+ setPrevLocationKey(locationKey);
19
+ setIsOpen(true);
20
+ };
13
21
  const closeMobileMenu = () => setIsOpen(false);
14
22
  return { isOpen, openMobileMenu, closeMobileMenu };
15
23
  }