@redocly/theme 0.61.1 → 0.62.0-custom.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/lib/components/AsyncApiDocs/hooks/AfterAsyncApiChannelDescription.d.ts +1 -0
  2. package/lib/components/AsyncApiDocs/hooks/AfterAsyncApiChannelDescription.js +12 -0
  3. package/lib/components/Badge/Badge.d.ts +2 -1
  4. package/lib/components/Badge/Badge.js +24 -2
  5. package/lib/components/Banner/Banner.js +19 -1
  6. package/lib/components/Banner/variables.js +1 -0
  7. package/lib/components/Breadcrumbs/Breadcrumb.js +1 -1
  8. package/lib/components/Breadcrumbs/BreadcrumbDropdown.js +9 -6
  9. package/lib/components/Breadcrumbs/Breadcrumbs.js +24 -15
  10. package/lib/components/Buttons/AIAssistantButton.js +7 -4
  11. package/lib/components/Buttons/EditPageButton.js +4 -26
  12. package/lib/components/Catalog/CatalogEntities.js +10 -8
  13. package/lib/components/Catalog/CatalogEntity/CatalogEntity.js +2 -2
  14. package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.js +3 -3
  15. package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem.js +6 -13
  16. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.js +2 -2
  17. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.js +13 -11
  18. package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +7 -5
  19. package/lib/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.js +9 -7
  20. package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.js +1 -1
  21. package/lib/components/Catalog/CatalogTagsWithTooltip.js +2 -2
  22. package/lib/components/CatalogClassic/CatalogClassicInfoBlock.js +1 -1
  23. package/lib/components/CodeBlock/CodeBlockControls.js +8 -6
  24. package/lib/components/Dropdown/Dropdown.js +1 -1
  25. package/lib/components/Dropdown/variables.js +1 -0
  26. package/lib/components/Feedback/Comment.js +17 -4
  27. package/lib/components/Feedback/Mood.js +6 -3
  28. package/lib/components/Feedback/Rating.js +6 -3
  29. package/lib/components/Feedback/Scale.js +6 -3
  30. package/lib/components/Feedback/Sentiment.js +6 -3
  31. package/lib/components/Filter/FilterCheckboxes.js +1 -1
  32. package/lib/components/JsonViewer/JsonViewer.js +2 -2
  33. package/lib/components/JsonViewer/{Helpers.js → helpers.js} +2 -1
  34. package/lib/components/LanguagePicker/LanguagePicker.js +1 -1
  35. package/lib/components/Markdown/Markdown.js +2 -2
  36. package/lib/components/Menu/MenuItem.js +41 -15
  37. package/lib/components/Menu/variables.js +3 -3
  38. package/lib/components/Navbar/NavbarItem.js +1 -1
  39. package/lib/components/OpenApiDocs/hooks/AdditionalOverviewInfo.d.ts +1 -0
  40. package/lib/components/OpenApiDocs/hooks/AdditionalOverviewInfo.js +12 -0
  41. package/lib/components/OpenApiDocs/hooks/AfterOpenApiDescription.d.ts +1 -0
  42. package/lib/components/OpenApiDocs/hooks/AfterOpenApiDescription.js +6 -0
  43. package/lib/components/PageActions/PageActions.js +25 -8
  44. package/lib/components/Search/SearchAiDialog.d.ts +4 -2
  45. package/lib/components/Search/SearchAiDialog.js +23 -4
  46. package/lib/components/Search/SearchAiMessage.d.ts +4 -2
  47. package/lib/components/Search/SearchAiMessage.js +82 -23
  48. package/lib/components/Search/SearchDialog.js +50 -25
  49. package/lib/components/Select/variables.js +2 -2
  50. package/lib/components/SvgViewer/SvgViewer.d.ts +15 -0
  51. package/lib/components/SvgViewer/SvgViewer.js +312 -0
  52. package/lib/components/SvgViewer/variables.d.ts +1 -0
  53. package/lib/components/SvgViewer/variables.dark.d.ts +1 -0
  54. package/lib/components/SvgViewer/variables.dark.js +8 -0
  55. package/lib/components/SvgViewer/variables.js +17 -0
  56. package/lib/components/Tag/Tag.js +1 -1
  57. package/lib/components/Tag/variables.dark.js +6 -0
  58. package/lib/components/Tag/variables.js +6 -0
  59. package/lib/components/Tooltip/Tooltip.d.ts +2 -3
  60. package/lib/components/Tooltip/Tooltip.js +66 -113
  61. package/lib/components/Tooltip/variables.dark.js +4 -0
  62. package/lib/components/Tooltip/variables.js +3 -3
  63. package/lib/components/UserMenu/LoginButton.d.ts +8 -2
  64. package/lib/components/UserMenu/LoginButton.js +4 -3
  65. package/lib/core/constants/feedback.d.ts +2 -0
  66. package/lib/core/constants/feedback.js +6 -0
  67. package/lib/core/constants/index.d.ts +1 -0
  68. package/lib/core/constants/index.js +1 -0
  69. package/lib/core/constants/search.d.ts +5 -1
  70. package/lib/core/constants/search.js +24 -1
  71. package/lib/core/hooks/search/use-search-dialog.js +2 -2
  72. package/lib/core/hooks/use-color-switcher.js +3 -1
  73. package/lib/core/hooks/use-mcp-config.js +2 -1
  74. package/lib/core/hooks/use-modal-scroll-lock.js +24 -10
  75. package/lib/core/hooks/use-outside-click.d.ts +3 -1
  76. package/lib/core/hooks/use-outside-click.js +8 -4
  77. package/lib/core/hooks/use-page-actions.d.ts +1 -1
  78. package/lib/core/hooks/use-page-actions.js +50 -14
  79. package/lib/core/hooks/use-product-picker.js +1 -1
  80. package/lib/core/hooks/use-unique-svg-ids.d.ts +6 -0
  81. package/lib/core/hooks/use-unique-svg-ids.js +15 -0
  82. package/lib/core/openapi/index.d.ts +2 -0
  83. package/lib/core/openapi/index.js +5 -1
  84. package/lib/core/styles/dark.js +13 -0
  85. package/lib/core/styles/global.js +38 -15
  86. package/lib/core/types/catalog.d.ts +1 -1
  87. package/lib/core/types/hooks.d.ts +23 -2
  88. package/lib/core/types/l10n.d.ts +1 -1
  89. package/lib/core/types/search.d.ts +24 -0
  90. package/lib/core/types/search.js +9 -1
  91. package/lib/core/utils/content-segments.d.ts +2 -0
  92. package/lib/core/utils/content-segments.js +22 -0
  93. package/lib/core/utils/index.d.ts +1 -0
  94. package/lib/core/utils/index.js +1 -0
  95. package/lib/core/utils/transform-revisions-to-version-history.js +18 -68
  96. package/lib/ext/process-scorecard.d.ts +49 -0
  97. package/lib/ext/process-scorecard.js +12 -0
  98. package/lib/icons/DirectionRightIcon/DirectionRightIcon.d.ts +5 -0
  99. package/lib/icons/DirectionRightIcon/DirectionRightIcon.js +24 -0
  100. package/lib/icons/FitToViewIcon/FitToViewIcon.d.ts +9 -0
  101. package/lib/icons/FitToViewIcon/FitToViewIcon.js +25 -0
  102. package/lib/index.d.ts +8 -0
  103. package/lib/index.js +8 -0
  104. package/lib/layouts/DocumentationLayout.js +4 -25
  105. package/lib/layouts/DocumentationLayoutBottom.d.ts +11 -0
  106. package/lib/layouts/DocumentationLayoutBottom.js +28 -0
  107. package/lib/layouts/DocumentationLayoutTop.d.ts +13 -0
  108. package/lib/layouts/DocumentationLayoutTop.js +33 -0
  109. package/lib/layouts/Forbidden.js +22 -18
  110. package/lib/markdoc/components/Cards/Card.js +1 -0
  111. package/lib/markdoc/components/CodeWalkthrough/CodeFilters.js +1 -1
  112. package/lib/markdoc/components/Heading/Heading.js +40 -2
  113. package/lib/markdoc/components/LoginButton/LoginButton.d.ts +9 -0
  114. package/lib/markdoc/components/LoginButton/LoginButton.js +48 -0
  115. package/lib/markdoc/components/Mermaid/Mermaid.js +70 -2
  116. package/lib/markdoc/components/default.d.ts +1 -0
  117. package/lib/markdoc/components/default.js +1 -0
  118. package/lib/markdoc/default.d.ts +6 -0
  119. package/lib/markdoc/default.js +2 -0
  120. package/lib/markdoc/tags/login-button.d.ts +2 -0
  121. package/lib/markdoc/tags/login-button.js +32 -0
  122. package/package.json +10 -10
  123. package/src/components/AsyncApiDocs/hooks/AfterAsyncApiChannelDescription.tsx +10 -0
  124. package/src/components/Badge/Badge.tsx +18 -2
  125. package/src/components/Banner/Banner.tsx +23 -1
  126. package/src/components/Banner/variables.ts +1 -0
  127. package/src/components/Breadcrumbs/Breadcrumb.tsx +3 -3
  128. package/src/components/Breadcrumbs/BreadcrumbDropdown.tsx +11 -8
  129. package/src/components/Breadcrumbs/Breadcrumbs.tsx +24 -15
  130. package/src/components/Buttons/AIAssistantButton.tsx +7 -4
  131. package/src/components/Buttons/EditPageButton.tsx +13 -34
  132. package/src/components/Catalog/CatalogEntities.tsx +10 -8
  133. package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +1 -1
  134. package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.tsx +3 -4
  135. package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem.tsx +5 -21
  136. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.tsx +1 -1
  137. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +13 -11
  138. package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +7 -5
  139. package/src/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.tsx +9 -7
  140. package/src/components/Catalog/CatalogTableView/CatalogTableViewRow.tsx +1 -2
  141. package/src/components/Catalog/CatalogTagsWithTooltip.tsx +9 -5
  142. package/src/components/CatalogClassic/CatalogClassicInfoBlock.tsx +3 -1
  143. package/src/components/CodeBlock/CodeBlockControls.tsx +16 -10
  144. package/src/components/Dropdown/Dropdown.tsx +1 -1
  145. package/src/components/Dropdown/variables.ts +1 -0
  146. package/src/components/Feedback/Comment.tsx +22 -4
  147. package/src/components/Feedback/Mood.tsx +6 -2
  148. package/src/components/Feedback/Rating.tsx +6 -2
  149. package/src/components/Feedback/Scale.tsx +6 -2
  150. package/src/components/Feedback/Sentiment.tsx +6 -2
  151. package/src/components/Filter/FilterCheckboxes.tsx +1 -1
  152. package/src/components/JsonViewer/JsonViewer.tsx +1 -2
  153. package/src/components/JsonViewer/{Helpers.tsx → helpers.tsx} +1 -0
  154. package/src/components/LanguagePicker/LanguagePicker.tsx +1 -1
  155. package/src/components/Markdown/Markdown.tsx +2 -2
  156. package/src/components/Menu/MenuItem.tsx +61 -16
  157. package/src/components/Menu/variables.ts +3 -3
  158. package/src/components/Navbar/NavbarItem.tsx +3 -1
  159. package/src/components/OpenApiDocs/hooks/AdditionalOverviewInfo.tsx +10 -0
  160. package/src/components/OpenApiDocs/hooks/AfterOpenApiDescription.tsx +2 -0
  161. package/src/components/PageActions/PageActions.tsx +38 -15
  162. package/src/components/Search/SearchAiDialog.tsx +31 -2
  163. package/src/components/Search/SearchAiMessage.tsx +103 -17
  164. package/src/components/Search/SearchDialog.tsx +70 -37
  165. package/src/components/Select/variables.ts +2 -2
  166. package/src/components/SvgViewer/SvgViewer.tsx +405 -0
  167. package/src/components/SvgViewer/variables.dark.ts +5 -0
  168. package/src/components/SvgViewer/variables.ts +14 -0
  169. package/src/components/Tag/Tag.tsx +2 -1
  170. package/src/components/Tag/variables.dark.ts +6 -0
  171. package/src/components/Tag/variables.ts +6 -0
  172. package/src/components/Tooltip/Tooltip.tsx +77 -120
  173. package/src/components/Tooltip/variables.dark.ts +4 -0
  174. package/src/components/Tooltip/variables.ts +3 -3
  175. package/src/components/UserMenu/LoginButton.tsx +23 -8
  176. package/src/core/constants/feedback.ts +2 -0
  177. package/src/core/constants/index.ts +1 -0
  178. package/src/core/constants/search.ts +27 -1
  179. package/src/core/hooks/__mocks__/use-theme-hooks.ts +10 -1
  180. package/src/core/hooks/search/use-search-dialog.ts +2 -2
  181. package/src/core/hooks/use-color-switcher.ts +3 -1
  182. package/src/core/hooks/use-mcp-config.ts +2 -1
  183. package/src/core/hooks/use-modal-scroll-lock.ts +29 -10
  184. package/src/core/hooks/use-outside-click.ts +16 -5
  185. package/src/core/hooks/use-page-actions.ts +77 -30
  186. package/src/core/hooks/use-product-picker.ts +1 -1
  187. package/src/core/hooks/use-unique-svg-ids.ts +12 -0
  188. package/src/core/openapi/index.ts +2 -0
  189. package/src/core/styles/dark.ts +14 -0
  190. package/src/core/styles/global.ts +38 -15
  191. package/src/core/types/catalog.ts +1 -1
  192. package/src/core/types/hooks.ts +29 -1
  193. package/src/core/types/l10n.ts +13 -1
  194. package/src/core/types/search.ts +19 -0
  195. package/src/core/utils/content-segments.ts +27 -0
  196. package/src/core/utils/index.ts +1 -0
  197. package/src/core/utils/transform-revisions-to-version-history.ts +19 -99
  198. package/src/ext/process-scorecard.ts +59 -0
  199. package/src/icons/DirectionRightIcon/DirectionRightIcon.tsx +35 -0
  200. package/src/icons/FitToViewIcon/FitToViewIcon.tsx +26 -0
  201. package/src/index.ts +8 -0
  202. package/src/layouts/DocumentationLayout.tsx +4 -30
  203. package/src/layouts/DocumentationLayoutBottom.tsx +42 -0
  204. package/src/layouts/DocumentationLayoutTop.tsx +52 -0
  205. package/src/layouts/Forbidden.tsx +36 -21
  206. package/src/markdoc/components/Cards/Card.tsx +1 -0
  207. package/src/markdoc/components/CodeWalkthrough/CodeFilters.tsx +1 -1
  208. package/src/markdoc/components/Heading/Heading.tsx +52 -4
  209. package/src/markdoc/components/LoginButton/LoginButton.tsx +38 -0
  210. package/src/markdoc/components/Mermaid/Mermaid.tsx +57 -8
  211. package/src/markdoc/components/default.ts +1 -0
  212. package/src/markdoc/default.ts +2 -0
  213. package/src/markdoc/tags/login-button.ts +30 -0
  214. package/lib/components/Tooltip/TooltipWrapper.d.ts +0 -12
  215. package/lib/components/Tooltip/TooltipWrapper.js +0 -34
  216. package/src/components/Tooltip/TooltipWrapper.tsx +0 -70
  217. /package/lib/components/JsonViewer/{Helpers.d.ts → helpers.d.ts} +0 -0
@@ -0,0 +1,48 @@
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.LoginButton = LoginButton;
37
+ const React = __importStar(require("react"));
38
+ const hooks_1 = require("../../../core/hooks");
39
+ const LoginButton_1 = require("../../../components/UserMenu/LoginButton");
40
+ function LoginButton({ variant, size, label, labelTranslationKey, }) {
41
+ const { useUserMenu } = (0, hooks_1.useThemeHooks)();
42
+ const { userData, loginUrl } = useUserMenu();
43
+ if (userData === null || userData === void 0 ? void 0 : userData.isAuthenticated) {
44
+ return null;
45
+ }
46
+ return (React.createElement(LoginButton_1.LoginButton, { href: loginUrl || '', variant: variant, size: size, label: label, labelTranslationKey: labelTranslationKey, "data-component-name": "Markdoc/LoginButton" }));
47
+ }
48
+ //# sourceMappingURL=LoginButton.js.map
@@ -1,18 +1,75 @@
1
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
+ })();
2
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
37
  };
5
38
  Object.defineProperty(exports, "__esModule", { value: true });
6
39
  exports.Mermaid = Mermaid;
7
- const react_1 = __importDefault(require("react"));
40
+ const react_1 = __importStar(require("react"));
8
41
  const styled_components_1 = __importDefault(require("styled-components"));
9
42
  const utils_1 = require("../../../core/utils");
43
+ const hooks_1 = require("../../../core/hooks");
44
+ const SvgViewer_1 = require("../../../components/SvgViewer/SvgViewer");
10
45
  function Mermaid({ diagramHtml, 'data-source': dataSource, 'data-hash': dataHash, className, }) {
11
- return (react_1.default.createElement(Wrapper, { className: (0, utils_1.concatClassNames)('mermaid-wrapper', className), dangerouslySetInnerHTML: { __html: diagramHtml }, "data-component-name": "Markdoc/Mermaid/Mermaid", "data-source": dataSource, "data-hash": dataHash }));
46
+ const { useTranslate } = (0, hooks_1.useThemeHooks)();
47
+ const { translate } = useTranslate();
48
+ const [isOpen, setIsOpen] = (0, react_1.useState)(false);
49
+ const open = () => setIsOpen(true);
50
+ const close = () => setIsOpen(false);
51
+ return (react_1.default.createElement(react_1.default.Fragment, null,
52
+ react_1.default.createElement(Wrapper, { className: (0, utils_1.concatClassNames)('mermaid-wrapper', className), dangerouslySetInnerHTML: { __html: diagramHtml }, "data-component-name": "Markdoc/Mermaid/Mermaid", "data-source": dataSource, "data-hash": dataHash, onClick: open, onKeyDown: (e) => e.key === 'Enter' || (e.key === ' ' && open()), role: "button", tabIndex: 0, "aria-label": translate('mermaid.openFullscreen', 'Click to open diagram in fullscreen') }),
53
+ react_1.default.createElement(SvgViewer_1.SvgViewer, { isOpen: isOpen, onClose: close, labels: {
54
+ zoomIn: translate('mermaid.zoomIn', 'Zoom in'),
55
+ zoomOut: translate('mermaid.zoomOut', 'Zoom out'),
56
+ fitToView: translate('mermaid.reset', 'Fit to view'),
57
+ close: translate('mermaid.close', 'Close'),
58
+ dialogLabel: translate('mermaid.viewer', 'Mermaid diagram viewer'),
59
+ } },
60
+ react_1.default.createElement(ViewerContent, { dangerouslySetInnerHTML: { __html: diagramHtml } }))));
12
61
  }
13
62
  const Wrapper = styled_components_1.default.div `
14
63
  background-color: var(--mermaid-bg-color);
15
64
  border-radius: var(--mermaid-border-radius);
65
+ cursor: pointer;
66
+ transition: box-shadow 0.2s ease;
67
+
68
+ &:hover,
69
+ &:focus {
70
+ outline: none;
71
+ box-shadow: 0 0 0 2px var(--border-color-input-focus);
72
+ }
16
73
 
17
74
  * {
18
75
  font-family: var(--mermaid-font-family) !important;
@@ -23,4 +80,15 @@ const Wrapper = styled_components_1.default.div `
23
80
  max-width: 100%;
24
81
  }
25
82
  `;
83
+ const ViewerContent = styled_components_1.default.div `
84
+ * {
85
+ font-family: var(--mermaid-font-family) !important;
86
+ }
87
+
88
+ .mermaid > svg {
89
+ font-size: var(--font-size-base) !important;
90
+ display: block;
91
+ max-width: none !important;
92
+ }
93
+ `;
26
94
  //# sourceMappingURL=Mermaid.js.map
@@ -21,3 +21,4 @@ export * from '../../markdoc/components/CodeWalkthrough/CodeContainer';
21
21
  export * from '../../markdoc/components/CodeGroup/CodeGroup';
22
22
  export * from '../../markdoc/components/Icon/Icon';
23
23
  export * from '../../markdoc/components/ConnectMCP/ConnectMCP';
24
+ export * from '../../markdoc/components/LoginButton/LoginButton';
@@ -37,4 +37,5 @@ __exportStar(require("../../markdoc/components/CodeWalkthrough/CodeContainer"),
37
37
  __exportStar(require("../../markdoc/components/CodeGroup/CodeGroup"), exports);
38
38
  __exportStar(require("../../markdoc/components/Icon/Icon"), exports);
39
39
  __exportStar(require("../../markdoc/components/ConnectMCP/ConnectMCP"), exports);
40
+ __exportStar(require("../../markdoc/components/LoginButton/LoginButton"), exports);
40
41
  //# sourceMappingURL=default.js.map
@@ -23,6 +23,7 @@ import { toggle } from '../markdoc/tags/code-toggle';
23
23
  import { codeGroup } from '../markdoc/tags/code-group';
24
24
  import { icon } from '../markdoc/tags/icon';
25
25
  import { connectMcp } from '../markdoc/tags/connect-mcp';
26
+ import { loginButton } from '../markdoc/tags/login-button';
26
27
  export declare const tags: {
27
28
  [admonition.tagName]: import("@markdoc/markdoc").Schema & {
28
29
  attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute & {
@@ -119,4 +120,9 @@ export declare const tags: {
119
120
  resolver?: string;
120
121
  }>;
121
122
  };
123
+ [loginButton.tagName]: import("@markdoc/markdoc").Schema & {
124
+ attributes?: Record<string, import("@markdoc/markdoc").SchemaAttribute & {
125
+ resolver?: string;
126
+ }>;
127
+ };
122
128
  };
@@ -65,6 +65,7 @@ const code_toggle_1 = require("../markdoc/tags/code-toggle");
65
65
  const code_group_1 = require("../markdoc/tags/code-group");
66
66
  const icon_1 = require("../markdoc/tags/icon");
67
67
  const connect_mcp_1 = require("../markdoc/tags/connect-mcp");
68
+ const login_button_1 = require("../markdoc/tags/login-button");
68
69
  exports.tags = {
69
70
  [admonition_1.admonition.tagName]: admonition_1.admonition.schema,
70
71
  [debug_1.debug.tagName]: debug_1.debug.schema,
@@ -85,5 +86,6 @@ exports.tags = {
85
86
  [code_group_1.codeGroup.tagName]: code_group_1.codeGroup.schema,
86
87
  [icon_1.icon.tagName]: icon_1.icon.schema,
87
88
  [connect_mcp_1.connectMcp.tagName]: connect_mcp_1.connectMcp.schema,
89
+ [login_button_1.loginButton.tagName]: login_button_1.loginButton.schema,
88
90
  };
89
91
  //# sourceMappingURL=default.js.map
@@ -0,0 +1,2 @@
1
+ import type { MarkdocSchemaWrapper } from '../../markdoc/tags/types';
2
+ export declare const loginButton: MarkdocSchemaWrapper;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.loginButton = void 0;
4
+ exports.loginButton = {
5
+ schema: {
6
+ render: 'LoginButton',
7
+ attributes: {
8
+ variant: {
9
+ type: String,
10
+ default: 'primary',
11
+ matches: ['primary', 'secondary', 'outlined', 'text', 'link', 'ghost'],
12
+ },
13
+ size: {
14
+ type: String,
15
+ default: 'medium',
16
+ matches: ['small', 'medium', 'large'],
17
+ },
18
+ label: {
19
+ type: String,
20
+ description: 'Custom button label text. Overrides translation.',
21
+ },
22
+ labelTranslationKey: {
23
+ type: String,
24
+ default: 'userMenu.login',
25
+ description: 'Translation key for the button label.',
26
+ },
27
+ },
28
+ selfClosing: true,
29
+ },
30
+ tagName: 'login-button',
31
+ };
32
+ //# sourceMappingURL=login-button.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/theme",
3
- "version": "0.61.1",
3
+ "version": "0.62.0-custom.1",
4
4
  "description": "Shared UI components lib",
5
5
  "keywords": [
6
6
  "theme",
@@ -29,9 +29,9 @@
29
29
  "@markdoc/markdoc": "0.5.2",
30
30
  "lodash.debounce": "^4.0.8",
31
31
  "lodash.throttle": "^4.1.1",
32
- "react": "19.2.3",
33
- "react-dom": "19.2.3",
34
- "react-router-dom": "^6.21.1",
32
+ "react": "^19.2.4",
33
+ "react-dom": "^19.2.4",
34
+ "react-router-dom": "^6.30.3",
35
35
  "styled-components": "^4.1.1 || ^5.3.11 || ^6.0.0"
36
36
  },
37
37
  "devDependencies": {
@@ -51,7 +51,7 @@
51
51
  "@vitest/coverage-v8": "4.0.10",
52
52
  "@vitest/ui": "3.2.4",
53
53
  "concurrently": "7.6.0",
54
- "react-router-dom": "^6.21.1",
54
+ "react-router-dom": "^6.30.3",
55
55
  "resize-observer-polyfill": "1.5.1",
56
56
  "rimraf": "5.0.7",
57
57
  "styled-components": "5.3.11",
@@ -62,8 +62,8 @@
62
62
  "typescript": "5.9.3",
63
63
  "vitest": "4.0.10",
64
64
  "vitest-when": "0.6.2",
65
- "webpack": "5.94.0",
66
- "@redocly/realm-asyncapi-sdk": "0.7.0"
65
+ "webpack": "5.105.2",
66
+ "@redocly/realm-asyncapi-sdk": "0.9.0-next.1"
67
67
  },
68
68
  "dependencies": {
69
69
  "@tanstack/react-query": "5.62.3",
@@ -78,17 +78,17 @@
78
78
  "lodash.debounce": "^4.0.8",
79
79
  "lodash.throttle": "4.1.1",
80
80
  "nprogress": "0.2.0",
81
- "openapi-sampler": "1.6.2",
81
+ "openapi-sampler": "1.7.0",
82
82
  "react-calendar": "5.1.0",
83
83
  "react-date-picker": "11.0.0",
84
- "@redocly/config": "0.41.2"
84
+ "@redocly/config": "0.43.0-custom.1"
85
85
  },
86
86
  "scripts": {
87
87
  "watch": "tsc -p tsconfig.build.json && (concurrently \"tsc -w -p tsconfig.build.json\" \"tsc-alias -w -p tsconfig.build.json\")",
88
88
  "ts:check": "tsc --noEmit --skipLibCheck",
89
89
  "clean": "rimraf lib",
90
90
  "compile": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
91
- "build": "npm run clean && npm run compile",
91
+ "build": "pnpm run clean && pnpm run compile",
92
92
  "test": "vitest run",
93
93
  "test:update": "vitest run --update",
94
94
  "test:watch": "vitest",
@@ -0,0 +1,10 @@
1
+ // interface AfterAsyncApiChannelDescriptionProps {
2
+ // channel: any;
3
+ // }
4
+
5
+ // export function AfterAsyncApiChannelDescription(_props: AfterAsyncApiChannelDescriptionProps) {
6
+ // return null;
7
+ // }
8
+
9
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
10
+ export const AfterAsyncApiChannelDescription: any = null;
@@ -3,15 +3,23 @@ import styled, { css } from 'styled-components';
3
3
 
4
4
  import type { PropsWithChildren, JSX } from 'react';
5
5
 
6
+ import { GenericIcon } from '@redocly/theme/icons/GenericIcon/GenericIcon';
7
+
6
8
  export type BadgeProps = PropsWithChildren<{
7
9
  deprecated?: boolean;
8
10
  color?: string;
9
11
  key?: string;
10
12
  className?: string;
13
+ icon?: string;
11
14
  }>;
12
15
 
13
- export function Badge(props: BadgeProps): JSX.Element {
14
- return <BadgeComponent {...props} data-component-name="Badge/Badge" />;
16
+ export function Badge({ icon, children, ...props }: BadgeProps): JSX.Element {
17
+ return (
18
+ <BadgeComponent {...props} data-component-name="Badge/Badge">
19
+ {icon ? <BadgeIcon icon={icon} /> : null}
20
+ {children}
21
+ </BadgeComponent>
22
+ );
15
23
  }
16
24
 
17
25
  const BadgeComponent = styled.span<BadgeProps>`
@@ -34,3 +42,11 @@ const BadgeComponent = styled.span<BadgeProps>`
34
42
  border-radius: var(--badge-deprecated-border-radius);
35
43
  `}
36
44
  `;
45
+
46
+ const BadgeIcon = styled(GenericIcon)`
47
+ --icon-width: var(--font-size-sm);
48
+ --icon-height: var(--font-size-sm);
49
+ margin-right: var(--spacing-xxs);
50
+ flex-shrink: 0;
51
+ vertical-align: middle;
52
+ `;
@@ -5,10 +5,13 @@ import type { BannerConfig } from '@redocly/config';
5
5
  import type { JSX } from 'react';
6
6
 
7
7
  import { useThemeHooks } from '@redocly/theme/core/hooks';
8
+ import { getNavbarElement } from '@redocly/theme/core/utils';
8
9
  import { Markdown } from '@redocly/theme/components/Markdown/Markdown';
9
10
  import { CloseIcon } from '@redocly/theme/icons/CloseIcon/CloseIcon';
10
11
  import { Button } from '@redocly/theme/components/Button/Button';
11
12
 
13
+ const ANIMATION_DURATION = 0.4;
14
+
12
15
  type BannerColor = 'info' | 'success' | 'warning' | 'error';
13
16
 
14
17
  type BannerProps = {
@@ -67,6 +70,25 @@ export function Banner({ className }: BannerProps): JSX.Element | null {
67
70
 
68
71
  updateHeight();
69
72
 
73
+ if (window.location.hash) {
74
+ setTimeout(
75
+ () => {
76
+ const hash = window.location.hash;
77
+ const el = document.getElementById(hash.slice(1));
78
+ if (el) {
79
+ const navbar = getNavbarElement();
80
+ const navbarHeight = navbar?.getBoundingClientRect().height ?? 0;
81
+ const elementTop = el.getBoundingClientRect().top + window.scrollY;
82
+ const scrollPosition = elementTop - navbarHeight;
83
+ if (Math.abs(window.scrollY - scrollPosition) > 1) {
84
+ window.scrollTo({ top: scrollPosition });
85
+ }
86
+ }
87
+ },
88
+ ANIMATION_DURATION * 1000 + 100,
89
+ );
90
+ }
91
+
70
92
  const resizeObserver = new ResizeObserver(updateHeight);
71
93
  resizeObserver.observe(bannerElement);
72
94
 
@@ -154,7 +176,7 @@ const BannerWrapper = styled.div<{ $color?: BannerColor; $isVisible?: boolean }>
154
176
  width: 100%;
155
177
  z-index: var(--z-index-overlay);
156
178
  transform: ${({ $isVisible }) => ($isVisible ? 'translateY(0)' : 'translateY(-100%)')};
157
- transition: transform 0.4s ease-out;
179
+ transition: transform ${ANIMATION_DURATION}s ease-out;
158
180
  ${({ $color }) =>
159
181
  $color &&
160
182
  css`
@@ -4,6 +4,7 @@ export const banner = css`
4
4
  /**
5
5
  * @tokens Banner
6
6
  */
7
+ --banner-height: 0px; /* default 0px so calc formulas work on page load */
7
8
  --banner-button-size: 22px;
8
9
  --banner-button-padding: 3px; // @presenter Spacing
9
10
  --banner-button-font-size: var(--font-size-base);
@@ -4,7 +4,7 @@ import styled, { css } from 'styled-components';
4
4
  import type { JSX } from 'react';
5
5
 
6
6
  import { Link } from '@redocly/theme/components/Link/Link';
7
- import { TooltipComponent } from '@redocly/theme/components/Tooltip/Tooltip';
7
+ import { Tooltip } from '@redocly/theme/components/Tooltip/Tooltip';
8
8
  import { BreadcrumbIcon } from '@redocly/theme/components/Breadcrumbs/BreadcrumbIcon';
9
9
  import { trimText } from '@redocly/theme/core/utils';
10
10
  import { BREADCRUMB_MAX_LENGTH } from '@redocly/theme/core/constants';
@@ -48,9 +48,9 @@ export function Breadcrumb({ label, link, isActive, onClick, icon }: BreadcrumbP
48
48
  );
49
49
 
50
50
  return isTruncated ? (
51
- <TooltipComponent tip={label} placement="bottom" width="max-content">
51
+ <Tooltip tip={label} placement="bottom">
52
52
  {breadcrumbContent}
53
- </TooltipComponent>
53
+ </Tooltip>
54
54
  ) : (
55
55
  breadcrumbContent
56
56
  );
@@ -8,7 +8,7 @@ import { useThemeHooks } from '@redocly/theme/core/hooks';
8
8
  import { Dropdown } from '@redocly/theme/components/Dropdown/Dropdown';
9
9
  import { DropdownMenu } from '@redocly/theme/components/Dropdown/DropdownMenu';
10
10
  import { DropdownMenuItem } from '@redocly/theme/components/Dropdown/DropdownMenuItem';
11
- import { TooltipComponent } from '@redocly/theme/components/Tooltip/Tooltip';
11
+ import { Tooltip } from '@redocly/theme/components/Tooltip/Tooltip';
12
12
  import { GenericIcon } from '@redocly/theme/icons/GenericIcon/GenericIcon';
13
13
  import { BREADCRUMB_MAX_LENGTH } from '@redocly/theme/core/constants';
14
14
  import { BreadcrumbIcon } from '@redocly/theme/components/Breadcrumbs/BreadcrumbIcon';
@@ -39,9 +39,9 @@ export function BreadcrumbDropdown({
39
39
  const isTruncated = label.length > BREADCRUMB_MAX_LENGTH;
40
40
 
41
41
  const triggerContent = isTruncated ? (
42
- <TooltipComponent tip={label} placement="bottom" width="max-content">
42
+ <Tooltip tip={label} placement="bottom">
43
43
  <TriggerContentWrapper>{children}</TriggerContentWrapper>
44
- </TooltipComponent>
44
+ </Tooltip>
45
45
  ) : (
46
46
  children
47
47
  );
@@ -66,11 +66,14 @@ export function BreadcrumbDropdown({
66
66
  key={index}
67
67
  onAction={() => {
68
68
  onItemClick?.(item, index);
69
- telemetry.sendBreadcrumbClickedMessage({
70
- link: item.link,
71
- position: index + 1,
72
- totalBreadcrumbs: items.length,
73
- });
69
+ telemetry.sendBreadcrumbClickedMessage([
70
+ {
71
+ object: 'breadcrumb',
72
+ link: item.link,
73
+ position: index + 1,
74
+ totalBreadcrumbs: items.length,
75
+ },
76
+ ]);
74
77
  }}
75
78
  $hasLink={hasLink}
76
79
  to={item.link}
@@ -66,11 +66,14 @@ export function Breadcrumbs(props: {
66
66
  label={translatedLabel}
67
67
  items={siblingsWithActive}
68
68
  onItemClick={(item, itemIdx) =>
69
- telemetry.sendBreadcrumbClickedMessage({
70
- link: item.link,
71
- position: itemIdx + 1,
72
- totalBreadcrumbs: siblingsWithActive.length,
73
- })
69
+ telemetry.sendBreadcrumbClickedMessage([
70
+ {
71
+ object: 'breadcrumb',
72
+ link: item.link,
73
+ position: itemIdx + 1,
74
+ totalBreadcrumbs: siblingsWithActive.length,
75
+ },
76
+ ])
74
77
  }
75
78
  >
76
79
  <BreadcrumbIcon icon={breadcrumb.icon} />
@@ -87,11 +90,14 @@ export function Breadcrumbs(props: {
87
90
  isActive={isActive}
88
91
  icon={breadcrumb.icon}
89
92
  onClick={() =>
90
- telemetry.sendBreadcrumbClickedMessage({
91
- link: breadcrumb.link,
92
- position: idx + 1,
93
- totalBreadcrumbs: breadcrumbs.length,
94
- })
93
+ telemetry.sendBreadcrumbClickedMessage([
94
+ {
95
+ object: 'breadcrumb',
96
+ link: breadcrumb.link,
97
+ position: idx + 1,
98
+ totalBreadcrumbs: breadcrumbs.length,
99
+ },
100
+ ])
95
101
  }
96
102
  />
97
103
  );
@@ -112,11 +118,14 @@ export function Breadcrumbs(props: {
112
118
  label="..."
113
119
  items={collapsedBreadcrumbs}
114
120
  onItemClick={(item, itemIdx) =>
115
- telemetry.sendBreadcrumbClickedMessage({
116
- link: item.link,
117
- position: itemIdx + 1,
118
- totalBreadcrumbs: breadcrumbs.length,
119
- })
121
+ telemetry.sendBreadcrumbClickedMessage([
122
+ {
123
+ object: 'breadcrumb',
124
+ link: item.link,
125
+ position: itemIdx + 1,
126
+ totalBreadcrumbs: breadcrumbs.length,
127
+ },
128
+ ])
120
129
  }
121
130
  >
122
131
  ...
@@ -77,9 +77,12 @@ export function AIAssistantButton() {
77
77
 
78
78
  const handleOpen = () => {
79
79
  setIsOpen(true);
80
- telemetry.sendSearchAiOpenedMessage({
81
- method: 'ai_trigger_button',
82
- });
80
+ telemetry.sendSearchAiOpenedMessage([
81
+ {
82
+ object: 'search',
83
+ method: 'ai_trigger_button',
84
+ },
85
+ ]);
83
86
  };
84
87
 
85
88
  const handleClose = () => {
@@ -108,7 +111,7 @@ export function AIAssistantButton() {
108
111
  const StyledAIAssistantButton = styled(Button)<{ $inputType?: AIAssistantButtonType }>`
109
112
  position: fixed;
110
113
  bottom: var(--ai-assistant-button-bottom);
111
- right: var(--ai-assistant-button-right);
114
+ right: calc(var(--ai-assistant-button-right) + var(--modal-scrollbar-width, 0px));
112
115
  ${({ $inputType }) =>
113
116
  $inputType === 'icon'
114
117
  ? `
@@ -5,7 +5,7 @@ import type { JSX } from 'react';
5
5
 
6
6
  import { useThemeHooks } from '@redocly/theme/core/hooks';
7
7
  import { EditIcon } from '@redocly/theme/icons/EditIcon/EditIcon';
8
- import { Link } from '@redocly/theme/components/Link/Link';
8
+ import { Button } from '@redocly/theme/components/Button/Button';
9
9
 
10
10
  export type EditPageButtonProps = {
11
11
  to: string;
@@ -17,43 +17,22 @@ export function EditPageButton({ to }: EditPageButtonProps): JSX.Element {
17
17
  const telemetry = useTelemetry();
18
18
 
19
19
  return (
20
- <EditPageButtonWrapper
21
- data-component-name="Buttons/EditPageButton"
22
- target="_blank"
23
- to={to}
24
- onClick={() => telemetry.sendEditPageLinkClickedMessage()}
25
- >
26
- <ButtonIcon />
27
- <ButtonText data-translation-key="markdown.editPage.text">
20
+ <EditPageButtonWrapper data-component-name="Buttons/EditPageButton">
21
+ <Button
22
+ to={to}
23
+ external={true}
24
+ variant="ghost"
25
+ size="small"
26
+ icon={<EditIcon />}
27
+ onClick={() => telemetry.sendEditPageLinkClickedMessage()}
28
+ data-translation-key="markdown.editPage.text"
29
+ >
28
30
  {translate('markdown.editPage.text', 'Edit')}
29
- </ButtonText>
31
+ </Button>
30
32
  </EditPageButtonWrapper>
31
33
  );
32
34
  }
33
35
 
34
- const EditPageButtonWrapper = styled(Link)`
35
- height: fit-content;
36
+ const EditPageButtonWrapper = styled.div`
36
37
  margin-left: auto;
37
- display: inline-flex;
38
- color: var(--text-color-secondary);
39
- font-weight: var(--font-weight-bold);
40
- font-size: var(--font-size-base);
41
- font-family: var(--font-family-base);
42
- text-decoration: none;
43
-
44
- &:hover {
45
- color: var(--text-color-primary);
46
- }
47
-
48
- @media print {
49
- display: none;
50
- }
51
- `;
52
-
53
- const ButtonIcon = styled(EditIcon)`
54
- margin-right: 3px;
55
- `;
56
-
57
- const ButtonText = styled.span`
58
- line-height: 14px;
59
38
  `;
@@ -76,14 +76,16 @@ export function CatalogEntities(props: CatalogEntitiesProps): JSX.Element {
76
76
 
77
77
  const onRowClick = (entity: BffCatalogEntity) => {
78
78
  if (searchQuery) {
79
- telemetry.sendCatalogEntitiesListSearchResultClickedMessage({
80
- id: entity.id,
81
- object: 'catalog_entity',
82
- uri: getEntityDetailsLink(entity),
83
- query: searchQuery,
84
- entityKey: entity.key,
85
- entityType: entity.type,
86
- });
79
+ telemetry.sendCatalogEntitiesListSearchResultClickedMessage([
80
+ {
81
+ id: entity.id,
82
+ object: 'catalog_entity',
83
+ uri: getEntityDetailsLink(entity),
84
+ query: searchQuery,
85
+ entityKey: entity.key,
86
+ entityType: entity.type,
87
+ },
88
+ ]);
87
89
  }
88
90
  };
89
91
 
@@ -20,7 +20,7 @@ import { useThemeHooks } from '@redocly/theme/core/hooks';
20
20
  import { CatalogEntitySchema } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntitySchema';
21
21
  import { CatalogEntityMethodAndPath } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath';
22
22
  import { CatalogEntityRelationsGraph } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.lazy';
23
- import { CatalogEntityHistorySidebar } from '@redocly/theme';
23
+ import { CatalogEntityHistorySidebar } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar';
24
24
 
25
25
  export type CatalogEntityProps = {
26
26
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */