@redocly/theme 0.59.0-next.1 → 0.59.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.
- package/lib/components/Accordion/Accordion.js +17 -7
- package/lib/components/Accordion/AccordionBody.js +17 -7
- package/lib/components/Admonition/Admonition.js +17 -7
- package/lib/components/Badge/Badge.js +17 -7
- package/lib/components/Breadcrumbs/Breadcrumb.js +17 -7
- package/lib/components/Breadcrumbs/BreadcrumbDropdown.js +17 -7
- package/lib/components/Button/Button.js +17 -7
- package/lib/components/Buttons/AIAssistantButton.js +17 -7
- package/lib/components/Buttons/CopyButton.js +17 -7
- package/lib/components/Catalog/Catalog.d.ts +6 -0
- package/lib/components/Catalog/Catalog.js +7 -6
- package/lib/components/Catalog/CatalogEntities.js +17 -7
- package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.js +17 -7
- package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.lazy.js +17 -7
- package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.js +17 -7
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.js +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +17 -7
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +17 -7
- package/lib/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.js +17 -7
- package/lib/components/Catalog/CatalogFilter/CatalogFilterContent.js +17 -7
- package/lib/components/Catalog/CatalogFilter/CatalogFilterDateRange.js +17 -7
- package/lib/components/Catalog/CatalogFilter/CatalogFilterSelect.js +17 -7
- package/lib/components/Catalog/CatalogSortButton.js +17 -7
- package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.js +17 -7
- package/lib/components/Catalog/CatalogViewModeToggle.js +17 -7
- package/lib/components/CatalogClassic/CatalogClassicActions.js +17 -7
- package/lib/components/CatalogClassic/CatalogClassicCard.js +17 -7
- package/lib/components/CatalogClassic/CatalogClassicHighlight.js +17 -7
- package/lib/components/CatalogClassic/CatalogClassicVirtualizedGroups.js +17 -7
- package/lib/components/CodeBlock/CodeBlock.js +17 -7
- package/lib/components/CodeBlock/CodeBlockContainer.js +17 -7
- package/lib/components/CodeBlock/CodeBlockTabs.js +17 -7
- package/lib/components/Dropdown/Dropdown.d.ts +16 -2
- package/lib/components/Dropdown/Dropdown.js +22 -12
- package/lib/components/Dropdown/DropdownMenuItem.js +17 -7
- package/lib/components/Feedback/Comment.js +17 -7
- package/lib/components/Feedback/Feedback.js +17 -7
- package/lib/components/Feedback/Mood.js +17 -7
- package/lib/components/Feedback/Rating.js +17 -7
- package/lib/components/Feedback/Reasons.js +17 -7
- package/lib/components/Feedback/Scale.js +17 -7
- package/lib/components/Feedback/Sentiment.js +17 -7
- package/lib/components/Feedback/Stars.js +17 -7
- package/lib/components/Filter/FilterContent.js +17 -7
- package/lib/components/Filter/FilterInput.js +17 -7
- package/lib/components/Image/Image.js +17 -7
- package/lib/components/JsonViewer/JsonViewer.js +17 -7
- package/lib/components/JsonViewer/helpers.js +17 -7
- package/lib/components/LastUpdated/LastUpdated.js +17 -7
- package/lib/components/Link/Link.js +17 -7
- package/lib/components/Markdown/Markdown.js +17 -7
- package/lib/components/Marker/Marker.js +17 -7
- package/lib/components/Menu/MenuContainer.js +17 -7
- package/lib/components/Menu/MenuItem.js +18 -8
- package/lib/components/Menu/MenuMobile.js +17 -7
- package/lib/components/PageActions/PageActions.js +17 -7
- package/lib/components/PageNavigation/NextButton.js +17 -7
- package/lib/components/Panel/Panel.js +17 -7
- package/lib/components/Panel/PanelBody.js +17 -7
- package/lib/components/Search/FilterFields/SearchFilterFieldSelect.js +17 -7
- package/lib/components/Search/SearchAiConversationInput.d.ts +2 -1
- package/lib/components/Search/SearchAiConversationInput.js +28 -10
- package/lib/components/Search/SearchAiDialog.js +17 -7
- package/lib/components/Search/SearchDialog.js +23 -10
- package/lib/components/Search/SearchFilter.js +17 -7
- package/lib/components/Search/SearchGroups.js +17 -7
- package/lib/components/Search/SearchHighlight.js +17 -7
- package/lib/components/Search/SearchItem.js +17 -7
- package/lib/components/Search/SearchRecent.js +17 -7
- package/lib/components/Search/SearchShortcut.js +17 -7
- package/lib/components/Search/SearchSuggestedPages.js +17 -7
- package/lib/components/Search/SearchTrigger.js +17 -7
- package/lib/components/Search/variables.js +5 -1
- package/lib/components/Segmented/Segmented.js +17 -7
- package/lib/components/Select/Select.js +17 -7
- package/lib/components/Select/SelectInput.js +17 -7
- package/lib/components/Sidebar/Sidebar.js +17 -7
- package/lib/components/SidebarActions/styled.js +17 -7
- package/lib/components/SkipContent/SkipContent.js +17 -7
- package/lib/components/Switch/Switch.js +17 -7
- package/lib/components/TableOfContent/TableOfContent.js +17 -7
- package/lib/components/Tooltip/Tooltip.js +17 -7
- package/lib/components/VersionPicker/VersionPicker.js +17 -7
- package/lib/core/constants/search.d.ts +5 -4
- package/lib/core/constants/search.js +4 -5
- package/lib/core/contexts/CodeSnippetContext.js +17 -7
- package/lib/core/hooks/use-tabs.d.ts +3 -2
- package/lib/core/hooks/use-tabs.js +115 -57
- package/lib/core/templates/Markdown.js +17 -7
- package/lib/core/types/hooks.d.ts +6 -3
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/core/utils/download-code-walkthrough.js +17 -7
- package/lib/core/utils/get-file-icon.js +17 -7
- package/lib/icons/AiStarsIcon/AiStarsIcon.js +11 -2
- package/lib/icons/GenericIcon/GenericIcon.js +17 -7
- package/lib/icons/RedoclyIcon/RedoclyIcon.js +4 -7
- package/lib/icons/Spinner/Spinner.js +17 -7
- package/lib/index.js +17 -7
- package/lib/layouts/OIDCForbidden.js +17 -7
- package/lib/layouts/ThreePanelLayout.js +17 -7
- package/lib/markdoc/components/Cards/Cards.js +17 -7
- package/lib/markdoc/components/CodeGroup/CodeGroup.js +17 -7
- package/lib/markdoc/components/CodeWalkthrough/CodeContainer.js +17 -7
- package/lib/markdoc/components/CodeWalkthrough/CodePanel.js +17 -7
- package/lib/markdoc/components/CodeWalkthrough/CodePanelHeader.js +17 -7
- package/lib/markdoc/components/CodeWalkthrough/CodePanelPreview.js +17 -7
- package/lib/markdoc/components/CodeWalkthrough/CodePanelToolbar.js +17 -7
- package/lib/markdoc/components/CodeWalkthrough/CodeStep.js +17 -7
- package/lib/markdoc/components/CodeWalkthrough/CodeToggle.js +17 -7
- package/lib/markdoc/components/CodeWalkthrough/CodeWalkthrough.js +17 -7
- package/lib/markdoc/components/CodeWalkthrough/Input.js +17 -7
- package/lib/markdoc/components/Heading/Heading.js +17 -7
- package/lib/markdoc/components/HtmlBlock/HtmlBlock.js +17 -7
- package/lib/markdoc/components/InlineSvg/InlineSvg.js +17 -7
- package/lib/markdoc/components/MarkdocExample/MarkdocExample.js +17 -7
- package/lib/markdoc/components/Tabs/TabList.d.ts +3 -1
- package/lib/markdoc/components/Tabs/TabList.js +214 -54
- package/lib/markdoc/components/Tabs/Tabs.d.ts +2 -1
- package/lib/markdoc/components/Tabs/Tabs.js +74 -19
- package/lib/markdoc/default.d.ts +104 -1
- package/lib/markdoc/default.js +17 -7
- package/package.json +5 -5
- package/src/components/Catalog/Catalog.tsx +15 -4
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.tsx +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +1 -1
- package/src/components/Dropdown/Dropdown.tsx +84 -79
- package/src/components/Menu/MenuItem.tsx +1 -0
- package/src/components/Search/SearchAiConversationInput.tsx +12 -2
- package/src/components/Search/SearchDialog.tsx +6 -3
- package/src/components/Search/variables.ts +5 -1
- package/src/core/constants/search.ts +8 -4
- package/src/core/hooks/use-tabs.ts +168 -86
- package/src/core/types/hooks.ts +6 -1
- package/src/core/types/l10n.ts +1 -0
- package/src/icons/AiStarsIcon/AiStarsIcon.tsx +11 -2
- package/src/icons/RedoclyIcon/RedoclyIcon.tsx +4 -22
- package/src/markdoc/components/Tabs/TabList.tsx +312 -105
- package/src/markdoc/components/Tabs/Tabs.tsx +136 -11
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
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
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
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
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
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
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.ControlsWrapChangeLayoutButtons = exports.ControlsWrap = exports.StyledChangeViewButtonWrap = exports.StyledChangeViewButton = void 0;
|
|
27
37
|
const styled_components_1 = __importStar(require("styled-components"));
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
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
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
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
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
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
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
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
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.Tooltip = void 0;
|
|
27
37
|
exports.TooltipComponent = TooltipComponent;
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
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
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
@@ -6,10 +6,11 @@ export declare enum AiSearchError {
|
|
|
6
6
|
EmptyResponse = "empty_response",
|
|
7
7
|
ErrorProcessingResponse = "error_processing_response"
|
|
8
8
|
}
|
|
9
|
-
export declare const
|
|
10
|
-
USER
|
|
11
|
-
ASSISTANT
|
|
12
|
-
}
|
|
9
|
+
export declare const AiSearchConversationRole: {
|
|
10
|
+
readonly USER: "user";
|
|
11
|
+
readonly ASSISTANT: "assistant";
|
|
12
|
+
};
|
|
13
|
+
export type AiSearchConversationRole = (typeof AiSearchConversationRole)[keyof typeof AiSearchConversationRole];
|
|
13
14
|
export declare const AI_SEARCH_ERROR_CONFIG: Record<AiSearchError, AiSearchErrorConfig>;
|
|
14
15
|
export declare const AI_SEARCH_MAX_MESSAGE_LENGTH = 45000;
|
|
15
16
|
export declare const SEARCH_DEBOUNCE_TIME_MS = 300;
|
|
@@ -9,11 +9,10 @@ var AiSearchError;
|
|
|
9
9
|
AiSearchError["EmptyResponse"] = "empty_response";
|
|
10
10
|
AiSearchError["ErrorProcessingResponse"] = "error_processing_response";
|
|
11
11
|
})(AiSearchError || (exports.AiSearchError = AiSearchError = {}));
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
})(AiSearchConversationRole || (exports.AiSearchConversationRole = AiSearchConversationRole = {}));
|
|
12
|
+
exports.AiSearchConversationRole = {
|
|
13
|
+
USER: 'user',
|
|
14
|
+
ASSISTANT: 'assistant',
|
|
15
|
+
};
|
|
17
16
|
const defaultErrorConfig = {
|
|
18
17
|
headerKey: 'search.ai.error.header',
|
|
19
18
|
headerDefault: 'Oops! Something went wrong.',
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
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
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.useActiveCodeSnippetId = exports.useCodeSnippetContext = exports.CodeSnippetContext = exports.CODE_GROUP_SNIPPET_NAME_KEY = void 0;
|
|
27
37
|
exports.CodeSnippetProvider = CodeSnippetProvider;
|
|
@@ -4,18 +4,19 @@ type UseTabsProps = {
|
|
|
4
4
|
totalTabs: number;
|
|
5
5
|
containerRef?: React.RefObject<HTMLElement | null>;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
type UseTabsReturn = {
|
|
8
8
|
setTabRef: (element: HTMLButtonElement | null, index: number) => void;
|
|
9
9
|
onTabClick: (labelOrIndex: string | number) => void;
|
|
10
10
|
handleKeyboard: (event: React.KeyboardEvent, index: number) => void;
|
|
11
11
|
visibleTabs: number[];
|
|
12
12
|
overflowTabs: number[];
|
|
13
|
-
|
|
13
|
+
isReady: boolean;
|
|
14
14
|
};
|
|
15
15
|
type UseActiveTabProps = {
|
|
16
16
|
initialTab: string;
|
|
17
17
|
tabsId?: string;
|
|
18
18
|
};
|
|
19
|
+
export declare function useTabs({ activeTab, onTabChange, totalTabs, containerRef, }: UseTabsProps): UseTabsReturn;
|
|
19
20
|
export declare const useActiveTab: ({ initialTab, tabsId }: UseActiveTabProps) => {
|
|
20
21
|
activeTab: string;
|
|
21
22
|
setActiveTab: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
@@ -6,15 +6,20 @@ const react_1 = require("react");
|
|
|
6
6
|
const react_router_dom_1 = require("react-router-dom");
|
|
7
7
|
const MORE_BUTTON_WIDTH = 80;
|
|
8
8
|
const TABS_GAP = 8;
|
|
9
|
-
function useTabs({ activeTab, onTabChange, totalTabs, containerRef }) {
|
|
9
|
+
function useTabs({ activeTab, onTabChange, totalTabs, containerRef, }) {
|
|
10
10
|
const [tabs, setTabs] = (0, react_1.useState)({
|
|
11
11
|
visible: Array.from({ length: totalTabs }, (_, i) => i),
|
|
12
12
|
overflow: [],
|
|
13
13
|
});
|
|
14
|
+
const [isReady, setIsReady] = (0, react_1.useState)(false);
|
|
15
|
+
const isFirstCalculation = (0, react_1.useRef)(true);
|
|
14
16
|
const tabRefs = (0, react_1.useRef)([]);
|
|
15
17
|
const tabWidthsRef = (0, react_1.useRef)([]);
|
|
16
18
|
const tabLabelsRef = (0, react_1.useRef)([]);
|
|
17
|
-
const
|
|
19
|
+
const activeTabRef = (0, react_1.useRef)(activeTab);
|
|
20
|
+
const calculateVisibleTabsRef = (0, react_1.useRef)(null);
|
|
21
|
+
// Synchronously update ref before any callbacks or effects run
|
|
22
|
+
activeTabRef.current = activeTab;
|
|
18
23
|
const setTabRef = (0, react_1.useCallback)((element, index) => {
|
|
19
24
|
tabRefs.current[index] = element;
|
|
20
25
|
const width = element === null || element === void 0 ? void 0 : element.offsetWidth;
|
|
@@ -25,18 +30,25 @@ function useTabs({ activeTab, onTabChange, totalTabs, containerRef }) {
|
|
|
25
30
|
if (label) {
|
|
26
31
|
tabLabelsRef.current[index] = label;
|
|
27
32
|
}
|
|
28
|
-
|
|
29
|
-
|
|
33
|
+
// Trigger calculation once all tabs are registered
|
|
34
|
+
if (isFirstCalculation.current &&
|
|
35
|
+
tabWidthsRef.current.length >= totalTabs &&
|
|
36
|
+
tabLabelsRef.current.length >= totalTabs &&
|
|
37
|
+
calculateVisibleTabsRef.current) {
|
|
38
|
+
requestAnimationFrame(calculateVisibleTabsRef.current);
|
|
39
|
+
}
|
|
40
|
+
}, [totalTabs]);
|
|
41
|
+
const focusTab = (0, react_1.useCallback)((index) => {
|
|
30
42
|
const currentElement = tabRefs.current[index];
|
|
31
43
|
currentElement === null || currentElement === void 0 ? void 0 : currentElement.focus();
|
|
32
|
-
};
|
|
44
|
+
}, []);
|
|
33
45
|
const onTabSelect = (0, react_1.useCallback)((index) => {
|
|
34
46
|
var _a;
|
|
35
47
|
focusTab(index);
|
|
36
48
|
const label = (_a = tabRefs.current[index]) === null || _a === void 0 ? void 0 : _a.getAttribute('data-label');
|
|
37
49
|
if (label)
|
|
38
50
|
onTabChange(label);
|
|
39
|
-
}, [onTabChange]);
|
|
51
|
+
}, [onTabChange, focusTab]);
|
|
40
52
|
const handleKeyboard = (0, react_1.useCallback)((event, index) => {
|
|
41
53
|
let newIndex = index;
|
|
42
54
|
if (event.key === 'ArrowRight') {
|
|
@@ -59,109 +71,155 @@ function useTabs({ activeTab, onTabChange, totalTabs, containerRef }) {
|
|
|
59
71
|
onTabSelect(newIndex);
|
|
60
72
|
}, [totalTabs, onTabSelect]);
|
|
61
73
|
const replaceLastVisibleTabWithClickedOverflowTab = (0, react_1.useCallback)((clickedIndex) => {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
newOverflowTabs.unshift(lastVisible);
|
|
71
|
-
newVisibleTabs.splice(newVisibleTabs.length - 1, 1);
|
|
72
|
-
newVisibleTabs.unshift(clickedIndex);
|
|
73
|
-
}
|
|
74
|
-
setTabs({
|
|
75
|
-
visible: newVisibleTabs,
|
|
76
|
-
overflow: newOverflowTabs,
|
|
74
|
+
setTabs((prevTabs) => {
|
|
75
|
+
const { visible: visibleTabs, overflow: overflowTabs } = prevTabs;
|
|
76
|
+
const sortedVisible = [...visibleTabs].sort((a, b) => a - b);
|
|
77
|
+
const lastVisible = sortedVisible[sortedVisible.length - 1];
|
|
78
|
+
return {
|
|
79
|
+
visible: visibleTabs.map((idx) => (idx === lastVisible ? clickedIndex : idx)),
|
|
80
|
+
overflow: overflowTabs.map((idx) => (idx === clickedIndex ? lastVisible : idx)),
|
|
81
|
+
};
|
|
77
82
|
});
|
|
78
|
-
}, [
|
|
83
|
+
}, []);
|
|
79
84
|
const onTabClick = (0, react_1.useCallback)((labelOrIndex) => {
|
|
80
85
|
const clickedIndex = typeof labelOrIndex === 'string'
|
|
81
86
|
? tabRefs.current.findIndex((ref) => (ref === null || ref === void 0 ? void 0 : ref.getAttribute('data-label')) === labelOrIndex)
|
|
82
87
|
: labelOrIndex;
|
|
83
88
|
if (clickedIndex === -1)
|
|
84
89
|
return;
|
|
85
|
-
const hasOverflowTabs = tabs.overflow.length > 0;
|
|
86
|
-
if (hasOverflowTabs && !allTabsHidden && tabs.overflow.includes(clickedIndex)) {
|
|
87
|
-
replaceLastVisibleTabWithClickedOverflowTab(clickedIndex);
|
|
88
|
-
}
|
|
89
90
|
const label = tabLabelsRef.current[clickedIndex];
|
|
90
|
-
if (label)
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
if (!label)
|
|
92
|
+
return;
|
|
93
|
+
// If this is an overflow tab, replace it with a visible one
|
|
94
|
+
if (tabs.overflow.includes(clickedIndex)) {
|
|
95
|
+
replaceLastVisibleTabWithClickedOverflowTab(clickedIndex);
|
|
93
96
|
}
|
|
94
|
-
|
|
97
|
+
onTabChange(label);
|
|
98
|
+
focusTab(clickedIndex);
|
|
99
|
+
}, [tabs.overflow, onTabChange, replaceLastVisibleTabWithClickedOverflowTab, focusTab]);
|
|
95
100
|
const calculateVisibleTabs = (0, react_1.useCallback)(() => {
|
|
96
101
|
const container = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current;
|
|
97
102
|
if (!container)
|
|
98
103
|
return;
|
|
99
104
|
const containerWidth = container.offsetWidth;
|
|
100
105
|
const tabWidths = tabWidthsRef.current;
|
|
101
|
-
const
|
|
102
|
-
//
|
|
106
|
+
const tabLabels = tabLabelsRef.current;
|
|
107
|
+
// Wait until all tabs are registered before calculating
|
|
108
|
+
if (tabWidths.length < totalTabs || tabLabels.length < totalTabs) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
// Check if container has proper width (not zero)
|
|
112
|
+
if (containerWidth === 0) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
// Find active tab index by label in tabLabelsRef, not by DOM element
|
|
116
|
+
// because tab might not be rendered if it's in overflow
|
|
117
|
+
const activeTabIndex = tabLabels.findIndex((label) => label === activeTabRef.current);
|
|
103
118
|
let tabsWidth = activeTabIndex !== -1 ? tabWidths[activeTabIndex] : 0;
|
|
104
|
-
const
|
|
105
|
-
const
|
|
119
|
+
const visibleTabs = activeTabIndex !== -1 ? [activeTabIndex] : [];
|
|
120
|
+
const overflowTabs = [];
|
|
106
121
|
for (let i = 0; i < tabWidths.length; i++) {
|
|
107
|
-
|
|
108
|
-
if (i === activeTabIndex) {
|
|
122
|
+
if (i === activeTabIndex)
|
|
109
123
|
continue;
|
|
110
|
-
}
|
|
111
124
|
const tabWidthWithGap = tabWidths[i] + TABS_GAP;
|
|
112
125
|
const projectedWidth = tabsWidth + tabWidthWithGap;
|
|
113
126
|
if (projectedWidth <= containerWidth) {
|
|
114
|
-
|
|
127
|
+
visibleTabs.push(i);
|
|
115
128
|
tabsWidth += tabWidthWithGap;
|
|
116
129
|
}
|
|
117
130
|
else {
|
|
118
|
-
|
|
131
|
+
overflowTabs.push(i);
|
|
119
132
|
}
|
|
120
133
|
}
|
|
121
|
-
if (
|
|
134
|
+
if (overflowTabs.length > 0) {
|
|
122
135
|
tabsWidth += MORE_BUTTON_WIDTH;
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
if (removed !== undefined) {
|
|
127
|
-
|
|
136
|
+
while (tabsWidth > containerWidth && visibleTabs.length > 1) {
|
|
137
|
+
const removed = visibleTabs.pop();
|
|
138
|
+
// Never remove the active tab - it should always stay visible or be the last one
|
|
139
|
+
if (removed !== undefined && removed !== activeTabIndex) {
|
|
140
|
+
overflowTabs.unshift(removed);
|
|
128
141
|
tabsWidth -= tabWidths[removed];
|
|
129
142
|
}
|
|
143
|
+
else if (removed === activeTabIndex) {
|
|
144
|
+
// Put it back if we accidentally removed the active tab
|
|
145
|
+
visibleTabs.push(removed);
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
// If even with only the active tab visible, it doesn't fit with More button,
|
|
150
|
+
// move all tabs to overflow (show only dropdown)
|
|
151
|
+
if (tabsWidth > containerWidth && visibleTabs.length === 1) {
|
|
152
|
+
overflowTabs.unshift(...visibleTabs);
|
|
153
|
+
visibleTabs.length = 0;
|
|
130
154
|
}
|
|
131
155
|
}
|
|
132
156
|
setTabs({
|
|
133
|
-
visible,
|
|
134
|
-
overflow,
|
|
157
|
+
visible: visibleTabs,
|
|
158
|
+
overflow: overflowTabs,
|
|
135
159
|
});
|
|
136
|
-
|
|
160
|
+
// Set ready state on first calculation
|
|
161
|
+
if (isFirstCalculation.current) {
|
|
162
|
+
isFirstCalculation.current = false;
|
|
163
|
+
setIsReady(true);
|
|
164
|
+
}
|
|
165
|
+
}, [containerRef, totalTabs]);
|
|
166
|
+
// Store calculateVisibleTabs in ref for use in setTabRef
|
|
167
|
+
calculateVisibleTabsRef.current = calculateVisibleTabs;
|
|
168
|
+
// Reset isFirstCalculation when totalTabs changes (new page/tabs)
|
|
137
169
|
(0, react_1.useEffect)(() => {
|
|
138
|
-
|
|
170
|
+
isFirstCalculation.current = true;
|
|
171
|
+
setIsReady(false);
|
|
172
|
+
// Clear refs so we wait for new tabs to register
|
|
173
|
+
tabWidthsRef.current = [];
|
|
174
|
+
tabLabelsRef.current = [];
|
|
175
|
+
}, [totalTabs]);
|
|
176
|
+
// Call calculateVisibleTabs on first render and resize
|
|
177
|
+
(0, react_1.useEffect)(() => {
|
|
178
|
+
const container = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current;
|
|
179
|
+
if (!container)
|
|
139
180
|
return;
|
|
140
|
-
let resizeTimeout =
|
|
181
|
+
let resizeTimeout = null;
|
|
182
|
+
// Use ResizeObserver to wait until container has proper size
|
|
183
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
184
|
+
if (resizeTimeout)
|
|
185
|
+
cancelAnimationFrame(resizeTimeout);
|
|
186
|
+
resizeTimeout = requestAnimationFrame(calculateVisibleTabs);
|
|
187
|
+
});
|
|
188
|
+
resizeObserver.observe(container);
|
|
141
189
|
const handleResize = () => {
|
|
142
|
-
if (resizeTimeout)
|
|
190
|
+
if (resizeTimeout)
|
|
143
191
|
cancelAnimationFrame(resizeTimeout);
|
|
144
|
-
}
|
|
145
192
|
resizeTimeout = requestAnimationFrame(calculateVisibleTabs);
|
|
146
193
|
};
|
|
147
194
|
window.addEventListener('resize', handleResize);
|
|
148
195
|
return () => {
|
|
196
|
+
resizeObserver.disconnect();
|
|
149
197
|
window.removeEventListener('resize', handleResize);
|
|
150
|
-
|
|
198
|
+
if (resizeTimeout)
|
|
199
|
+
cancelAnimationFrame(resizeTimeout);
|
|
151
200
|
};
|
|
152
201
|
}, [containerRef, totalTabs, calculateVisibleTabs]);
|
|
202
|
+
// Recalculate when activeTab changes to ensure it's visible
|
|
203
|
+
(0, react_1.useEffect)(() => {
|
|
204
|
+
if (!(containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) || isFirstCalculation.current)
|
|
205
|
+
return;
|
|
206
|
+
requestAnimationFrame(calculateVisibleTabs);
|
|
207
|
+
}, [activeTab, containerRef, calculateVisibleTabs]);
|
|
153
208
|
return {
|
|
154
209
|
setTabRef,
|
|
155
210
|
onTabClick,
|
|
156
211
|
handleKeyboard,
|
|
157
212
|
visibleTabs: tabs.visible,
|
|
158
213
|
overflowTabs: tabs.overflow,
|
|
159
|
-
|
|
214
|
+
isReady,
|
|
160
215
|
};
|
|
161
216
|
}
|
|
162
217
|
const useActiveTab = ({ initialTab, tabsId }) => {
|
|
163
218
|
const [searchParams, setSearchParams] = (0, react_router_dom_1.useSearchParams)();
|
|
164
|
-
const
|
|
219
|
+
const initialTabValue = (0, react_1.useMemo)(() => getInitialTab({ initialTab, searchParams, tabsId }),
|
|
220
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
221
|
+
[]);
|
|
222
|
+
const [activeTab, setActiveTab] = (0, react_1.useState)(initialTabValue);
|
|
165
223
|
const prevActiveTabRef = (0, react_1.useRef)(activeTab);
|
|
166
224
|
(0, react_1.useEffect)(() => {
|
|
167
225
|
const hasActiveTabChanged = prevActiveTabRef.current !== activeTab;
|
|
@@ -174,10 +232,10 @@ const useActiveTab = ({ initialTab, tabsId }) => {
|
|
|
174
232
|
return searchParams;
|
|
175
233
|
});
|
|
176
234
|
}, [activeTab, setSearchParams, tabsId]);
|
|
177
|
-
return {
|
|
235
|
+
return (0, react_1.useMemo)(() => ({
|
|
178
236
|
activeTab,
|
|
179
237
|
setActiveTab,
|
|
180
|
-
};
|
|
238
|
+
}), [activeTab]);
|
|
181
239
|
};
|
|
182
240
|
exports.useActiveTab = useActiveTab;
|
|
183
241
|
const getInitialTab = ({ initialTab, searchParams, tabsId }) => {
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
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
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.default = default_1;
|
|
27
37
|
const React = __importStar(require("react"));
|