@redocly/theme 0.56.0-next.9 → 0.56.0
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/Button/Button.d.ts +1 -1
- package/lib/components/Button/Button.js +2 -1
- package/lib/components/Button/ButtonGroup.d.ts +12 -0
- package/lib/components/Button/ButtonGroup.js +38 -0
- package/lib/components/Button/variables.js +32 -5
- package/lib/components/Catalog/Catalog.d.ts +1 -1
- package/lib/components/Catalog/CatalogCardView/CatalogCard.js +2 -2
- package/lib/components/Catalog/CatalogSelector.d.ts +1 -1
- package/lib/components/Catalog/CatalogSelector.js +4 -3
- package/lib/components/Catalog/CatalogViewModeToggle.d.ts +1 -1
- package/lib/components/CodeBlock/CodeBlock.d.ts +16 -6
- package/lib/components/CodeBlock/CodeBlock.js +2 -2
- package/lib/components/CodeBlock/CodeBlockControls.d.ts +4 -3
- package/lib/components/CodeBlock/CodeBlockControls.js +8 -5
- package/lib/components/CodeBlock/CodeBlockDropdown.d.ts +3 -0
- package/lib/components/CodeBlock/CodeBlockDropdown.js +35 -0
- package/lib/components/CodeBlock/CodeBlockTabs.d.ts +2 -2
- package/lib/components/CodeBlock/CodeBlockTabs.js +18 -9
- package/lib/components/CodeBlock/variables.js +1 -1
- package/lib/components/Dropdown/Dropdown.js +1 -0
- package/lib/components/Dropdown/DropdownMenu.js +4 -0
- package/lib/components/Dropdown/variables.js +1 -0
- package/lib/components/Footer/FooterItem.js +4 -7
- package/lib/components/Footer/variables.js +2 -2
- package/lib/components/Markdown/Markdown.js +9 -9
- package/lib/components/Markdown/styles/headingAnchor.js +0 -1
- package/lib/components/Menu/MenuItem.js +5 -5
- package/lib/components/Menu/variables.js +1 -1
- package/lib/components/Navbar/NavbarItem.js +8 -39
- package/lib/components/Navbar/variables.js +2 -2
- package/lib/components/PageActions/PageActions.d.ts +6 -0
- package/lib/components/PageActions/PageActions.js +104 -0
- package/lib/components/PageActions/PageActionsMenuItem.d.ts +7 -0
- package/lib/components/PageActions/PageActionsMenuItem.js +58 -0
- package/lib/components/PageActions/variables.d.ts +1 -0
- package/lib/components/PageActions/variables.dark.d.ts +1 -0
- package/lib/components/PageActions/variables.dark.js +9 -0
- package/lib/components/PageActions/variables.js +37 -0
- package/lib/components/TableOfContent/TableOfContent.js +15 -12
- package/lib/components/Tags/CounterTag.d.ts +1 -1
- package/lib/components/Tags/HttpTag.d.ts +1 -1
- package/lib/core/constants/common.d.ts +4 -0
- package/lib/core/constants/common.js +5 -1
- package/lib/core/contexts/CodeSnippetContext.d.ts +7 -0
- package/lib/core/contexts/CodeSnippetContext.js +23 -0
- package/lib/core/contexts/index.d.ts +1 -0
- package/lib/core/contexts/index.js +1 -0
- package/lib/core/hooks/__mocks__/use-theme-hooks.d.ts +1 -0
- package/lib/core/hooks/__mocks__/use-theme-hooks.js +1 -0
- package/lib/core/hooks/code-walkthrough/use-renderable-files.d.ts +1 -2
- package/lib/core/hooks/code-walkthrough/use-renderable-files.js +2 -2
- package/lib/core/hooks/index.d.ts +1 -0
- package/lib/core/hooks/index.js +1 -0
- package/lib/core/hooks/use-active-heading.d.ts +7 -2
- package/lib/core/hooks/use-active-heading.js +160 -23
- package/lib/core/hooks/use-codeblock-tabs-controls.d.ts +2 -2
- package/lib/core/hooks/use-codeblock-tabs-controls.js +6 -6
- package/lib/core/hooks/use-local-state.d.ts +1 -0
- package/lib/core/hooks/use-local-state.js +32 -0
- package/lib/core/hooks/use-page-actions.d.ts +2 -0
- package/lib/core/hooks/use-page-actions.js +101 -0
- package/lib/core/hooks/use-theme-hooks.js +2 -0
- package/lib/core/styles/dark.js +2 -0
- package/lib/core/styles/global.js +2 -0
- package/lib/core/types/hooks.d.ts +2 -1
- package/lib/core/types/index.d.ts +1 -0
- package/lib/core/types/index.js +1 -0
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/core/types/page-actions.d.ts +15 -0
- package/lib/core/types/page-actions.js +3 -0
- package/lib/core/types/sidebar.d.ts +1 -0
- package/lib/core/utils/enhanced-smoothstep.d.ts +5 -0
- package/lib/core/utils/enhanced-smoothstep.js +15 -0
- package/lib/core/utils/get-file-icon.d.ts +3 -2
- package/lib/core/utils/get-file-icon.js +109 -29
- package/lib/core/utils/icon-resolver.d.ts +28 -0
- package/lib/core/utils/icon-resolver.js +52 -0
- package/lib/core/utils/index.d.ts +4 -1
- package/lib/core/utils/index.js +4 -1
- package/lib/core/utils/lang-to-name.d.ts +1 -0
- package/lib/core/utils/lang-to-name.js +37 -0
- package/lib/core/utils/{text-transform.js → string.js} +1 -1
- package/lib/ext/configure.d.ts +1 -1
- package/lib/icons/CDNIcon/CDNIcon.d.ts +14 -0
- package/lib/icons/CDNIcon/CDNIcon.js +48 -0
- package/lib/icons/ChatGptIcon/ChatGptIcon.d.ts +9 -0
- package/lib/icons/ChatGptIcon/ChatGptIcon.js +22 -0
- package/lib/icons/CheckmarkOutlineIcon/CheckmarkOutlineIcon.d.ts +9 -0
- package/lib/icons/CheckmarkOutlineIcon/CheckmarkOutlineIcon.js +23 -0
- package/lib/icons/ClaudeIcon/ClaudeIcon.d.ts +9 -0
- package/lib/icons/ClaudeIcon/ClaudeIcon.js +22 -0
- package/lib/icons/GenericIcon/GenericIcon.d.ts +11 -0
- package/lib/icons/GenericIcon/GenericIcon.js +61 -0
- package/lib/icons/MarkdownFullIcon/MarkdownFullIcon.d.ts +9 -0
- package/lib/icons/MarkdownFullIcon/MarkdownFullIcon.js +23 -0
- package/lib/icons/NoneIcon/NoneIcon.d.ts +9 -0
- package/lib/icons/NoneIcon/NoneIcon.js +17 -0
- package/lib/icons/types.d.ts +6 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.js +6 -0
- package/lib/layouts/CodeWalkthroughLayout.js +2 -2
- package/lib/layouts/DocumentationLayout.js +14 -10
- package/lib/markdoc/components/Cards/CardIcon.js +7 -19
- package/lib/markdoc/components/CodeGroup/CodeGroup.d.ts +4 -0
- package/lib/markdoc/components/CodeGroup/CodeGroup.js +72 -0
- package/lib/markdoc/components/CodeWalkthrough/CodePanelHeader.js +7 -4
- package/lib/markdoc/components/Heading/Heading.d.ts +2 -1
- package/lib/markdoc/components/Heading/Heading.js +21 -3
- package/lib/markdoc/components/Icon/Icon.d.ts +3 -0
- package/lib/markdoc/components/Icon/Icon.js +29 -0
- package/lib/markdoc/components/Tabs/Tab.d.ts +2 -1
- package/lib/markdoc/components/Tabs/Tab.js +5 -2
- package/lib/markdoc/components/Tabs/Tabs.d.ts +1 -1
- package/lib/markdoc/components/Tabs/variables.js +2 -0
- package/lib/markdoc/components/default.d.ts +2 -0
- package/lib/markdoc/components/default.js +2 -0
- package/lib/markdoc/default.js +4 -0
- package/lib/markdoc/tags/card.js +1 -1
- package/lib/markdoc/tags/code-group.d.ts +2 -0
- package/lib/markdoc/tags/code-group.js +23 -0
- package/lib/markdoc/tags/code-snippet.js +1 -1
- package/lib/markdoc/tags/icon.d.ts +2 -0
- package/lib/markdoc/tags/icon.js +16 -0
- package/lib/markdoc/tags/tab.js +1 -0
- package/package.json +3 -3
- package/src/components/Button/Button.tsx +3 -2
- package/src/components/Button/ButtonGroup.tsx +53 -0
- package/src/components/Button/variables.ts +32 -5
- package/src/components/Catalog/Catalog.tsx +1 -1
- package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +1 -1
- package/src/components/Catalog/CatalogSelector.tsx +3 -1
- package/src/components/Catalog/CatalogViewModeToggle.tsx +1 -1
- package/src/components/CodeBlock/CodeBlock.tsx +14 -5
- package/src/components/CodeBlock/CodeBlockControls.tsx +14 -6
- package/src/components/CodeBlock/CodeBlockDropdown.tsx +53 -0
- package/src/components/CodeBlock/CodeBlockTabs.tsx +29 -20
- package/src/components/CodeBlock/variables.ts +1 -1
- package/src/components/Dropdown/Dropdown.tsx +1 -0
- package/src/components/Dropdown/DropdownMenu.tsx +4 -0
- package/src/components/Dropdown/variables.ts +1 -0
- package/src/components/Footer/FooterItem.tsx +5 -12
- package/src/components/Footer/variables.ts +2 -2
- package/src/components/Markdown/Markdown.tsx +3 -3
- package/src/components/Markdown/styles/headingAnchor.ts +0 -1
- package/src/components/Menu/MenuItem.tsx +5 -5
- package/src/components/Menu/variables.ts +1 -1
- package/src/components/Navbar/NavbarItem.tsx +8 -17
- package/src/components/Navbar/variables.ts +2 -2
- package/src/components/PageActions/PageActions.tsx +110 -0
- package/src/components/PageActions/PageActionsMenuItem.tsx +73 -0
- package/src/components/PageActions/variables.dark.ts +6 -0
- package/src/components/PageActions/variables.ts +34 -0
- package/src/components/TableOfContent/TableOfContent.tsx +33 -36
- package/src/core/constants/common.ts +4 -0
- package/src/core/contexts/CodeSnippetContext.tsx +31 -0
- package/src/core/contexts/index.ts +1 -0
- package/src/core/hooks/__mocks__/use-theme-hooks.ts +1 -0
- package/src/core/hooks/code-walkthrough/use-renderable-files.ts +3 -4
- package/src/core/hooks/index.ts +1 -0
- package/src/core/hooks/use-active-heading.ts +199 -28
- package/src/core/hooks/use-codeblock-tabs-controls.ts +8 -8
- package/src/core/hooks/use-local-state.ts +30 -0
- package/src/core/hooks/use-page-actions.ts +115 -0
- package/src/core/hooks/use-theme-hooks.ts +2 -0
- package/src/core/styles/dark.ts +2 -1
- package/src/core/styles/global.ts +2 -0
- package/src/core/types/hooks.ts +2 -0
- package/src/core/types/index.ts +1 -0
- package/src/core/types/l10n.ts +12 -0
- package/src/core/types/page-actions.ts +18 -0
- package/src/core/types/sidebar.ts +1 -0
- package/src/core/utils/enhanced-smoothstep.ts +14 -0
- package/src/core/utils/get-file-icon.tsx +94 -0
- package/src/core/utils/icon-resolver.ts +57 -0
- package/src/core/utils/index.ts +4 -1
- package/src/core/utils/lang-to-name.ts +35 -0
- package/src/ext/configure.ts +1 -1
- package/src/icons/CDNIcon/CDNIcon.tsx +47 -0
- package/src/icons/ChatGptIcon/ChatGptIcon.tsx +23 -0
- package/src/icons/CheckmarkOutlineIcon/CheckmarkOutlineIcon.tsx +24 -0
- package/src/icons/ClaudeIcon/ClaudeIcon.tsx +23 -0
- package/src/icons/GenericIcon/GenericIcon.tsx +69 -0
- package/src/icons/MarkdownFullIcon/MarkdownFullIcon.tsx +24 -0
- package/src/icons/NoneIcon/NoneIcon.tsx +17 -0
- package/src/icons/types.ts +7 -0
- package/src/index.ts +6 -0
- package/src/layouts/CodeWalkthroughLayout.tsx +1 -1
- package/src/layouts/DocumentationLayout.tsx +23 -13
- package/src/markdoc/components/Cards/CardIcon.tsx +6 -21
- package/src/markdoc/components/CodeGroup/CodeGroup.tsx +78 -0
- package/src/markdoc/components/CodeWalkthrough/CodePanelHeader.tsx +7 -4
- package/src/markdoc/components/Heading/Heading.tsx +22 -3
- package/src/markdoc/components/Icon/Icon.tsx +16 -0
- package/src/markdoc/components/Tabs/Tab.tsx +6 -1
- package/src/markdoc/components/Tabs/Tabs.tsx +1 -1
- package/src/markdoc/components/Tabs/variables.ts +2 -0
- package/src/markdoc/components/default.ts +2 -0
- package/src/markdoc/default.ts +4 -0
- package/src/markdoc/tags/card.ts +1 -1
- package/src/markdoc/tags/code-group.ts +21 -0
- package/src/markdoc/tags/code-snippet.ts +1 -1
- package/src/markdoc/tags/icon.ts +14 -0
- package/src/markdoc/tags/tab.ts +1 -0
- package/src/core/utils/get-file-icon.ts +0 -42
- /package/lib/core/utils/{text-transform.d.ts → string.d.ts} +0 -0
- /package/src/core/utils/{text-transform.ts → string.ts} +0 -0
|
@@ -36,6 +36,7 @@ const constants_1 = require("../../core/constants");
|
|
|
36
36
|
const utils_1 = require("../../core/utils");
|
|
37
37
|
const ArrowRightIcon_1 = require("../../icons/ArrowRightIcon/ArrowRightIcon");
|
|
38
38
|
const Badge_1 = require("../../components/Badge/Badge");
|
|
39
|
+
const GenericIcon_1 = require("../../icons/GenericIcon/GenericIcon");
|
|
39
40
|
function MenuItem(props) {
|
|
40
41
|
var _a;
|
|
41
42
|
const { item, depth, className, onClick } = props;
|
|
@@ -75,7 +76,7 @@ function MenuItem(props) {
|
|
|
75
76
|
const httpColor = item.deprecated ? 'http-deprecated' : item.httpVerb;
|
|
76
77
|
const label = item.label && (react_1.default.createElement(MenuItemLabelWrapper, { active: item.active, deprecated: item.deprecated, depth: depth, withChevron: hasChevron, isSeparator: isSeparator, onClick: handleOnClick, onKeyDown: handleExpandOnEnter, ref: labelRef, role: item.link ? 'none' : 'link', tabIndex: !item.link ? 0 : undefined, "data-testid": "menu-item-label" },
|
|
77
78
|
hasChevron ? react_1.default.createElement(ChevronWrapper, null, chevron) : null,
|
|
78
|
-
|
|
79
|
+
react_1.default.createElement(MenuItemIcon, { icon: item.icon, srcSet: item.srcSet }),
|
|
79
80
|
react_1.default.createElement(MenuItemLabelTextWrapper, null,
|
|
80
81
|
react_1.default.createElement(MenuItemLabel, null,
|
|
81
82
|
react_1.default.createElement("span", null, translate(item.labelTranslationKey, item.label)), (_a = item.badges) === null || _a === void 0 ? void 0 :
|
|
@@ -240,11 +241,10 @@ const MenuItemSubLabel = styled_components_1.default.div `
|
|
|
240
241
|
font-size: var(--menu-item-sublabel-font-size);
|
|
241
242
|
font-family: var(--menu-item-sublabel-font-family);
|
|
242
243
|
`;
|
|
243
|
-
const MenuItemIcon = styled_components_1.default.
|
|
244
|
-
width: var(--menu-item-icon-size);
|
|
245
|
-
height: var(--menu-item-icon-size);
|
|
244
|
+
const MenuItemIcon = (0, styled_components_1.default)(GenericIcon_1.GenericIcon) `
|
|
245
|
+
--icon-width: var(--menu-item-icon-size);
|
|
246
|
+
--icon-height: var(--menu-item-icon-size);
|
|
246
247
|
margin: var(--menu-item-icon-margin);
|
|
247
|
-
border-radius: var(--menu-item-icon-border-radius);
|
|
248
248
|
flex-shrink: 0;
|
|
249
249
|
overflow: hidden;
|
|
250
250
|
`;
|
|
@@ -71,7 +71,7 @@ exports.menu = (0, styled_components_1.css) `
|
|
|
71
71
|
* @tokens Menu item icons
|
|
72
72
|
*/
|
|
73
73
|
--menu-item-icon-size: var(--spacing-base);
|
|
74
|
-
--menu-item-icon-margin:
|
|
74
|
+
--menu-item-icon-margin: 0 var(--spacing-xxs) 0 0;
|
|
75
75
|
--menu-item-icon-border-radius: 100%;
|
|
76
76
|
|
|
77
77
|
--menu-item-external-icon-size: 10px;
|
|
@@ -1,34 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
28
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
6
|
exports.NavbarItem = NavbarItem;
|
|
30
7
|
const react_1 = __importDefault(require("react"));
|
|
31
|
-
const styled_components_1 =
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
32
9
|
const react_router_dom_1 = require("react-router-dom");
|
|
33
10
|
const DropdownMenu_1 = require("../../components/Dropdown/DropdownMenu");
|
|
34
11
|
const DropdownMenuItem_1 = require("../../components/Dropdown/DropdownMenuItem");
|
|
@@ -37,6 +14,7 @@ const hooks_1 = require("../../core/hooks");
|
|
|
37
14
|
const LaunchIcon_1 = require("../../icons/LaunchIcon/LaunchIcon");
|
|
38
15
|
const Link_1 = require("../../components/Link/Link");
|
|
39
16
|
const Dropdown_1 = require("../../components/Dropdown/Dropdown");
|
|
17
|
+
const GenericIcon_1 = require("../../icons/GenericIcon/GenericIcon");
|
|
40
18
|
function NavbarItem({ navItem, className }) {
|
|
41
19
|
const { pathname } = (0, react_router_dom_1.useLocation)();
|
|
42
20
|
const { useTranslate, useL10nConfig, useTelemetry } = (0, hooks_1.useThemeHooks)();
|
|
@@ -50,7 +28,7 @@ function NavbarItem({ navItem, className }) {
|
|
|
50
28
|
const isActive = pathname ===
|
|
51
29
|
(0, utils_1.withPathPrefix)((0, utils_1.getPathnameForLocale)(normalizedPath, defaultLocale, currentLocale, locales));
|
|
52
30
|
const itemContent = (react_1.default.createElement(NavbarMenuItem, { as: item.link ? Link_1.Link : undefined, active: isActive, className: className, onClick: () => telemetry.send({ type: 'navbar.menu_item_clicked', payload: { type: item.type } }), external: item.external, target: item.target, to: item.link },
|
|
53
|
-
react_1.default.createElement(NavbarIcon, {
|
|
31
|
+
react_1.default.createElement(NavbarIcon, { icon: item.icon, srcSet: item.srcSet }),
|
|
54
32
|
react_1.default.createElement(NavbarLabel, { "data-translation-key": item.labelTranslationKey }, translate(item.labelTranslationKey, item.label)),
|
|
55
33
|
item.external ? react_1.default.createElement(ExternalLinkIcon, { size: "10px" }) : null));
|
|
56
34
|
if (navItem.items) {
|
|
@@ -60,7 +38,7 @@ function NavbarItem({ navItem, className }) {
|
|
|
60
38
|
if (item.type !== 'link' && item.type !== 'separator')
|
|
61
39
|
return null;
|
|
62
40
|
return (react_1.default.createElement(DropdownMenuItem_1.DropdownMenuItem, { key: `${item.label}_${index}`, to: item.link, separator: item.type === 'separator', separatorLine: item.separatorLine, "data-translation-key": item.labelTranslationKey, external: item.external },
|
|
63
|
-
react_1.default.createElement(NavbarIcon, {
|
|
41
|
+
react_1.default.createElement(NavbarIcon, { icon: item.icon, srcSet: item.srcSet }),
|
|
64
42
|
react_1.default.createElement(NavbarLabel, { "data-translation-key": item.labelTranslationKey }, translate(item.labelTranslationKey, item.label)),
|
|
65
43
|
item.external ? react_1.default.createElement(ExternalLinkIcon, { size: "10px" }) : null));
|
|
66
44
|
});
|
|
@@ -100,19 +78,10 @@ const NavbarLabel = styled_components_1.default.span `
|
|
|
100
78
|
cursor: pointer;
|
|
101
79
|
vertical-align: middle;
|
|
102
80
|
`;
|
|
103
|
-
const NavbarIcon = styled_components_1.default.
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
width: var(--navbar-item-icon-width);
|
|
108
|
-
height: var(--navbar-item-icon-height);
|
|
109
|
-
display: inline-block;
|
|
110
|
-
background-size: contain;
|
|
111
|
-
margin-right: var(--navbar-item-icon-margin-right);
|
|
112
|
-
vertical-align: middle;
|
|
113
|
-
background-position: center;
|
|
114
|
-
background-repeat: no-repeat;
|
|
115
|
-
`}
|
|
81
|
+
const NavbarIcon = (0, styled_components_1.default)(GenericIcon_1.GenericIcon) `
|
|
82
|
+
--icon-width: var(--navbar-item-icon-width);
|
|
83
|
+
--icon-height: var(--navbar-item-icon-height);
|
|
84
|
+
margin-right: var(--navbar-item-icon-margin-right);
|
|
116
85
|
`;
|
|
117
86
|
const ExternalLinkIcon = (0, styled_components_1.default)(LaunchIcon_1.LaunchIcon) `
|
|
118
87
|
margin-left: 5px;
|
|
@@ -37,8 +37,8 @@ exports.navbar = (0, styled_components_1.css) `
|
|
|
37
37
|
--navbar-item-bg-color-hover: var(--bg-color);
|
|
38
38
|
--navbar-item-bottom-border-hover: none;
|
|
39
39
|
|
|
40
|
-
--navbar-item-icon-width: 1.
|
|
41
|
-
--navbar-item-icon-height: 1.
|
|
40
|
+
--navbar-item-icon-width: 1.25em; // @presenter Spacing
|
|
41
|
+
--navbar-item-icon-height: 1.25em; // @presenter Spacing
|
|
42
42
|
--navbar-item-icon-margin-right: 0.5em; // @presenter Spacing
|
|
43
43
|
|
|
44
44
|
--navbar-logo-height: var(--logo-height);
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.PageActions = PageActions;
|
|
39
|
+
const react_1 = __importStar(require("react"));
|
|
40
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
41
|
+
const PageActionsMenuItem_1 = require("../../components/PageActions/PageActionsMenuItem");
|
|
42
|
+
const Link_1 = require("../../components/Link/Link");
|
|
43
|
+
const ButtonGroup_1 = require("../../components/Button/ButtonGroup");
|
|
44
|
+
const Button_1 = require("../../components/Button/Button");
|
|
45
|
+
const Dropdown_1 = require("../../components/Dropdown/Dropdown");
|
|
46
|
+
const DropdownMenu_1 = require("../../components/Dropdown/DropdownMenu");
|
|
47
|
+
const Spinner_1 = require("../../icons/Spinner/Spinner");
|
|
48
|
+
const CheckmarkFilledIcon_1 = require("../../icons/CheckmarkFilledIcon/CheckmarkFilledIcon");
|
|
49
|
+
const hooks_1 = require("../../core/hooks");
|
|
50
|
+
const ACTION_DONE_DISPLAY_DURATION = 1000;
|
|
51
|
+
function PageActions(props) {
|
|
52
|
+
const { pageSlug } = props;
|
|
53
|
+
const actions = (0, hooks_1.usePageActions)(pageSlug || '/');
|
|
54
|
+
const [actionState, setActionState] = (0, react_1.useState)('idle');
|
|
55
|
+
if (!actions.length) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
const buttonAction = actions[0];
|
|
59
|
+
const handleActionClick = (action) => __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
if (!('onClick' in action)) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
setActionState('processing');
|
|
64
|
+
yield action.onClick();
|
|
65
|
+
setActionState('done');
|
|
66
|
+
setTimeout(() => {
|
|
67
|
+
setActionState('idle');
|
|
68
|
+
}, ACTION_DONE_DISPLAY_DURATION);
|
|
69
|
+
});
|
|
70
|
+
const menuItems = actions.map((action) => ({
|
|
71
|
+
content: 'link' in action ? (react_1.default.createElement(LinkMenuItem, { to: action.link, external: true },
|
|
72
|
+
react_1.default.createElement(PageActionsMenuItem_1.PageActionsMenuItem, { pageAction: action }))) : (react_1.default.createElement(PageActionsMenuItem_1.PageActionsMenuItem, { pageAction: action })),
|
|
73
|
+
onAction: 'onClick' in action ? () => handleActionClick(action) : undefined,
|
|
74
|
+
}));
|
|
75
|
+
return (react_1.default.createElement(PageActionsWrapper, null,
|
|
76
|
+
react_1.default.createElement(ButtonGroup_1.ButtonGroup, { variant: "outlined", size: "medium" },
|
|
77
|
+
react_1.default.createElement(Button_1.Button, { icon: renderIcon(buttonAction, actionState), to: 'link' in buttonAction ? buttonAction.link : undefined, external: true, onClick: () => handleActionClick(buttonAction) }, buttonAction.buttonText),
|
|
78
|
+
actions.length > 1 ? (react_1.default.createElement(Dropdown_1.Dropdown, { withArrow: true, trigger: react_1.default.createElement(Button_1.Button, null), placement: "bottom", alignment: "end" },
|
|
79
|
+
react_1.default.createElement(DropdownMenu_1.DropdownMenu, { items: menuItems }))) : null)));
|
|
80
|
+
}
|
|
81
|
+
function renderIcon(buttonAction, actionState) {
|
|
82
|
+
switch (actionState) {
|
|
83
|
+
case 'processing':
|
|
84
|
+
return react_1.default.createElement(Spinner_1.Spinner, { color: "var(--page-actions-processing-icon-color)" });
|
|
85
|
+
case 'done':
|
|
86
|
+
return react_1.default.createElement(CheckmarkFilledIcon_1.CheckmarkFilledIcon, { color: "var(--page-actions-done-icon-color)" });
|
|
87
|
+
default:
|
|
88
|
+
return react_1.default.createElement(buttonAction.iconComponent, null);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
const PageActionsWrapper = styled_components_1.default.div `
|
|
92
|
+
margin-left: auto;
|
|
93
|
+
padding-left: var(--page-actions-padding-left);
|
|
94
|
+
--button-color: var(--page-actions-button-text-color);
|
|
95
|
+
|
|
96
|
+
.button-group-size-medium .button.button-size-medium {
|
|
97
|
+
--button-icon-left-padding: var(--page-actions-button-padding);
|
|
98
|
+
}
|
|
99
|
+
`;
|
|
100
|
+
const LinkMenuItem = (0, styled_components_1.default)(Link_1.Link) `
|
|
101
|
+
text-decoration: none;
|
|
102
|
+
--link-decoration-hover: none;
|
|
103
|
+
`;
|
|
104
|
+
//# sourceMappingURL=PageActions.js.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PageActionsMenuItem = PageActionsMenuItem;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const LaunchIcon_1 = require("../../icons/LaunchIcon/LaunchIcon");
|
|
10
|
+
function PageActionsMenuItem(props) {
|
|
11
|
+
const { pageAction } = props;
|
|
12
|
+
return (react_1.default.createElement(MenuItemWrapper, { "data-component-name": "PageActions/PageActionsMenuItem" },
|
|
13
|
+
react_1.default.createElement(IconWrapper, null,
|
|
14
|
+
react_1.default.createElement(pageAction.iconComponent, null)),
|
|
15
|
+
react_1.default.createElement(ContentWrapper, null,
|
|
16
|
+
react_1.default.createElement(Title, null,
|
|
17
|
+
pageAction.title,
|
|
18
|
+
'link' in pageAction ? (react_1.default.createElement(LaunchIcon_1.LaunchIcon, { color: "var(--page-actions-menu-item-title-icon-color)", size: "14px" })) : null),
|
|
19
|
+
react_1.default.createElement(Description, null, pageAction.description))));
|
|
20
|
+
}
|
|
21
|
+
const MenuItemWrapper = styled_components_1.default.div `
|
|
22
|
+
padding: var(--page-actions-menu-item-padding);
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: row;
|
|
25
|
+
align-items: center;
|
|
26
|
+
gap: var(--page-actions-menu-item-gap);
|
|
27
|
+
`;
|
|
28
|
+
const IconWrapper = styled_components_1.default.div `
|
|
29
|
+
color: var(--page-actions-menu-item-icon-color);
|
|
30
|
+
border: 1px solid var(--page-actions-menu-item-icon-border-color);
|
|
31
|
+
border-radius: var(--page-actions-menu-item-icon-border-radius);
|
|
32
|
+
width: var(--page-actions-menu-item-icon-wrapper-size);
|
|
33
|
+
height: var(--page-actions-menu-item-icon-wrapper-size);
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
justify-content: center;
|
|
37
|
+
`;
|
|
38
|
+
const ContentWrapper = styled_components_1.default.div `
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
gap: var(--page-actions-menu-item-text-gap);
|
|
42
|
+
`;
|
|
43
|
+
const Title = styled_components_1.default.div `
|
|
44
|
+
font-weight: var(--page-actions-menu-item-title-font-weight);
|
|
45
|
+
font-size: var(--page-actions-menu-item-title-font-size);
|
|
46
|
+
line-height: var(--page-actions-menu-item-title-line-height);
|
|
47
|
+
color: var(--page-actions-menu-item-title-color);
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
gap: var(--page-actions-menu-item-title-icon-gap);
|
|
51
|
+
`;
|
|
52
|
+
const Description = styled_components_1.default.div `
|
|
53
|
+
font-weight: var(--page-actions-menu-item-description-font-weight);
|
|
54
|
+
font-size: var(--page-actions-menu-item-description-font-size);
|
|
55
|
+
line-height: var(--page-actions-menu-item-description-line-height);
|
|
56
|
+
color: var(--page-actions-menu-item-description-color);
|
|
57
|
+
`;
|
|
58
|
+
//# sourceMappingURL=PageActionsMenuItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const pageActions: import("styled-components").FlattenSimpleInterpolation;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const pageActionsDarkMode: import("styled-components").FlattenSimpleInterpolation;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pageActionsDarkMode = void 0;
|
|
4
|
+
const styled_components_1 = require("styled-components");
|
|
5
|
+
exports.pageActionsDarkMode = (0, styled_components_1.css) `
|
|
6
|
+
--page-actions-menu-item-icon-border-color: var(--color-warm-grey-5);
|
|
7
|
+
--page-actions-menu-item-description-color: var(--text-color-secondary);
|
|
8
|
+
`;
|
|
9
|
+
//# sourceMappingURL=variables.dark.js.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pageActions = void 0;
|
|
4
|
+
const styled_components_1 = require("styled-components");
|
|
5
|
+
exports.pageActions = (0, styled_components_1.css) `
|
|
6
|
+
/* Minimum spacing between page actions and heading text */
|
|
7
|
+
--page-actions-padding-left: var(--spacing-sm);
|
|
8
|
+
|
|
9
|
+
--page-actions-button-text-color: var(--text-color-secondary);
|
|
10
|
+
--page-actions-button-padding: 5px 14px 5px var(--spacing-sm);
|
|
11
|
+
|
|
12
|
+
--page-actions-menu-item-padding: 3px 0;
|
|
13
|
+
--page-actions-menu-item-gap: var(--spacing-xs);
|
|
14
|
+
--page-actions-menu-item-icon-color: var(--icon-color-secondary);
|
|
15
|
+
--page-actions-menu-item-icon-border-color: var(--color-warm-grey-3);
|
|
16
|
+
--page-actions-menu-item-icon-border-radius: var(--border-radius);
|
|
17
|
+
--page-actions-menu-item-icon-wrapper-size: 28px;
|
|
18
|
+
|
|
19
|
+
--page-actions-menu-item-text-gap: 2px;
|
|
20
|
+
|
|
21
|
+
--page-actions-menu-item-title-font-weight: var(--font-weight-regular);
|
|
22
|
+
--page-actions-menu-item-title-font-size: var(--font-size-base);
|
|
23
|
+
--page-actions-menu-item-title-line-height: var(--line-height-base);
|
|
24
|
+
--page-actions-menu-item-title-color: var(--text-color-secondary);
|
|
25
|
+
|
|
26
|
+
--page-actions-menu-item-title-icon-gap: var(--spacing-xxs);
|
|
27
|
+
--page-actions-menu-item-title-icon-color: var(--icon-color-secondary);
|
|
28
|
+
|
|
29
|
+
--page-actions-menu-item-description-font-weight: var(--font-weight-regular);
|
|
30
|
+
--page-actions-menu-item-description-font-size: var(--font-size-sm);
|
|
31
|
+
--page-actions-menu-item-description-line-height: var(--line-height-sm);
|
|
32
|
+
--page-actions-menu-item-description-color: var(--text-color-description);
|
|
33
|
+
|
|
34
|
+
--page-actions-processing-icon-color: var(--icon-color-interactive);
|
|
35
|
+
--page-actions-done-icon-color: var(--color-success-base);
|
|
36
|
+
`;
|
|
37
|
+
//# sourceMappingURL=variables.js.map
|
|
@@ -41,21 +41,24 @@ function TableOfContent(props) {
|
|
|
41
41
|
const { markdown: { toc = {} } = {} } = (0, hooks_1.useThemeConfig)();
|
|
42
42
|
const displayedHeadings = (0, utils_1.getDisplayedHeadings)(headings, toc.depth || 3);
|
|
43
43
|
const leastDepth = (0, utils_1.getLeastDepth)(displayedHeadings);
|
|
44
|
-
const
|
|
44
|
+
const { heading: activeHeading, handleHeadingClick } = (0, hooks_1.useActiveHeading)(contentWrapper, displayedHeadings);
|
|
45
45
|
if (toc === null || toc === void 0 ? void 0 : toc.hide) {
|
|
46
46
|
return null;
|
|
47
47
|
}
|
|
48
|
-
return (React.createElement(
|
|
49
|
-
React.createElement(
|
|
50
|
-
React.createElement(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
48
|
+
return (React.createElement(TableOfContentMenu, { "data-component-name": "TableOfContent/TableOfContent", className: className },
|
|
49
|
+
React.createElement(TableOfContentItems, { ref: sidebar },
|
|
50
|
+
displayedHeadings.length ? (React.createElement(TableOfContentHeader, { "data-translation-key": "toc.header" }, translate('toc.header', toc.header || 'On this page'))) : null,
|
|
51
|
+
displayedHeadings.map((heading, idx) => {
|
|
52
|
+
if (!heading) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
const href = '#' + heading.id;
|
|
56
|
+
return (React.createElement(TableOfContentMenuItem, { key: href + idx, href: href, depth: heading.depth - leastDepth + 1 || 0, className: activeHeading === heading.id ? 'active' : '', dangerouslySetInnerHTML: { __html: heading.value || '' }, "data-testid": `toc-${heading.value}`, onClick: (e) => {
|
|
57
|
+
e.preventDefault();
|
|
58
|
+
telemetry.send({ type: 'toc_item.clicked' });
|
|
59
|
+
handleHeadingClick(heading.id);
|
|
60
|
+
} }));
|
|
61
|
+
}))));
|
|
59
62
|
}
|
|
60
63
|
const TableOfContentMenu = styled_components_1.default.aside `
|
|
61
64
|
background-color: var(--toc-bg-color);
|
|
@@ -2,4 +2,4 @@ import { Tag } from '../../components/Tag/Tag';
|
|
|
2
2
|
export declare const CounterTag: import("styled-components").StyledComponent<typeof Tag, any, {
|
|
3
3
|
className: "tag-counter";
|
|
4
4
|
'data-component-name': string;
|
|
5
|
-
}, "data-component-name"
|
|
5
|
+
}, "className" | "data-component-name">;
|
|
@@ -2,4 +2,4 @@ import { Tag } from '../../components/Tag/Tag';
|
|
|
2
2
|
export declare const HttpTag: import("styled-components").StyledComponent<typeof Tag, any, {
|
|
3
3
|
className: "tag-http";
|
|
4
4
|
'data-component-name': string;
|
|
5
|
-
}, "data-component-name"
|
|
5
|
+
}, "className" | "data-component-name">;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export { REDOCLY_TEAMS_RBAC } from '@redocly/config';
|
|
2
2
|
export declare const DEFAULT_LOCALE_PLACEHOLDER = "default_locale";
|
|
3
3
|
export declare const CONTENT_ID = "content";
|
|
4
|
+
export declare const ICONS_CDN_URL: {
|
|
5
|
+
'font-awesome': string;
|
|
6
|
+
code: string;
|
|
7
|
+
};
|
|
4
8
|
export declare enum FEEDBACK_TYPES {
|
|
5
9
|
RATING = "rating",
|
|
6
10
|
SENTIMENT = "sentiment",
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MobileMenuType = exports.MenuItemType = exports.DEFAULT_FEEDBACK_TYPE = exports.FEEDBACK_TYPES = exports.CONTENT_ID = exports.DEFAULT_LOCALE_PLACEHOLDER = exports.REDOCLY_TEAMS_RBAC = void 0;
|
|
3
|
+
exports.MobileMenuType = exports.MenuItemType = exports.DEFAULT_FEEDBACK_TYPE = exports.FEEDBACK_TYPES = exports.ICONS_CDN_URL = exports.CONTENT_ID = exports.DEFAULT_LOCALE_PLACEHOLDER = exports.REDOCLY_TEAMS_RBAC = void 0;
|
|
4
4
|
var config_1 = require("@redocly/config");
|
|
5
5
|
Object.defineProperty(exports, "REDOCLY_TEAMS_RBAC", { enumerable: true, get: function () { return config_1.REDOCLY_TEAMS_RBAC; } });
|
|
6
6
|
exports.DEFAULT_LOCALE_PLACEHOLDER = 'default_locale';
|
|
7
7
|
exports.CONTENT_ID = 'content';
|
|
8
|
+
exports.ICONS_CDN_URL = {
|
|
9
|
+
'font-awesome': 'https://cdn.redocly.com/icons/fa/7.0.0',
|
|
10
|
+
code: 'https://cdn.redocly.com/icons/code/5.24.0',
|
|
11
|
+
};
|
|
8
12
|
var FEEDBACK_TYPES;
|
|
9
13
|
(function (FEEDBACK_TYPES) {
|
|
10
14
|
FEEDBACK_TYPES["RATING"] = "rating";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type CodeSnippetContextType = {
|
|
2
|
+
activeSnippetName: string;
|
|
3
|
+
setActiveSnippetName: (name: string) => void;
|
|
4
|
+
};
|
|
5
|
+
export declare const CODE_GROUP_SNIPPET_NAME_KEY = "redocly:codeGroupSnippetName";
|
|
6
|
+
export declare const CodeSnippetContext: import("react").Context<CodeSnippetContextType | null>;
|
|
7
|
+
export declare function useActiveCodeSnippetName(mode: 'tabs' | 'dropdown'): [string, (name: string) => void];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CodeSnippetContext = exports.CODE_GROUP_SNIPPET_NAME_KEY = void 0;
|
|
4
|
+
exports.useActiveCodeSnippetName = useActiveCodeSnippetName;
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
exports.CODE_GROUP_SNIPPET_NAME_KEY = 'redocly:codeGroupSnippetName';
|
|
7
|
+
exports.CodeSnippetContext = (0, react_1.createContext)(null);
|
|
8
|
+
function useActiveCodeSnippetName(mode) {
|
|
9
|
+
const context = (0, react_1.useContext)(exports.CodeSnippetContext);
|
|
10
|
+
if (!context) {
|
|
11
|
+
throw new Error('useCodeSnippetContext must be used within a CodeSnippetContext');
|
|
12
|
+
}
|
|
13
|
+
const [activeSnippetName, setActiveSnippetName] = (0, react_1.useState)(mode === 'tabs' ? '' : context.activeSnippetName);
|
|
14
|
+
if (mode === 'tabs') {
|
|
15
|
+
// use non-synced state for tabs mode
|
|
16
|
+
return [activeSnippetName, setActiveSnippetName];
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
// use global synced state for dropdown mode
|
|
20
|
+
return [context.activeSnippetName, context.setActiveSnippetName];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=CodeSnippetContext.js.map
|
|
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./ThemeDataContext"), exports);
|
|
18
18
|
__exportStar(require("./CodeWalkthrough/CodeWalkthroughControlsContext"), exports);
|
|
19
19
|
__exportStar(require("./CodeWalkthrough/CodeWalkthroughStepsContext"), exports);
|
|
20
|
+
__exportStar(require("./CodeSnippetContext"), exports);
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { CodeWalkthroughFile } from '@redocly/config';
|
|
2
|
-
import type { IconProps } from '../../../icons/types';
|
|
3
2
|
export type RenderableFile = CodeWalkthroughFile & {
|
|
4
|
-
|
|
3
|
+
fileIcon: React.JSX.Element;
|
|
5
4
|
parentFolder: string;
|
|
6
5
|
isNameDuplicate: boolean;
|
|
7
6
|
inRootDir: boolean;
|
|
@@ -10,11 +10,11 @@ function useRenderableFiles(files) {
|
|
|
10
10
|
const filePaths = files.map(({ path }) => path);
|
|
11
11
|
const rootDir = (0, find_closest_common_directory_1.findClosestCommonDirectory)(filePaths);
|
|
12
12
|
const renderableFiles = files.map((file) => {
|
|
13
|
-
const
|
|
13
|
+
const fileIcon = getFileTypeIcon(file.basename);
|
|
14
14
|
const parentFolder = file.path.split('/').slice(-2, -1)[0];
|
|
15
15
|
const isNameDuplicate = files.some((_file) => file.basename === _file.basename && file.path !== _file.path);
|
|
16
16
|
const inRootDir = file.path === `${(0, urls_1.removeLeadingSlash)(rootDir)}/${file.basename}`;
|
|
17
|
-
return Object.assign(Object.assign({}, file), {
|
|
17
|
+
return Object.assign(Object.assign({}, file), { fileIcon,
|
|
18
18
|
inRootDir,
|
|
19
19
|
parentFolder,
|
|
20
20
|
isNameDuplicate });
|
package/lib/core/hooks/index.js
CHANGED
|
@@ -56,4 +56,5 @@ __exportStar(require("./catalog/useCatalogEntities"), exports);
|
|
|
56
56
|
__exportStar(require("./use-active-page-version"), exports);
|
|
57
57
|
__exportStar(require("./use-page-versions"), exports);
|
|
58
58
|
__exportStar(require("./use-user-teams"), exports);
|
|
59
|
+
__exportStar(require("./use-page-actions"), exports);
|
|
59
60
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
1
|
+
export declare function useActiveHeading(contentElement: HTMLDivElement | null, displayedHeadings?: Array<{
|
|
2
|
+
id: string;
|
|
3
|
+
depth: number;
|
|
4
|
+
} | null>): {
|
|
5
|
+
heading: string | undefined;
|
|
6
|
+
handleHeadingClick: (headingId: string) => void;
|
|
7
|
+
};
|