@redocly/theme 0.56.0-next.2 → 0.56.0-next.3

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 (175) hide show
  1. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.d.ts +1 -0
  2. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.js +9 -0
  3. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +31 -6
  4. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.d.ts +0 -1
  5. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.d.ts +2 -1
  6. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js +11 -5
  7. package/lib/components/Catalog/CatalogEntityIcon.js +6 -0
  8. package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.d.ts +6 -4
  9. package/lib/components/Catalog/CatalogTableView/CatalogEntityRelationCell.d.ts +3 -0
  10. package/lib/components/Catalog/CatalogTableView/CatalogEntityRelationCell.js +11 -0
  11. package/lib/components/Catalog/CatalogTableView/CatalogTableView.js +4 -0
  12. package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.js +4 -0
  13. package/lib/components/Catalog/CatalogTagsWithTooltip.js +2 -3
  14. package/lib/components/Catalog/variables.js +2 -2
  15. package/lib/components/Tags/CounterTag.d.ts +1 -1
  16. package/lib/components/Tags/HttpTag.d.ts +1 -1
  17. package/lib/core/constants/catalog.d.ts +3 -0
  18. package/lib/core/constants/catalog.js +55 -1
  19. package/lib/core/constants/index.d.ts +5 -5
  20. package/lib/core/constants/index.js +5 -5
  21. package/lib/core/constants/search.d.ts +1 -1
  22. package/lib/core/contexts/CodeWalkthrough/CodeWalkthroughControlsContext.d.ts +1 -1
  23. package/lib/core/contexts/CodeWalkthrough/CodeWalkthroughStepsContext.d.ts +1 -1
  24. package/lib/core/contexts/ThemeDataContext.d.ts +1 -1
  25. package/lib/core/contexts/index.d.ts +3 -3
  26. package/lib/core/contexts/index.js +3 -3
  27. package/lib/core/hoc/index.d.ts +1 -1
  28. package/lib/core/hoc/index.js +1 -1
  29. package/lib/core/hooks/__mocks__/index.d.ts +28 -28
  30. package/lib/core/hooks/__mocks__/index.js +28 -28
  31. package/lib/core/hooks/catalog/useCatalogEntities.d.ts +1 -1
  32. package/lib/core/hooks/catalog/useCatalogTableViewRow.js +2 -2
  33. package/lib/core/hooks/code-walkthrough/use-code-panel.js +6 -5
  34. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-controls.js +8 -5
  35. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.d.ts +1 -1
  36. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.js +9 -9
  37. package/lib/core/hooks/code-walkthrough/use-code-walkthrough.d.ts +2 -2
  38. package/lib/core/hooks/code-walkthrough/use-code-walkthrough.js +4 -3
  39. package/lib/core/hooks/code-walkthrough/use-renderable-files.js +6 -4
  40. package/lib/core/hooks/feedback/use-report-dialog.js +4 -3
  41. package/lib/core/hooks/index.d.ts +42 -42
  42. package/lib/core/hooks/index.js +42 -42
  43. package/lib/core/hooks/menu/use-menu-item-expanded.d.ts +1 -1
  44. package/lib/core/hooks/menu/use-mobile-menu-items.d.ts +1 -1
  45. package/lib/core/hooks/menu/use-mobile-menu-items.js +13 -12
  46. package/lib/core/hooks/menu/use-mobile-menu-levels.d.ts +1 -1
  47. package/lib/core/hooks/menu/use-mobile-menu-levels.js +8 -7
  48. package/lib/core/hooks/menu/use-nested-menu.d.ts +1 -1
  49. package/lib/core/hooks/menu/use-nested-menu.js +8 -6
  50. package/lib/core/hooks/search/use-recent-searches.js +3 -3
  51. package/lib/core/hooks/search/use-search-dialog.js +4 -3
  52. package/lib/core/hooks/search/use-search-filter.d.ts +1 -1
  53. package/lib/core/hooks/search/use-suggested-pages.js +2 -2
  54. package/lib/core/hooks/use-active-page-version.js +2 -2
  55. package/lib/core/hooks/use-active-section-id.js +2 -2
  56. package/lib/core/hooks/use-color-switcher.js +4 -3
  57. package/lib/core/hooks/use-input-key-commands.js +2 -2
  58. package/lib/core/hooks/use-language-picker.d.ts +1 -1
  59. package/lib/core/hooks/use-language-picker.js +4 -4
  60. package/lib/core/hooks/use-mobile-menu.js +2 -2
  61. package/lib/core/hooks/use-navbar-height.js +3 -3
  62. package/lib/core/hooks/use-page-versions.js +2 -2
  63. package/lib/core/hooks/use-product-picker.js +2 -2
  64. package/lib/core/hooks/use-theme-config.js +2 -2
  65. package/lib/core/hooks/use-theme-hooks.d.ts +1 -1
  66. package/lib/core/hooks/use-theme-hooks.js +2 -2
  67. package/lib/core/hooks/use-time-ago.js +2 -2
  68. package/lib/core/hooks/use-user-teams.js +2 -2
  69. package/lib/core/index.d.ts +7 -7
  70. package/lib/core/index.js +7 -7
  71. package/lib/core/openapi/index.d.ts +18 -0
  72. package/lib/core/openapi/index.js +48 -0
  73. package/lib/core/styles/global.js +1 -1
  74. package/lib/core/styles/index.d.ts +2 -2
  75. package/lib/core/styles/index.js +2 -2
  76. package/lib/core/templates/Markdown.d.ts +1 -1
  77. package/lib/core/templates/Markdown.js +8 -6
  78. package/lib/core/types/catalog.d.ts +6 -2
  79. package/lib/core/types/code-walkthrough.d.ts +1 -1
  80. package/lib/core/types/feedback.d.ts +1 -1
  81. package/lib/core/types/filter.d.ts +1 -1
  82. package/lib/core/types/hooks.d.ts +11 -3
  83. package/lib/core/types/index.d.ts +18 -18
  84. package/lib/core/types/index.js +18 -18
  85. package/lib/core/types/search.d.ts +1 -1
  86. package/lib/core/types/sidebar.d.ts +1 -1
  87. package/lib/core/utils/download-code-walkthrough.js +6 -4
  88. package/lib/core/utils/get-code-walkthrough-file-text.js +4 -3
  89. package/lib/core/utils/index.d.ts +35 -35
  90. package/lib/core/utils/index.js +35 -35
  91. package/lib/core/utils/load-and-navigate.js +2 -2
  92. package/lib/core/utils/match-code-walkthrough-conditions.js +3 -3
  93. package/lib/core/utils/menu.d.ts +3 -2
  94. package/lib/core/utils/menu.js +12 -12
  95. package/lib/core/utils/toc.d.ts +1 -1
  96. package/lib/core/utils/type-guards.d.ts +1 -1
  97. package/lib/core/utils/type-guards.js +5 -5
  98. package/lib/core/utils/urls.d.ts +1 -1
  99. package/lib/core/utils/urls.js +2 -2
  100. package/lib/markdoc/components/Tabs/TabList.js +2 -0
  101. package/package.json +1 -1
  102. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.tsx +15 -0
  103. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +8 -2
  104. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +0 -1
  105. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +16 -3
  106. package/src/components/Catalog/CatalogEntityIcon.tsx +6 -0
  107. package/src/components/Catalog/CatalogTableView/CatalogEntityCell.tsx +5 -4
  108. package/src/components/Catalog/CatalogTableView/CatalogEntityRelationCell.tsx +19 -0
  109. package/src/components/Catalog/CatalogTableView/CatalogTableView.tsx +4 -0
  110. package/src/components/Catalog/CatalogTableView/CatalogTableViewRow.tsx +4 -0
  111. package/src/components/Catalog/CatalogTagsWithTooltip.tsx +7 -15
  112. package/src/components/Catalog/variables.ts +2 -2
  113. package/src/core/constants/catalog.ts +58 -0
  114. package/src/core/constants/index.ts +5 -5
  115. package/src/core/constants/search.ts +1 -1
  116. package/src/core/contexts/CodeWalkthrough/CodeWalkthroughControlsContext.tsx +1 -1
  117. package/src/core/contexts/CodeWalkthrough/CodeWalkthroughStepsContext.tsx +1 -1
  118. package/src/core/contexts/ThemeDataContext.tsx +3 -3
  119. package/src/core/contexts/index.ts +3 -3
  120. package/src/core/hoc/index.ts +1 -1
  121. package/src/core/hooks/__mocks__/index.ts +28 -28
  122. package/src/core/hooks/catalog/useCatalogEntities.ts +1 -1
  123. package/src/core/hooks/catalog/useCatalogTableViewRow.ts +1 -1
  124. package/src/core/hooks/code-walkthrough/use-code-panel.ts +3 -5
  125. package/src/core/hooks/code-walkthrough/use-code-walkthrough-controls.ts +4 -6
  126. package/src/core/hooks/code-walkthrough/use-code-walkthrough-steps.ts +4 -3
  127. package/src/core/hooks/code-walkthrough/use-code-walkthrough.ts +3 -3
  128. package/src/core/hooks/code-walkthrough/use-renderable-files.ts +4 -6
  129. package/src/core/hooks/feedback/use-report-dialog.ts +3 -2
  130. package/src/core/hooks/index.ts +42 -42
  131. package/src/core/hooks/menu/use-menu-item-expanded.ts +1 -1
  132. package/src/core/hooks/menu/use-mobile-menu-items.ts +4 -7
  133. package/src/core/hooks/menu/use-mobile-menu-levels.ts +3 -2
  134. package/src/core/hooks/menu/use-nested-menu.ts +5 -3
  135. package/src/core/hooks/search/use-recent-searches.ts +1 -1
  136. package/src/core/hooks/search/use-search-dialog.ts +2 -1
  137. package/src/core/hooks/search/use-search-filter.ts +1 -1
  138. package/src/core/hooks/search/use-suggested-pages.ts +1 -1
  139. package/src/core/hooks/use-active-page-version.ts +1 -1
  140. package/src/core/hooks/use-active-section-id.ts +1 -1
  141. package/src/core/hooks/use-codeblock-tabs-controls.ts +1 -1
  142. package/src/core/hooks/use-color-switcher.ts +2 -1
  143. package/src/core/hooks/use-input-key-commands.ts +1 -1
  144. package/src/core/hooks/use-language-picker.ts +3 -3
  145. package/src/core/hooks/use-mobile-menu.ts +1 -1
  146. package/src/core/hooks/use-navbar-height.ts +1 -1
  147. package/src/core/hooks/use-page-versions.ts +1 -1
  148. package/src/core/hooks/use-product-picker.ts +1 -1
  149. package/src/core/hooks/use-theme-config.ts +2 -2
  150. package/src/core/hooks/use-theme-hooks.ts +2 -2
  151. package/src/core/hooks/use-time-ago.ts +3 -2
  152. package/src/core/hooks/use-user-teams.ts +1 -1
  153. package/src/core/index.ts +7 -7
  154. package/src/core/openapi/index.ts +31 -0
  155. package/src/core/styles/global.ts +2 -1
  156. package/src/core/styles/index.ts +2 -2
  157. package/src/core/templates/Markdown.tsx +8 -4
  158. package/src/core/types/catalog.ts +15 -2
  159. package/src/core/types/code-walkthrough.ts +1 -1
  160. package/src/core/types/feedback.ts +6 -6
  161. package/src/core/types/filter.ts +1 -1
  162. package/src/core/types/hooks.ts +17 -16
  163. package/src/core/types/index.ts +18 -18
  164. package/src/core/types/search.ts +1 -1
  165. package/src/core/types/sidebar.ts +1 -1
  166. package/src/core/utils/download-code-walkthrough.ts +3 -5
  167. package/src/core/utils/get-code-walkthrough-file-text.ts +2 -1
  168. package/src/core/utils/index.ts +35 -35
  169. package/src/core/utils/load-and-navigate.ts +1 -1
  170. package/src/core/utils/match-code-walkthrough-conditions.ts +1 -1
  171. package/src/core/utils/menu.ts +4 -3
  172. package/src/core/utils/toc.ts +1 -1
  173. package/src/core/utils/type-guards.ts +2 -2
  174. package/src/core/utils/urls.ts +2 -2
  175. package/src/markdoc/components/Tabs/TabList.tsx +1 -0
@@ -1,6 +1,6 @@
1
1
  import type { ItemBadge, REDOCLY_ROUTE_RBAC } from '@redocly/config';
2
2
  import type { ProductConfig } from '../../config';
3
- import type { AiSearchConversationRole } from '../../core/constants';
3
+ import type { AiSearchConversationRole } from '../constants/search';
4
4
  export type OperationParameter = {
5
5
  name: string | string[];
6
6
  description: string | string[];
@@ -1,5 +1,5 @@
1
1
  import type { REDOCLY_TEAMS_RBAC, REDOCLY_ROUTE_RBAC, MenuStyle, RbacScopeItems, ItemBadge } from '@redocly/config';
2
- import type { MenuItemType } from '../../core/constants';
2
+ import type { MenuItemType } from '../constants/common';
3
3
  export type { MenuStyle } from '@redocly/config';
4
4
  export type SidebarNavItem = {
5
5
  label?: string;
@@ -15,21 +15,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.downloadCodeWalkthrough = downloadCodeWalkthrough;
16
16
  const file_saver_1 = require("file-saver");
17
17
  const jszip_1 = __importDefault(require("jszip"));
18
- const utils_1 = require("../../core/utils");
18
+ const urls_1 = require("./urls");
19
+ const find_closest_common_directory_1 = require("./find-closest-common-directory");
20
+ const get_code_walkthrough_file_text_1 = require("./get-code-walkthrough-file-text");
19
21
  // https://github.com/Stuk/jszip/issues/196#issuecomment-69503828
20
22
  jszip_1.default.support.nodebuffer = false;
21
23
  function downloadCodeWalkthrough(files, state, inputsState) {
22
24
  return __awaiter(this, void 0, void 0, function* () {
23
25
  const zip = new jszip_1.default();
24
26
  const filePaths = files.map(({ path }) => path);
25
- const commonClosestDirectory = (0, utils_1.findClosestCommonDirectory)(filePaths);
27
+ const commonClosestDirectory = (0, find_closest_common_directory_1.findClosestCommonDirectory)(filePaths);
26
28
  for (const file of files) {
27
- const fileContent = (0, utils_1.getCodeWalkthroughFileText)(file, state, inputsState);
29
+ const fileContent = (0, get_code_walkthrough_file_text_1.getCodeWalkthroughFileText)(file, state, inputsState);
28
30
  if (commonClosestDirectory === '/') {
29
31
  zip.file(file.path, fileContent);
30
32
  }
31
33
  else {
32
- const filePath = file.path.replace((0, utils_1.removeLeadingSlash)(`${commonClosestDirectory}/`), '');
34
+ const filePath = file.path.replace((0, urls_1.removeLeadingSlash)(`${commonClosestDirectory}/`), '');
33
35
  zip.file(filePath, fileContent);
34
36
  }
35
37
  }
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getCodeWalkthroughFileText = getCodeWalkthroughFileText;
4
- const utils_1 = require("../../core/utils");
4
+ const match_code_walkthrough_conditions_1 = require("./match-code-walkthrough-conditions");
5
+ const replace_inputs_with_value_1 = require("./replace-inputs-with-value");
5
6
  function getCodeWalkthroughFileText(file, state, inputsState) {
6
7
  var _a;
7
8
  const contentChunks = (_a = file === null || file === void 0 ? void 0 : file.content.flatMap((node) => getChunkText(node, state, inputsState))) !== null && _a !== void 0 ? _a : [];
@@ -9,11 +10,11 @@ function getCodeWalkthroughFileText(file, state, inputsState) {
9
10
  }
10
11
  function getChunkText(node, state, inputsState) {
11
12
  if (typeof node === 'string') {
12
- const replacedNode = (0, utils_1.replaceInputsWithValue)(node, inputsState);
13
+ const replacedNode = (0, replace_inputs_with_value_1.replaceInputsWithValue)(node, inputsState);
13
14
  return [replacedNode];
14
15
  }
15
16
  else {
16
- if (!(0, utils_1.matchCodeWalkthroughConditions)(node.condition || {}, state)) {
17
+ if (!(0, match_code_walkthrough_conditions_1.matchCodeWalkthroughConditions)(node.condition || {}, state)) {
17
18
  return [];
18
19
  }
19
20
  return node.children.flatMap((child) => getChunkText(child, state, inputsState));
@@ -1,35 +1,35 @@
1
- export * from '../../core/utils/clipboard-service';
2
- export * from '../../core/utils/css-variables';
3
- export * from '../../core/utils/add-line-numbers';
4
- export * from '../../core/utils/media-css';
5
- export * from '../../core/utils/theme-helpers';
6
- export * from '../../core/utils/class-names';
7
- export * from '../../core/utils/args-typecheck';
8
- export * from '../../core/utils/color';
9
- export * from '../../core/utils/urls';
10
- export * from '../../core/utils/js-utils';
11
- export * from '../../core/utils/tags-parser';
12
- export * from '../../core/utils/text-transform';
13
- export * from '../../core/utils/dom';
14
- export * from '../../core/utils/markdoc';
15
- export * from '../../core/utils/attribute-parser';
16
- export * from '../../core/utils/type-guards';
17
- export * from '../../core/utils/dom';
18
- export * from '../../core/utils/toc';
19
- export * from '../../core/utils/menu';
20
- export * from '../../core/utils/load-and-navigate';
21
- export * from '../../core/utils/get-scorecard-color-variable';
22
- export * from '../../core/utils/change-text-casing';
23
- export * from '../../core/utils/format-date-without-timezone';
24
- export * from '../../core/utils/details';
25
- export * from '../../core/utils/get-navbar-element';
26
- export * from '../../core/utils/with-load-progress';
27
- export * from '../../core/utils/text-trimmer';
28
- export * from '../../core/utils/get-code-walkthrough-file-text';
29
- export * from '../../core/utils/download-code-walkthrough';
30
- export * from '../../core/utils/get-file-icon';
31
- export * from '../../core/utils/match-code-walkthrough-conditions';
32
- export * from '../../core/utils/replace-inputs-with-value';
33
- export * from '../../core/utils/find-closest-common-directory';
34
- export * from '../../core/utils/get-user-agent';
35
- export * from '../../core/utils/parse-style-string';
1
+ export * from './clipboard-service';
2
+ export * from './css-variables';
3
+ export * from './add-line-numbers';
4
+ export * from './media-css';
5
+ export * from './theme-helpers';
6
+ export * from './class-names';
7
+ export * from './args-typecheck';
8
+ export * from './color';
9
+ export * from './urls';
10
+ export * from './js-utils';
11
+ export * from './tags-parser';
12
+ export * from './text-transform';
13
+ export * from './dom';
14
+ export * from './markdoc';
15
+ export * from './attribute-parser';
16
+ export * from './type-guards';
17
+ export * from './dom';
18
+ export * from './toc';
19
+ export * from './menu';
20
+ export * from './load-and-navigate';
21
+ export * from './get-scorecard-color-variable';
22
+ export * from './change-text-casing';
23
+ export * from './format-date-without-timezone';
24
+ export * from './details';
25
+ export * from './get-navbar-element';
26
+ export * from './with-load-progress';
27
+ export * from './text-trimmer';
28
+ export * from './get-code-walkthrough-file-text';
29
+ export * from './download-code-walkthrough';
30
+ export * from './get-file-icon';
31
+ export * from './match-code-walkthrough-conditions';
32
+ export * from './replace-inputs-with-value';
33
+ export * from './find-closest-common-directory';
34
+ export * from './get-user-agent';
35
+ export * from './parse-style-string';
@@ -14,39 +14,39 @@ 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("../../core/utils/clipboard-service"), exports);
18
- __exportStar(require("../../core/utils/css-variables"), exports);
19
- __exportStar(require("../../core/utils/add-line-numbers"), exports);
20
- __exportStar(require("../../core/utils/media-css"), exports);
21
- __exportStar(require("../../core/utils/theme-helpers"), exports);
22
- __exportStar(require("../../core/utils/class-names"), exports);
23
- __exportStar(require("../../core/utils/args-typecheck"), exports);
24
- __exportStar(require("../../core/utils/color"), exports);
25
- __exportStar(require("../../core/utils/urls"), exports);
26
- __exportStar(require("../../core/utils/js-utils"), exports);
27
- __exportStar(require("../../core/utils/tags-parser"), exports);
28
- __exportStar(require("../../core/utils/text-transform"), exports);
29
- __exportStar(require("../../core/utils/dom"), exports);
30
- __exportStar(require("../../core/utils/markdoc"), exports);
31
- __exportStar(require("../../core/utils/attribute-parser"), exports);
32
- __exportStar(require("../../core/utils/type-guards"), exports);
33
- __exportStar(require("../../core/utils/dom"), exports);
34
- __exportStar(require("../../core/utils/toc"), exports);
35
- __exportStar(require("../../core/utils/menu"), exports);
36
- __exportStar(require("../../core/utils/load-and-navigate"), exports);
37
- __exportStar(require("../../core/utils/get-scorecard-color-variable"), exports);
38
- __exportStar(require("../../core/utils/change-text-casing"), exports);
39
- __exportStar(require("../../core/utils/format-date-without-timezone"), exports);
40
- __exportStar(require("../../core/utils/details"), exports);
41
- __exportStar(require("../../core/utils/get-navbar-element"), exports);
42
- __exportStar(require("../../core/utils/with-load-progress"), exports);
43
- __exportStar(require("../../core/utils/text-trimmer"), exports);
44
- __exportStar(require("../../core/utils/get-code-walkthrough-file-text"), exports);
45
- __exportStar(require("../../core/utils/download-code-walkthrough"), exports);
46
- __exportStar(require("../../core/utils/get-file-icon"), exports);
47
- __exportStar(require("../../core/utils/match-code-walkthrough-conditions"), exports);
48
- __exportStar(require("../../core/utils/replace-inputs-with-value"), exports);
49
- __exportStar(require("../../core/utils/find-closest-common-directory"), exports);
50
- __exportStar(require("../../core/utils/get-user-agent"), exports);
51
- __exportStar(require("../../core/utils/parse-style-string"), exports);
17
+ __exportStar(require("./clipboard-service"), exports);
18
+ __exportStar(require("./css-variables"), exports);
19
+ __exportStar(require("./add-line-numbers"), exports);
20
+ __exportStar(require("./media-css"), exports);
21
+ __exportStar(require("./theme-helpers"), exports);
22
+ __exportStar(require("./class-names"), exports);
23
+ __exportStar(require("./args-typecheck"), exports);
24
+ __exportStar(require("./color"), exports);
25
+ __exportStar(require("./urls"), exports);
26
+ __exportStar(require("./js-utils"), exports);
27
+ __exportStar(require("./tags-parser"), exports);
28
+ __exportStar(require("./text-transform"), exports);
29
+ __exportStar(require("./dom"), exports);
30
+ __exportStar(require("./markdoc"), exports);
31
+ __exportStar(require("./attribute-parser"), exports);
32
+ __exportStar(require("./type-guards"), exports);
33
+ __exportStar(require("./dom"), exports);
34
+ __exportStar(require("./toc"), exports);
35
+ __exportStar(require("./menu"), exports);
36
+ __exportStar(require("./load-and-navigate"), exports);
37
+ __exportStar(require("./get-scorecard-color-variable"), exports);
38
+ __exportStar(require("./change-text-casing"), exports);
39
+ __exportStar(require("./format-date-without-timezone"), exports);
40
+ __exportStar(require("./details"), exports);
41
+ __exportStar(require("./get-navbar-element"), exports);
42
+ __exportStar(require("./with-load-progress"), exports);
43
+ __exportStar(require("./text-trimmer"), exports);
44
+ __exportStar(require("./get-code-walkthrough-file-text"), exports);
45
+ __exportStar(require("./download-code-walkthrough"), exports);
46
+ __exportStar(require("./get-file-icon"), exports);
47
+ __exportStar(require("./match-code-walkthrough-conditions"), exports);
48
+ __exportStar(require("./replace-inputs-with-value"), exports);
49
+ __exportStar(require("./find-closest-common-directory"), exports);
50
+ __exportStar(require("./get-user-agent"), exports);
51
+ __exportStar(require("./parse-style-string"), exports);
52
52
  //# sourceMappingURL=index.js.map
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.loadAndNavigate = loadAndNavigate;
13
- const utils_1 = require("../../core/utils");
13
+ const with_load_progress_1 = require("./with-load-progress");
14
14
  let lastNavigatedPath;
15
15
  // this is copy from portal/src/client/app/utils/loadAndNavigate.ts, for case when we need to run Redoc without Realm
16
16
  function loadAndNavigate(_a) {
@@ -20,7 +20,7 @@ function loadAndNavigate(_a) {
20
20
  const { pathname, hash, search } = new URL(to, window.location.origin + window.location.pathname);
21
21
  // use window-shared loader instead of importing to prevent circular import issue
22
22
  const loader = window['__LOADER'];
23
- const result = yield (0, utils_1.withLoadProgress)(loader.tryLoad(pathname));
23
+ const result = yield (0, with_load_progress_1.withLoadProgress)(loader.tryLoad(pathname));
24
24
  // @ts-ignore
25
25
  if (result === null || result === void 0 ? void 0 : result.redirectTo) {
26
26
  // @ts-ignore
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.matchCodeWalkthroughConditions = matchCodeWalkthroughConditions;
4
- const utils_1 = require("../../core/utils");
4
+ const type_guards_1 = require("./type-guards");
5
5
  function matchCodeWalkthroughConditions(conditions = {}, state) {
6
6
  const { when, unless } = conditions;
7
7
  function evaluateCondition(key, value) {
@@ -12,10 +12,10 @@ function matchCodeWalkthroughConditions(conditions = {}, state) {
12
12
  }
13
13
  return stateValue === value;
14
14
  }
15
- const matchesWhen = (0, utils_1.isObject)(when)
15
+ const matchesWhen = (0, type_guards_1.isObject)(when)
16
16
  ? Object.entries(when).every(([key, value]) => evaluateCondition(key, value))
17
17
  : true;
18
- const matchesUnless = (0, utils_1.isObject)(unless)
18
+ const matchesUnless = (0, type_guards_1.isObject)(unless)
19
19
  ? Object.entries(unless).some(([key, value]) => evaluateCondition(key, value))
20
20
  : false;
21
21
  return matchesWhen && !matchesUnless;
@@ -1,7 +1,8 @@
1
1
  import type { ResolvedNavItem, Version } from '@redocly/config';
2
2
  import type { Location } from 'react-router-dom';
3
- import { type Locale, type TFunction, type ItemState } from '../../core/types';
4
- import { MenuItemType } from '../../core/constants';
3
+ import { type Locale, type TFunction } from '../types/l10n';
4
+ import { type ItemState } from '../types/sidebar';
5
+ import { MenuItemType } from '../constants/common';
5
6
  export declare const mapNavbarItems: (items: ResolvedNavItem[], defaultLocale: string, currentLocale: string, locales: Locale[], location: Location) => ItemState[];
6
7
  export declare const isItemActive: (item: ResolvedNavItem, defaultLocale: string, currentLocale: string, locales: Locale[], location: Location) => boolean;
7
8
  export declare const buildLanguagesGroup: (locales: Locale[], defaultLocale: string, currentLocale: string) => ResolvedNavItem | undefined;
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.buildVersionSection = exports.buildLanguagesGroup = exports.isItemActive = exports.mapNavbarItems = void 0;
4
4
  exports.getMenuItemType = getMenuItemType;
5
- const utils_1 = require("../../core/utils");
6
- const constants_1 = require("../../core/constants");
5
+ const common_1 = require("../constants/common");
6
+ const urls_1 = require("./urls");
7
7
  const TRANSLATION_KEYS = {
8
8
  version: 'mobileMenu.version',
9
9
  };
@@ -21,8 +21,8 @@ const isItemActive = (item, defaultLocale, currentLocale, locales, location) =>
21
21
  const pathHash = location.pathname + location.hash;
22
22
  const link = item.languageInsensitive
23
23
  ? item.link || ''
24
- : (0, utils_1.getPathnameForLocale)(item.link || '/', defaultLocale, currentLocale, locales);
25
- return pathHash === (0, utils_1.withPathPrefix)(link);
24
+ : (0, urls_1.getPathnameForLocale)(item.link || '/', defaultLocale, currentLocale, locales);
25
+ return pathHash === (0, urls_1.withPathPrefix)(link);
26
26
  };
27
27
  exports.isItemActive = isItemActive;
28
28
  const buildLanguagesGroup = (locales, defaultLocale, currentLocale) => {
@@ -36,7 +36,7 @@ const buildLanguagesGroup = (locales, defaultLocale, currentLocale) => {
36
36
  items: locales
37
37
  .filter((locale) => locale.code !== currentLocale)
38
38
  .map((locale) => {
39
- const newLangPathname = (0, utils_1.getPathnameForLocale)((0, utils_1.withoutPathPrefix)(location.pathname), defaultLocale, locale.code, locales);
39
+ const newLangPathname = (0, urls_1.getPathnameForLocale)((0, urls_1.withoutPathPrefix)(location.pathname), defaultLocale, locale.code, locales);
40
40
  const newUrlWithLanguage = `${newLangPathname}${location.search}${location.hash}`;
41
41
  return {
42
42
  type: 'link',
@@ -76,19 +76,19 @@ const buildVersionSection = (translate, versions, activeVersion) => {
76
76
  exports.buildVersionSection = buildVersionSection;
77
77
  function getMenuItemType(item) {
78
78
  var _a, _b;
79
- if (item.type === constants_1.MenuItemType.Separator) {
80
- return constants_1.MenuItemType.Separator;
79
+ if (item.type === common_1.MenuItemType.Separator) {
80
+ return common_1.MenuItemType.Separator;
81
81
  }
82
82
  else if (item.menuStyle === 'drilldown') {
83
- return constants_1.MenuItemType.DrillDown;
83
+ return common_1.MenuItemType.DrillDown;
84
84
  }
85
- else if (((_a = item.items) === null || _a === void 0 ? void 0 : _a.length) || (item.type === constants_1.MenuItemType.Group && ((_b = item.items) === null || _b === void 0 ? void 0 : _b.length))) {
86
- return constants_1.MenuItemType.Group;
85
+ else if (((_a = item.items) === null || _a === void 0 ? void 0 : _a.length) || (item.type === common_1.MenuItemType.Group && ((_b = item.items) === null || _b === void 0 ? void 0 : _b.length))) {
86
+ return common_1.MenuItemType.Group;
87
87
  }
88
88
  else if (item.httpVerb) {
89
- return constants_1.MenuItemType.Operation;
89
+ return common_1.MenuItemType.Operation;
90
90
  }
91
91
  else
92
- return constants_1.MenuItemType.Default;
92
+ return common_1.MenuItemType.Default;
93
93
  }
94
94
  //# sourceMappingURL=menu.js.map
@@ -1,4 +1,4 @@
1
- import type { MdHeading } from '../../core/types';
1
+ import type { MdHeading } from '../types/markdown';
2
2
  export declare function getDisplayedHeadings(headings: Array<MdHeading | null> | null | undefined, tocDepth: number): Array<MdHeading | null>;
3
3
  export declare function getDisplayedHeadingsIds(headings: Array<MdHeading | null> | null | undefined): Array<string | undefined>;
4
4
  export declare function getLeastDepth(headings: Array<MdHeading | null> | null | undefined): number;
@@ -3,7 +3,7 @@ export declare function isUndefined<T>(value: T | undefined): value is undefined
3
3
  export declare function isNull<T>(value: T | null): value is null;
4
4
  export declare function isString<T>(value: T | string): value is string;
5
5
  export declare function isNotNull<T>(value: T): value is NonNullable<T>;
6
- export declare const isObject: (item: unknown) => item is object;
6
+ export declare function isObject(item: unknown): item is object;
7
7
  export declare const isNavLinkItem: (item: ResolvedNavItem) => item is ResolvedNavLinkItem;
8
8
  export declare const isFromToSelectedOptions: (options: unknown) => options is {
9
9
  from: string;
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isFromToSelectedOptions = exports.isNavLinkItem = exports.isObject = void 0;
3
+ exports.isFromToSelectedOptions = exports.isNavLinkItem = void 0;
4
4
  exports.isUndefined = isUndefined;
5
5
  exports.isNull = isNull;
6
6
  exports.isString = isString;
7
7
  exports.isNotNull = isNotNull;
8
+ exports.isObject = isObject;
8
9
  function isUndefined(value) {
9
10
  return value === undefined;
10
11
  }
@@ -17,16 +18,15 @@ function isString(value) {
17
18
  function isNotNull(value) {
18
19
  return !isNull(value);
19
20
  }
20
- const isObject = (item) => {
21
+ function isObject(item) {
21
22
  return isNotNull(item) && typeof item === 'object';
22
- };
23
- exports.isObject = isObject;
23
+ }
24
24
  const isNavLinkItem = (item) => {
25
25
  return item.link !== undefined;
26
26
  };
27
27
  exports.isNavLinkItem = isNavLinkItem;
28
28
  const isFromToSelectedOptions = (options) => {
29
- return (0, exports.isObject)(options) && 'from' in options && 'to' in options;
29
+ return isObject(options) && 'from' in options && 'to' in options;
30
30
  };
31
31
  exports.isFromToSelectedOptions = isFromToSelectedOptions;
32
32
  //# sourceMappingURL=type-guards.js.map
@@ -1,4 +1,4 @@
1
- import type { Locale } from '../../core/types';
1
+ import type { Locale } from '../types/l10n';
2
2
  export declare function combineUrls(baseURL: string, ...relativeURLs: (string | undefined)[]): string;
3
3
  export declare function withPathPrefix(url: string): string;
4
4
  export declare function withoutPathPrefix(pathname: string): string;
@@ -14,7 +14,7 @@ exports.slash = slash;
14
14
  exports.addTrailingSlash = addTrailingSlash;
15
15
  exports.getPathnameForLocale = getPathnameForLocale;
16
16
  exports.getLocaleFromPathname = getLocaleFromPathname;
17
- const constants_1 = require("../../core/constants");
17
+ const common_1 = require("../constants/common");
18
18
  function combineUrls(baseURL, ...relativeURLs) {
19
19
  let res = baseURL;
20
20
  for (let relativeURL of relativeURLs) {
@@ -107,7 +107,7 @@ function getPathnameForLocale(originalPathname, defaultLocale, newLocale, allLoc
107
107
  * @param allLocales - Array of all available locales to check against
108
108
  * @returns The locale code from the pathname, or the default locale if none found
109
109
  */
110
- function getLocaleFromPathname(pathname, defaultLocale = constants_1.DEFAULT_LOCALE_PLACEHOLDER, allLocales = []) {
110
+ function getLocaleFromPathname(pathname, defaultLocale = common_1.DEFAULT_LOCALE_PLACEHOLDER, allLocales = []) {
111
111
  const maybeLocale = pathname === null || pathname === void 0 ? void 0 : pathname.split('/')[1];
112
112
  const locale = allLocales.find((locale) => locale.code.toLowerCase() === maybeLocale);
113
113
  return (locale === null || locale === void 0 ? void 0 : locale.code) || defaultLocale;
@@ -51,6 +51,8 @@ function TabList({ childrenArray, size, overflowTabs, visibleTabs, setTabRef, on
51
51
  el.setAttribute('data-animating', isAnimating.toString());
52
52
  }
53
53
  }, onKeyDown: (event) => handleKeyboard(event, index), onClick: () => {
54
+ var _a, _b;
55
+ (_b = (_a = child.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a);
54
56
  onTabClick(label);
55
57
  } }));
56
58
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/theme",
3
- "version": "0.56.0-next.2",
3
+ "version": "0.56.0-next.3",
4
4
  "description": "Shared UI components lib",
5
5
  "keywords": [
6
6
  "theme",
@@ -15,6 +15,7 @@ import {
15
15
  import { CatalogEntityCell } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogEntityCell';
16
16
  import { Tag } from '@redocly/theme/components/Tag/Tag';
17
17
  import { CatalogEntityRelationsTable } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable';
18
+ import { CatalogEntityRelationCell } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogEntityRelationCell';
18
19
 
19
20
  const columns: CatalogColumn<BffCatalogRelatedEntity>[] = [
20
21
  {
@@ -23,6 +24,7 @@ const columns: CatalogColumn<BffCatalogRelatedEntity>[] = [
23
24
  render: (entity) => <CatalogEntityCell entity={entity} />,
24
25
  sortable: true,
25
26
  sortKey: 'title',
27
+ width: '2.5fr',
26
28
  },
27
29
  {
28
30
  key: 'type',
@@ -34,6 +36,18 @@ const columns: CatalogColumn<BffCatalogRelatedEntity>[] = [
34
36
  ),
35
37
  sortable: true,
36
38
  sortKey: 'type',
39
+ width: '1fr',
40
+ },
41
+ {
42
+ key: 'relationType',
43
+ title: 'Relations',
44
+ render: (entity) => (
45
+ <CatalogEntityRelationCell
46
+ relationType={entity.relationType}
47
+ relationRole={entity.relationRole}
48
+ />
49
+ ),
50
+ width: '1fr',
37
51
  },
38
52
  ];
39
53
 
@@ -48,6 +62,7 @@ export type CatalogEntityDefaultRelationsProps = {
48
62
  };
49
63
  searchQuery: string;
50
64
  setSearchQuery: (query: string) => void;
65
+ setFilter: (filter: string) => void;
51
66
  sortOption: SortOption | null;
52
67
  setSortOption: (sortOption: SortOption | null) => void;
53
68
  handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
@@ -1,4 +1,4 @@
1
- import React, { JSX } from 'react';
1
+ import React, { JSX, useState } from 'react';
2
2
  import { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
3
3
 
4
4
  import { BffCatalogEntity, BffCatalogRelatedEntityList } from '@redocly/theme/core/types';
@@ -13,6 +13,9 @@ export type CatalogEntityRelationsProps = {
13
13
  initialRelations: BffCatalogRelatedEntityList;
14
14
  };
15
15
  const LOAD_MORE_THRESHOLD = 10;
16
+ const ENTITY_DEFAULT_FILTERS: Record<string, string> = {
17
+ team: 'type:user',
18
+ };
16
19
 
17
20
  export function CatalogEntityRelations({
18
21
  entity,
@@ -23,9 +26,10 @@ export function CatalogEntityRelations({
23
26
  const { useCatalogSort, useCatalogSearch, useFetchCatalogEntitiesRelations } = useThemeHooks();
24
27
  const { sortOption, setSortOption, handleSortClick, isColumnSorted } = useCatalogSort();
25
28
  const { searchQuery, setSearchQuery } = useCatalogSearch();
29
+ const [filter, setFilter] = useState<string>(ENTITY_DEFAULT_FILTERS[entity.type] ?? '');
26
30
 
27
31
  const { items: relations, query } = useFetchCatalogEntitiesRelations(
28
- { entityKey: entity.key, search: searchQuery, sort: sortOption ?? undefined },
32
+ { entityKey: entity.key, search: searchQuery, sort: sortOption ?? undefined, filter },
29
33
  initialRelations,
30
34
  );
31
35
 
@@ -49,6 +53,7 @@ export function CatalogEntityRelations({
49
53
  query={query}
50
54
  searchQuery={searchQuery}
51
55
  setSearchQuery={setSearchQuery}
56
+ setFilter={setFilter}
52
57
  sortOption={sortOption}
53
58
  setSortOption={setSortOption}
54
59
  handleSortClick={handleSortClick}
@@ -68,6 +73,7 @@ export function CatalogEntityRelations({
68
73
  query={query}
69
74
  searchQuery={searchQuery}
70
75
  setSearchQuery={setSearchQuery}
76
+ setFilter={setFilter}
71
77
  sortOption={sortOption}
72
78
  setSortOption={setSortOption}
73
79
  handleSortClick={handleSortClick}
@@ -24,7 +24,6 @@ export type CatalogEntityRelationsTableProps = {
24
24
  searchQuery: string;
25
25
  setSearchQuery: (query: string) => void;
26
26
  heading: string;
27
- filter?: string;
28
27
  columns: CatalogColumn<BffCatalogRelatedEntity>[];
29
28
  sortOption: SortOption | null;
30
29
  setSortOption: (sortOption: SortOption | null) => void;
@@ -11,6 +11,7 @@ import { Tag } from '@redocly/theme/components/Tag/Tag';
11
11
  import { CatalogEntityRelationsTable } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable';
12
12
  import { CatalogUserEntityCell } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogUserEntityCell';
13
13
  import { CatalogEntityDefaultRelations } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations';
14
+ import { CatalogEntityRelationCell } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogEntityRelationCell';
14
15
 
15
16
  const teamColumns: CatalogColumn<BffCatalogRelatedEntity>[] = [
16
17
  {
@@ -29,6 +30,16 @@ const teamColumns: CatalogColumn<BffCatalogRelatedEntity>[] = [
29
30
  render: (entity) => (entity.metadata?.role ? <Tag>{entity.metadata?.role}</Tag> : null),
30
31
  width: '2fr',
31
32
  },
33
+ {
34
+ key: 'relationType',
35
+ title: 'Relations',
36
+ render: (entity) => (
37
+ <CatalogEntityRelationCell
38
+ relationType={entity.relationType}
39
+ relationRole={entity.relationRole}
40
+ />
41
+ ),
42
+ },
32
43
  {
33
44
  key: 'description',
34
45
  title: 'Description',
@@ -49,6 +60,7 @@ export type CatalogEntityTeamRelationsProps = {
49
60
  };
50
61
  searchQuery: string;
51
62
  setSearchQuery: (query: string) => void;
63
+ setFilter: (filter: string) => void;
52
64
  sortOption: SortOption | null;
53
65
  setSortOption: (sortOption: SortOption | null) => void;
54
66
  handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
@@ -62,6 +74,7 @@ export function CatalogEntityTeamRelations({
62
74
  query,
63
75
  searchQuery,
64
76
  setSearchQuery,
77
+ setFilter,
65
78
  entitiesCatalogConfig,
66
79
  catalogConfig,
67
80
  sortOption,
@@ -73,7 +86,7 @@ export function CatalogEntityTeamRelations({
73
86
  return (
74
87
  <div data-component-name="Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations">
75
88
  <Tabs forceReady={relations.length > 0} size={TabsSize.MEDIUM}>
76
- <TabItem label="Members" icon={<PeopleIcon />}>
89
+ <TabItem label="Members" icon={<PeopleIcon />} onClick={() => setFilter('type:user')}>
77
90
  <CatalogEntityRelationsTable
78
91
  entity={entity}
79
92
  entitiesCatalogConfig={entitiesCatalogConfig}
@@ -83,7 +96,6 @@ export function CatalogEntityTeamRelations({
83
96
  searchQuery={searchQuery}
84
97
  setSearchQuery={setSearchQuery}
85
98
  heading="Members"
86
- filter="type:user"
87
99
  columns={teamColumns}
88
100
  sortOption={sortOption}
89
101
  setSortOption={setSortOption}
@@ -92,13 +104,14 @@ export function CatalogEntityTeamRelations({
92
104
  shouldShowLoadMore={shouldShowLoadMore}
93
105
  />
94
106
  </TabItem>
95
- <TabItem label="Related entities" icon={<EntityTypeIcon />}>
107
+ <TabItem label="Related entities" icon={<EntityTypeIcon />} onClick={() => setFilter('')}>
96
108
  <CatalogEntityDefaultRelations
97
109
  entity={entity}
98
110
  relations={relations}
99
111
  query={query}
100
112
  searchQuery={searchQuery}
101
113
  setSearchQuery={setSearchQuery}
114
+ setFilter={setFilter}
102
115
  entitiesCatalogConfig={entitiesCatalogConfig}
103
116
  catalogConfig={catalogConfig}
104
117
  sortOption={sortOption}
@@ -14,6 +14,8 @@ const entityIconMap: Record<EntityType, JSX.Element> = {
14
14
  team: <PeopleIcon color={iconColor} />,
15
15
  user: <UserIcon color={iconColor} />,
16
16
  'api-description': <CodeIcon color={iconColor} />,
17
+ 'data-schema': <CodeIcon color={iconColor} />,
18
+ 'api-operation': <CodeIcon color={iconColor} />,
17
19
  };
18
20
 
19
21
  export type CatalogEntityIconProps = {
@@ -34,6 +36,10 @@ export function CatalogEntityIcon({ entityType }: CatalogEntityIconProps): JSX.E
34
36
  return entityIconMap.user;
35
37
  case 'api-description':
36
38
  return entityIconMap['api-description'];
39
+ case 'data-schema':
40
+ return entityIconMap.service;
41
+ case 'api-operation':
42
+ return entityIconMap.service;
37
43
  default:
38
44
  const exhaustiveCheck: never = key;
39
45
  throw new Error(`Unhandled entity type: ${exhaustiveCheck}`);