@redocly/theme 0.57.0-next.0 → 0.57.0-next.2

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 (108) hide show
  1. package/lib/components/Catalog/CatalogCardView/CatalogCard.js +1 -0
  2. package/lib/components/Catalog/CatalogEntity/CatalogEntity.js +36 -25
  3. package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsEdge.d.ts +6 -0
  4. package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsEdge.js +38 -0
  5. package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.d.ts +6 -0
  6. package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.js +83 -0
  7. package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.lazy.d.ts +2 -0
  8. package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.lazy.js +29 -0
  9. package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsLinkedNode.d.ts +8 -0
  10. package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsLinkedNode.js +33 -0
  11. package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsNode.d.ts +16 -0
  12. package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsNode.js +24 -0
  13. package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsRootNode.d.ts +7 -0
  14. package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsRootNode.js +30 -0
  15. package/lib/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.js +5 -2
  16. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.d.ts +1 -0
  17. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +7 -3
  18. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.js +3 -8
  19. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.d.ts +22 -0
  20. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.js +18 -0
  21. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js +2 -2
  22. package/lib/components/Catalog/CatalogEntityIcon.d.ts +2 -1
  23. package/lib/components/Catalog/CatalogEntityIcon.js +4 -6
  24. package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.js +1 -1
  25. package/lib/components/Catalog/variables.js +42 -0
  26. package/lib/components/CatalogClassic/CatalogClassicVirtualizedGroups.js +13 -8
  27. package/lib/core/constants/catalog.d.ts +10 -0
  28. package/lib/core/constants/catalog.js +14 -1
  29. package/lib/core/hooks/__mocks__/search/use-recent-searches.d.ts +2 -2
  30. package/lib/core/hooks/__mocks__/search/use-recent-searches.js +2 -1
  31. package/lib/core/hooks/__mocks__/search/use-search-filter.d.ts +2 -2
  32. package/lib/core/hooks/__mocks__/search/use-search-filter.js +2 -1
  33. package/lib/core/hooks/__mocks__/search/use-suggested-pages.d.ts +2 -2
  34. package/lib/core/hooks/__mocks__/search/use-suggested-pages.js +2 -1
  35. package/lib/core/hooks/__mocks__/use-controlled-state.d.ts +1 -1
  36. package/lib/core/hooks/__mocks__/use-controlled-state.js +2 -1
  37. package/lib/core/hooks/__mocks__/use-input-key-commands.d.ts +3 -3
  38. package/lib/core/hooks/__mocks__/use-input-key-commands.js +3 -2
  39. package/lib/core/hooks/__mocks__/use-mobile-menu.d.ts +1 -1
  40. package/lib/core/hooks/__mocks__/use-mobile-menu.js +2 -1
  41. package/lib/core/hooks/__mocks__/use-theme-config.d.ts +2 -2
  42. package/lib/core/hooks/__mocks__/use-theme-config.js +2 -1
  43. package/lib/core/hooks/__mocks__/use-theme-hooks.d.ts +47 -47
  44. package/lib/core/hooks/__mocks__/use-theme-hooks.js +38 -37
  45. package/lib/core/hooks/__mocks__/use-time-ago.d.ts +2 -2
  46. package/lib/core/hooks/__mocks__/use-time-ago.js +2 -1
  47. package/lib/core/hooks/catalog/useGraph.d.ts +15 -0
  48. package/lib/core/hooks/catalog/useGraph.js +165 -0
  49. package/lib/core/hooks/code-walkthrough/__mocks__/MockIntersectionObserver.js +4 -3
  50. package/lib/core/hooks/index.d.ts +1 -0
  51. package/lib/core/hooks/index.js +1 -0
  52. package/lib/core/hooks/menu/__mocks__/use-mobile-menu-items.d.ts +1 -1
  53. package/lib/core/hooks/menu/__mocks__/use-mobile-menu-items.js +2 -1
  54. package/lib/core/hooks/use-page-actions.js +5 -1
  55. package/lib/core/openapi/index.d.ts +1 -0
  56. package/lib/core/openapi/index.js +3 -1
  57. package/lib/core/styles/index.d.ts +1 -0
  58. package/lib/core/styles/index.js +3 -0
  59. package/lib/core/styles/xyflow.d.ts +1 -0
  60. package/lib/core/styles/xyflow.js +623 -0
  61. package/lib/core/utils/dynamic.d.ts +9 -0
  62. package/lib/core/utils/dynamic.js +59 -0
  63. package/lib/core/utils/index.d.ts +1 -0
  64. package/lib/core/utils/index.js +1 -0
  65. package/lib/icons/GenericIcon/GenericIcon.d.ts +2 -2
  66. package/lib/icons/GenericIcon/GenericIcon.js +8 -3
  67. package/lib/icons/__tests__/IconTestUtils.d.ts +0 -1
  68. package/lib/icons/__tests__/IconTestUtils.js +8 -7
  69. package/package.json +11 -14
  70. package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +1 -0
  71. package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +60 -42
  72. package/src/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsEdge.tsx +63 -0
  73. package/src/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.lazy.tsx +7 -0
  74. package/src/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.tsx +91 -0
  75. package/src/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsLinkedNode.tsx +48 -0
  76. package/src/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsNode.tsx +45 -0
  77. package/src/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsRootNode.tsx +49 -0
  78. package/src/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.tsx +6 -2
  79. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +8 -2
  80. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +24 -43
  81. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.tsx +76 -0
  82. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +2 -2
  83. package/src/components/Catalog/CatalogEntityIcon.tsx +7 -5
  84. package/src/components/Catalog/CatalogTableView/CatalogTableViewRow.tsx +1 -1
  85. package/src/components/Catalog/variables.ts +42 -0
  86. package/src/components/CatalogClassic/CatalogClassicVirtualizedGroups.tsx +29 -18
  87. package/src/core/constants/catalog.ts +13 -0
  88. package/src/core/hooks/__mocks__/search/use-recent-searches.ts +3 -1
  89. package/src/core/hooks/__mocks__/search/use-search-filter.ts +3 -1
  90. package/src/core/hooks/__mocks__/search/use-suggested-pages.ts +3 -1
  91. package/src/core/hooks/__mocks__/use-controlled-state.ts +3 -1
  92. package/src/core/hooks/__mocks__/use-input-key-commands.ts +4 -2
  93. package/src/core/hooks/__mocks__/use-mobile-menu.ts +3 -1
  94. package/src/core/hooks/__mocks__/use-theme-config.ts +3 -1
  95. package/src/core/hooks/__mocks__/use-theme-hooks.ts +39 -37
  96. package/src/core/hooks/__mocks__/use-time-ago.ts +3 -1
  97. package/src/core/hooks/catalog/useGraph.ts +236 -0
  98. package/src/core/hooks/code-walkthrough/__mocks__/MockIntersectionObserver.ts +5 -3
  99. package/src/core/hooks/index.ts +1 -0
  100. package/src/core/hooks/menu/__mocks__/use-mobile-menu-items.ts +3 -1
  101. package/src/core/hooks/use-page-actions.ts +5 -1
  102. package/src/core/openapi/index.ts +1 -0
  103. package/src/core/styles/index.ts +1 -0
  104. package/src/core/styles/xyflow.ts +620 -0
  105. package/src/core/utils/dynamic.tsx +85 -0
  106. package/src/core/utils/index.ts +1 -0
  107. package/src/icons/GenericIcon/GenericIcon.tsx +13 -4
  108. package/src/icons/__tests__/IconTestUtils.tsx +5 -4
@@ -384,5 +384,47 @@ exports.catalog = (0, styled_components_1.css) `
384
384
 
385
385
  --catalog-avatar-bg-color: #ededf2;
386
386
  // @tokens End
387
+
388
+ /**
389
+ * @tokens Catalog entity relations node
390
+ */
391
+ --catalog-entity-relations-node-padding-vertical: 10px;
392
+ --catalog-entity-relations-node-padding-horizontal: 14px;
393
+ --catalog-entity-relations-node-padding: var(--catalog-entity-relations-node-padding-vertical) var(--catalog-entity-relations-node-padding-horizontal);
394
+ --catalog-entity-relations-node-gap: 8px;
395
+ --catalog-entity-relations-node-border-radius: 10px;
396
+
397
+ --catalog-entity-relations-node-bg-color: var(--layer-color);
398
+ --catalog-entity-relations-node-text-color: var(--catalog-card-text-color);
399
+
400
+ --catalog-entity-relations-node-border-color: var(--border-color-secondary);
401
+ --catalog-entity-relations-node-border-width: var(--border-width);
402
+ --catalog-entity-relations-node-border-style: var(--border-style);
403
+
404
+ --catalog-entity-relations-node-font-weight: var(--font-weight-regular);
405
+ --catalog-entity-relations-node-font-weight-root: 600;
406
+
407
+ --catalog-entity-relations-node-root-bg-color: var(--color-blue-6);
408
+ --catalog-entity-relations-node-root-text-color: #ffffff;
409
+ --catalog-entity-relations-node-root-icon-color: #ffffff;
410
+ // @tokens End
411
+
412
+ /**
413
+ * @tokens Catalog entity relations edge
414
+ */
415
+ --catalog-entity-relations-edge-label-bg-color: var(--layer-color);
416
+ --catalog-entity-relations-edge-label-text-color: var(--catalog-card-text-color);
417
+ --catalog-entity-relations-edge-label-border-color: var(--border-color-secondary);
418
+ --catalog-entity-relations-edge-label-border-width: var(--border-width);
419
+ --catalog-entity-relations-edge-label-border-style: var(--border-style);
420
+ --catalog-entity-relations-edge-label-border-radius: 10px;
421
+
422
+ --catalog-entity-relations-edge-label-padding-vertical: 2px;
423
+ --catalog-entity-relations-edge-label-padding-horizontal: 8px;
424
+ --catalog-entity-relations-edge-label-padding: var(--catalog-entity-relations-edge-label-padding-vertical) var(--catalog-entity-relations-edge-label-padding-horizontal);
425
+
426
+ --catalog-entity-relations-edge-label-font-size: 12px;
427
+ --catalog-entity-relations-edge-label-line-height: 1.2;
428
+ // @tokens End
387
429
  `;
388
430
  //# sourceMappingURL=variables.js.map
@@ -103,6 +103,7 @@ function CatalogClassicVirtualizedGroups({ groups, filters, filterTerm, }) {
103
103
  return ESTIMATED_CARD_HEIGHT;
104
104
  },
105
105
  overscan: 5,
106
+ enabled: shouldVirtualize,
106
107
  });
107
108
  (0, react_1.useEffect)(() => {
108
109
  if (!size.width || !shouldVirtualize) {
@@ -111,19 +112,23 @@ function CatalogClassicVirtualizedGroups({ groups, filters, filterTerm, }) {
111
112
  virtualizer.measure();
112
113
  // eslint-disable-next-line react-hooks/exhaustive-deps
113
114
  }, [filters, filterTerm, size.width, shouldVirtualize]);
115
+ const renderRow = (rowData) => {
116
+ if (rowData.type === 'header') {
117
+ return (react_1.default.createElement(SSRHeaderRow, { key: rowData.key },
118
+ react_1.default.createElement(CatalogSeparatorLabel, null, rowData.groupTitle),
119
+ react_1.default.createElement(CounterTag_1.CounterTag, { borderless: true }, rowData.groupCount)));
120
+ }
121
+ return (react_1.default.createElement(SSRGridRow, { key: rowData.key }, rowData.items.map((item) => (react_1.default.createElement(CatalogClassicCard_1.CatalogClassicCard, { key: item.link, item: item })))));
122
+ };
114
123
  if (!isClient) {
115
124
  return (react_1.default.createElement("div", { ref: parentRef, "data-component-name": "CatalogClassic/CatalogClassicVirtualizedGroups" },
116
- flatRows.slice(0, 15).map((rowData) => {
117
- if (rowData.type === 'header') {
118
- return (react_1.default.createElement(SSRHeaderRow, { key: rowData.key },
119
- react_1.default.createElement(CatalogSeparatorLabel, null, rowData.groupTitle),
120
- react_1.default.createElement(CounterTag_1.CounterTag, { borderless: true }, rowData.groupCount)));
121
- }
122
- return (react_1.default.createElement(SSRGridRow, { key: rowData.key }, rowData.items.map((item) => (react_1.default.createElement(CatalogClassicCard_1.CatalogClassicCard, { key: item.link, item: item })))));
123
- }),
125
+ flatRows.slice(0, 15).map((rowData) => renderRow(rowData)),
124
126
  react_1.default.createElement(LoadingWrapper, null,
125
127
  react_1.default.createElement(SpinnerLoader_1.SpinnerLoader, { color: "var(--catalog-classic-description-text-color)", size: "20px" }))));
126
128
  }
129
+ if (!shouldVirtualize) {
130
+ return (react_1.default.createElement("div", { ref: parentRef, "data-component-name": "CatalogClassic/CatalogClassicVirtualizedGroups" }, flatRows.map((rowData) => renderRow(rowData))));
131
+ }
127
132
  return (react_1.default.createElement("div", { ref: parentRef, "data-component-name": "CatalogClassic/CatalogClassicVirtualizedGroups" },
128
133
  react_1.default.createElement("div", { style: {
129
134
  position: 'relative',
@@ -2,3 +2,13 @@ import type { EntityRelationType } from '../types/catalog';
2
2
  export declare const CATALOG_TAG_MAX_LENGTH = 15;
3
3
  export declare const ENTITY_RELATION_TYPES: readonly ["partOf", "hasParts", "creates", "createdBy", "owns", "ownedBy", "implements", "implementedBy", "dependsOn", "dependencyOf", "uses", "usedBy", "produces", "consumes", "linksTo", "supersedes", "supersededBy", "compatibleWith", "extends", "extendedBy", "relatesTo", "hasMember", "memberOf", "triggers", "triggeredBy"];
4
4
  export declare const reverseRelationMap: Record<EntityRelationType, EntityRelationType>;
5
+ export declare enum GraphHandleType {
6
+ Target = "target",
7
+ Source = "source"
8
+ }
9
+ export declare enum GraphCustomNodeType {
10
+ CatalogEntity = "catalogEntity"
11
+ }
12
+ export declare enum GraphCustomEdgeType {
13
+ CatalogEdge = "catalogEdge"
14
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.reverseRelationMap = exports.ENTITY_RELATION_TYPES = exports.CATALOG_TAG_MAX_LENGTH = void 0;
3
+ exports.GraphCustomEdgeType = exports.GraphCustomNodeType = exports.GraphHandleType = exports.reverseRelationMap = exports.ENTITY_RELATION_TYPES = exports.CATALOG_TAG_MAX_LENGTH = void 0;
4
4
  exports.CATALOG_TAG_MAX_LENGTH = 15;
5
5
  exports.ENTITY_RELATION_TYPES = [
6
6
  'partOf',
@@ -56,4 +56,17 @@ exports.reverseRelationMap = {
56
56
  triggers: 'triggeredBy',
57
57
  triggeredBy: 'triggers',
58
58
  };
59
+ var GraphHandleType;
60
+ (function (GraphHandleType) {
61
+ GraphHandleType["Target"] = "target";
62
+ GraphHandleType["Source"] = "source";
63
+ })(GraphHandleType || (exports.GraphHandleType = GraphHandleType = {}));
64
+ var GraphCustomNodeType;
65
+ (function (GraphCustomNodeType) {
66
+ GraphCustomNodeType["CatalogEntity"] = "catalogEntity";
67
+ })(GraphCustomNodeType || (exports.GraphCustomNodeType = GraphCustomNodeType = {}));
68
+ var GraphCustomEdgeType;
69
+ (function (GraphCustomEdgeType) {
70
+ GraphCustomEdgeType["CatalogEdge"] = "catalogEdge";
71
+ })(GraphCustomEdgeType || (exports.GraphCustomEdgeType = GraphCustomEdgeType = {}));
59
72
  //# sourceMappingURL=catalog.js.map
@@ -1,5 +1,5 @@
1
- export declare const useRecentSearches: jest.Mock<{
1
+ export declare const useRecentSearches: import("vitest").Mock<() => {
2
2
  items: string[];
3
3
  addSearchHistoryItem: (value: string) => string;
4
4
  removeSearchHistoryItem: (value: string) => string;
5
- }, [], any>;
5
+ }>;
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useRecentSearches = void 0;
4
- exports.useRecentSearches = jest.fn(() => {
4
+ const vitest_1 = require("vitest");
5
+ exports.useRecentSearches = vitest_1.vi.fn(() => {
5
6
  const items = ['test'];
6
7
  return {
7
8
  items,
@@ -1,8 +1,8 @@
1
- export declare const useSearchFilter: jest.Mock<{
1
+ export declare const useSearchFilter: import("vitest").Mock<() => {
2
2
  isFilterOpen: boolean;
3
3
  onFacetReset: () => void;
4
4
  onFilterChange: () => void;
5
5
  onFilterToggle: () => void;
6
6
  onFilterReset: () => void;
7
7
  onQuickFilterReset: () => void;
8
- }, [], any>;
8
+ }>;
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useSearchFilter = void 0;
4
- exports.useSearchFilter = jest.fn(() => {
4
+ const vitest_1 = require("vitest");
5
+ exports.useSearchFilter = vitest_1.vi.fn(() => {
5
6
  return {
6
7
  isFilterOpen: false,
7
8
  onFacetReset: () => { },
@@ -1,4 +1,4 @@
1
- export declare const useSuggestedPages: jest.Mock<{
1
+ export declare const useSuggestedPages: import("vitest").Mock<() => {
2
2
  link: string;
3
3
  label: string;
4
- }[], [], any>;
4
+ }[]>;
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useSuggestedPages = void 0;
4
- exports.useSuggestedPages = jest.fn(() => {
4
+ const vitest_1 = require("vitest");
5
+ exports.useSuggestedPages = vitest_1.vi.fn(() => {
5
6
  return [
6
7
  {
7
8
  link: '/',
@@ -1 +1 @@
1
- export declare const useControlledState: () => (boolean | jest.Mock<any, any, any>)[];
1
+ export declare const useControlledState: () => (boolean | import("vitest").Mock<(...args: any[]) => any>)[];
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useControlledState = void 0;
4
- const useControlledState = () => [false, jest.fn()];
4
+ const vitest_1 = require("vitest");
5
+ const useControlledState = () => [false, vitest_1.vi.fn()];
5
6
  exports.useControlledState = useControlledState;
6
7
  //# sourceMappingURL=use-controlled-state.js.map
@@ -1,3 +1,3 @@
1
- export declare const useInputKeyCommands: jest.Mock<{
2
- onKeyDown: jest.Mock<any, any, any>;
3
- }, [], any>;
1
+ export declare const useInputKeyCommands: import("vitest").Mock<() => {
2
+ onKeyDown: import("vitest").Mock<(...args: any[]) => any>;
3
+ }>;
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useInputKeyCommands = void 0;
4
- exports.useInputKeyCommands = jest.fn(() => ({
5
- onKeyDown: jest.fn(),
4
+ const vitest_1 = require("vitest");
5
+ exports.useInputKeyCommands = vitest_1.vi.fn(() => ({
6
+ onKeyDown: vitest_1.vi.fn(),
6
7
  }));
7
8
  //# sourceMappingURL=use-input-key-commands.js.map
@@ -1 +1 @@
1
- export declare const useMobileMenu: () => (boolean | typeof jest.fn)[];
1
+ export declare const useMobileMenu: () => (boolean | import("vitest").Mock<(...args: any[]) => any>)[];
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useMobileMenu = void 0;
4
- const useMobileMenu = () => [false, jest.fn];
4
+ const vitest_1 = require("vitest");
5
+ const useMobileMenu = () => [false, vitest_1.vi.fn()];
5
6
  exports.useMobileMenu = useMobileMenu;
6
7
  //# sourceMappingURL=use-mobile-menu.js.map
@@ -1,8 +1,8 @@
1
- export declare const useThemeConfig: jest.Mock<{
1
+ export declare const useThemeConfig: import("vitest").Mock<() => {
2
2
  userMenu: {
3
3
  items: never[];
4
4
  };
5
5
  codeSnippet: {
6
6
  elementFormat: string;
7
7
  };
8
- }, [], any>;
8
+ }>;
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useThemeConfig = void 0;
4
- exports.useThemeConfig = jest.fn(() => ({
4
+ const vitest_1 = require("vitest");
5
+ exports.useThemeConfig = vitest_1.vi.fn(() => ({
5
6
  userMenu: {
6
7
  items: [],
7
8
  },
@@ -1,68 +1,68 @@
1
- export declare const useThemeHooks: jest.Mock<{
2
- useTranslate: jest.Mock<{
3
- translate: jest.Mock<any, [key: string, defaultValue: string], any>;
4
- }, [], any>;
5
- useTelemetry: jest.Mock<{
6
- send: jest.Mock<any, any, any>;
7
- }, [], any>;
8
- useBreadcrumbs: jest.Mock<any, any, any>;
9
- usePageSharedData: jest.Mock<any, any, any>;
10
- useCatalogClassic: jest.Mock<{
1
+ export declare const useThemeHooks: import("vitest").Mock<() => {
2
+ useTranslate: import("vitest").Mock<() => {
3
+ translate: import("vitest").Mock<(key: string, defaultValue: string) => any>;
4
+ }>;
5
+ useTelemetry: import("vitest").Mock<() => {
6
+ send: import("vitest").Mock<(...args: any[]) => any>;
7
+ }>;
8
+ useBreadcrumbs: import("vitest").Mock<(...args: any[]) => any>;
9
+ usePageSharedData: import("vitest").Mock<(...args: any[]) => any>;
10
+ useCatalogClassic: import("vitest").Mock<() => {
11
11
  groups: never[];
12
12
  filters: never[];
13
13
  filterTerm: string;
14
- setFilterTerm: jest.Mock<any, any, any>;
15
- }, [], any>;
16
- useL10n: jest.Mock<{
17
- changeLanguage: jest.Mock<any, any, any>;
18
- }, [], any>;
19
- useL10nConfig: jest.Mock<{
14
+ setFilterTerm: import("vitest").Mock<(...args: any[]) => any>;
15
+ }>;
16
+ useL10n: import("vitest").Mock<() => {
17
+ changeLanguage: import("vitest").Mock<(...args: any[]) => any>;
18
+ }>;
19
+ useL10nConfig: import("vitest").Mock<() => {
20
20
  currentLocale: string;
21
21
  defaultLocale: string;
22
22
  locales: {
23
23
  code: string;
24
24
  name: string;
25
25
  }[];
26
- }, [], any>;
27
- usePreloadHistory: jest.Mock<{
28
- push: jest.Mock<any, any, any>;
29
- }, [], any>;
30
- useCurrentProduct: jest.Mock<any, any, any>;
31
- useProducts: jest.Mock<never[], [], any>;
32
- useSearch: jest.Mock<{
33
- query: jest.Mock<any, any, any>;
34
- setQuery: jest.Mock<any, any, any>;
26
+ }>;
27
+ usePreloadHistory: import("vitest").Mock<() => {
28
+ push: import("vitest").Mock<(...args: any[]) => any>;
29
+ }>;
30
+ useCurrentProduct: import("vitest").Mock<(...args: any[]) => any>;
31
+ useProducts: import("vitest").Mock<() => never[]>;
32
+ useSearch: import("vitest").Mock<() => {
33
+ query: import("vitest").Mock<(...args: any[]) => any>;
34
+ setQuery: import("vitest").Mock<(...args: any[]) => any>;
35
35
  items: never[];
36
36
  isLoading: boolean;
37
- }, [], any>;
38
- useAiSearch: jest.Mock<{
39
- askQuestion: jest.Mock<any, any, any>;
37
+ }>;
38
+ useAiSearch: import("vitest").Mock<() => {
39
+ askQuestion: import("vitest").Mock<(...args: any[]) => any>;
40
40
  references: never[];
41
- }, [], any>;
42
- useFacetQuery: jest.Mock<{
41
+ }>;
42
+ useFacetQuery: import("vitest").Mock<() => {
43
43
  searchFacet: null;
44
- setSearchFacet: jest.Mock<any, any, any>;
45
- setSearchFacetQuery: jest.Mock<any, any, any>;
46
- }, [], any>;
47
- useMarkdownText: jest.Mock<null, [], any>;
48
- useUserMenu: jest.Mock<{
44
+ setSearchFacet: import("vitest").Mock<(...args: any[]) => any>;
45
+ setSearchFacetQuery: import("vitest").Mock<(...args: any[]) => any>;
46
+ }>;
47
+ useMarkdownText: import("vitest").Mock<() => null>;
48
+ useUserMenu: import("vitest").Mock<() => {
49
49
  userData: {
50
50
  isAuthenticated: boolean;
51
51
  name: string;
52
52
  email: string;
53
53
  picture: string;
54
54
  };
55
- handleLogout: jest.Mock<any, any, any>;
55
+ handleLogout: import("vitest").Mock<(...args: any[]) => any>;
56
56
  loginUrl: string;
57
57
  hasDeveloperOnboarding: boolean;
58
- }, [], any>;
59
- usePageVersions: jest.Mock<any, any, any>;
60
- useSidebarItems: jest.Mock<any, any, any>;
61
- useSidebarSiblingsData: jest.Mock<any, any, any>;
62
- useSubmitFeedback: jest.Mock<{
63
- submitFeedback: jest.Mock<any, any, any>;
64
- }, [], any>;
65
- useLoadAndNavigate: jest.Mock<any, any, any>;
66
- usePageProps: jest.Mock<any, any, any>;
67
- usePageData: jest.Mock<any, any, any>;
68
- }, [], any>;
58
+ }>;
59
+ usePageVersions: import("vitest").Mock<(...args: any[]) => any>;
60
+ useSidebarItems: import("vitest").Mock<(...args: any[]) => any>;
61
+ useSidebarSiblingsData: import("vitest").Mock<(...args: any[]) => any>;
62
+ useSubmitFeedback: import("vitest").Mock<() => {
63
+ submitFeedback: import("vitest").Mock<(...args: any[]) => any>;
64
+ }>;
65
+ useLoadAndNavigate: import("vitest").Mock<(...args: any[]) => any>;
66
+ usePageProps: import("vitest").Mock<(...args: any[]) => any>;
67
+ usePageData: import("vitest").Mock<(...args: any[]) => any>;
68
+ }>;
@@ -1,29 +1,30 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useThemeHooks = void 0;
4
- exports.useThemeHooks = jest.fn(() => ({
5
- useTranslate: jest.fn(() => ({
6
- translate: jest.fn((key, defaultValue) => defaultValue
4
+ const vitest_1 = require("vitest");
5
+ exports.useThemeHooks = vitest_1.vi.fn(() => ({
6
+ useTranslate: vitest_1.vi.fn(() => ({
7
+ translate: vitest_1.vi.fn((key, defaultValue) => defaultValue
7
8
  ? typeof defaultValue !== 'string'
8
9
  ? defaultValue.defaultValue
9
10
  : defaultValue
10
11
  : key),
11
12
  })),
12
- useTelemetry: jest.fn(() => ({
13
- send: jest.fn(),
13
+ useTelemetry: vitest_1.vi.fn(() => ({
14
+ send: vitest_1.vi.fn(),
14
15
  })),
15
- useBreadcrumbs: jest.fn().mockReturnValue([]),
16
- usePageSharedData: jest.fn().mockReturnValue({}),
17
- useCatalogClassic: jest.fn(() => ({
16
+ useBreadcrumbs: vitest_1.vi.fn().mockReturnValue([]),
17
+ usePageSharedData: vitest_1.vi.fn().mockReturnValue({}),
18
+ useCatalogClassic: vitest_1.vi.fn(() => ({
18
19
  groups: [],
19
20
  filters: [],
20
21
  filterTerm: '',
21
- setFilterTerm: jest.fn(),
22
+ setFilterTerm: vitest_1.vi.fn(),
22
23
  })),
23
- useL10n: jest.fn(() => ({
24
- changeLanguage: jest.fn(),
24
+ useL10n: vitest_1.vi.fn(() => ({
25
+ changeLanguage: vitest_1.vi.fn(),
25
26
  })),
26
- useL10nConfig: jest.fn(() => ({
27
+ useL10nConfig: vitest_1.vi.fn(() => ({
27
28
  currentLocale: 'en',
28
29
  defaultLocale: 'en',
29
30
  locales: [
@@ -32,42 +33,42 @@ exports.useThemeHooks = jest.fn(() => ({
32
33
  { code: 'uk', name: 'Ukraine' },
33
34
  ],
34
35
  })),
35
- usePreloadHistory: jest.fn(() => ({
36
- push: jest.fn(),
36
+ usePreloadHistory: vitest_1.vi.fn(() => ({
37
+ push: vitest_1.vi.fn(),
37
38
  })),
38
- useCurrentProduct: jest.fn(),
39
- useProducts: jest.fn(() => []),
40
- useSearch: jest.fn(() => ({
41
- query: jest.fn().mockReturnValue(''),
42
- setQuery: jest.fn(),
39
+ useCurrentProduct: vitest_1.vi.fn(),
40
+ useProducts: vitest_1.vi.fn(() => []),
41
+ useSearch: vitest_1.vi.fn(() => ({
42
+ query: vitest_1.vi.fn().mockReturnValue(''),
43
+ setQuery: vitest_1.vi.fn(),
43
44
  items: [],
44
45
  isLoading: false,
45
46
  })),
46
- useAiSearch: jest.fn(() => ({
47
- askQuestion: jest.fn(),
47
+ useAiSearch: vitest_1.vi.fn(() => ({
48
+ askQuestion: vitest_1.vi.fn(),
48
49
  references: [],
49
50
  })),
50
- useFacetQuery: jest.fn(() => ({
51
+ useFacetQuery: vitest_1.vi.fn(() => ({
51
52
  searchFacet: null,
52
- setSearchFacet: jest.fn(),
53
- setSearchFacetQuery: jest.fn(),
53
+ setSearchFacet: vitest_1.vi.fn(),
54
+ setSearchFacetQuery: vitest_1.vi.fn(),
54
55
  })),
55
- useMarkdownText: jest.fn(() => {
56
+ useMarkdownText: vitest_1.vi.fn(() => {
56
57
  return null;
57
58
  }),
58
- useUserMenu: jest.fn(() => ({
59
+ useUserMenu: vitest_1.vi.fn(() => ({
59
60
  userData: {
60
61
  isAuthenticated: true,
61
62
  name: 'test-name',
62
63
  email: 'test-email@test.xyz',
63
64
  picture: 'picture',
64
65
  },
65
- handleLogout: jest.fn(),
66
+ handleLogout: vitest_1.vi.fn(),
66
67
  loginUrl: 'https://login.redoc.ly',
67
68
  hasDeveloperOnboarding: true,
68
69
  })),
69
- usePageVersions: jest.fn(),
70
- useSidebarItems: jest.fn().mockReturnValue({
70
+ usePageVersions: vitest_1.vi.fn(),
71
+ useSidebarItems: vitest_1.vi.fn().mockReturnValue({
71
72
  currentItems: [
72
73
  {
73
74
  label: 'Item',
@@ -78,15 +79,15 @@ exports.useThemeHooks = jest.fn(() => ({
78
79
  label: 'Item',
79
80
  },
80
81
  ],
81
- popDrilldownState: jest.fn(),
82
- pushDrilldownState: jest.fn(),
82
+ popDrilldownState: vitest_1.vi.fn(),
83
+ pushDrilldownState: vitest_1.vi.fn(),
83
84
  }),
84
- useSidebarSiblingsData: jest.fn(),
85
- useSubmitFeedback: jest.fn(() => ({
86
- submitFeedback: jest.fn(),
85
+ useSidebarSiblingsData: vitest_1.vi.fn(),
86
+ useSubmitFeedback: vitest_1.vi.fn(() => ({
87
+ submitFeedback: vitest_1.vi.fn(),
87
88
  })),
88
- useLoadAndNavigate: jest.fn(),
89
- usePageProps: jest.fn().mockReturnValue({}),
90
- usePageData: jest.fn().mockReturnValue(null),
89
+ useLoadAndNavigate: vitest_1.vi.fn(),
90
+ usePageProps: vitest_1.vi.fn().mockReturnValue({}),
91
+ usePageData: vitest_1.vi.fn().mockReturnValue(null),
91
92
  }));
92
93
  //# sourceMappingURL=use-theme-hooks.js.map
@@ -1,3 +1,3 @@
1
- export declare const useTimeAgo: jest.Mock<{
1
+ export declare const useTimeAgo: import("vitest").Mock<() => {
2
2
  format: () => "5 days ago";
3
- }, [], any>;
3
+ }>;
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useTimeAgo = void 0;
4
- exports.useTimeAgo = jest.fn(() => ({
4
+ const vitest_1 = require("vitest");
5
+ exports.useTimeAgo = vitest_1.vi.fn(() => ({
5
6
  format: () => '5 days ago',
6
7
  }));
7
8
  //# sourceMappingURL=use-time-ago.js.map
@@ -0,0 +1,15 @@
1
+ import { type Node, type Edge, type Connection, OnNodesChange, OnEdgesChange } from '@xyflow/react';
2
+ import { type CatalogEntityNodeData } from '../../../components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsNode';
3
+ import { BffCatalogEntity, BffCatalogRelatedEntity } from '../../types';
4
+ export type UseGraphProps = {
5
+ entity: BffCatalogEntity;
6
+ relations: BffCatalogRelatedEntity[];
7
+ };
8
+ export type UseGraphReturn = {
9
+ nodes: Node<CatalogEntityNodeData>[];
10
+ edges: Edge[];
11
+ onNodesChange: OnNodesChange<Node<CatalogEntityNodeData>>;
12
+ onEdgesChange: OnEdgesChange<Edge>;
13
+ onConnect: (params: Connection) => void;
14
+ };
15
+ export declare function useGraph({ entity, relations }: UseGraphProps): UseGraphReturn;