@redocly/theme 0.61.1 → 0.62.0-custom.1
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/AsyncApiDocs/hooks/AfterAsyncApiChannelDescription.d.ts +1 -0
- package/lib/components/AsyncApiDocs/hooks/AfterAsyncApiChannelDescription.js +12 -0
- package/lib/components/Badge/Badge.d.ts +2 -1
- package/lib/components/Badge/Badge.js +24 -2
- package/lib/components/Banner/Banner.js +19 -1
- package/lib/components/Banner/variables.js +1 -0
- package/lib/components/Breadcrumbs/Breadcrumb.js +1 -1
- package/lib/components/Breadcrumbs/BreadcrumbDropdown.js +9 -6
- package/lib/components/Breadcrumbs/Breadcrumbs.js +24 -15
- package/lib/components/Buttons/AIAssistantButton.js +7 -4
- package/lib/components/Buttons/EditPageButton.js +4 -26
- package/lib/components/Catalog/CatalogEntities.js +10 -8
- package/lib/components/Catalog/CatalogEntity/CatalogEntity.js +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.js +3 -3
- package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem.js +6 -13
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.js +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.js +13 -11
- package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +7 -5
- package/lib/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.js +9 -7
- package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.js +1 -1
- package/lib/components/Catalog/CatalogTagsWithTooltip.js +2 -2
- package/lib/components/CatalogClassic/CatalogClassicInfoBlock.js +1 -1
- package/lib/components/CodeBlock/CodeBlockControls.js +8 -6
- package/lib/components/Dropdown/Dropdown.js +1 -1
- package/lib/components/Dropdown/variables.js +1 -0
- package/lib/components/Feedback/Comment.js +17 -4
- package/lib/components/Feedback/Mood.js +6 -3
- package/lib/components/Feedback/Rating.js +6 -3
- package/lib/components/Feedback/Scale.js +6 -3
- package/lib/components/Feedback/Sentiment.js +6 -3
- package/lib/components/Filter/FilterCheckboxes.js +1 -1
- package/lib/components/JsonViewer/JsonViewer.js +2 -2
- package/lib/components/JsonViewer/{Helpers.js → helpers.js} +2 -1
- package/lib/components/LanguagePicker/LanguagePicker.js +1 -1
- package/lib/components/Markdown/Markdown.js +2 -2
- package/lib/components/Menu/MenuItem.js +41 -15
- package/lib/components/Menu/variables.js +3 -3
- package/lib/components/Navbar/NavbarItem.js +1 -1
- package/lib/components/OpenApiDocs/hooks/AdditionalOverviewInfo.d.ts +1 -0
- package/lib/components/OpenApiDocs/hooks/AdditionalOverviewInfo.js +12 -0
- package/lib/components/OpenApiDocs/hooks/AfterOpenApiDescription.d.ts +1 -0
- package/lib/components/OpenApiDocs/hooks/AfterOpenApiDescription.js +6 -0
- package/lib/components/PageActions/PageActions.js +25 -8
- package/lib/components/Search/SearchAiDialog.d.ts +4 -2
- package/lib/components/Search/SearchAiDialog.js +23 -4
- package/lib/components/Search/SearchAiMessage.d.ts +4 -2
- package/lib/components/Search/SearchAiMessage.js +82 -23
- package/lib/components/Search/SearchDialog.js +50 -25
- package/lib/components/Select/variables.js +2 -2
- package/lib/components/SvgViewer/SvgViewer.d.ts +15 -0
- package/lib/components/SvgViewer/SvgViewer.js +312 -0
- package/lib/components/SvgViewer/variables.d.ts +1 -0
- package/lib/components/SvgViewer/variables.dark.d.ts +1 -0
- package/lib/components/SvgViewer/variables.dark.js +8 -0
- package/lib/components/SvgViewer/variables.js +17 -0
- package/lib/components/Tag/Tag.js +1 -1
- package/lib/components/Tag/variables.dark.js +6 -0
- package/lib/components/Tag/variables.js +6 -0
- package/lib/components/Tooltip/Tooltip.d.ts +2 -3
- package/lib/components/Tooltip/Tooltip.js +66 -113
- package/lib/components/Tooltip/variables.dark.js +4 -0
- package/lib/components/Tooltip/variables.js +3 -3
- package/lib/components/UserMenu/LoginButton.d.ts +8 -2
- package/lib/components/UserMenu/LoginButton.js +4 -3
- package/lib/core/constants/feedback.d.ts +2 -0
- package/lib/core/constants/feedback.js +6 -0
- package/lib/core/constants/index.d.ts +1 -0
- package/lib/core/constants/index.js +1 -0
- package/lib/core/constants/search.d.ts +5 -1
- package/lib/core/constants/search.js +24 -1
- package/lib/core/hooks/search/use-search-dialog.js +2 -2
- package/lib/core/hooks/use-color-switcher.js +3 -1
- package/lib/core/hooks/use-mcp-config.js +2 -1
- package/lib/core/hooks/use-modal-scroll-lock.js +24 -10
- package/lib/core/hooks/use-outside-click.d.ts +3 -1
- package/lib/core/hooks/use-outside-click.js +8 -4
- package/lib/core/hooks/use-page-actions.d.ts +1 -1
- package/lib/core/hooks/use-page-actions.js +50 -14
- package/lib/core/hooks/use-product-picker.js +1 -1
- package/lib/core/hooks/use-unique-svg-ids.d.ts +6 -0
- package/lib/core/hooks/use-unique-svg-ids.js +15 -0
- package/lib/core/openapi/index.d.ts +2 -0
- package/lib/core/openapi/index.js +5 -1
- package/lib/core/styles/dark.js +13 -0
- package/lib/core/styles/global.js +38 -15
- package/lib/core/types/catalog.d.ts +1 -1
- package/lib/core/types/hooks.d.ts +23 -2
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/core/types/search.d.ts +24 -0
- package/lib/core/types/search.js +9 -1
- package/lib/core/utils/content-segments.d.ts +2 -0
- package/lib/core/utils/content-segments.js +22 -0
- package/lib/core/utils/index.d.ts +1 -0
- package/lib/core/utils/index.js +1 -0
- package/lib/core/utils/transform-revisions-to-version-history.js +18 -68
- package/lib/ext/process-scorecard.d.ts +49 -0
- package/lib/ext/process-scorecard.js +12 -0
- package/lib/icons/DirectionRightIcon/DirectionRightIcon.d.ts +5 -0
- package/lib/icons/DirectionRightIcon/DirectionRightIcon.js +24 -0
- package/lib/icons/FitToViewIcon/FitToViewIcon.d.ts +9 -0
- package/lib/icons/FitToViewIcon/FitToViewIcon.js +25 -0
- package/lib/index.d.ts +8 -0
- package/lib/index.js +8 -0
- package/lib/layouts/DocumentationLayout.js +4 -25
- package/lib/layouts/DocumentationLayoutBottom.d.ts +11 -0
- package/lib/layouts/DocumentationLayoutBottom.js +28 -0
- package/lib/layouts/DocumentationLayoutTop.d.ts +13 -0
- package/lib/layouts/DocumentationLayoutTop.js +33 -0
- package/lib/layouts/Forbidden.js +22 -18
- package/lib/markdoc/components/Cards/Card.js +1 -0
- package/lib/markdoc/components/CodeWalkthrough/CodeFilters.js +1 -1
- package/lib/markdoc/components/Heading/Heading.js +40 -2
- package/lib/markdoc/components/LoginButton/LoginButton.d.ts +9 -0
- package/lib/markdoc/components/LoginButton/LoginButton.js +48 -0
- package/lib/markdoc/components/Mermaid/Mermaid.js +70 -2
- package/lib/markdoc/components/default.d.ts +1 -0
- package/lib/markdoc/components/default.js +1 -0
- package/lib/markdoc/default.d.ts +6 -0
- package/lib/markdoc/default.js +2 -0
- package/lib/markdoc/tags/login-button.d.ts +2 -0
- package/lib/markdoc/tags/login-button.js +32 -0
- package/package.json +10 -10
- package/src/components/AsyncApiDocs/hooks/AfterAsyncApiChannelDescription.tsx +10 -0
- package/src/components/Badge/Badge.tsx +18 -2
- package/src/components/Banner/Banner.tsx +23 -1
- package/src/components/Banner/variables.ts +1 -0
- package/src/components/Breadcrumbs/Breadcrumb.tsx +3 -3
- package/src/components/Breadcrumbs/BreadcrumbDropdown.tsx +11 -8
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +24 -15
- package/src/components/Buttons/AIAssistantButton.tsx +7 -4
- package/src/components/Buttons/EditPageButton.tsx +13 -34
- package/src/components/Catalog/CatalogEntities.tsx +10 -8
- package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.tsx +3 -4
- package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem.tsx +5 -21
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.tsx +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +13 -11
- package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +7 -5
- package/src/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.tsx +9 -7
- package/src/components/Catalog/CatalogTableView/CatalogTableViewRow.tsx +1 -2
- package/src/components/Catalog/CatalogTagsWithTooltip.tsx +9 -5
- package/src/components/CatalogClassic/CatalogClassicInfoBlock.tsx +3 -1
- package/src/components/CodeBlock/CodeBlockControls.tsx +16 -10
- package/src/components/Dropdown/Dropdown.tsx +1 -1
- package/src/components/Dropdown/variables.ts +1 -0
- package/src/components/Feedback/Comment.tsx +22 -4
- package/src/components/Feedback/Mood.tsx +6 -2
- package/src/components/Feedback/Rating.tsx +6 -2
- package/src/components/Feedback/Scale.tsx +6 -2
- package/src/components/Feedback/Sentiment.tsx +6 -2
- package/src/components/Filter/FilterCheckboxes.tsx +1 -1
- package/src/components/JsonViewer/JsonViewer.tsx +1 -2
- package/src/components/JsonViewer/{Helpers.tsx → helpers.tsx} +1 -0
- package/src/components/LanguagePicker/LanguagePicker.tsx +1 -1
- package/src/components/Markdown/Markdown.tsx +2 -2
- package/src/components/Menu/MenuItem.tsx +61 -16
- package/src/components/Menu/variables.ts +3 -3
- package/src/components/Navbar/NavbarItem.tsx +3 -1
- package/src/components/OpenApiDocs/hooks/AdditionalOverviewInfo.tsx +10 -0
- package/src/components/OpenApiDocs/hooks/AfterOpenApiDescription.tsx +2 -0
- package/src/components/PageActions/PageActions.tsx +38 -15
- package/src/components/Search/SearchAiDialog.tsx +31 -2
- package/src/components/Search/SearchAiMessage.tsx +103 -17
- package/src/components/Search/SearchDialog.tsx +70 -37
- package/src/components/Select/variables.ts +2 -2
- package/src/components/SvgViewer/SvgViewer.tsx +405 -0
- package/src/components/SvgViewer/variables.dark.ts +5 -0
- package/src/components/SvgViewer/variables.ts +14 -0
- package/src/components/Tag/Tag.tsx +2 -1
- package/src/components/Tag/variables.dark.ts +6 -0
- package/src/components/Tag/variables.ts +6 -0
- package/src/components/Tooltip/Tooltip.tsx +77 -120
- package/src/components/Tooltip/variables.dark.ts +4 -0
- package/src/components/Tooltip/variables.ts +3 -3
- package/src/components/UserMenu/LoginButton.tsx +23 -8
- package/src/core/constants/feedback.ts +2 -0
- package/src/core/constants/index.ts +1 -0
- package/src/core/constants/search.ts +27 -1
- package/src/core/hooks/__mocks__/use-theme-hooks.ts +10 -1
- package/src/core/hooks/search/use-search-dialog.ts +2 -2
- package/src/core/hooks/use-color-switcher.ts +3 -1
- package/src/core/hooks/use-mcp-config.ts +2 -1
- package/src/core/hooks/use-modal-scroll-lock.ts +29 -10
- package/src/core/hooks/use-outside-click.ts +16 -5
- package/src/core/hooks/use-page-actions.ts +77 -30
- package/src/core/hooks/use-product-picker.ts +1 -1
- package/src/core/hooks/use-unique-svg-ids.ts +12 -0
- package/src/core/openapi/index.ts +2 -0
- package/src/core/styles/dark.ts +14 -0
- package/src/core/styles/global.ts +38 -15
- package/src/core/types/catalog.ts +1 -1
- package/src/core/types/hooks.ts +29 -1
- package/src/core/types/l10n.ts +13 -1
- package/src/core/types/search.ts +19 -0
- package/src/core/utils/content-segments.ts +27 -0
- package/src/core/utils/index.ts +1 -0
- package/src/core/utils/transform-revisions-to-version-history.ts +19 -99
- package/src/ext/process-scorecard.ts +59 -0
- package/src/icons/DirectionRightIcon/DirectionRightIcon.tsx +35 -0
- package/src/icons/FitToViewIcon/FitToViewIcon.tsx +26 -0
- package/src/index.ts +8 -0
- package/src/layouts/DocumentationLayout.tsx +4 -30
- package/src/layouts/DocumentationLayoutBottom.tsx +42 -0
- package/src/layouts/DocumentationLayoutTop.tsx +52 -0
- package/src/layouts/Forbidden.tsx +36 -21
- package/src/markdoc/components/Cards/Card.tsx +1 -0
- package/src/markdoc/components/CodeWalkthrough/CodeFilters.tsx +1 -1
- package/src/markdoc/components/Heading/Heading.tsx +52 -4
- package/src/markdoc/components/LoginButton/LoginButton.tsx +38 -0
- package/src/markdoc/components/Mermaid/Mermaid.tsx +57 -8
- package/src/markdoc/components/default.ts +1 -0
- package/src/markdoc/default.ts +2 -0
- package/src/markdoc/tags/login-button.ts +30 -0
- package/lib/components/Tooltip/TooltipWrapper.d.ts +0 -12
- package/lib/components/Tooltip/TooltipWrapper.js +0 -34
- package/src/components/Tooltip/TooltipWrapper.tsx +0 -70
- /package/lib/components/JsonViewer/{Helpers.d.ts → helpers.d.ts} +0 -0
|
@@ -3,44 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.transformRevisionsToVersionHistory = transformRevisionsToVersionHistory;
|
|
4
4
|
const constants_1 = require("../../core/constants");
|
|
5
5
|
const date_1 = require("./date");
|
|
6
|
-
function compareVersionsDescending(versionA, versionB) {
|
|
7
|
-
return versionB.localeCompare(versionA, undefined, { numeric: true });
|
|
8
|
-
}
|
|
9
|
-
function extractGroupComparisonData(group) {
|
|
10
|
-
var _a, _b;
|
|
11
|
-
const version = group.version;
|
|
12
|
-
const isNotSpecified = version === constants_1.VERSION_NOT_SPECIFIED;
|
|
13
|
-
// Get version dates (oldest revision date for each group - the version's creation date)
|
|
14
|
-
// This ensures versions stay in their original order even when new revisions are added
|
|
15
|
-
const date = group.singleRevisionDate ||
|
|
16
|
-
(group.revisions && group.revisions.length > 0
|
|
17
|
-
? (_a = group.revisions[group.revisions.length - 1]) === null || _a === void 0 ? void 0 : _a.revisionDate
|
|
18
|
-
: undefined) ||
|
|
19
|
-
'';
|
|
20
|
-
const time = date ? new Date(date).getTime() : 0;
|
|
21
|
-
const hasCurrent = (_b = group.hasCurrentRevisionFromBackend) !== null && _b !== void 0 ? _b : false;
|
|
22
|
-
return { version, isNotSpecified, time, hasCurrent };
|
|
23
|
-
}
|
|
24
|
-
function compareVersionGroupsDescending(groupA, groupB) {
|
|
25
|
-
const { version: versionA, isNotSpecified: isNotSpecifiedA, time: timeA, hasCurrent: hasCurrentA, } = extractGroupComparisonData(groupA);
|
|
26
|
-
const { version: versionB, isNotSpecified: isNotSpecifiedB, time: timeB, hasCurrent: hasCurrentB, } = extractGroupComparisonData(groupB);
|
|
27
|
-
// First, compare by version date (oldest first, so most recent versions come first)
|
|
28
|
-
const dateComparison = timeB - timeA;
|
|
29
|
-
if (dateComparison !== 0) {
|
|
30
|
-
return dateComparison;
|
|
31
|
-
}
|
|
32
|
-
// If dates are equal, prioritize the one with isCurrent from backend
|
|
33
|
-
if (hasCurrentA !== hasCurrentB) {
|
|
34
|
-
return hasCurrentB ? 1 : -1; // hasCurrentB comes first if true
|
|
35
|
-
}
|
|
36
|
-
// If both have same isCurrent status, compare by version
|
|
37
|
-
// If both are unknown or both are real versions, compare by version
|
|
38
|
-
if (isNotSpecifiedA === isNotSpecifiedB) {
|
|
39
|
-
return compareVersionsDescending(versionA, versionB);
|
|
40
|
-
}
|
|
41
|
-
// If one is unknown and one is a real version, unknown comes last
|
|
42
|
-
return isNotSpecifiedA ? 1 : -1;
|
|
43
|
-
}
|
|
44
6
|
function transformRevisionsToVersionHistory({ revisions, currentRevisionDate, currentVersion, locale = typeof navigator !== 'undefined' ? navigator.language : 'en-US', }) {
|
|
45
7
|
const normalizedCurrentVersion = currentVersion === null ? constants_1.VERSION_NOT_SPECIFIED : currentVersion;
|
|
46
8
|
const versionMap = new Map();
|
|
@@ -54,17 +16,12 @@ function transformRevisionsToVersionHistory({ revisions, currentRevisionDate, cu
|
|
|
54
16
|
});
|
|
55
17
|
const versionGroups = Array.from(versionMap.entries()).map(([version, versionRevisions]) => {
|
|
56
18
|
var _a, _b, _c;
|
|
57
|
-
const
|
|
58
|
-
const dateA = a.revision ? new Date(a.revision).getTime() : 0;
|
|
59
|
-
const dateB = b.revision ? new Date(b.revision).getTime() : 0;
|
|
60
|
-
return dateB - dateA;
|
|
61
|
-
});
|
|
62
|
-
const latestRevision = sortedRevisions[0];
|
|
19
|
+
const latestRevision = versionRevisions[0];
|
|
63
20
|
const versionMatches = normalizedCurrentVersion === undefined || normalizedCurrentVersion === version;
|
|
64
21
|
let isCurrent;
|
|
65
22
|
if (currentRevisionDate !== undefined) {
|
|
66
23
|
// Check if revision matches AND version matches
|
|
67
|
-
const revisionMatches =
|
|
24
|
+
const revisionMatches = versionRevisions.some((rev) => rev.revision === currentRevisionDate);
|
|
68
25
|
isCurrent = revisionMatches && versionMatches;
|
|
69
26
|
}
|
|
70
27
|
else {
|
|
@@ -73,27 +30,20 @@ function transformRevisionsToVersionHistory({ revisions, currentRevisionDate, cu
|
|
|
73
30
|
isCurrent = ((_a = latestRevision === null || latestRevision === void 0 ? void 0 : latestRevision.isCurrent) !== null && _a !== void 0 ? _a : false) && versionMatches;
|
|
74
31
|
}
|
|
75
32
|
// Check if any revision in this version group is the default version
|
|
76
|
-
const isDefaultVersion =
|
|
77
|
-
const revisions =
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
date: (0, date_1.toLocalizedShortDateTime)(rev.revision, locale),
|
|
91
|
-
revisionDate: rev.revision,
|
|
92
|
-
isActive: isActiveRevision || isCurrentByDefault,
|
|
93
|
-
isCurrent: (_a = rev.isCurrent) !== null && _a !== void 0 ? _a : false,
|
|
94
|
-
};
|
|
95
|
-
})
|
|
96
|
-
: undefined;
|
|
33
|
+
const isDefaultVersion = versionRevisions.some((rev) => rev.isDefaultVersion === true);
|
|
34
|
+
const revisions = versionRevisions.map((rev, index) => {
|
|
35
|
+
var _a;
|
|
36
|
+
const revisionMatches = currentRevisionDate ? rev.revision === currentRevisionDate : false;
|
|
37
|
+
const isActiveRevision = revisionMatches && versionMatches;
|
|
38
|
+
const isCurrentByDefault = !currentRevisionDate && normalizedCurrentVersion === undefined && index === 0 && isCurrent;
|
|
39
|
+
return {
|
|
40
|
+
name: `r.${versionRevisions.length - index}`,
|
|
41
|
+
date: (0, date_1.toLocalizedShortDateTime)(rev.revision, locale),
|
|
42
|
+
revisionDate: rev.revision,
|
|
43
|
+
isActive: isActiveRevision || isCurrentByDefault,
|
|
44
|
+
isCurrent: (_a = rev.isCurrent) !== null && _a !== void 0 ? _a : false,
|
|
45
|
+
};
|
|
46
|
+
});
|
|
97
47
|
return {
|
|
98
48
|
version,
|
|
99
49
|
date: (0, date_1.toLocalizedShortDate)((latestRevision === null || latestRevision === void 0 ? void 0 : latestRevision.revision) || null, locale),
|
|
@@ -102,9 +52,9 @@ function transformRevisionsToVersionHistory({ revisions, currentRevisionDate, cu
|
|
|
102
52
|
hasCurrentRevisionFromBackend: (_b = latestRevision === null || latestRevision === void 0 ? void 0 : latestRevision.isCurrent) !== null && _b !== void 0 ? _b : false,
|
|
103
53
|
isDefaultVersion,
|
|
104
54
|
revisions,
|
|
105
|
-
singleRevisionDate:
|
|
55
|
+
singleRevisionDate: versionRevisions.length === 1 ? (_c = versionRevisions[0]) === null || _c === void 0 ? void 0 : _c.revision : undefined,
|
|
106
56
|
};
|
|
107
57
|
});
|
|
108
|
-
return versionGroups
|
|
58
|
+
return versionGroups;
|
|
109
59
|
}
|
|
110
60
|
//# sourceMappingURL=transform-revisions-to-version-history.js.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { CatalogItem } from '../core/types';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
export type ScorecardApiTableRow<TScorecard = unknown> = {
|
|
4
|
+
api: CatalogItem;
|
|
5
|
+
scorecard?: TScorecard;
|
|
6
|
+
};
|
|
7
|
+
export type ScorecardApiTableColumnStatus = 'error' | 'warning' | 'success';
|
|
8
|
+
export type ScorecardApiTableColumnDetails<TScorecard = unknown> = {
|
|
9
|
+
hidden?: boolean;
|
|
10
|
+
tabLabel?: string;
|
|
11
|
+
description?: ReactNode | ((row: ScorecardApiTableRow<TScorecard>) => ReactNode);
|
|
12
|
+
render?: (params: {
|
|
13
|
+
row: ScorecardApiTableRow<TScorecard>;
|
|
14
|
+
value: unknown;
|
|
15
|
+
}) => ReactNode;
|
|
16
|
+
status?: ScorecardApiTableColumnStatus | ((params: {
|
|
17
|
+
row: ScorecardApiTableRow<TScorecard>;
|
|
18
|
+
value: unknown;
|
|
19
|
+
}) => ScorecardApiTableColumnStatus);
|
|
20
|
+
statusRule?: 'problem-if-truthy' | 'problem-if-falsy';
|
|
21
|
+
};
|
|
22
|
+
export type ScorecardApiTableColumn<TScorecard = unknown> = {
|
|
23
|
+
id: string;
|
|
24
|
+
header: string;
|
|
25
|
+
placement?: 'beforeLevels' | 'afterLevels';
|
|
26
|
+
size?: number;
|
|
27
|
+
minSize?: number;
|
|
28
|
+
maxSize?: number;
|
|
29
|
+
sortRule?: 'string' | 'number' | 'date';
|
|
30
|
+
sortDescFirst?: boolean;
|
|
31
|
+
getValue?: (row: ScorecardApiTableRow<TScorecard>) => unknown;
|
|
32
|
+
getSortValue?: (row: ScorecardApiTableRow<TScorecard>) => unknown;
|
|
33
|
+
render?: (params: {
|
|
34
|
+
row: ScorecardApiTableRow<TScorecard>;
|
|
35
|
+
value: unknown;
|
|
36
|
+
}) => ReactNode;
|
|
37
|
+
details?: ScorecardApiTableColumnDetails<TScorecard>;
|
|
38
|
+
sortingFn?: (params: {
|
|
39
|
+
rowA: ScorecardApiTableRow<TScorecard>;
|
|
40
|
+
rowB: ScorecardApiTableRow<TScorecard>;
|
|
41
|
+
valueA: unknown;
|
|
42
|
+
valueB: unknown;
|
|
43
|
+
}) => number;
|
|
44
|
+
};
|
|
45
|
+
export declare function useProcessScorecard(): {
|
|
46
|
+
processScorecard: <T = any>(scorecard: T, api: CatalogItem) => T;
|
|
47
|
+
processInfo: <T>(info: T) => T;
|
|
48
|
+
getApiTableColumns: () => ScorecardApiTableColumn[];
|
|
49
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useProcessScorecard = useProcessScorecard;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
function useProcessScorecard() {
|
|
6
|
+
return {
|
|
7
|
+
processScorecard: (0, react_1.useCallback)((scorecard) => scorecard, []),
|
|
8
|
+
processInfo: (0, react_1.useCallback)((info) => info, []),
|
|
9
|
+
getApiTableColumns: (0, react_1.useCallback)(() => [], []),
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=process-scorecard.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { IconProps } from '../../icons/types';
|
|
3
|
+
export declare const DirectionRightIcon: import("styled-components").StyledComponent<(props: IconProps) => React.JSX.Element, any, {
|
|
4
|
+
'data-component-name': string;
|
|
5
|
+
}, "data-component-name">;
|
|
@@ -0,0 +1,24 @@
|
|
|
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.DirectionRightIcon = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const utils_1 = require("../../core/utils");
|
|
10
|
+
const Icon = (props) => (react_1.default.createElement("svg", Object.assign({ width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
11
|
+
react_1.default.createElement("path", { d: "M9.5 4L8.79295 4.70705L11.0859 7H5C4.73478 7 4.48043 7.10536 4.29289 7.29289C4.10536 7.48043 4 7.73478 4 8V14H5V8H11.0859L8.79295 10.2929L9.5 11L13 7.5L9.5 4Z", fill: "#1A1C21" }),
|
|
12
|
+
react_1.default.createElement("path", { d: "M5 2H4V6H5V2Z", fill: "#1A1C21" })));
|
|
13
|
+
exports.DirectionRightIcon = (0, styled_components_1.default)(Icon).attrs(() => ({
|
|
14
|
+
'data-component-name': 'icons/DirectionRightIcon/DirectionRightIcon',
|
|
15
|
+
})) `
|
|
16
|
+
path {
|
|
17
|
+
fill: ${({ color }) => (0, utils_1.getCssColorVariable)(color)};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
height: ${({ size }) => size || '16px'};
|
|
21
|
+
width: ${({ size }) => size || '16px'};
|
|
22
|
+
vertical-align: middle;
|
|
23
|
+
`;
|
|
24
|
+
//# sourceMappingURL=DirectionRightIcon.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { IconProps } from '../../icons/types';
|
|
3
|
+
export declare const FitToViewIcon: import("styled-components").StyledComponent<(props: IconProps) => React.JSX.Element, any, {
|
|
4
|
+
'data-component-name': string;
|
|
5
|
+
} & {
|
|
6
|
+
color?: string;
|
|
7
|
+
size?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
} & React.SVGProps<SVGSVGElement>, "data-component-name">;
|
|
@@ -0,0 +1,25 @@
|
|
|
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.FitToViewIcon = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const utils_1 = require("../../core/utils");
|
|
10
|
+
const Icon = (props) => (react_1.default.createElement("svg", Object.assign({ viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
11
|
+
react_1.default.createElement("path", { d: "M1 1H5V2.5H2.5V5H1V1Z" }),
|
|
12
|
+
react_1.default.createElement("path", { d: "M15 1H11V2.5H13.5V5H15V1Z" }),
|
|
13
|
+
react_1.default.createElement("path", { d: "M1 15H5V13.5H2.5V11H1V15Z" }),
|
|
14
|
+
react_1.default.createElement("path", { d: "M15 15H11V13.5H13.5V11H15V15Z" })));
|
|
15
|
+
exports.FitToViewIcon = (0, styled_components_1.default)(Icon).attrs(() => ({
|
|
16
|
+
'data-component-name': 'icons/FitToViewIcon/FitToViewIcon',
|
|
17
|
+
})) `
|
|
18
|
+
path {
|
|
19
|
+
fill: ${({ color }) => (0, utils_1.getCssColorVariable)(color)};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
height: ${({ size }) => size || '16px'};
|
|
23
|
+
width: ${({ size }) => size || '16px'};
|
|
24
|
+
`;
|
|
25
|
+
//# sourceMappingURL=FitToViewIcon.js.map
|
package/lib/index.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export * from './components/Tags/CounterTag';
|
|
|
25
25
|
export * from './components/VersionPicker/VersionPicker';
|
|
26
26
|
export * from './components/Marker/Marker';
|
|
27
27
|
export * from './components/PageActions/PageActions';
|
|
28
|
+
export * from './components/SvgViewer/SvgViewer';
|
|
28
29
|
export * from './components/Buttons/CopyButton';
|
|
29
30
|
export * from './components/Buttons/EditPageButton';
|
|
30
31
|
export * from './components/Buttons/EmailButton';
|
|
@@ -79,9 +80,12 @@ export * from './components/UserMenu/UserMenuMobile';
|
|
|
79
80
|
export * from './components/Sidebar/Sidebar';
|
|
80
81
|
export * from './components/OpenApiDocs/hooks/AfterOpenApiOperation';
|
|
81
82
|
export * from './components/OpenApiDocs/hooks/AfterOpenApiTitle';
|
|
83
|
+
export * from './components/OpenApiDocs/hooks/AfterOpenApiDescription';
|
|
82
84
|
export * from './components/OpenApiDocs/hooks/BeforeOpenApiOperation';
|
|
83
85
|
export * from './components/OpenApiDocs/hooks/OpenApiFooter';
|
|
84
86
|
export * from './components/OpenApiDocs/hooks/OpenApiHeader';
|
|
87
|
+
export * from './components/OpenApiDocs/hooks/AdditionalOverviewInfo';
|
|
88
|
+
export * from './components/AsyncApiDocs/hooks/AfterAsyncApiChannelDescription';
|
|
85
89
|
export * from './components/SidebarActions/ChangeViewButton';
|
|
86
90
|
export * from './components/SidebarActions/SidebarActions';
|
|
87
91
|
export * from './components/SidebarActions/styled';
|
|
@@ -266,6 +270,7 @@ export * from './icons/WorkflowHierarchyIcon/WorkflowHierarchyIcon';
|
|
|
266
270
|
export * from './icons/GenericIcon/GenericIcon';
|
|
267
271
|
export * from './icons/ShareIcon/ShareIcon';
|
|
268
272
|
export * from './icons/HashtagIcon/HashtagIcon';
|
|
273
|
+
export * from './icons/FitToViewIcon/FitToViewIcon';
|
|
269
274
|
export * from './layouts/RootLayout';
|
|
270
275
|
export * from './layouts/PageLayout';
|
|
271
276
|
export * from './layouts/NotFound';
|
|
@@ -274,5 +279,8 @@ export * from './layouts/OIDCForbidden';
|
|
|
274
279
|
export * from './layouts/ThreePanelLayout';
|
|
275
280
|
export * from './layouts/CodeWalkthroughLayout';
|
|
276
281
|
export * from './layouts/InternalServerErrorLayout';
|
|
282
|
+
export * from './layouts/DocumentationLayout';
|
|
283
|
+
export * from './layouts/DocumentationLayoutTop';
|
|
284
|
+
export * from './layouts/DocumentationLayoutBottom';
|
|
277
285
|
export * as markdoc from './markdoc/default';
|
|
278
286
|
export * from './components/DatePicker/DatePicker';
|
package/lib/index.js
CHANGED
|
@@ -64,6 +64,7 @@ __exportStar(require("./components/Tags/CounterTag"), exports);
|
|
|
64
64
|
__exportStar(require("./components/VersionPicker/VersionPicker"), exports);
|
|
65
65
|
__exportStar(require("./components/Marker/Marker"), exports);
|
|
66
66
|
__exportStar(require("./components/PageActions/PageActions"), exports);
|
|
67
|
+
__exportStar(require("./components/SvgViewer/SvgViewer"), exports);
|
|
67
68
|
/* Buttons */
|
|
68
69
|
__exportStar(require("./components/Buttons/CopyButton"), exports);
|
|
69
70
|
__exportStar(require("./components/Buttons/EditPageButton"), exports);
|
|
@@ -132,9 +133,12 @@ __exportStar(require("./components/Sidebar/Sidebar"), exports);
|
|
|
132
133
|
/* OpenApiDocs */
|
|
133
134
|
__exportStar(require("./components/OpenApiDocs/hooks/AfterOpenApiOperation"), exports);
|
|
134
135
|
__exportStar(require("./components/OpenApiDocs/hooks/AfterOpenApiTitle"), exports);
|
|
136
|
+
__exportStar(require("./components/OpenApiDocs/hooks/AfterOpenApiDescription"), exports);
|
|
135
137
|
__exportStar(require("./components/OpenApiDocs/hooks/BeforeOpenApiOperation"), exports);
|
|
136
138
|
__exportStar(require("./components/OpenApiDocs/hooks/OpenApiFooter"), exports);
|
|
137
139
|
__exportStar(require("./components/OpenApiDocs/hooks/OpenApiHeader"), exports);
|
|
140
|
+
__exportStar(require("./components/OpenApiDocs/hooks/AdditionalOverviewInfo"), exports);
|
|
141
|
+
__exportStar(require("./components/AsyncApiDocs/hooks/AfterAsyncApiChannelDescription"), exports);
|
|
138
142
|
/* SidebarActions */
|
|
139
143
|
__exportStar(require("./components/SidebarActions/ChangeViewButton"), exports);
|
|
140
144
|
__exportStar(require("./components/SidebarActions/SidebarActions"), exports);
|
|
@@ -329,6 +333,7 @@ __exportStar(require("./icons/WorkflowHierarchyIcon/WorkflowHierarchyIcon"), exp
|
|
|
329
333
|
__exportStar(require("./icons/GenericIcon/GenericIcon"), exports);
|
|
330
334
|
__exportStar(require("./icons/ShareIcon/ShareIcon"), exports);
|
|
331
335
|
__exportStar(require("./icons/HashtagIcon/HashtagIcon"), exports);
|
|
336
|
+
__exportStar(require("./icons/FitToViewIcon/FitToViewIcon"), exports);
|
|
332
337
|
/* Layouts */
|
|
333
338
|
__exportStar(require("./layouts/RootLayout"), exports);
|
|
334
339
|
__exportStar(require("./layouts/PageLayout"), exports);
|
|
@@ -338,6 +343,9 @@ __exportStar(require("./layouts/OIDCForbidden"), exports);
|
|
|
338
343
|
__exportStar(require("./layouts/ThreePanelLayout"), exports);
|
|
339
344
|
__exportStar(require("./layouts/CodeWalkthroughLayout"), exports);
|
|
340
345
|
__exportStar(require("./layouts/InternalServerErrorLayout"), exports);
|
|
346
|
+
__exportStar(require("./layouts/DocumentationLayout"), exports);
|
|
347
|
+
__exportStar(require("./layouts/DocumentationLayoutTop"), exports);
|
|
348
|
+
__exportStar(require("./layouts/DocumentationLayoutBottom"), exports);
|
|
341
349
|
/* Markdoc */
|
|
342
350
|
exports.markdoc = __importStar(require("./markdoc/default"));
|
|
343
351
|
/* DatePicker */
|
|
@@ -6,26 +6,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.DocumentationLayout = DocumentationLayout;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
-
const EditPageButton_1 = require("../components/Buttons/EditPageButton");
|
|
10
9
|
const utils_1 = require("../core/utils");
|
|
11
|
-
const PageNavigation_1 = require("../components/PageNavigation/PageNavigation");
|
|
12
|
-
const LastUpdated_1 = require("../components/LastUpdated/LastUpdated");
|
|
13
|
-
const Breadcrumbs_1 = require("../components/Breadcrumbs/Breadcrumbs");
|
|
14
10
|
const CodeSnippetContext_1 = require("../core/contexts/CodeSnippetContext");
|
|
11
|
+
const DocumentationLayoutTop_1 = require("../layouts/DocumentationLayoutTop");
|
|
12
|
+
const DocumentationLayoutBottom_1 = require("../layouts/DocumentationLayoutBottom");
|
|
15
13
|
function DocumentationLayout({ tableOfContent, feedback, config, editPage, lastModified, nextPage, prevPage, className, children, }) {
|
|
16
14
|
var _a;
|
|
17
|
-
const { editPage: themeEditPage } = config || {};
|
|
18
|
-
const mergedConf = editPage ? Object.assign(Object.assign({}, themeEditPage), editPage) : undefined;
|
|
19
15
|
return (react_1.default.createElement(CodeSnippetContext_1.CodeSnippetProvider, null,
|
|
20
16
|
react_1.default.createElement(LayoutWrapper, { "data-component-name": "Layout/DocumentationLayout", className: className },
|
|
21
17
|
react_1.default.createElement(ContentWrapper, { withToc: !((_a = config === null || config === void 0 ? void 0 : config.toc) === null || _a === void 0 ? void 0 : _a.hide) },
|
|
22
|
-
react_1.default.createElement(
|
|
23
|
-
react_1.default.createElement(LayoutTop, null,
|
|
24
|
-
lastModified && react_1.default.createElement(LastUpdated_1.LastUpdated, { lastModified: new Date(lastModified) }),
|
|
25
|
-
mergedConf && react_1.default.createElement(EditPageButton_1.EditPageButton, { to: mergedConf.to })),
|
|
18
|
+
react_1.default.createElement(DocumentationLayoutTop_1.DocumentationLayoutTop, { config: config, editPage: editPage, lastModified: lastModified }),
|
|
26
19
|
children,
|
|
27
|
-
react_1.default.createElement(
|
|
28
|
-
react_1.default.createElement(PageNavigation_1.PageNavigation, { nextPage: nextPage, prevPage: prevPage })),
|
|
20
|
+
react_1.default.createElement(DocumentationLayoutBottom_1.DocumentationLayoutBottom, { feedback: feedback, nextPage: nextPage, prevPage: prevPage })),
|
|
29
21
|
tableOfContent)));
|
|
30
22
|
}
|
|
31
23
|
const LayoutWrapper = styled_components_1.default.div.attrs(({ className }) => ({
|
|
@@ -58,17 +50,4 @@ const ContentWrapper = styled_components_1.default.section `
|
|
|
58
50
|
width: ${({ withToc }) => (withToc ? `calc(90% - var(--toc-width))` : '90%')};
|
|
59
51
|
}
|
|
60
52
|
`;
|
|
61
|
-
const LayoutTop = styled_components_1.default.div `
|
|
62
|
-
display: flex;
|
|
63
|
-
justify-content: space-between;
|
|
64
|
-
flex-flow: row nowrap;
|
|
65
|
-
`;
|
|
66
|
-
const Breadcrumbs = (0, styled_components_1.default)(Breadcrumbs_1.Breadcrumbs) `
|
|
67
|
-
margin-bottom: var(--breadcrumbs-margin-bottom);
|
|
68
|
-
`;
|
|
69
|
-
const LayoutBottom = (0, styled_components_1.default)(LayoutTop) `
|
|
70
|
-
> * {
|
|
71
|
-
margin: 25px 0;
|
|
72
|
-
}
|
|
73
|
-
`;
|
|
74
53
|
//# sourceMappingURL=DocumentationLayout.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { JSX } from 'react';
|
|
3
|
+
import type { ResolvedNavItemWithLink } from '@redocly/config';
|
|
4
|
+
type DocumentationLayoutBottomProps = {
|
|
5
|
+
feedback: React.ReactNode;
|
|
6
|
+
nextPage?: ResolvedNavItemWithLink | null;
|
|
7
|
+
prevPage?: ResolvedNavItemWithLink | null;
|
|
8
|
+
className?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function DocumentationLayoutBottom({ feedback, nextPage, prevPage, }: React.PropsWithChildren<DocumentationLayoutBottomProps>): JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
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.DocumentationLayoutBottom = DocumentationLayoutBottom;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const PageNavigation_1 = require("../components/PageNavigation/PageNavigation");
|
|
10
|
+
function DocumentationLayoutBottom({ feedback, nextPage, prevPage, }) {
|
|
11
|
+
return (react_1.default.createElement(Wrapper, { "data-component-name": "Layout/DocumentationLayoutBottom" },
|
|
12
|
+
react_1.default.createElement(LayoutBottom, null, feedback),
|
|
13
|
+
react_1.default.createElement(PageNavigation_1.PageNavigation, { nextPage: nextPage, prevPage: prevPage })));
|
|
14
|
+
}
|
|
15
|
+
const Wrapper = styled_components_1.default.div `
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
`;
|
|
19
|
+
const LayoutBottom = styled_components_1.default.div `
|
|
20
|
+
display: flex;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
flex-flow: row nowrap;
|
|
23
|
+
|
|
24
|
+
> * {
|
|
25
|
+
margin: 25px 0;
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
//# sourceMappingURL=DocumentationLayoutBottom.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { JSX } from 'react';
|
|
3
|
+
import type { MarkdownConfig } from '@redocly/config';
|
|
4
|
+
type DocumentationLayoutTopProps = {
|
|
5
|
+
config?: MarkdownConfig;
|
|
6
|
+
editPage?: {
|
|
7
|
+
to: string;
|
|
8
|
+
};
|
|
9
|
+
/** String in ISO format */
|
|
10
|
+
lastModified?: string | null;
|
|
11
|
+
};
|
|
12
|
+
export declare function DocumentationLayoutTop({ config, editPage, lastModified, }: React.PropsWithChildren<DocumentationLayoutTopProps>): JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
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.DocumentationLayoutTop = DocumentationLayoutTop;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const EditPageButton_1 = require("../components/Buttons/EditPageButton");
|
|
10
|
+
const LastUpdated_1 = require("../components/LastUpdated/LastUpdated");
|
|
11
|
+
const Breadcrumbs_1 = require("../components/Breadcrumbs/Breadcrumbs");
|
|
12
|
+
function DocumentationLayoutTop({ config, editPage, lastModified, }) {
|
|
13
|
+
const { editPage: themeEditPage } = config || {};
|
|
14
|
+
const mergedConf = editPage ? Object.assign(Object.assign({}, themeEditPage), editPage) : undefined;
|
|
15
|
+
return (react_1.default.createElement(Wrapper, { "data-component-name": "Layout/DocumentationLayoutTop" },
|
|
16
|
+
react_1.default.createElement(Breadcrumbs, null),
|
|
17
|
+
react_1.default.createElement(LayoutTop, null,
|
|
18
|
+
lastModified && react_1.default.createElement(LastUpdated_1.LastUpdated, { lastModified: new Date(lastModified) }),
|
|
19
|
+
mergedConf && react_1.default.createElement(EditPageButton_1.EditPageButton, { to: mergedConf.to }))));
|
|
20
|
+
}
|
|
21
|
+
const Wrapper = styled_components_1.default.div `
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
`;
|
|
25
|
+
const LayoutTop = styled_components_1.default.div `
|
|
26
|
+
display: flex;
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
flex-flow: row nowrap;
|
|
29
|
+
`;
|
|
30
|
+
const Breadcrumbs = (0, styled_components_1.default)(Breadcrumbs_1.Breadcrumbs) `
|
|
31
|
+
margin-bottom: var(--breadcrumbs-margin-bottom);
|
|
32
|
+
`;
|
|
33
|
+
//# sourceMappingURL=DocumentationLayoutTop.js.map
|
package/lib/layouts/Forbidden.js
CHANGED
|
@@ -8,38 +8,42 @@ const react_1 = __importDefault(require("react"));
|
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const hooks_1 = require("../core/hooks");
|
|
10
10
|
const Button_1 = require("../components/Button/Button");
|
|
11
|
+
const ArrowLeftIcon_1 = require("../icons/ArrowLeftIcon/ArrowLeftIcon");
|
|
11
12
|
function Forbidden() {
|
|
12
13
|
const { useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
13
14
|
const { translate } = useTranslate();
|
|
14
|
-
return (react_1.default.createElement(
|
|
15
|
-
react_1.default.createElement(
|
|
16
|
-
react_1.default.createElement(
|
|
17
|
-
react_1.default.createElement(
|
|
15
|
+
return (react_1.default.createElement(ForbiddenWrapper, { "data-component-name": "layouts/Forbidden" },
|
|
16
|
+
react_1.default.createElement(StatusText, null, "403"),
|
|
17
|
+
react_1.default.createElement(Title, { "data-translation-key": "page.forbidden.title" }, translate('page.forbidden.title', 'Access forbidden')),
|
|
18
|
+
react_1.default.createElement(Description, { "data-translation-key": "page.forbidden.description" }, translate('page.forbidden.description', "You don't have permission to access this page. If you believe this is an error, contact your administrator or return to the homepage.")),
|
|
19
|
+
react_1.default.createElement(Button_1.Button, { variant: "primary", size: "large", to: "/", "data-translation-key": "page.homeButton", icon: react_1.default.createElement(ArrowLeftIcon_1.ArrowLeftIcon, null) }, translate('page.homeButton', 'Go home'))));
|
|
18
20
|
}
|
|
19
|
-
const
|
|
21
|
+
const ForbiddenWrapper = styled_components_1.default.div `
|
|
22
|
+
height: 100%;
|
|
23
|
+
max-width: var(--page-403-max-width);
|
|
20
24
|
display: flex;
|
|
21
25
|
flex-direction: column;
|
|
22
|
-
align-items: center;
|
|
23
26
|
justify-content: center;
|
|
24
|
-
margin:
|
|
27
|
+
margin: var(--page-403-margin-vertical) var(--page-403-margin-horizontal);
|
|
25
28
|
font-family: var(--page-403-font-family);
|
|
26
|
-
|
|
29
|
+
gap: var(--page-403-gap);
|
|
27
30
|
`;
|
|
28
|
-
const
|
|
29
|
-
color: var(--page-403-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
const StatusText = styled_components_1.default.div `
|
|
32
|
+
color: var(--page-403-status-text-color);
|
|
33
|
+
font-size: var(--page-403-status-font-size);
|
|
34
|
+
line-height: var(--page-403-status-line-height);
|
|
35
|
+
font-weight: var(--page-403-status-font-weight);
|
|
36
|
+
`;
|
|
37
|
+
const Title = styled_components_1.default.div `
|
|
38
|
+
color: var(--page-403-title-text-color);
|
|
39
|
+
font-size: var(--page-403-title-font-size);
|
|
40
|
+
line-height: var(--page-403-title-line-height);
|
|
41
|
+
font-weight: var(--page-403-title-font-weight);
|
|
34
42
|
`;
|
|
35
43
|
const Description = styled_components_1.default.div `
|
|
36
44
|
color: var(--page-403-description-text-color);
|
|
37
|
-
margin: var(--page-403-description-margin);
|
|
38
45
|
font-size: var(--page-403-description-font-size);
|
|
39
46
|
line-height: var(--page-403-description-line-height);
|
|
40
47
|
font-weight: var(--page-403-description-font-weight);
|
|
41
48
|
`;
|
|
42
|
-
const HomeButton = (0, styled_components_1.default)(Button_1.Button) `
|
|
43
|
-
margin-top: var(--page-403-button-margin);
|
|
44
|
-
`;
|
|
45
49
|
//# sourceMappingURL=Forbidden.js.map
|
|
@@ -46,7 +46,7 @@ const FilterWrapper = styled_components_1.default.div `
|
|
|
46
46
|
padding-bottom: var(--spacing-xs);
|
|
47
47
|
top: var(--navbar-height);
|
|
48
48
|
background-color: var(--bg-color);
|
|
49
|
-
z-index:
|
|
49
|
+
z-index: var(--z-index-raised);
|
|
50
50
|
max-width: var(--md-content-max-width);
|
|
51
51
|
`;
|
|
52
52
|
const ButtonsWrapper = styled_components_1.default.div `
|
|
@@ -40,10 +40,31 @@ exports.Heading = Heading;
|
|
|
40
40
|
const react_1 = __importStar(require("react"));
|
|
41
41
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
42
42
|
const react_router_dom_1 = require("react-router-dom");
|
|
43
|
+
const Image_1 = require("../../../markdoc/components/Image/Image");
|
|
43
44
|
const utils_1 = require("../../../core/utils");
|
|
44
45
|
const LinkIcon_1 = require("../../../icons/LinkIcon/LinkIcon");
|
|
45
46
|
const PageActions_1 = require("../../../components/PageActions/PageActions");
|
|
46
47
|
const hooks_1 = require("../../../core/hooks");
|
|
48
|
+
function renderWithSpanWrapper(children) {
|
|
49
|
+
const childrenArray = react_1.default.Children.toArray(children);
|
|
50
|
+
if (childrenArray.length === 0)
|
|
51
|
+
return null;
|
|
52
|
+
const first = childrenArray[0];
|
|
53
|
+
const last = childrenArray[childrenArray.length - 1];
|
|
54
|
+
// Check if an element is an <img> or the Markdoc Image component
|
|
55
|
+
const isImage = (node) => {
|
|
56
|
+
if (!(0, react_1.isValidElement)(node))
|
|
57
|
+
return false;
|
|
58
|
+
if (typeof node.type === 'string')
|
|
59
|
+
return node.type === 'img';
|
|
60
|
+
return node.type === Image_1.Image;
|
|
61
|
+
};
|
|
62
|
+
const middleChildren = childrenArray.slice(isImage(first) ? 1 : 0, isImage(last) ? childrenArray.length - 1 : childrenArray.length);
|
|
63
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
64
|
+
isImage(first) && first,
|
|
65
|
+
middleChildren.length > 0 && react_1.default.createElement(StyledHeadingText, null, middleChildren),
|
|
66
|
+
isImage(last) && last));
|
|
67
|
+
}
|
|
47
68
|
/**
|
|
48
69
|
* Class name for all MD tags
|
|
49
70
|
*/
|
|
@@ -64,12 +85,29 @@ function Heading({ level, id, children, 'data-source': dataSource, 'data-hash':
|
|
|
64
85
|
'data-hash': dataHash,
|
|
65
86
|
}, react_1.default.createElement(HeadingContentWrapper, null,
|
|
66
87
|
linkEl,
|
|
67
|
-
react_1.default.createElement("span", null, children),
|
|
88
|
+
react_1.default.createElement("span", null, renderWithSpanWrapper(children)),
|
|
68
89
|
isMarkdownPage && __idx === 0 ? react_1.default.createElement(PageActions_1.PageActions, { pageSlug: pathname }) : null));
|
|
69
90
|
}
|
|
70
91
|
const HeadingContentWrapper = styled_components_1.default.div `
|
|
71
92
|
display: flex;
|
|
72
93
|
gap: var(--spacing-xs);
|
|
73
|
-
|
|
94
|
+
|
|
95
|
+
& > span {
|
|
96
|
+
display: flex;
|
|
97
|
+
align-items: flex-start;
|
|
98
|
+
gap: var(--spacing-sm);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&:has([data-component-name='PageActions/PageActions']:hover) {
|
|
102
|
+
&& .anchor svg {
|
|
103
|
+
visibility: hidden;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
`;
|
|
107
|
+
const StyledHeadingText = styled_components_1.default.span `
|
|
108
|
+
margin: auto 0;
|
|
109
|
+
&& > img:only-child {
|
|
110
|
+
display: inline-block;
|
|
111
|
+
}
|
|
74
112
|
`;
|
|
75
113
|
//# sourceMappingURL=Heading.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ButtonVariant, ButtonSize } from '../../../components/Button/Button';
|
|
3
|
+
export type MarkdocLoginButtonProps = {
|
|
4
|
+
variant?: ButtonVariant;
|
|
5
|
+
size?: ButtonSize;
|
|
6
|
+
label?: string;
|
|
7
|
+
labelTranslationKey?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function LoginButton({ variant, size, label, labelTranslationKey, }: MarkdocLoginButtonProps): React.JSX.Element | null;
|