@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
package/lib/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from './core';
|
|
|
2
2
|
export * from './config';
|
|
3
3
|
export * from './ext/configure';
|
|
4
4
|
export * from './components/Button/Button';
|
|
5
|
+
export * from './components/Button/ButtonGroup';
|
|
5
6
|
export * from './components/JsonViewer/JsonViewer';
|
|
6
7
|
export * from './components/Tag/Tag';
|
|
7
8
|
export * from './components/TableOfContent/TableOfContent';
|
|
@@ -23,6 +24,7 @@ export * from './components/Tags/HttpTag';
|
|
|
23
24
|
export * from './components/Tags/CounterTag';
|
|
24
25
|
export * from './components/VersionPicker/VersionPicker';
|
|
25
26
|
export * from './components/Marker/Marker';
|
|
27
|
+
export * from './components/PageActions/PageActions';
|
|
26
28
|
export * from './components/Buttons/CopyButton';
|
|
27
29
|
export * from './components/Buttons/EditPageButton';
|
|
28
30
|
export * from './components/Buttons/EmailButton';
|
|
@@ -145,7 +147,9 @@ export * from './icons/ArrowLeftIcon/ArrowLeftIcon';
|
|
|
145
147
|
export * from './icons/AddIcon/AddIcon';
|
|
146
148
|
export * from './icons/BookmarkAddIcon/BookmarkAddIcon';
|
|
147
149
|
export * from './icons/SpinnerIcon/SpinnerIcon';
|
|
150
|
+
export * from './icons/ChatGptIcon/ChatGptIcon';
|
|
148
151
|
export * from './icons/CopyIcon/CopyIcon';
|
|
152
|
+
export * from './icons/ClaudeIcon/ClaudeIcon';
|
|
149
153
|
export * from './icons/CleanIcon/CleanIcon';
|
|
150
154
|
export * from './icons/GraphqlIcon/GraphqlIcon';
|
|
151
155
|
export * from './icons/DeselectIcon/DeselectIcon';
|
|
@@ -211,6 +215,7 @@ export * from './icons/LinkIcon/LinkIcon';
|
|
|
211
215
|
export * from './icons/LaunchIcon/LaunchIcon';
|
|
212
216
|
export * from './icons/MinimizeIcon/MinimizeIcon';
|
|
213
217
|
export * from './icons/MaximizeIcon/MaximizeIcon';
|
|
218
|
+
export * from './icons/MarkdownFullIcon/MarkdownFullIcon';
|
|
214
219
|
export * from './icons/DocumentBlankIcon/DocumentBlankIcon';
|
|
215
220
|
export * from './icons/WarningSquareIcon/WarningSquareIcon';
|
|
216
221
|
export * from './icons/MenuIcon/MenuIcon';
|
|
@@ -249,6 +254,7 @@ export * from './icons/RabbitMQIcon/RabbitMQIcon';
|
|
|
249
254
|
export * from './icons/CurveAutoColonIcon/CurveAutoColonIcon';
|
|
250
255
|
export * from './icons/AiStarsIcon/AiStarsIcon';
|
|
251
256
|
export * from './icons/AiStarsGradientIcon/AiStarsGradientIcon';
|
|
257
|
+
export * from './icons/GenericIcon/GenericIcon';
|
|
252
258
|
export * from './layouts/RootLayout';
|
|
253
259
|
export * from './layouts/PageLayout';
|
|
254
260
|
export * from './layouts/NotFound';
|
package/lib/index.js
CHANGED
|
@@ -32,6 +32,7 @@ __exportStar(require("./config"), exports);
|
|
|
32
32
|
__exportStar(require("./ext/configure"), exports);
|
|
33
33
|
/* Components */
|
|
34
34
|
__exportStar(require("./components/Button/Button"), exports);
|
|
35
|
+
__exportStar(require("./components/Button/ButtonGroup"), exports);
|
|
35
36
|
__exportStar(require("./components/JsonViewer/JsonViewer"), exports);
|
|
36
37
|
__exportStar(require("./components/Tag/Tag"), exports);
|
|
37
38
|
__exportStar(require("./components/TableOfContent/TableOfContent"), exports);
|
|
@@ -53,6 +54,7 @@ __exportStar(require("./components/Tags/HttpTag"), exports);
|
|
|
53
54
|
__exportStar(require("./components/Tags/CounterTag"), exports);
|
|
54
55
|
__exportStar(require("./components/VersionPicker/VersionPicker"), exports);
|
|
55
56
|
__exportStar(require("./components/Marker/Marker"), exports);
|
|
57
|
+
__exportStar(require("./components/PageActions/PageActions"), exports);
|
|
56
58
|
/* Buttons */
|
|
57
59
|
__exportStar(require("./components/Buttons/CopyButton"), exports);
|
|
58
60
|
__exportStar(require("./components/Buttons/EditPageButton"), exports);
|
|
@@ -198,7 +200,9 @@ __exportStar(require("./icons/ArrowLeftIcon/ArrowLeftIcon"), exports);
|
|
|
198
200
|
__exportStar(require("./icons/AddIcon/AddIcon"), exports);
|
|
199
201
|
__exportStar(require("./icons/BookmarkAddIcon/BookmarkAddIcon"), exports);
|
|
200
202
|
__exportStar(require("./icons/SpinnerIcon/SpinnerIcon"), exports);
|
|
203
|
+
__exportStar(require("./icons/ChatGptIcon/ChatGptIcon"), exports);
|
|
201
204
|
__exportStar(require("./icons/CopyIcon/CopyIcon"), exports);
|
|
205
|
+
__exportStar(require("./icons/ClaudeIcon/ClaudeIcon"), exports);
|
|
202
206
|
__exportStar(require("./icons/CleanIcon/CleanIcon"), exports);
|
|
203
207
|
__exportStar(require("./icons/GraphqlIcon/GraphqlIcon"), exports);
|
|
204
208
|
__exportStar(require("./icons/DeselectIcon/DeselectIcon"), exports);
|
|
@@ -264,6 +268,7 @@ __exportStar(require("./icons/LinkIcon/LinkIcon"), exports);
|
|
|
264
268
|
__exportStar(require("./icons/LaunchIcon/LaunchIcon"), exports);
|
|
265
269
|
__exportStar(require("./icons/MinimizeIcon/MinimizeIcon"), exports);
|
|
266
270
|
__exportStar(require("./icons/MaximizeIcon/MaximizeIcon"), exports);
|
|
271
|
+
__exportStar(require("./icons/MarkdownFullIcon/MarkdownFullIcon"), exports);
|
|
267
272
|
__exportStar(require("./icons/DocumentBlankIcon/DocumentBlankIcon"), exports);
|
|
268
273
|
__exportStar(require("./icons/WarningSquareIcon/WarningSquareIcon"), exports);
|
|
269
274
|
__exportStar(require("./icons/MenuIcon/MenuIcon"), exports);
|
|
@@ -302,6 +307,7 @@ __exportStar(require("./icons/RabbitMQIcon/RabbitMQIcon"), exports);
|
|
|
302
307
|
__exportStar(require("./icons/CurveAutoColonIcon/CurveAutoColonIcon"), exports);
|
|
303
308
|
__exportStar(require("./icons/AiStarsIcon/AiStarsIcon"), exports);
|
|
304
309
|
__exportStar(require("./icons/AiStarsGradientIcon/AiStarsGradientIcon"), exports);
|
|
310
|
+
__exportStar(require("./icons/GenericIcon/GenericIcon"), exports);
|
|
305
311
|
/* Layouts */
|
|
306
312
|
__exportStar(require("./layouts/RootLayout"), exports);
|
|
307
313
|
__exportStar(require("./layouts/PageLayout"), exports);
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.CodeWalkthroughLayout = CodeWalkthroughLayout;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
-
const
|
|
9
|
+
const utils_1 = require("../core/utils");
|
|
10
10
|
function CodeWalkthroughLayout({ className, children, }) {
|
|
11
11
|
return (react_1.default.createElement(LayoutWrapper, { "data-component-name": "Layout/CodeWalkthroughLayout", className: className },
|
|
12
12
|
react_1.default.createElement(ContentWrapper, null, children)));
|
|
@@ -61,7 +61,7 @@ const ContentWrapper = styled_components_1.default.section `
|
|
|
61
61
|
/* Full-width styling for all .code-walkthroughs */
|
|
62
62
|
.code-walkthrough {
|
|
63
63
|
width: 100%;
|
|
64
|
-
max-width: ${
|
|
64
|
+
max-width: ${utils_1.breakpoints.max};
|
|
65
65
|
margin-left: auto;
|
|
66
66
|
margin-right: auto;
|
|
67
67
|
}
|
|
@@ -11,20 +11,24 @@ const utils_1 = require("../core/utils");
|
|
|
11
11
|
const PageNavigation_1 = require("../components/PageNavigation/PageNavigation");
|
|
12
12
|
const LastUpdated_1 = require("../components/LastUpdated/LastUpdated");
|
|
13
13
|
const Breadcrumbs_1 = require("../components/Breadcrumbs/Breadcrumbs");
|
|
14
|
+
const CodeSnippetContext_1 = require("../core/contexts/CodeSnippetContext");
|
|
15
|
+
const use_local_state_1 = require("../core/hooks/use-local-state");
|
|
14
16
|
function DocumentationLayout({ tableOfContent, feedback, config, editPage, lastModified, nextPage, prevPage, className, children, }) {
|
|
15
17
|
var _a;
|
|
16
18
|
const { editPage: themeEditPage } = config || {};
|
|
17
19
|
const mergedConf = editPage ? Object.assign(Object.assign({}, themeEditPage), editPage) : undefined;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
react_1.default.createElement(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
const [activeSnippetName, setActiveSnippetName] = (0, use_local_state_1.useLocalState)(CodeSnippetContext_1.CODE_GROUP_SNIPPET_NAME_KEY, '');
|
|
21
|
+
return (react_1.default.createElement(CodeSnippetContext_1.CodeSnippetContext.Provider, { value: { activeSnippetName, setActiveSnippetName } },
|
|
22
|
+
react_1.default.createElement(LayoutWrapper, { "data-component-name": "Layout/DocumentationLayout", className: className },
|
|
23
|
+
react_1.default.createElement(ContentWrapper, { withToc: !((_a = config === null || config === void 0 ? void 0 : config.toc) === null || _a === void 0 ? void 0 : _a.hide) },
|
|
24
|
+
react_1.default.createElement(Breadcrumbs, null),
|
|
25
|
+
react_1.default.createElement(LayoutTop, null,
|
|
26
|
+
lastModified && react_1.default.createElement(LastUpdated_1.LastUpdated, { lastModified: new Date(lastModified) }),
|
|
27
|
+
mergedConf && react_1.default.createElement(EditPageButton_1.EditPageButton, { to: mergedConf.to })),
|
|
28
|
+
children,
|
|
29
|
+
react_1.default.createElement(LayoutBottom, null, feedback),
|
|
30
|
+
react_1.default.createElement(PageNavigation_1.PageNavigation, { nextPage: nextPage, prevPage: prevPage })),
|
|
31
|
+
tableOfContent)));
|
|
28
32
|
}
|
|
29
33
|
const LayoutWrapper = styled_components_1.default.div.attrs(({ className }) => ({
|
|
30
34
|
className,
|
|
@@ -6,28 +6,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.CardIcon = CardIcon;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
-
const
|
|
9
|
+
const GenericIcon_1 = require("../../../icons/GenericIcon/GenericIcon");
|
|
10
10
|
function CardIcon({ variant, src, rawContent, position }) {
|
|
11
|
-
return (react_1.default.createElement(CardIconWrapper, { "$variant": variant, "$position": position },
|
|
11
|
+
return (react_1.default.createElement(CardIconWrapper, { "$variant": variant, "$position": position },
|
|
12
|
+
react_1.default.createElement(GenericIcon_1.GenericIcon, { icon: src, rawContent: rawContent })));
|
|
12
13
|
}
|
|
13
|
-
const CardImg = styled_components_1.default.img `
|
|
14
|
-
width: var(--card-icon-width);
|
|
15
|
-
height: var(--card-icon-height);
|
|
16
|
-
display: inline-block;
|
|
17
|
-
object-fit: cover;
|
|
18
|
-
`;
|
|
19
|
-
const CardSvg = (0, styled_components_1.default)(InlineSvg_1.InlineSvg) `
|
|
20
|
-
width: var(--card-icon-width);
|
|
21
|
-
height: var(--card-icon-height);
|
|
22
|
-
display: inline-block;
|
|
23
|
-
|
|
24
|
-
svg {
|
|
25
|
-
width: 100%;
|
|
26
|
-
height: 100%;
|
|
27
|
-
fill: var(--card-icon-color);
|
|
28
|
-
}
|
|
29
|
-
`;
|
|
30
14
|
const CardIconWrapper = styled_components_1.default.div `
|
|
15
|
+
--icon-width: var(--card-icon-width);
|
|
16
|
+
--icon-height: var(--card-icon-height);
|
|
17
|
+
--icon-color: var(--card-icon-color);
|
|
18
|
+
|
|
31
19
|
display: flex;
|
|
32
20
|
align-self: ${({ $position }) => ($position ? $position : 'auto')};
|
|
33
21
|
justify-content: center;
|
|
@@ -0,0 +1,72 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.CodeGroup = CodeGroup;
|
|
27
|
+
const React = __importStar(require("react"));
|
|
28
|
+
const CodeBlock_1 = require("../../../components/CodeBlock/CodeBlock");
|
|
29
|
+
const utils_1 = require("../../../core/utils");
|
|
30
|
+
const contexts_1 = require("../../../core/contexts");
|
|
31
|
+
function CodeGroup(props) {
|
|
32
|
+
const mode = props.mode || 'tabs';
|
|
33
|
+
const isTabsMode = mode === 'tabs';
|
|
34
|
+
const rawSnippets = React.useMemo(() => React.Children.toArray(props.children).map((child, idx) => {
|
|
35
|
+
const childProps = child;
|
|
36
|
+
return {
|
|
37
|
+
name: getTabName(childProps.props, idx),
|
|
38
|
+
languageName: (0, utils_1.langToName)(childProps.props.lang || 'Default'),
|
|
39
|
+
lang: childProps.props.lang || '',
|
|
40
|
+
props: childProps.props,
|
|
41
|
+
};
|
|
42
|
+
}), [props.children]);
|
|
43
|
+
const [activeSnippetName, setActiveSnippetName] = (0, contexts_1.useActiveCodeSnippetName)(mode);
|
|
44
|
+
const snippets = React.useMemo(() => Object.fromEntries(rawSnippets.map((snippet) => {
|
|
45
|
+
const getItemName = (snippet) => isTabsMode ? snippet === null || snippet === void 0 ? void 0 : snippet.name : (snippet === null || snippet === void 0 ? void 0 : snippet.languageName) || '';
|
|
46
|
+
const name = getItemName(snippet);
|
|
47
|
+
const items = rawSnippets.map((item) => ({
|
|
48
|
+
name: getItemName(item),
|
|
49
|
+
lang: item.lang,
|
|
50
|
+
}));
|
|
51
|
+
const itemsProps = {
|
|
52
|
+
items,
|
|
53
|
+
onChange: (name) => {
|
|
54
|
+
setActiveSnippetName(name);
|
|
55
|
+
},
|
|
56
|
+
value: activeSnippetName || getItemName(rawSnippets[0]),
|
|
57
|
+
};
|
|
58
|
+
const snippetProps = Object.assign(Object.assign(Object.assign({}, snippet.props), { header: Object.assign(Object.assign({}, snippet.props.header), { title: isTabsMode ? undefined : snippet.name }) }), (isTabsMode ? { tabs: itemsProps } : { dropdown: itemsProps }));
|
|
59
|
+
return [name, snippetProps];
|
|
60
|
+
})), [rawSnippets, activeSnippetName, isTabsMode, setActiveSnippetName]);
|
|
61
|
+
const firstName = Object.keys(snippets)[0];
|
|
62
|
+
const activeSnippet = snippets[activeSnippetName] || snippets[firstName];
|
|
63
|
+
if (!activeSnippet) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
return React.createElement(CodeBlock_1.CodeBlock, Object.assign({}, activeSnippet));
|
|
67
|
+
}
|
|
68
|
+
function getTabName(props, idx) {
|
|
69
|
+
var _a;
|
|
70
|
+
return String(((_a = props.header) === null || _a === void 0 ? void 0 : _a.title) || props.file || (0, utils_1.langToName)(props.lang || '') || 'Tab ' + String(idx + 1));
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=CodeGroup.js.map
|
|
@@ -74,19 +74,19 @@ function CodePanelHeader({ files, handleTabSwitch, activeTabName, onDownloadCode
|
|
|
74
74
|
}, [activeTabName, files, renderableFiles]);
|
|
75
75
|
return (react_1.default.createElement(CodePanelHeaderWrapper, { "data-component-name": "Markdoc/CodeWalkthrough/CodePanelHeader" },
|
|
76
76
|
react_1.default.createElement(TabsWrapper, { ref: tabsWrapperRef },
|
|
77
|
-
react_1.default.createElement(Tabs, null, renderableFiles.map(({ path, basename,
|
|
77
|
+
react_1.default.createElement(Tabs, null, renderableFiles.map(({ path, basename, fileIcon, parentFolder, isNameDuplicate, inRootDir }, i) => {
|
|
78
78
|
return (react_1.default.createElement(Tab, { ref: (el) => {
|
|
79
79
|
tabRefs.current[i] = el;
|
|
80
80
|
}, "data-name": path, active: path === activeTabName, key: i, onClick: () => handleTabSwitch(path) },
|
|
81
|
-
|
|
81
|
+
fileIcon,
|
|
82
82
|
basename,
|
|
83
83
|
isNameDuplicate && !inRootDir ? react_1.default.createElement(Dirname, null, parentFolder) : null));
|
|
84
84
|
})),
|
|
85
85
|
react_1.default.createElement(Gradient, null)),
|
|
86
86
|
react_1.default.createElement(ActionBar, null,
|
|
87
87
|
hiddenFiles.length ? (react_1.default.createElement(Dropdown_1.Dropdown, { trigger: react_1.default.createElement(StyledOverflowMenuVerticalIcon, { size: "14px" }), alignment: "end" },
|
|
88
|
-
react_1.default.createElement(StyledDropdownMenu, null, hiddenFiles.map(({ path, basename,
|
|
89
|
-
return (react_1.default.createElement(DropdownMenuItem_1.DropdownMenuItem, { active: path === activeTabName, key: i, onAction: () => handleTabSwitch(path), prefix:
|
|
88
|
+
react_1.default.createElement(StyledDropdownMenu, null, hiddenFiles.map(({ path, basename, fileIcon, isNameDuplicate, inRootDir, parentFolder }, i) => {
|
|
89
|
+
return (react_1.default.createElement(DropdownMenuItem_1.DropdownMenuItem, { active: path === activeTabName, key: i, onAction: () => handleTabSwitch(path), prefix: fileIcon, content: isNameDuplicate && !inRootDir ? `${parentFolder}/${basename}` : basename }));
|
|
90
90
|
})))) : null,
|
|
91
91
|
react_1.default.createElement(Button_1.Button, { variant: "text", icon: react_1.default.createElement(DownloadIcon_1.DownloadIcon, null), onClick: onDownloadCode, size: "small" }, translate('codeWalkthrough.download', 'Download')))));
|
|
92
92
|
}
|
|
@@ -127,6 +127,9 @@ const ActionBar = styled_components_1.default.div `
|
|
|
127
127
|
display: flex;
|
|
128
128
|
`;
|
|
129
129
|
const Tab = styled_components_1.default.button `
|
|
130
|
+
--icon-width: 16px;
|
|
131
|
+
--icon-height: 16px;
|
|
132
|
+
|
|
130
133
|
display: inline-flex;
|
|
131
134
|
align-items: center;
|
|
132
135
|
padding: 0 var(--spacing-sm);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { JSX, PropsWithChildren } from 'react';
|
|
2
|
-
export declare function Heading({ level, id, children, 'data-source': dataSource, 'data-hash': dataHash, className, }: PropsWithChildren<{
|
|
2
|
+
export declare function Heading({ level, id, children, 'data-source': dataSource, 'data-hash': dataHash, className, __idx, }: PropsWithChildren<{
|
|
3
3
|
level: number;
|
|
4
4
|
id: string;
|
|
5
5
|
'data-source'?: string;
|
|
6
6
|
'data-hash'?: string;
|
|
7
7
|
className?: string;
|
|
8
|
+
__idx?: number;
|
|
8
9
|
}>): JSX.Element;
|
|
@@ -22,16 +22,28 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
25
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
29
|
exports.Heading = Heading;
|
|
27
30
|
const react_1 = __importStar(require("react"));
|
|
31
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
32
|
+
const react_router_dom_1 = require("react-router-dom");
|
|
28
33
|
const utils_1 = require("../../../core/utils");
|
|
29
34
|
const LinkIcon_1 = require("../../../icons/LinkIcon/LinkIcon");
|
|
35
|
+
const PageActions_1 = require("../../../components/PageActions/PageActions");
|
|
36
|
+
const hooks_1 = require("../../../core/hooks");
|
|
30
37
|
/**
|
|
31
38
|
* Class name for all MD tags
|
|
32
39
|
*/
|
|
33
40
|
const mdClassName = 'md';
|
|
34
|
-
function Heading({ level, id, children, 'data-source': dataSource, 'data-hash': dataHash, className, }) {
|
|
41
|
+
function Heading({ level, id, children, 'data-source': dataSource, 'data-hash': dataHash, className, __idx, }) {
|
|
42
|
+
var _a;
|
|
43
|
+
const { pathname } = (0, react_router_dom_1.useLocation)();
|
|
44
|
+
const { usePageProps } = (0, hooks_1.useThemeHooks)();
|
|
45
|
+
const pageProps = usePageProps();
|
|
46
|
+
const isMarkdownPage = ((_a = pageProps === null || pageProps === void 0 ? void 0 : pageProps.metadata) === null || _a === void 0 ? void 0 : _a.type) === 'markdown';
|
|
35
47
|
const linkEl = (react_1.default.createElement("a", { "aria-label": `link to ${id}`, href: `#${id}`, className: (0, utils_1.concatClassNames)('anchor', 'before') },
|
|
36
48
|
react_1.default.createElement(LinkIcon_1.LinkIcon, { size: "14px", color: "--heading-anchor-color" })));
|
|
37
49
|
return (0, react_1.createElement)(`h${level}`, {
|
|
@@ -40,8 +52,14 @@ function Heading({ level, id, children, 'data-source': dataSource, 'data-hash':
|
|
|
40
52
|
'data-component-name': 'Markdoc/Heading/Heading',
|
|
41
53
|
'data-source': dataSource,
|
|
42
54
|
'data-hash': dataHash,
|
|
43
|
-
}, react_1.default.createElement(
|
|
55
|
+
}, react_1.default.createElement(HeadingContentWrapper, null,
|
|
44
56
|
linkEl,
|
|
45
|
-
children)
|
|
57
|
+
react_1.default.createElement("span", null, children),
|
|
58
|
+
isMarkdownPage && __idx === 0 ? react_1.default.createElement(PageActions_1.PageActions, { pageSlug: pathname }) : null));
|
|
46
59
|
}
|
|
60
|
+
const HeadingContentWrapper = styled_components_1.default.div `
|
|
61
|
+
display: flex;
|
|
62
|
+
gap: var(--spacing-xs);
|
|
63
|
+
align-items: center;
|
|
64
|
+
`;
|
|
47
65
|
//# sourceMappingURL=Heading.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.Icon = Icon;
|
|
18
|
+
const react_1 = __importDefault(require("react"));
|
|
19
|
+
const CDNIcon_1 = require("../../../icons/CDNIcon/CDNIcon");
|
|
20
|
+
const utils_1 = require("../../../core/utils");
|
|
21
|
+
function Icon(props) {
|
|
22
|
+
const { name } = props, rest = __rest(props, ["name"]);
|
|
23
|
+
const resolvedIcon = (0, utils_1.resolveIcon)(name);
|
|
24
|
+
if (resolvedIcon.type === 'font-awesome') {
|
|
25
|
+
return react_1.default.createElement(CDNIcon_1.CDNIcon, Object.assign({ name: resolvedIcon.name, type: resolvedIcon.style }, rest));
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=Icon.js.map
|
|
@@ -10,6 +10,7 @@ export type TabProps = {
|
|
|
10
10
|
onKeyDown: (event: React.KeyboardEvent<HTMLButtonElement>) => void;
|
|
11
11
|
onClick: () => void;
|
|
12
12
|
icon?: React.ReactNode;
|
|
13
|
+
iconRawContent?: string;
|
|
13
14
|
};
|
|
14
|
-
export declare function TabComponent({ tabId, label, size, disabled, setRef, onKeyDown, onClick, icon, }: TabProps): JSX.Element;
|
|
15
|
+
export declare function TabComponent({ tabId, label, size, disabled, setRef, onKeyDown, onClick, icon, iconRawContent, }: TabProps): JSX.Element;
|
|
15
16
|
export declare const Tab: import("styled-components").StyledComponent<typeof TabComponent, any, {}, never>;
|
|
@@ -8,17 +8,20 @@ exports.TabComponent = TabComponent;
|
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
10
10
|
const TabList_1 = require("../../../markdoc/components/Tabs/TabList");
|
|
11
|
-
|
|
11
|
+
const GenericIcon_1 = require("../../../icons/GenericIcon/GenericIcon");
|
|
12
|
+
function TabComponent({ tabId, label, size, disabled, setRef, onKeyDown, onClick, icon, iconRawContent, }) {
|
|
12
13
|
return (react_1.default.createElement(TabList_1.TabItem, { "data-component-name": "Markdoc/Tabs/Tab", size: size, tabIndex: 0 },
|
|
13
14
|
react_1.default.createElement(TabList_1.TabButtonLink, { id: `tab-${tabId}`, role: "tab", "aria-selected": "false", "aria-controls": `panel-${tabId}`, tabIndex: -1, size: size, disabled: disabled, ref: setRef, onKeyDown: onKeyDown, onClick: onClick },
|
|
14
15
|
react_1.default.createElement(LabelWrapper, null,
|
|
15
|
-
icon,
|
|
16
|
+
react_1.default.createElement(GenericIcon_1.GenericIcon, { icon: icon, rawContent: iconRawContent }),
|
|
16
17
|
label))));
|
|
17
18
|
}
|
|
18
19
|
const LabelWrapper = styled_components_1.default.div `
|
|
19
20
|
display: flex;
|
|
20
21
|
align-items: center;
|
|
21
22
|
gap: 4px;
|
|
23
|
+
--icon-width: var(--md-tabs-icon-size);
|
|
24
|
+
--icon-height: var(--md-tabs-icon-size);
|
|
22
25
|
`;
|
|
23
26
|
exports.Tab = (0, styled_components_1.default)(TabComponent) ``;
|
|
24
27
|
//# sourceMappingURL=Tab.js.map
|
|
@@ -98,6 +98,8 @@ exports.markdownTabs = (0, styled_components_1.css) `
|
|
|
98
98
|
|
|
99
99
|
--md-tabs-tab-focused-padding: var(--spacing-unit); // @presenter Spacing
|
|
100
100
|
|
|
101
|
+
--md-tabs-icon-size: 16px; // @presenter Spacing
|
|
102
|
+
|
|
101
103
|
// @tokens End
|
|
102
104
|
`;
|
|
103
105
|
//# sourceMappingURL=variables.js.map
|
|
@@ -18,3 +18,5 @@ export * from '../../markdoc/components/CodeWalkthrough/CodeStep';
|
|
|
18
18
|
export * from '../../markdoc/components/CodeWalkthrough/Input';
|
|
19
19
|
export * from '../../markdoc/components/CodeWalkthrough/CodeToggle';
|
|
20
20
|
export * from '../../markdoc/components/CodeWalkthrough/CodeContainer';
|
|
21
|
+
export * from '../../markdoc/components/CodeGroup/CodeGroup';
|
|
22
|
+
export * from '../../markdoc/components/Icon/Icon';
|
|
@@ -34,4 +34,6 @@ __exportStar(require("../../markdoc/components/CodeWalkthrough/CodeStep"), expor
|
|
|
34
34
|
__exportStar(require("../../markdoc/components/CodeWalkthrough/Input"), exports);
|
|
35
35
|
__exportStar(require("../../markdoc/components/CodeWalkthrough/CodeToggle"), exports);
|
|
36
36
|
__exportStar(require("../../markdoc/components/CodeWalkthrough/CodeContainer"), exports);
|
|
37
|
+
__exportStar(require("../../markdoc/components/CodeGroup/CodeGroup"), exports);
|
|
38
|
+
__exportStar(require("../../markdoc/components/Icon/Icon"), exports);
|
|
37
39
|
//# sourceMappingURL=default.js.map
|
package/lib/markdoc/default.js
CHANGED
|
@@ -52,6 +52,8 @@ const code_walkthrough_1 = require("../markdoc/tags/code-walkthrough");
|
|
|
52
52
|
const code_step_1 = require("../markdoc/tags/code-step");
|
|
53
53
|
const input_1 = require("../markdoc/tags/input");
|
|
54
54
|
const code_toggle_1 = require("../markdoc/tags/code-toggle");
|
|
55
|
+
const code_group_1 = require("../markdoc/tags/code-group");
|
|
56
|
+
const icon_1 = require("../markdoc/tags/icon");
|
|
55
57
|
exports.tags = {
|
|
56
58
|
[admonition_1.admonition.tagName]: admonition_1.admonition.schema,
|
|
57
59
|
[debug_1.debug.tagName]: debug_1.debug.schema,
|
|
@@ -69,5 +71,7 @@ exports.tags = {
|
|
|
69
71
|
[code_step_1.codeStep.tagName]: code_step_1.codeStep.schema,
|
|
70
72
|
[code_toggle_1.toggle.tagName]: code_toggle_1.toggle.schema,
|
|
71
73
|
[input_1.input.tagName]: input_1.input.schema,
|
|
74
|
+
[code_group_1.codeGroup.tagName]: code_group_1.codeGroup.schema,
|
|
75
|
+
[icon_1.icon.tagName]: icon_1.icon.schema,
|
|
72
76
|
};
|
|
73
77
|
//# sourceMappingURL=default.js.map
|
package/lib/markdoc/tags/card.js
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
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.codeGroup = void 0;
|
|
7
|
+
const markdoc_1 = __importDefault(require("@markdoc/markdoc"));
|
|
8
|
+
exports.codeGroup = {
|
|
9
|
+
schema: {
|
|
10
|
+
render: 'CodeGroup',
|
|
11
|
+
children: ['fence', 'tag'],
|
|
12
|
+
attributes: {
|
|
13
|
+
mode: { type: String, default: 'tabs', matches: ['tabs', 'dropdown'] },
|
|
14
|
+
},
|
|
15
|
+
transform(node, config) {
|
|
16
|
+
const attributes = node.transformAttributes(config);
|
|
17
|
+
const children = node.transformChildren(config);
|
|
18
|
+
return new markdoc_1.default.Tag('CodeGroup', attributes, children);
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
tagName: 'code-group',
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=code-group.js.map
|
|
@@ -9,7 +9,7 @@ const code_snippet_file_1 = require("../../markdoc/attributes/code-snippet-file"
|
|
|
9
9
|
exports.codeSnippet = {
|
|
10
10
|
schema: {
|
|
11
11
|
attributes: {
|
|
12
|
-
file: { type: code_snippet_file_1.CodeSnippetFile,
|
|
12
|
+
file: { type: code_snippet_file_1.CodeSnippetFile, required: true },
|
|
13
13
|
language: { type: String, render: true },
|
|
14
14
|
title: { type: String, render: true },
|
|
15
15
|
to: { type: [String, Number], render: false },
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.icon = void 0;
|
|
4
|
+
exports.icon = {
|
|
5
|
+
schema: {
|
|
6
|
+
render: 'Icon',
|
|
7
|
+
attributes: {
|
|
8
|
+
name: { type: String, required: true },
|
|
9
|
+
size: { type: String, default: '1em' },
|
|
10
|
+
color: { type: String, default: 'currentColor' },
|
|
11
|
+
},
|
|
12
|
+
selfClosing: true,
|
|
13
|
+
},
|
|
14
|
+
tagName: 'icon',
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=icon.js.map
|
package/lib/markdoc/tags/tab.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/theme",
|
|
3
|
-
"version": "0.56.0
|
|
3
|
+
"version": "0.56.0",
|
|
4
4
|
"description": "Shared UI components lib",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"theme",
|
|
@@ -89,8 +89,8 @@
|
|
|
89
89
|
"nprogress": "0.2.0",
|
|
90
90
|
"react-calendar": "5.1.0",
|
|
91
91
|
"react-date-picker": "11.0.0",
|
|
92
|
-
"@redocly/config": "0.
|
|
93
|
-
"@redocly/realm-asyncapi-sdk": "0.2.0
|
|
92
|
+
"@redocly/config": "0.28.0",
|
|
93
|
+
"@redocly/realm-asyncapi-sdk": "0.2.0"
|
|
94
94
|
},
|
|
95
95
|
"scripts": {
|
|
96
96
|
"watch": "tsc -p tsconfig.build.json && (concurrently \"tsc -w -p tsconfig.build.json\" \"tsc-alias -w -p tsconfig.build.json\")",
|
|
@@ -27,13 +27,13 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
|
|
|
27
27
|
size?: ButtonSize;
|
|
28
28
|
extraClass?: string;
|
|
29
29
|
to?: string;
|
|
30
|
+
external?: boolean;
|
|
30
31
|
icon?: JSX.Element;
|
|
31
32
|
iconPosition?: 'left' | 'right';
|
|
32
33
|
title?: string;
|
|
33
34
|
tabIndex?: number;
|
|
34
35
|
onClick?: (e?: any) => void;
|
|
35
36
|
ref?: React.Ref<HTMLButtonElement>;
|
|
36
|
-
type?: 'button' | 'submit' | 'reset';
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
const getBlink = (): Keyframes => keyframes`
|
|
@@ -67,6 +67,7 @@ export function generateClassName({
|
|
|
67
67
|
extraClass = '',
|
|
68
68
|
}: ButtonProps) {
|
|
69
69
|
const classNames = [
|
|
70
|
+
'button',
|
|
70
71
|
extraClass,
|
|
71
72
|
`button-tone-${tone}`,
|
|
72
73
|
`button-variant-${variant}`,
|
|
@@ -190,7 +191,7 @@ const ButtonComponent: React.FC<ButtonProps> = (props) => {
|
|
|
190
191
|
|
|
191
192
|
if (props.to) {
|
|
192
193
|
return (
|
|
193
|
-
<StyledButtonLink to={props.to} onClick={props.onClick}>
|
|
194
|
+
<StyledButtonLink to={props.to} external={props.external} onClick={props.onClick}>
|
|
194
195
|
{button}
|
|
195
196
|
</StyledButtonLink>
|
|
196
197
|
);
|