@redocly/theme 0.58.0-next.4 → 0.58.0-next.5
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/Catalog/Catalog.js +1 -1
- package/lib/components/Catalog/CatalogEntityIcon.d.ts +2 -0
- package/lib/components/Catalog/CatalogEntityIcon.js +30 -13
- package/lib/components/Catalog/CatalogEntityTypeIcon.js +19 -6
- package/lib/components/Catalog/CatalogEntityTypeTag.js +9 -3
- package/lib/components/Catalog/variables.js +4 -0
- package/lib/components/Tooltip/Tooltip.js +7 -9
- package/lib/components/Tooltip/TooltipWrapper.js +1 -1
- package/lib/core/constants/catalog.d.ts +1 -1
- package/lib/core/constants/catalog.js +9 -27
- package/lib/core/hooks/use-control.js +17 -2
- package/lib/core/openapi/index.d.ts +1 -1
- package/lib/core/openapi/index.js +3 -3
- package/lib/core/styles/global.js +19 -0
- package/lib/core/types/catalog.d.ts +1 -1
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/icons/NoteIcon/NoteIcon.d.ts +9 -0
- package/lib/icons/NoteIcon/NoteIcon.js +24 -0
- package/lib/icons/ShareIcon/ShareIcon.d.ts +9 -0
- package/lib/icons/ShareIcon/ShareIcon.js +22 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/package.json +3 -3
- package/src/components/Catalog/Catalog.tsx +1 -1
- package/src/components/Catalog/CatalogEntityIcon.tsx +52 -17
- package/src/components/Catalog/CatalogEntityTypeIcon.tsx +19 -8
- package/src/components/Catalog/CatalogEntityTypeTag.tsx +11 -3
- package/src/components/Catalog/variables.ts +4 -0
- package/src/components/Tooltip/Tooltip.tsx +6 -8
- package/src/components/Tooltip/TooltipWrapper.tsx +1 -1
- package/src/core/constants/catalog.ts +9 -27
- package/src/core/hooks/use-control.ts +21 -3
- package/src/core/openapi/index.ts +1 -1
- package/src/core/styles/global.ts +19 -0
- package/src/core/types/catalog.ts +1 -2
- package/src/core/types/l10n.ts +3 -0
- package/src/icons/NoteIcon/NoteIcon.tsx +35 -0
- package/src/icons/ShareIcon/ShareIcon.tsx +23 -0
- package/src/index.ts +2 -0
|
@@ -27,7 +27,7 @@ const customCatalogOptionsCasing = (str) => {
|
|
|
27
27
|
if (index === 0 && word.toLowerCase() === 'api') {
|
|
28
28
|
return 'API';
|
|
29
29
|
}
|
|
30
|
-
return word[0].toUpperCase() + word.slice(1)
|
|
30
|
+
return word[0].toUpperCase() + word.slice(1);
|
|
31
31
|
})
|
|
32
32
|
.join(' ');
|
|
33
33
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
|
+
import { UiAccessibleConfig } from '@redocly/config';
|
|
2
3
|
export type CatalogEntityIconProps = {
|
|
3
4
|
entityType: string;
|
|
4
5
|
defaultColor?: boolean;
|
|
5
6
|
forceColor?: string;
|
|
7
|
+
entitiesCatalogConfig?: UiAccessibleConfig['entitiesCatalog'];
|
|
6
8
|
};
|
|
7
9
|
export declare function CatalogEntityIcon({ entityType, defaultColor, forceColor, }: CatalogEntityIconProps): JSX.Element;
|
|
@@ -11,22 +11,39 @@ const PeopleIcon_1 = require("../../icons/PeopleIcon/PeopleIcon");
|
|
|
11
11
|
const UserIcon_1 = require("../../icons/UserIcon/UserIcon");
|
|
12
12
|
const NetworkIcon_1 = require("../../icons/NetworkIcon/NetworkIcon");
|
|
13
13
|
const MoleculesIcon_1 = require("../../icons/MoleculesIcon/MoleculesIcon");
|
|
14
|
+
const Image_1 = require("../../components/Image/Image");
|
|
15
|
+
const core_1 = require("../../core");
|
|
16
|
+
const NoteIcon_1 = require("../../icons/NoteIcon/NoteIcon");
|
|
14
17
|
const getIconColor = (entityType) => `var(--catalog-entity-icon-color-${entityType})`;
|
|
15
|
-
const getEntityIcon = ({ entityType, defaultColor, forceColor }) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
const getEntityIcon = ({ entityType, defaultColor, forceColor, entitiesCatalogConfig, }) => {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
if (core_1.PREDEFINED_ENTITY_TYPES.includes(entityType)) {
|
|
21
|
+
const iconColor = forceColor !== null && forceColor !== void 0 ? forceColor : (defaultColor ? `var(--catalog-entity-icon-color)` : getIconColor(entityType));
|
|
22
|
+
const entityIconMap = {
|
|
23
|
+
service: react_1.default.createElement(CodeIcon_1.CodeIcon, { color: iconColor }),
|
|
24
|
+
domain: react_1.default.createElement(GraphIcon_1.GraphIcon, { color: iconColor }),
|
|
25
|
+
team: react_1.default.createElement(PeopleIcon_1.PeopleIcon, { color: iconColor }),
|
|
26
|
+
user: react_1.default.createElement(UserIcon_1.UserIcon, { color: iconColor }),
|
|
27
|
+
'api-description': react_1.default.createElement(NoteIcon_1.NoteIcon, { color: iconColor }),
|
|
28
|
+
'data-schema': react_1.default.createElement(NetworkIcon_1.NetworkIcon, { color: iconColor }),
|
|
29
|
+
'api-operation': react_1.default.createElement(MoleculesIcon_1.MoleculesIcon, { color: iconColor }),
|
|
30
|
+
};
|
|
31
|
+
return entityIconMap[entityType];
|
|
32
|
+
}
|
|
33
|
+
const iconConfig = (_b = (_a = entitiesCatalogConfig === null || entitiesCatalogConfig === void 0 ? void 0 : entitiesCatalogConfig.entityTypes) === null || _a === void 0 ? void 0 : _a[entityType]) === null || _b === void 0 ? void 0 : _b.icon;
|
|
34
|
+
if ((iconConfig === null || iconConfig === void 0 ? void 0 : iconConfig.src) || (iconConfig === null || iconConfig === void 0 ? void 0 : iconConfig.srcSet)) {
|
|
35
|
+
return (react_1.default.createElement(Image_1.Image, { src: iconConfig === null || iconConfig === void 0 ? void 0 : iconConfig.src, srcSet: iconConfig === null || iconConfig === void 0 ? void 0 : iconConfig.srcSet, alt: `${entityType} icon`, width: "16", height: "16" }));
|
|
36
|
+
}
|
|
37
|
+
return react_1.default.createElement(CodeIcon_1.CodeIcon, { color: "var(--catalog-entity-icon-color)" }); // @TODO: add default icon
|
|
27
38
|
};
|
|
28
39
|
function CatalogEntityIcon({ entityType, defaultColor = false, forceColor, }) {
|
|
29
|
-
const
|
|
40
|
+
const themeConfig = (0, core_1.useThemeConfig)();
|
|
41
|
+
const icon = getEntityIcon({
|
|
42
|
+
entityType,
|
|
43
|
+
defaultColor,
|
|
44
|
+
forceColor,
|
|
45
|
+
entitiesCatalogConfig: themeConfig.entitiesCatalog,
|
|
46
|
+
});
|
|
30
47
|
if (!icon) {
|
|
31
48
|
throw new Error(`Unhandled entity type: ${entityType}`);
|
|
32
49
|
}
|
|
@@ -7,6 +7,7 @@ exports.CatalogEntityTypeIcon = CatalogEntityTypeIcon;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const CatalogEntityIcon_1 = require("../../components/Catalog/CatalogEntityIcon");
|
|
10
|
+
const core_1 = require("../../core");
|
|
10
11
|
function CatalogEntityTypeIcon({ entityType, defaultColor = false, }) {
|
|
11
12
|
return (react_1.default.createElement(IconContainer, { "data-component-name": "Catalog/CatalogEntityTypeIcon", entityType: entityType, defaultColor: defaultColor },
|
|
12
13
|
react_1.default.createElement(CatalogEntityIcon_1.CatalogEntityIcon, { entityType: entityType, defaultColor: defaultColor })));
|
|
@@ -18,13 +19,25 @@ const IconContainer = styled_components_1.default.div `
|
|
|
18
19
|
width: var(--catalog-table-icon-width);
|
|
19
20
|
height: var(--catalog-table-icon-height);
|
|
20
21
|
border-radius: var(--catalog-table-icon-border-radius);
|
|
21
|
-
background-color: ${({ defaultColor, entityType }) =>
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
background-color: ${({ defaultColor, entityType }) => {
|
|
23
|
+
if (defaultColor) {
|
|
24
|
+
return 'var(--catalog-entity-bg-color)';
|
|
25
|
+
}
|
|
26
|
+
if (core_1.PREDEFINED_ENTITY_TYPES.includes(entityType)) {
|
|
27
|
+
return `var(--catalog-entity-bg-color-${entityType})`;
|
|
28
|
+
}
|
|
29
|
+
return 'var(--catalog-entity-bg-color-custom)';
|
|
30
|
+
}};
|
|
24
31
|
flex-shrink: 0;
|
|
25
32
|
border: 1px solid
|
|
26
|
-
${({ defaultColor, entityType }) =>
|
|
27
|
-
|
|
28
|
-
|
|
33
|
+
${({ defaultColor, entityType }) => {
|
|
34
|
+
if (defaultColor) {
|
|
35
|
+
return 'var(--catalog-entity-border-color)';
|
|
36
|
+
}
|
|
37
|
+
if (core_1.PREDEFINED_ENTITY_TYPES.includes(entityType)) {
|
|
38
|
+
return `var(--catalog-entity-border-color-${entityType})`;
|
|
39
|
+
}
|
|
40
|
+
return 'var(--catalog-entity-border-color-custom)';
|
|
41
|
+
}};
|
|
29
42
|
`;
|
|
30
43
|
//# sourceMappingURL=CatalogEntityTypeIcon.js.map
|
|
@@ -9,6 +9,7 @@ const react_1 = __importDefault(require("react"));
|
|
|
9
9
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
10
10
|
const Tag_1 = require("../../components/Tag/Tag");
|
|
11
11
|
const CatalogHighlight_1 = require("../../components/Catalog/CatalogHighlight");
|
|
12
|
+
const core_1 = require("../../core");
|
|
12
13
|
const entityTagColorMap = {
|
|
13
14
|
service: 'blue',
|
|
14
15
|
domain: 'grass',
|
|
@@ -33,8 +34,13 @@ function CatalogEntityTypeTag({ entityType }) {
|
|
|
33
34
|
const EntityTypeTagWrapper = (0, styled_components_1.default)(Tag_1.Tag) `
|
|
34
35
|
font-size: var(--font-size-base);
|
|
35
36
|
background-color: transparent;
|
|
36
|
-
text-transform:
|
|
37
|
-
border: 1px solid
|
|
38
|
-
|
|
37
|
+
text-transform: none;
|
|
38
|
+
border: 1px solid
|
|
39
|
+
${({ entityType }) => !core_1.PREDEFINED_ENTITY_TYPES.includes(entityType)
|
|
40
|
+
? 'var(--catalog-entity-border-color-custom)'
|
|
41
|
+
: `var(--catalog-entity-border-color-${entityType})`};
|
|
42
|
+
color: ${({ entityType }) => !core_1.PREDEFINED_ENTITY_TYPES.includes(entityType)
|
|
43
|
+
? 'var(--catalog-entity-icon-color-custom)'
|
|
44
|
+
: `var(--catalog-entity-icon-color-${entityType})`};
|
|
39
45
|
`;
|
|
40
46
|
//# sourceMappingURL=CatalogEntityTypeTag.js.map
|
|
@@ -132,6 +132,10 @@ exports.catalog = (0, styled_components_1.css) `
|
|
|
132
132
|
--catalog-entity-border-color-api-operation: var(--color-raspberry-3);
|
|
133
133
|
--catalog-entity-bg-color-api-operation: var(--color-raspberry-1);
|
|
134
134
|
|
|
135
|
+
--catalog-entity-icon-color-custom: var(--color-persian-green-8);
|
|
136
|
+
--catalog-entity-border-color-custom: var(--color-persian-green-5);
|
|
137
|
+
--catalog-entity-bg-color-custom: var(--color-persian-green-1);
|
|
138
|
+
|
|
135
139
|
/**
|
|
136
140
|
* @tokens Catalog tags
|
|
137
141
|
*/
|
|
@@ -91,15 +91,13 @@ function TooltipComponent({ children, isOpen, tip, withArrow = true, placement =
|
|
|
91
91
|
}
|
|
92
92
|
}, [isOpened, placement, updateTooltipPosition]);
|
|
93
93
|
(0, react_1.useEffect)(() => {
|
|
94
|
-
if (
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
handleClose();
|
|
100
|
-
}
|
|
94
|
+
if (isOpen && !disabled) {
|
|
95
|
+
handleOpen();
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
handleClose();
|
|
101
99
|
}
|
|
102
|
-
}, [isOpen,
|
|
100
|
+
}, [isOpen, handleOpen, handleClose, disabled]);
|
|
103
101
|
const controllers = !isControlled &&
|
|
104
102
|
!disabled && {
|
|
105
103
|
onMouseEnter: handleOpen,
|
|
@@ -228,7 +226,7 @@ const TooltipBody = styled_components_1.default.span `
|
|
|
228
226
|
display: inline-block;
|
|
229
227
|
|
|
230
228
|
padding: var(--tooltip-padding);
|
|
231
|
-
max-width: var(--tooltip-max-width);
|
|
229
|
+
max-width: ${({ width }) => width || 'var(--tooltip-max-width)'};
|
|
232
230
|
white-space: normal;
|
|
233
231
|
word-break: normal;
|
|
234
232
|
overflow-wrap: break-word;
|
|
@@ -9,7 +9,7 @@ const react_1 = __importDefault(require("react"));
|
|
|
9
9
|
const hooks_1 = require("../../core/hooks");
|
|
10
10
|
const Tooltip_1 = require("../../components/Tooltip/Tooltip");
|
|
11
11
|
function TooltipWrapper({ children, tip, placement = 'top', width = 'max-content', className = '', showOnHover = true, disabled = false, }) {
|
|
12
|
-
const tooltip = (0, hooks_1.useControl)();
|
|
12
|
+
const tooltip = (0, hooks_1.useControl)(false);
|
|
13
13
|
const handleMouseEnter = () => {
|
|
14
14
|
if (showOnHover && !disabled) {
|
|
15
15
|
tooltip.handleOpen();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EntityRelationType } from '../types/catalog';
|
|
2
2
|
export declare const CATALOG_TAG_MAX_LENGTH = 15;
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const PREDEFINED_ENTITY_TYPES: string[];
|
|
4
4
|
export declare const reverseRelationMap: Record<EntityRelationType, EntityRelationType>;
|
|
5
5
|
export declare const relationTypeMap: Record<EntityRelationType, string>;
|
|
6
6
|
export declare enum GraphHandleType {
|
|
@@ -1,33 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GraphCustomEdgeType = exports.GraphCustomNodeType = exports.GraphHandleType = exports.relationTypeMap = exports.reverseRelationMap = exports.
|
|
3
|
+
exports.GraphCustomEdgeType = exports.GraphCustomNodeType = exports.GraphHandleType = exports.relationTypeMap = exports.reverseRelationMap = exports.PREDEFINED_ENTITY_TYPES = exports.CATALOG_TAG_MAX_LENGTH = void 0;
|
|
4
4
|
exports.CATALOG_TAG_MAX_LENGTH = 15;
|
|
5
|
-
exports.
|
|
6
|
-
'
|
|
7
|
-
'
|
|
8
|
-
'
|
|
9
|
-
'
|
|
10
|
-
'
|
|
11
|
-
'
|
|
12
|
-
'
|
|
13
|
-
'implementedBy',
|
|
14
|
-
'dependsOn',
|
|
15
|
-
'dependencyOf',
|
|
16
|
-
'uses',
|
|
17
|
-
'usedBy',
|
|
18
|
-
'produces',
|
|
19
|
-
'consumes',
|
|
20
|
-
'linksTo',
|
|
21
|
-
'supersedes',
|
|
22
|
-
'supersededBy',
|
|
23
|
-
'compatibleWith',
|
|
24
|
-
'extends',
|
|
25
|
-
'extendedBy',
|
|
26
|
-
'relatesTo',
|
|
27
|
-
'hasMember',
|
|
28
|
-
'memberOf',
|
|
29
|
-
'triggers',
|
|
30
|
-
'triggeredBy',
|
|
5
|
+
exports.PREDEFINED_ENTITY_TYPES = [
|
|
6
|
+
'service',
|
|
7
|
+
'domain',
|
|
8
|
+
'team',
|
|
9
|
+
'user',
|
|
10
|
+
'api-description',
|
|
11
|
+
'data-schema',
|
|
12
|
+
'api-operation',
|
|
31
13
|
];
|
|
32
14
|
exports.reverseRelationMap = {
|
|
33
15
|
partOf: 'hasParts',
|
|
@@ -2,10 +2,25 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useControl = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
+
const DEFAULT_CONTROL_OPEN_DELAY = 300;
|
|
5
6
|
const useControl = (initialVal = false) => {
|
|
6
7
|
const [isOpened, setIsOpened] = (0, react_1.useState)(initialVal);
|
|
7
|
-
const
|
|
8
|
-
const
|
|
8
|
+
const timeoutRef = (0, react_1.useRef)(null);
|
|
9
|
+
const clearOpenTimer = (0, react_1.useCallback)(() => {
|
|
10
|
+
if (timeoutRef.current) {
|
|
11
|
+
clearTimeout(timeoutRef.current);
|
|
12
|
+
}
|
|
13
|
+
}, []);
|
|
14
|
+
const handleOpen = (0, react_1.useCallback)(() => {
|
|
15
|
+
clearOpenTimer();
|
|
16
|
+
timeoutRef.current = setTimeout(() => {
|
|
17
|
+
setIsOpened(true);
|
|
18
|
+
}, DEFAULT_CONTROL_OPEN_DELAY);
|
|
19
|
+
}, [clearOpenTimer]);
|
|
20
|
+
const handleClose = (0, react_1.useCallback)(() => {
|
|
21
|
+
clearOpenTimer();
|
|
22
|
+
setIsOpened(false);
|
|
23
|
+
}, [clearOpenTimer]);
|
|
9
24
|
return {
|
|
10
25
|
isOpened,
|
|
11
26
|
handleOpen,
|
|
@@ -9,6 +9,7 @@ export { useMount } from '../hooks/use-mount';
|
|
|
9
9
|
export { GlobalStyle } from '../styles/global';
|
|
10
10
|
export { breakpoints } from '../utils/media-css';
|
|
11
11
|
export { isPrimitive } from '../utils/args-typecheck';
|
|
12
|
+
export { ClipboardService } from '../utils/clipboard-service';
|
|
12
13
|
export { getUserAgent } from '../utils/get-user-agent';
|
|
13
14
|
export { useFocusTrap } from '../hooks/use-focus-trap';
|
|
14
15
|
export { useThemeHooks } from '../hooks/use-theme-hooks';
|
|
@@ -20,4 +21,3 @@ export { useDialogHotKeys } from '../hooks/use-dialog-hotkeys';
|
|
|
20
21
|
export { SecurityVariablesEnvSuffix } from '../constants/environments';
|
|
21
22
|
export { isUndefined, isString, isNotNull, isObject } from '../utils/type-guards';
|
|
22
23
|
export { ThemeDataContext, type ThemeDataTransferObject } from '../contexts/ThemeDataContext';
|
|
23
|
-
export { ENTITY_RELATION_TYPES } from '../constants/catalog';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ThemeDataContext = exports.isObject = exports.isNotNull = exports.isString = exports.isUndefined = exports.SecurityVariablesEnvSuffix = exports.useDialogHotKeys = exports.useSearchDialog = exports.useModalScrollLock = exports.useActiveSectionId = exports.useOutsideClick = exports.useThemeHooks = exports.useFocusTrap = exports.getUserAgent = exports.ClipboardService = exports.isPrimitive = exports.breakpoints = exports.GlobalStyle = exports.useMount = exports.typedMemo = exports.withPathPrefix = exports.addTrailingSlash = exports.combineUrls = exports.getPathPrefix = exports.removeLeadingSlash = exports.addLeadingSlash = exports.IS_BROWSER = void 0;
|
|
4
4
|
var dom_1 = require("../utils/dom");
|
|
5
5
|
Object.defineProperty(exports, "IS_BROWSER", { enumerable: true, get: function () { return dom_1.IS_BROWSER; } });
|
|
6
6
|
var urls_1 = require("../utils/urls");
|
|
@@ -20,6 +20,8 @@ var media_css_1 = require("../utils/media-css");
|
|
|
20
20
|
Object.defineProperty(exports, "breakpoints", { enumerable: true, get: function () { return media_css_1.breakpoints; } });
|
|
21
21
|
var args_typecheck_1 = require("../utils/args-typecheck");
|
|
22
22
|
Object.defineProperty(exports, "isPrimitive", { enumerable: true, get: function () { return args_typecheck_1.isPrimitive; } });
|
|
23
|
+
var clipboard_service_1 = require("../utils/clipboard-service");
|
|
24
|
+
Object.defineProperty(exports, "ClipboardService", { enumerable: true, get: function () { return clipboard_service_1.ClipboardService; } });
|
|
23
25
|
var get_user_agent_1 = require("../utils/get-user-agent");
|
|
24
26
|
Object.defineProperty(exports, "getUserAgent", { enumerable: true, get: function () { return get_user_agent_1.getUserAgent; } });
|
|
25
27
|
var use_focus_trap_1 = require("../hooks/use-focus-trap");
|
|
@@ -45,6 +47,4 @@ Object.defineProperty(exports, "isNotNull", { enumerable: true, get: function ()
|
|
|
45
47
|
Object.defineProperty(exports, "isObject", { enumerable: true, get: function () { return type_guards_1.isObject; } });
|
|
46
48
|
var ThemeDataContext_1 = require("../contexts/ThemeDataContext");
|
|
47
49
|
Object.defineProperty(exports, "ThemeDataContext", { enumerable: true, get: function () { return ThemeDataContext_1.ThemeDataContext; } });
|
|
48
|
-
var catalog_1 = require("../constants/catalog");
|
|
49
|
-
Object.defineProperty(exports, "ENTITY_RELATION_TYPES", { enumerable: true, get: function () { return catalog_1.ENTITY_RELATION_TYPES; } });
|
|
50
50
|
//# sourceMappingURL=index.js.map
|
|
@@ -773,6 +773,25 @@ const apiReferenceDocs = (0, styled_components_1.css) `
|
|
|
773
773
|
--fab-icon-color: var(--navbar-text-color); // @presenter Color
|
|
774
774
|
|
|
775
775
|
// @tokens End
|
|
776
|
+
|
|
777
|
+
/**
|
|
778
|
+
* @tokens OpenAPI Schema Catalog Link
|
|
779
|
+
*/
|
|
780
|
+
|
|
781
|
+
--schema-catalog-link-margin-bottom: var(--spacing-lg);
|
|
782
|
+
--schema-catalog-link-padding: 2px;
|
|
783
|
+
--schema-catalog-link-border-radius: var(--border-radius-md);
|
|
784
|
+
--schema-catalog-link-background-color: var(--layer-color);
|
|
785
|
+
--schema-catalog-link-color: var(--color-purple-7);
|
|
786
|
+
|
|
787
|
+
--schema-catalog-link-share-icon-color: var(--color-purple-7);
|
|
788
|
+
--schema-catalog-link-share-icon-background-color: var(--color-purple-1);
|
|
789
|
+
--schema-catalog-link-share-icon-border-radius: var(--border-radius-md);
|
|
790
|
+
--schema-catalog-link-share-icon-wrapper-size: var(--spacing-xl);
|
|
791
|
+
|
|
792
|
+
--schema-catalog-link-text-color: var(--text-color-primary);
|
|
793
|
+
|
|
794
|
+
// @tokens End
|
|
776
795
|
`;
|
|
777
796
|
const badges = (0, styled_components_1.css) `
|
|
778
797
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InfiniteData, UseInfiniteQueryResult } from '@tanstack/react-query';
|
|
2
2
|
import { CatalogEntityConfig, LayoutVariant } from '@redocly/config';
|
|
3
|
+
import { ENTITY_RELATION_TYPES } from '@redocly/config';
|
|
3
4
|
import type { CatalogFilterConfig } from '../../config';
|
|
4
|
-
import { ENTITY_RELATION_TYPES } from '../constants/catalog';
|
|
5
5
|
export type SortOption = 'title' | '-title' | 'type' | '-type';
|
|
6
6
|
export type UseCatalogResponse = {
|
|
7
7
|
filters: ResolvedFilter[];
|
package/lib/core/types/l10n.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TOptions } from 'i18next';
|
|
2
|
-
export type TranslationKey = 'dev.newApp' | 'dev.newApp.text' | 'dev.sidebar.header' | 'dev.sidebar.footer.text' | 'dev.create.app.dialog.appName.placeholder' | 'dev.create.app.dialog.appName.error' | 'dev.create.app.dialog.selectAPIs' | 'dev.create.app.dialog.description' | 'dev.create.app.dialog.description.placeholder' | 'dev.create.app.dialog.create' | 'dev.create.app.dialog.cancel' | 'dev.main.tab.appKeys' | 'dev.main.tab.logs' | 'dev.app.description.title' | 'dev.edit.description.dialog.title' | 'dev.edit.description.dialog.save' | 'dev.edit.description.dialog.cancel' | 'dev.edit.apis.dialog.selectedAPIs' | 'dev.app.key.create' | 'dev.create.key.dialog.title' | 'dev.create.key.dialog.create' | 'dev.create.key.dialog.cancel' | 'dev.app.edit' | 'dev.app.delete' | 'dev.edit.app.dialog.title' | 'dev.edit.app.dialog.save' | 'dev.edit.app.dialog.cancel' | 'dev.delete.app.dialog.title' | 'dev.delete.app.dialog.confirmation' | 'dev.delete.app.dialog.delete' | 'dev.delete.app.dialog.cancel' | 'dev.app.key.roll' | 'dev.roll.key.dialog.title' | 'dev.roll.key.dialog.apiKey' | 'dev.roll.key.dialog.expires' | 'dev.roll.key.dialog.confirmation' | 'dev.roll.key.dialog.cancel' | 'dev.roll.key.dialog.roll' | 'dev.update.key.dialog.title' | 'dev.update.key.dialog.update' | 'dev.update.key.dialog.cancel' | 'dev.app.key.api.name' | 'dev.app.key.api.status' | 'dev.app.key.api.edit' | 'dev.edit.apis.dialog.title' | 'dev.edit.apis.dialog.apiKey' | 'dev.edit.apis.dialog.save' | 'dev.edit.apis.dialog.cancel' | 'dev.select.placeholder' | 'dev.app.overview.status.pending' | 'dev.app.overview.status.approved' | 'dev.app.overview.status.revoked' | 'dev.app.overview.status' | 'dev.app.overview.non-production' | 'dev.app.overview.production' | 'dev.app.overview.clientId' | 'dev.app.overview.apiKey' | 'dev.app.key.revoke' | 'dev.revoke.key.dialog.title' | 'dev.revoke.key.dialog.apiKey' | 'dev.revoke.key.dialog.expires' | 'dev.revoke.key.dialog.confirmation' | 'dev.revoke.key.dialog.revoke' | 'dev.revoke.key.dialog.cancel' | 'dev.app.overview.expires' | 'dev.app.overview.created' | 'dev.app.overview.visibilityToggle.hide' | 'dev.app.overview.visibilityToggle.show' | 'search.loading' | 'search.noResults.title' | 'search.keys.navigate' | 'search.keys.select' | 'search.keys.exit' | 'search.label' | 'search.cancel' | 'search.recent' | 'search.navbar.label' | 'search.suggested' | 'search.showMore' | 'search.filter.title' | 'search.filter.reset' | 'search.filter.field.reset' | 'search.ai.welcomeText' | 'search.ai.newConversation' | 'search.ai.backToSearch' | 'search.ai.placeholder' | 'search.ai.generatingResponse' | 'search.ai.followUpQuestion' | 'search.ai.suggestionsTitle' | 'search.ai.thinkingText' | 'search.ai.resourcesFound' | 'search.ai.resourcesFound.basedOn' | 'search.ai.resourcesFound.resources' | 'search.ai.button' | 'search.ai.label' | 'search.ai.disclaimer' | 'search.ai.error.description' | 'search.ai.error.description.forbidden' | 'search.ai.error.description.unauthorized' | 'search.ai.error.header' | 'search.ai.error.header.forbidden' | 'search.ai.error.header.unauthorized' | 'toc.header' | 'footer.copyrightText' | 'page.homeButton' | 'page.forbidden.title' | 'page.notFound.title' | 'page.notFound.description' | 'page.lastUpdated.timeago' | 'page.lastUpdated.on' | 'catalog.filters.placeholder' | 'catalog.filters.title' | 'catalog.filters.add' | 'catalog.filters.clearAll' | 'catalog.filters.select.addFilter' | 'catalog.filters.select.all' | 'catalog.filters.done' | 'catalog.catalogs.all.title' | 'catalog.catalogs.all.description' | 'catalog.catalogs.all.switcherLabel' | 'catalog.catalogs.service.title' | 'catalog.catalogs.service.description' | 'catalog.catalogs.service.switcherLabel' | 'catalog.catalogs.user.title' | 'catalog.catalogs.user.description' | 'catalog.catalogs.user.switcherLabel' | 'catalog.catalogs.team.title' | 'catalog.catalogs.team.description' | 'catalog.catalogs.team.switcherLabel' | 'catalog.catalogs.domain.title' | 'catalog.catalogs.domain.description' | 'catalog.catalogs.domain.switcherLabel' | 'catalog.catalogs.apiDescription.title' | 'catalog.catalogs.apiDescription.description' | 'catalog.catalogs.apiDescription.switcherLabel' | 'catalog.catalogs.dataSchema.title' | 'catalog.catalogs.dataSchema.description' | 'catalog.catalogs.dataSchema.switcherLabel' | 'catalog.catalogs.apiOperation.title' | 'catalog.catalogs.apiOperation.description' | 'catalog.catalogs.apiOperation.switcherLabel' | 'catalog.entity.metadata.title' | 'catalog.entity.schema.title' | 'catalog.entity.properties.apiDescription.title' | 'sidebar.menu.backLabel' | 'sidebar.menu.backToLabel' | 'sidebar.actions.show' | 'sidebar.actions.hide' | 'sidebar.actions.changeToSingleColumn' | 'sidebar.actions.changeToTwoColumns' | 'sidebar.actions.singleColumn' | 'sidebar.actions.twoColumns' | 'versionPicker.label' | 'versionPicker.unversioned' | 'codeSnippet.copy.buttonText' | 'codeSnippet.copy.tooltipText' | 'codeSnippet.copy.toasterText' | 'markdown.editPage.text' | 'feedback.settings.comment.submitText' | 'feedback.settings.comment.label' | 'feedback.settings.comment.send' | 'feedback.settings.comment.cancel' | 'feedback.settings.comment.satisfiedLabel' | 'feedback.settings.comment.neutralLabel' | 'feedback.settings.comment.dissatisfiedLabel' | 'feedback.settings.submitText' | 'feedback.settings.label' | 'feedback.settings.reasons.label' | 'feedback.submit' | 'feedback.cancel' | 'feedback.settings.comment.likeLabel' | 'feedback.settings.comment.dislikeLabel' | 'feedback.sentiment.thumbUp' | 'feedback.sentiment.thumbDown' | 'feedback.settings.leftScaleLabel' | 'feedback.settings.rightScaleLabel' | 'feedback.settings.optionalEmail.placeholder' | 'feedback.settings.optionalEmail.label' | 'codeSnippet.report.buttonText' | 'codeSnippet.report.tooltipText' | 'codeSnippet.report.label' | 'codeSnippet.expand.tooltipText' | 'codeSnippet.collapse.tooltipText' | 'userMenu.login' | 'userMenu.logout' | 'userMenu.devOnboardingLabel' | 'mobileMenu.mainMenu' | 'mobileMenu.previous' | 'mobileMenu.products' | 'mobileMenu.version' | 'navbar.products' | 'page.nextButton' | 'page.previousButton' | 'page.actions.copyButtonText' | 'page.actions.copyTitle' | 'page.actions.copyDescription' | 'page.actions.viewAsMdTitle' | 'page.actions.viewAsMdButtonText' | 'page.actions.viewAsMdDescription' | 'page.actions.chatGptTitle' | 'page.actions.chatGptButtonText' | 'page.actions.chatGptDescription' | 'page.actions.claudeTitle' | 'page.actions.claudeButtonText' | 'page.actions.claudeDescription' | 'openapi.download.description.title' | 'openapi.info.title' | 'openapi.info.contact.url' | 'openapi.info.contact.name' | 'openapi.info.license' | 'openapi.info.termsOfService' | 'openapi.info.metadata.title' | 'openapi.key' | 'openapi.value' | 'openapi.enum' | 'openapi.items' | 'openapi.default' | 'openapi.variable' | 'openapi.variables' | 'openapi.actions.show' | 'openapi.actions.hide' | 'openapi.actions.more' | 'openapi.languages.title' | 'openapi.servers.title' | 'openapi.operations' | 'openapi.webhooks' | 'openapi.description' | 'openapi.badges.deprecated' | 'openapi.badges.required' | 'openapi.badges.webhook' | 'openapi.request' | 'openapi.path' | 'openapi.query' | 'openapi.cookie' | 'openapi.header' | 'openapi.body' | 'openapi.responses' | 'openapi.response' | 'openapi.callbacks' | 'openapi.callbackRequest' | 'openapi.callbackResponse' | 'openapi.payload' | 'openapi.discriminator' | 'openapi.contentType' | 'openapi.tryIt' | 'openapi.loading' | 'openapi.example' | 'openapi.examples' | 'openapi.additionalProperties' | 'openapi.patternProperties' | 'openapi.required' | 'openapi.recursive' | 'openapi.complex' | 'openapi.hideExample' | 'openapi.showExample' | 'openapi.expandAll' | 'openapi.collapseAll' | 'openapi.viewSecurityDetails' | 'openapi.noResponseExample' | 'openapi.discriminator.searchPlaceholder' | 'openapi.discriminator.searchNoResults' | 'openapi.noResponseContent' | 'openapi.noRequestPayload' | 'openapi.hidePattern' | 'openapi.showPattern' | 'openapi.authorizationUrl' | 'openapi.tokenUrl' | 'openapi.refreshUrl' | 'openapi.showOptionalScopes' | 'openapi.hideOptionalScopes' | 'openapi.security' | 'openapi.httpAuthorizationScheme' | 'openapi.bearerFormat' | 'openapi.parameterName' | 'openapi.flowType' | 'openapi.connectUrl' | 'openapi.requiredScopes' | 'openapi.unsupportedLanguage' | 'openapi.failedToGenerateCodeSample' | 'asyncapi.download.description.title' | 'asyncapi.info.title' | 'graphql.queries' | 'graphql.mutations' | 'graphql.subscriptions' | 'graphql.directives' | 'graphql.objects' | 'graphql.interfaces' | 'graphql.unions' | 'graphql.enums' | 'graphql.inputs' | 'graphql.scalars' | 'graphql.arguments.label' | 'graphql.arguments.show' | 'graphql.arguments.hide' | 'graphql.arguments.here' | 'graphql.returnTypes.label' | 'graphql.returnTypes.show' | 'graphql.returnTypes.hide' | 'graphql.possibleTypes' | 'graphql.defaultValue' | 'graphql.deprecationReason' | 'graphql.requiredScopes' | 'graphql.viewSecurityDetails' | 'graphql.objectScopes' | 'graphql.fieldScopes' | 'graphql.implementedInterfaces' | 'graphql.nonNull' | 'graphql.required' | 'graphql.deprecated' | 'graphql.variables' | 'graphql.querySample' | 'graphql.mutationSample' | 'graphql.subscriptionSample' | 'graphql.responseSample' | 'graphql.locations' | 'graphql.sample' | 'graphql.referenced' | 'graphql.content.fragment' | 'codeWalkthrough.download' | 'codeWalkthrough.preview' | 'time.justNow' | 'time.past.second' | 'time.past.seconds' | 'time.past.minute' | 'time.past.minutes' | 'time.past.hour' | 'time.past.hours' | 'time.past.day' | 'time.past.days' | 'time.past.week' | 'time.past.weeks' | 'time.past.month' | 'time.past.months' | 'time.past.year' | 'time.past.years' | 'page.internalServerError.title' | 'page.internalServerError.description' | 'page.skipToContent.label';
|
|
2
|
+
export type TranslationKey = 'dev.newApp' | 'dev.newApp.text' | 'dev.sidebar.header' | 'dev.sidebar.footer.text' | 'dev.create.app.dialog.appName.placeholder' | 'dev.create.app.dialog.appName.error' | 'dev.create.app.dialog.selectAPIs' | 'dev.create.app.dialog.description' | 'dev.create.app.dialog.description.placeholder' | 'dev.create.app.dialog.create' | 'dev.create.app.dialog.cancel' | 'dev.main.tab.appKeys' | 'dev.main.tab.logs' | 'dev.app.description.title' | 'dev.edit.description.dialog.title' | 'dev.edit.description.dialog.save' | 'dev.edit.description.dialog.cancel' | 'dev.edit.apis.dialog.selectedAPIs' | 'dev.app.key.create' | 'dev.create.key.dialog.title' | 'dev.create.key.dialog.create' | 'dev.create.key.dialog.cancel' | 'dev.app.edit' | 'dev.app.delete' | 'dev.edit.app.dialog.title' | 'dev.edit.app.dialog.save' | 'dev.edit.app.dialog.cancel' | 'dev.delete.app.dialog.title' | 'dev.delete.app.dialog.confirmation' | 'dev.delete.app.dialog.delete' | 'dev.delete.app.dialog.cancel' | 'dev.app.key.roll' | 'dev.roll.key.dialog.title' | 'dev.roll.key.dialog.apiKey' | 'dev.roll.key.dialog.expires' | 'dev.roll.key.dialog.confirmation' | 'dev.roll.key.dialog.cancel' | 'dev.roll.key.dialog.roll' | 'dev.update.key.dialog.title' | 'dev.update.key.dialog.update' | 'dev.update.key.dialog.cancel' | 'dev.app.key.api.name' | 'dev.app.key.api.status' | 'dev.app.key.api.edit' | 'dev.edit.apis.dialog.title' | 'dev.edit.apis.dialog.apiKey' | 'dev.edit.apis.dialog.save' | 'dev.edit.apis.dialog.cancel' | 'dev.select.placeholder' | 'dev.app.overview.status.pending' | 'dev.app.overview.status.approved' | 'dev.app.overview.status.revoked' | 'dev.app.overview.status' | 'dev.app.overview.non-production' | 'dev.app.overview.production' | 'dev.app.overview.clientId' | 'dev.app.overview.apiKey' | 'dev.app.key.revoke' | 'dev.revoke.key.dialog.title' | 'dev.revoke.key.dialog.apiKey' | 'dev.revoke.key.dialog.expires' | 'dev.revoke.key.dialog.confirmation' | 'dev.revoke.key.dialog.revoke' | 'dev.revoke.key.dialog.cancel' | 'dev.app.overview.expires' | 'dev.app.overview.created' | 'dev.app.overview.visibilityToggle.hide' | 'dev.app.overview.visibilityToggle.show' | 'search.loading' | 'search.noResults.title' | 'search.keys.navigate' | 'search.keys.select' | 'search.keys.exit' | 'search.label' | 'search.cancel' | 'search.recent' | 'search.navbar.label' | 'search.suggested' | 'search.showMore' | 'search.filter.title' | 'search.filter.reset' | 'search.filter.field.reset' | 'search.ai.welcomeText' | 'search.ai.newConversation' | 'search.ai.backToSearch' | 'search.ai.placeholder' | 'search.ai.generatingResponse' | 'search.ai.followUpQuestion' | 'search.ai.suggestionsTitle' | 'search.ai.thinkingText' | 'search.ai.resourcesFound' | 'search.ai.resourcesFound.basedOn' | 'search.ai.resourcesFound.resources' | 'search.ai.button' | 'search.ai.label' | 'search.ai.disclaimer' | 'search.ai.error.description' | 'search.ai.error.description.forbidden' | 'search.ai.error.description.unauthorized' | 'search.ai.error.header' | 'search.ai.error.header.forbidden' | 'search.ai.error.header.unauthorized' | 'toc.header' | 'footer.copyrightText' | 'page.homeButton' | 'page.forbidden.title' | 'page.notFound.title' | 'page.notFound.description' | 'page.lastUpdated.timeago' | 'page.lastUpdated.on' | 'catalog.filters.placeholder' | 'catalog.filters.title' | 'catalog.filters.add' | 'catalog.filters.clearAll' | 'catalog.filters.select.addFilter' | 'catalog.filters.select.all' | 'catalog.filters.done' | 'catalog.catalogs.all.title' | 'catalog.catalogs.all.description' | 'catalog.catalogs.all.switcherLabel' | 'catalog.catalogs.service.title' | 'catalog.catalogs.service.description' | 'catalog.catalogs.service.switcherLabel' | 'catalog.catalogs.user.title' | 'catalog.catalogs.user.description' | 'catalog.catalogs.user.switcherLabel' | 'catalog.catalogs.team.title' | 'catalog.catalogs.team.description' | 'catalog.catalogs.team.switcherLabel' | 'catalog.catalogs.domain.title' | 'catalog.catalogs.domain.description' | 'catalog.catalogs.domain.switcherLabel' | 'catalog.catalogs.apiDescription.title' | 'catalog.catalogs.apiDescription.description' | 'catalog.catalogs.apiDescription.switcherLabel' | 'catalog.catalogs.dataSchema.title' | 'catalog.catalogs.dataSchema.description' | 'catalog.catalogs.dataSchema.switcherLabel' | 'catalog.catalogs.apiOperation.title' | 'catalog.catalogs.apiOperation.description' | 'catalog.catalogs.apiOperation.switcherLabel' | 'catalog.entity.metadata.title' | 'catalog.entity.schema.title' | 'catalog.entity.properties.apiDescription.title' | 'sidebar.menu.backLabel' | 'sidebar.menu.backToLabel' | 'sidebar.actions.show' | 'sidebar.actions.hide' | 'sidebar.actions.changeToSingleColumn' | 'sidebar.actions.changeToTwoColumns' | 'sidebar.actions.singleColumn' | 'sidebar.actions.twoColumns' | 'versionPicker.label' | 'versionPicker.unversioned' | 'codeSnippet.copy.buttonText' | 'codeSnippet.copy.tooltipText' | 'codeSnippet.copy.toasterText' | 'markdown.editPage.text' | 'feedback.settings.comment.submitText' | 'feedback.settings.comment.label' | 'feedback.settings.comment.send' | 'feedback.settings.comment.cancel' | 'feedback.settings.comment.satisfiedLabel' | 'feedback.settings.comment.neutralLabel' | 'feedback.settings.comment.dissatisfiedLabel' | 'feedback.settings.submitText' | 'feedback.settings.label' | 'feedback.settings.reasons.label' | 'feedback.submit' | 'feedback.cancel' | 'feedback.settings.comment.likeLabel' | 'feedback.settings.comment.dislikeLabel' | 'feedback.sentiment.thumbUp' | 'feedback.sentiment.thumbDown' | 'feedback.settings.leftScaleLabel' | 'feedback.settings.rightScaleLabel' | 'feedback.settings.optionalEmail.placeholder' | 'feedback.settings.optionalEmail.label' | 'codeSnippet.report.buttonText' | 'codeSnippet.report.tooltipText' | 'codeSnippet.report.label' | 'codeSnippet.expand.tooltipText' | 'codeSnippet.collapse.tooltipText' | 'userMenu.login' | 'userMenu.logout' | 'userMenu.devOnboardingLabel' | 'mobileMenu.mainMenu' | 'mobileMenu.previous' | 'mobileMenu.products' | 'mobileMenu.version' | 'navbar.products' | 'page.nextButton' | 'page.previousButton' | 'page.actions.copyButtonText' | 'page.actions.copyTitle' | 'page.actions.copyDescription' | 'page.actions.viewAsMdTitle' | 'page.actions.viewAsMdButtonText' | 'page.actions.viewAsMdDescription' | 'page.actions.chatGptTitle' | 'page.actions.chatGptButtonText' | 'page.actions.chatGptDescription' | 'page.actions.claudeTitle' | 'page.actions.claudeButtonText' | 'page.actions.claudeDescription' | 'openapi.download.description.title' | 'openapi.info.title' | 'openapi.info.contact.url' | 'openapi.info.contact.name' | 'openapi.info.license' | 'openapi.info.termsOfService' | 'openapi.info.metadata.title' | 'openapi.key' | 'openapi.value' | 'openapi.enum' | 'openapi.items' | 'openapi.default' | 'openapi.variable' | 'openapi.variables' | 'openapi.actions.show' | 'openapi.actions.hide' | 'openapi.actions.more' | 'openapi.languages.title' | 'openapi.servers.title' | 'openapi.operations' | 'openapi.webhooks' | 'openapi.description' | 'openapi.badges.deprecated' | 'openapi.badges.required' | 'openapi.badges.webhook' | 'openapi.request' | 'openapi.path' | 'openapi.query' | 'openapi.cookie' | 'openapi.header' | 'openapi.body' | 'openapi.responses' | 'openapi.response' | 'openapi.callbacks' | 'openapi.callbackRequest' | 'openapi.callbackResponse' | 'openapi.payload' | 'openapi.discriminator' | 'openapi.contentType' | 'openapi.tryIt' | 'openapi.loading' | 'openapi.example' | 'openapi.examples' | 'openapi.additionalProperties' | 'openapi.patternProperties' | 'openapi.required' | 'openapi.recursive' | 'openapi.complex' | 'openapi.hideExample' | 'openapi.showExample' | 'openapi.expandAll' | 'openapi.collapseAll' | 'openapi.viewSecurityDetails' | 'openapi.noResponseExample' | 'openapi.discriminator.searchPlaceholder' | 'openapi.discriminator.searchNoResults' | 'openapi.noResponseContent' | 'openapi.noRequestPayload' | 'openapi.hidePattern' | 'openapi.showPattern' | 'openapi.authorizationUrl' | 'openapi.tokenUrl' | 'openapi.refreshUrl' | 'openapi.showOptionalScopes' | 'openapi.hideOptionalScopes' | 'openapi.security' | 'openapi.httpAuthorizationScheme' | 'openapi.bearerFormat' | 'openapi.parameterName' | 'openapi.flowType' | 'openapi.connectUrl' | 'openapi.requiredScopes' | 'openapi.unsupportedLanguage' | 'openapi.failedToGenerateCodeSample' | 'openapi.schemaCatalogLink.title' | 'openapi.schemaCatalogLink.copyButtonTooltip' | 'openapi.schemaCatalogLink.copiedTooltip' | 'asyncapi.download.description.title' | 'asyncapi.info.title' | 'graphql.queries' | 'graphql.mutations' | 'graphql.subscriptions' | 'graphql.directives' | 'graphql.objects' | 'graphql.interfaces' | 'graphql.unions' | 'graphql.enums' | 'graphql.inputs' | 'graphql.scalars' | 'graphql.arguments.label' | 'graphql.arguments.show' | 'graphql.arguments.hide' | 'graphql.arguments.here' | 'graphql.returnTypes.label' | 'graphql.returnTypes.show' | 'graphql.returnTypes.hide' | 'graphql.possibleTypes' | 'graphql.defaultValue' | 'graphql.deprecationReason' | 'graphql.requiredScopes' | 'graphql.viewSecurityDetails' | 'graphql.objectScopes' | 'graphql.fieldScopes' | 'graphql.implementedInterfaces' | 'graphql.nonNull' | 'graphql.required' | 'graphql.deprecated' | 'graphql.variables' | 'graphql.querySample' | 'graphql.mutationSample' | 'graphql.subscriptionSample' | 'graphql.responseSample' | 'graphql.locations' | 'graphql.sample' | 'graphql.referenced' | 'graphql.content.fragment' | 'codeWalkthrough.download' | 'codeWalkthrough.preview' | 'time.justNow' | 'time.past.second' | 'time.past.seconds' | 'time.past.minute' | 'time.past.minutes' | 'time.past.hour' | 'time.past.hours' | 'time.past.day' | 'time.past.days' | 'time.past.week' | 'time.past.weeks' | 'time.past.month' | 'time.past.months' | 'time.past.year' | 'time.past.years' | 'page.internalServerError.title' | 'page.internalServerError.description' | 'page.skipToContent.label';
|
|
3
3
|
export type Locale = {
|
|
4
4
|
code: string;
|
|
5
5
|
name: string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { IconProps } from '../../icons/types';
|
|
3
|
+
export declare const NoteIcon: 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,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.NoteIcon = 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({ xmlns: "http://www.w3.org/2000/svg", width: "8", height: "12", viewBox: "0 0 8 12", fill: "none" }, props),
|
|
11
|
+
react_1.default.createElement("path", { d: "M7.6375 3.4875L5.0125 0.8625C4.9375 0.7875 4.8625 0.75 4.75 0.75H1C0.5875 0.75 0.25 1.0875 0.25 1.5V10.5C0.25 10.9125 0.5875 11.25 1 11.25H7C7.4125 11.25 7.75 10.9125 7.75 10.5V3.75C7.75 3.6375 7.7125 3.5625 7.6375 3.4875ZM4.75 1.65L6.85 3.75H4.75V1.65ZM7 10.5H1V1.5H4V3.75C4 4.1625 4.3375 4.5 4.75 4.5H7V10.5Z", fill: "currentColor" }),
|
|
12
|
+
react_1.default.createElement("path", { d: "M6.25 8.25H1.75V9H6.25V8.25Z", fill: "currentColor" }),
|
|
13
|
+
react_1.default.createElement("path", { d: "M6.25 6H1.75V6.75H6.25V6Z", fill: "currentColor" })));
|
|
14
|
+
exports.NoteIcon = (0, styled_components_1.default)(Icon).attrs(() => ({
|
|
15
|
+
'data-component-name': 'icons/NoteIcon/NoteIcon',
|
|
16
|
+
})) `
|
|
17
|
+
path {
|
|
18
|
+
fill: ${({ color }) => (0, utils_1.getCssColorVariable)(color)};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
height: ${({ size }) => size || '16px'};
|
|
22
|
+
width: ${({ size }) => size || '16px'};
|
|
23
|
+
`;
|
|
24
|
+
//# sourceMappingURL=NoteIcon.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { IconProps } from '../../icons/types';
|
|
3
|
+
export declare const ShareIcon: 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,22 @@
|
|
|
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.ShareIcon = 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: "M11.5 10.0001C11.1257 10.002 10.7566 10.0879 10.42 10.2514C10.0834 10.415 9.78776 10.652 9.55497 10.9451L5.89997 8.6601C6.03318 8.23018 6.03318 7.77002 5.89997 7.3401L9.55497 5.0551C9.92594 5.51446 10.4475 5.82769 11.0273 5.93931C11.6071 6.05092 12.2077 5.95372 12.7227 5.66491C13.2377 5.37611 13.6339 4.91435 13.841 4.36143C14.0482 3.8085 14.0529 3.20011 13.8544 2.64402C13.656 2.08793 13.2671 1.62003 12.7567 1.32322C12.2462 1.0264 11.6472 0.919827 11.0657 1.02237C10.4843 1.12491 9.95785 1.42996 9.57975 1.88346C9.20164 2.33697 8.99626 2.90966 8.99997 3.5001C9.00233 3.72369 9.03599 3.94585 9.09997 4.1601L5.44497 6.4451C5.12229 6.03889 4.68124 5.74313 4.18295 5.5988C3.68465 5.45447 3.1538 5.46873 2.66398 5.63961C2.17415 5.81048 1.74961 6.1295 1.44921 6.55245C1.14881 6.9754 0.987427 7.48133 0.987427 8.0001C0.987427 8.51888 1.14881 9.0248 1.44921 9.44775C1.74961 9.8707 2.17415 10.1897 2.66398 10.3606C3.1538 10.5315 3.68465 10.5457 4.18295 10.4014C4.68124 10.2571 5.12229 9.96131 5.44497 9.5551L9.09997 11.8401C9.03599 12.0544 9.00233 12.2765 8.99997 12.5001C8.99997 12.9946 9.14659 13.4779 9.4213 13.889C9.696 14.3002 10.0864 14.6206 10.5433 14.8098C11.0001 14.999 11.5027 15.0485 11.9877 14.9521C12.4726 14.8556 12.9181 14.6175 13.2677 14.2679C13.6174 13.9182 13.8555 13.4728 13.9519 12.9878C14.0484 12.5029 13.9989 12.0002 13.8097 11.5434C13.6204 11.0866 13.3 10.6961 12.8889 10.4214C12.4778 10.1467 11.9944 10.0001 11.5 10.0001ZM11.5 2.0001C11.7966 2.0001 12.0867 2.08808 12.3333 2.2529C12.58 2.41772 12.7723 2.65199 12.8858 2.92608C12.9993 3.20017 13.029 3.50177 12.9711 3.79274C12.9133 4.08371 12.7704 4.35098 12.5606 4.56076C12.3509 4.77054 12.0836 4.9134 11.7926 4.97128C11.5016 5.02916 11.2 4.99945 10.9259 4.88592C10.6519 4.77239 10.4176 4.58013 10.2528 4.33346C10.0879 4.08678 9.99997 3.79677 9.99997 3.5001C9.99997 3.10228 10.158 2.72075 10.4393 2.43944C10.7206 2.15814 11.1021 2.0001 11.5 2.0001ZM3.49997 9.5001C3.2033 9.5001 2.91329 9.41213 2.66661 9.24731C2.41994 9.08248 2.22768 8.84822 2.11415 8.57413C2.00062 8.30004 1.97091 7.99844 2.02879 7.70747C2.08667 7.4165 2.22953 7.14922 2.43931 6.93944C2.64909 6.72966 2.91636 6.5868 3.20733 6.52892C3.49831 6.47105 3.79991 6.50075 4.074 6.61428C4.34808 6.72781 4.58235 6.92007 4.74717 7.16675C4.912 7.41342 4.99997 7.70343 4.99997 8.0001C4.99997 8.39793 4.84193 8.77946 4.56063 9.06076C4.27933 9.34207 3.89779 9.5001 3.49997 9.5001ZM11.5 14.0001C11.2033 14.0001 10.9133 13.9121 10.6666 13.7473C10.4199 13.5825 10.2277 13.3482 10.1142 13.0741C10.0006 12.8 9.97091 12.4984 10.0288 12.2075C10.0867 11.9165 10.2295 11.6492 10.4393 11.4394C10.6491 11.2297 10.9164 11.0868 11.2073 11.0289C11.4983 10.971 11.7999 11.0008 12.074 11.1143C12.3481 11.2278 12.5824 11.4201 12.7472 11.6667C12.912 11.9134 13 12.2034 13 12.5001C13 12.8979 12.8419 13.2795 12.5606 13.5608C12.2793 13.8421 11.8978 14.0001 11.5 14.0001Z" })));
|
|
12
|
+
exports.ShareIcon = (0, styled_components_1.default)(Icon).attrs(() => ({
|
|
13
|
+
'data-component-name': 'icons/ShareIcon/ShareIcon',
|
|
14
|
+
})) `
|
|
15
|
+
path {
|
|
16
|
+
fill: ${({ color }) => (0, utils_1.getCssColorVariable)(color)};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
height: ${({ size }) => size || '16px'};
|
|
20
|
+
width: ${({ size }) => size || '16px'};
|
|
21
|
+
`;
|
|
22
|
+
//# sourceMappingURL=ShareIcon.js.map
|
package/lib/index.d.ts
CHANGED
|
@@ -219,6 +219,7 @@ export * from './icons/MarkdownFullIcon/MarkdownFullIcon';
|
|
|
219
219
|
export * from './icons/DocumentBlankIcon/DocumentBlankIcon';
|
|
220
220
|
export * from './icons/WarningSquareIcon/WarningSquareIcon';
|
|
221
221
|
export * from './icons/MenuIcon/MenuIcon';
|
|
222
|
+
export * from './icons/NoteIcon/NoteIcon';
|
|
222
223
|
export * from './icons/GlobalOutlinedIcon/GlobalOutlinedIcon';
|
|
223
224
|
export * from './icons/FaceDissatisfiedIcon/FaceDissatisfiedIcon';
|
|
224
225
|
export * from './icons/FaceNeutralIcon/FaceNeutralIcon';
|
|
@@ -257,6 +258,7 @@ export * from './icons/AiStarsIcon/AiStarsIcon';
|
|
|
257
258
|
export * from './icons/AiStarsGradientIcon/AiStarsGradientIcon';
|
|
258
259
|
export * from './icons/WorkflowHierarchyIcon/WorkflowHierarchyIcon';
|
|
259
260
|
export * from './icons/GenericIcon/GenericIcon';
|
|
261
|
+
export * from './icons/ShareIcon/ShareIcon';
|
|
260
262
|
export * from './layouts/RootLayout';
|
|
261
263
|
export * from './layouts/PageLayout';
|
|
262
264
|
export * from './layouts/NotFound';
|
package/lib/index.js
CHANGED
|
@@ -272,6 +272,7 @@ __exportStar(require("./icons/MarkdownFullIcon/MarkdownFullIcon"), exports);
|
|
|
272
272
|
__exportStar(require("./icons/DocumentBlankIcon/DocumentBlankIcon"), exports);
|
|
273
273
|
__exportStar(require("./icons/WarningSquareIcon/WarningSquareIcon"), exports);
|
|
274
274
|
__exportStar(require("./icons/MenuIcon/MenuIcon"), exports);
|
|
275
|
+
__exportStar(require("./icons/NoteIcon/NoteIcon"), exports);
|
|
275
276
|
__exportStar(require("./icons/GlobalOutlinedIcon/GlobalOutlinedIcon"), exports);
|
|
276
277
|
__exportStar(require("./icons/FaceDissatisfiedIcon/FaceDissatisfiedIcon"), exports);
|
|
277
278
|
__exportStar(require("./icons/FaceNeutralIcon/FaceNeutralIcon"), exports);
|
|
@@ -310,6 +311,7 @@ __exportStar(require("./icons/AiStarsIcon/AiStarsIcon"), exports);
|
|
|
310
311
|
__exportStar(require("./icons/AiStarsGradientIcon/AiStarsGradientIcon"), exports);
|
|
311
312
|
__exportStar(require("./icons/WorkflowHierarchyIcon/WorkflowHierarchyIcon"), exports);
|
|
312
313
|
__exportStar(require("./icons/GenericIcon/GenericIcon"), exports);
|
|
314
|
+
__exportStar(require("./icons/ShareIcon/ShareIcon"), exports);
|
|
313
315
|
/* Layouts */
|
|
314
316
|
__exportStar(require("./layouts/RootLayout"), exports);
|
|
315
317
|
__exportStar(require("./layouts/PageLayout"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/theme",
|
|
3
|
-
"version": "0.58.0-next.
|
|
3
|
+
"version": "0.58.0-next.5",
|
|
4
4
|
"description": "Shared UI components lib",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"theme",
|
|
@@ -87,8 +87,8 @@
|
|
|
87
87
|
"openapi-sampler": "1.6.1",
|
|
88
88
|
"react-calendar": "5.1.0",
|
|
89
89
|
"react-date-picker": "11.0.0",
|
|
90
|
-
"@redocly/
|
|
91
|
-
"@redocly/
|
|
90
|
+
"@redocly/config": "0.33.0",
|
|
91
|
+
"@redocly/realm-asyncapi-sdk": "0.4.0-next.1"
|
|
92
92
|
},
|
|
93
93
|
"scripts": {
|
|
94
94
|
"watch": "tsc -p tsconfig.build.json && (concurrently \"tsc -w -p tsconfig.build.json\" \"tsc-alias -w -p tsconfig.build.json\")",
|
|
@@ -33,7 +33,7 @@ const customCatalogOptionsCasing = (str: string): string => {
|
|
|
33
33
|
if (index === 0 && word.toLowerCase() === 'api') {
|
|
34
34
|
return 'API';
|
|
35
35
|
}
|
|
36
|
-
return word[0].toUpperCase() + word.slice(1)
|
|
36
|
+
return word[0].toUpperCase() + word.slice(1);
|
|
37
37
|
})
|
|
38
38
|
.join(' ');
|
|
39
39
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { JSX } from 'react';
|
|
2
|
+
import { UiAccessibleConfig } from '@redocly/config';
|
|
2
3
|
|
|
3
4
|
import { EntityType } from '@redocly/theme/core/types';
|
|
4
5
|
import { CodeIcon } from '@redocly/theme/icons/CodeIcon/CodeIcon';
|
|
@@ -7,31 +8,58 @@ import { PeopleIcon } from '@redocly/theme/icons/PeopleIcon/PeopleIcon';
|
|
|
7
8
|
import { UserIcon } from '@redocly/theme/icons/UserIcon/UserIcon';
|
|
8
9
|
import { NetworkIcon } from '@redocly/theme/icons/NetworkIcon/NetworkIcon';
|
|
9
10
|
import { MoleculesIcon } from '@redocly/theme/icons/MoleculesIcon/MoleculesIcon';
|
|
11
|
+
import { Image } from '@redocly/theme/components/Image/Image';
|
|
12
|
+
import { PREDEFINED_ENTITY_TYPES, useThemeConfig } from '@redocly/theme/core';
|
|
13
|
+
import { NoteIcon } from '@redocly/theme/icons/NoteIcon/NoteIcon';
|
|
10
14
|
|
|
11
15
|
export type CatalogEntityIconProps = {
|
|
12
16
|
entityType: string;
|
|
13
17
|
defaultColor?: boolean;
|
|
14
18
|
forceColor?: string;
|
|
19
|
+
entitiesCatalogConfig?: UiAccessibleConfig['entitiesCatalog'];
|
|
15
20
|
};
|
|
16
21
|
|
|
17
22
|
const getIconColor = (entityType: EntityType) => `var(--catalog-entity-icon-color-${entityType})`;
|
|
18
23
|
|
|
19
|
-
const getEntityIcon = ({
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
24
|
+
const getEntityIcon = ({
|
|
25
|
+
entityType,
|
|
26
|
+
defaultColor,
|
|
27
|
+
forceColor,
|
|
28
|
+
entitiesCatalogConfig,
|
|
29
|
+
}: CatalogEntityIconProps) => {
|
|
30
|
+
if (PREDEFINED_ENTITY_TYPES.includes(entityType)) {
|
|
31
|
+
const iconColor =
|
|
32
|
+
forceColor ??
|
|
33
|
+
(defaultColor ? `var(--catalog-entity-icon-color)` : getIconColor(entityType as EntityType));
|
|
34
|
+
|
|
35
|
+
const entityIconMap: Record<EntityType, JSX.Element> = {
|
|
36
|
+
service: <CodeIcon color={iconColor} />,
|
|
37
|
+
domain: <GraphIcon color={iconColor} />,
|
|
38
|
+
team: <PeopleIcon color={iconColor} />,
|
|
39
|
+
user: <UserIcon color={iconColor} />,
|
|
40
|
+
'api-description': <NoteIcon color={iconColor} />,
|
|
41
|
+
'data-schema': <NetworkIcon color={iconColor} />,
|
|
42
|
+
'api-operation': <MoleculesIcon color={iconColor} />,
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return entityIconMap[entityType as EntityType];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const iconConfig = entitiesCatalogConfig?.entityTypes?.[entityType]?.icon;
|
|
49
|
+
|
|
50
|
+
if (iconConfig?.src || iconConfig?.srcSet) {
|
|
51
|
+
return (
|
|
52
|
+
<Image
|
|
53
|
+
src={iconConfig?.src}
|
|
54
|
+
srcSet={iconConfig?.srcSet}
|
|
55
|
+
alt={`${entityType} icon`}
|
|
56
|
+
width="16"
|
|
57
|
+
height="16"
|
|
58
|
+
/>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return <CodeIcon color="var(--catalog-entity-icon-color)" />; // @TODO: add default icon
|
|
35
63
|
};
|
|
36
64
|
|
|
37
65
|
export function CatalogEntityIcon({
|
|
@@ -39,7 +67,14 @@ export function CatalogEntityIcon({
|
|
|
39
67
|
defaultColor = false,
|
|
40
68
|
forceColor,
|
|
41
69
|
}: CatalogEntityIconProps): JSX.Element {
|
|
42
|
-
const
|
|
70
|
+
const themeConfig = useThemeConfig();
|
|
71
|
+
|
|
72
|
+
const icon = getEntityIcon({
|
|
73
|
+
entityType,
|
|
74
|
+
defaultColor,
|
|
75
|
+
forceColor,
|
|
76
|
+
entitiesCatalogConfig: themeConfig.entitiesCatalog,
|
|
77
|
+
});
|
|
43
78
|
|
|
44
79
|
if (!icon) {
|
|
45
80
|
throw new Error(`Unhandled entity type: ${entityType}`);
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
4
|
import { CatalogEntityIcon } from '@redocly/theme/components/Catalog/CatalogEntityIcon';
|
|
5
|
+
import { PREDEFINED_ENTITY_TYPES } from '@redocly/theme/core';
|
|
5
6
|
|
|
6
7
|
export type CatalogEntityTypeIconProps = {
|
|
7
8
|
entityType: string;
|
|
@@ -30,14 +31,24 @@ const IconContainer = styled.div<{ entityType: string; defaultColor: boolean }>`
|
|
|
30
31
|
width: var(--catalog-table-icon-width);
|
|
31
32
|
height: var(--catalog-table-icon-height);
|
|
32
33
|
border-radius: var(--catalog-table-icon-border-radius);
|
|
33
|
-
background-color: ${({ defaultColor, entityType }) =>
|
|
34
|
-
defaultColor
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
background-color: ${({ defaultColor, entityType }) => {
|
|
35
|
+
if (defaultColor) {
|
|
36
|
+
return 'var(--catalog-entity-bg-color)';
|
|
37
|
+
}
|
|
38
|
+
if (PREDEFINED_ENTITY_TYPES.includes(entityType)) {
|
|
39
|
+
return `var(--catalog-entity-bg-color-${entityType})`;
|
|
40
|
+
}
|
|
41
|
+
return 'var(--catalog-entity-bg-color-custom)';
|
|
42
|
+
}};
|
|
37
43
|
flex-shrink: 0;
|
|
38
44
|
border: 1px solid
|
|
39
|
-
${({ defaultColor, entityType }) =>
|
|
40
|
-
defaultColor
|
|
41
|
-
|
|
42
|
-
|
|
45
|
+
${({ defaultColor, entityType }) => {
|
|
46
|
+
if (defaultColor) {
|
|
47
|
+
return 'var(--catalog-entity-border-color)';
|
|
48
|
+
}
|
|
49
|
+
if (PREDEFINED_ENTITY_TYPES.includes(entityType)) {
|
|
50
|
+
return `var(--catalog-entity-border-color-${entityType})`;
|
|
51
|
+
}
|
|
52
|
+
return 'var(--catalog-entity-border-color-custom)';
|
|
53
|
+
}};
|
|
43
54
|
`;
|
|
@@ -4,6 +4,7 @@ import styled from 'styled-components';
|
|
|
4
4
|
import { EntityType } from '@redocly/theme/core/types';
|
|
5
5
|
import { Tag } from '@redocly/theme/components/Tag/Tag';
|
|
6
6
|
import { CatalogHighlight } from '@redocly/theme/components/Catalog/CatalogHighlight';
|
|
7
|
+
import { PREDEFINED_ENTITY_TYPES } from '@redocly/theme/core';
|
|
7
8
|
|
|
8
9
|
export type CatalogEntityTypeTagProps = {
|
|
9
10
|
entityType: string;
|
|
@@ -43,7 +44,14 @@ export function CatalogEntityTypeTag({ entityType }: CatalogEntityTypeTagProps):
|
|
|
43
44
|
const EntityTypeTagWrapper = styled(Tag)<{ entityType: EntityType }>`
|
|
44
45
|
font-size: var(--font-size-base);
|
|
45
46
|
background-color: transparent;
|
|
46
|
-
text-transform:
|
|
47
|
-
border: 1px solid
|
|
48
|
-
|
|
47
|
+
text-transform: none;
|
|
48
|
+
border: 1px solid
|
|
49
|
+
${({ entityType }) =>
|
|
50
|
+
!PREDEFINED_ENTITY_TYPES.includes(entityType)
|
|
51
|
+
? 'var(--catalog-entity-border-color-custom)'
|
|
52
|
+
: `var(--catalog-entity-border-color-${entityType})`};
|
|
53
|
+
color: ${({ entityType }) =>
|
|
54
|
+
!PREDEFINED_ENTITY_TYPES.includes(entityType)
|
|
55
|
+
? 'var(--catalog-entity-icon-color-custom)'
|
|
56
|
+
: `var(--catalog-entity-icon-color-${entityType})`};
|
|
49
57
|
`;
|
|
@@ -130,6 +130,10 @@ export const catalog = css`
|
|
|
130
130
|
--catalog-entity-border-color-api-operation: var(--color-raspberry-3);
|
|
131
131
|
--catalog-entity-bg-color-api-operation: var(--color-raspberry-1);
|
|
132
132
|
|
|
133
|
+
--catalog-entity-icon-color-custom: var(--color-persian-green-8);
|
|
134
|
+
--catalog-entity-border-color-custom: var(--color-persian-green-5);
|
|
135
|
+
--catalog-entity-bg-color-custom: var(--color-persian-green-1);
|
|
136
|
+
|
|
133
137
|
/**
|
|
134
138
|
* @tokens Catalog tags
|
|
135
139
|
*/
|
|
@@ -98,14 +98,12 @@ export function TooltipComponent({
|
|
|
98
98
|
}, [isOpened, placement, updateTooltipPosition]);
|
|
99
99
|
|
|
100
100
|
useEffect(() => {
|
|
101
|
-
if (
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
handleClose();
|
|
106
|
-
}
|
|
101
|
+
if (isOpen && !disabled) {
|
|
102
|
+
handleOpen();
|
|
103
|
+
} else {
|
|
104
|
+
handleClose();
|
|
107
105
|
}
|
|
108
|
-
}, [isOpen,
|
|
106
|
+
}, [isOpen, handleOpen, handleClose, disabled]);
|
|
109
107
|
|
|
110
108
|
const controllers = !isControlled &&
|
|
111
109
|
!disabled && {
|
|
@@ -268,7 +266,7 @@ const TooltipBody = styled.span<
|
|
|
268
266
|
display: inline-block;
|
|
269
267
|
|
|
270
268
|
padding: var(--tooltip-padding);
|
|
271
|
-
max-width: var(--tooltip-max-width);
|
|
269
|
+
max-width: ${({ width }) => width || 'var(--tooltip-max-width)'};
|
|
272
270
|
white-space: normal;
|
|
273
271
|
word-break: normal;
|
|
274
272
|
overflow-wrap: break-word;
|
|
@@ -26,7 +26,7 @@ export function TooltipWrapper({
|
|
|
26
26
|
showOnHover = true,
|
|
27
27
|
disabled = false,
|
|
28
28
|
}: TooltipWrapperProps): JSX.Element {
|
|
29
|
-
const tooltip = useControl();
|
|
29
|
+
const tooltip = useControl(false);
|
|
30
30
|
|
|
31
31
|
const handleMouseEnter = (): void => {
|
|
32
32
|
if (showOnHover && !disabled) {
|
|
@@ -2,33 +2,15 @@ import type { EntityRelationType } from '../types/catalog';
|
|
|
2
2
|
|
|
3
3
|
export const CATALOG_TAG_MAX_LENGTH = 15;
|
|
4
4
|
|
|
5
|
-
export const
|
|
6
|
-
'
|
|
7
|
-
'
|
|
8
|
-
'
|
|
9
|
-
'
|
|
10
|
-
'
|
|
11
|
-
'
|
|
12
|
-
'
|
|
13
|
-
|
|
14
|
-
'dependsOn',
|
|
15
|
-
'dependencyOf',
|
|
16
|
-
'uses',
|
|
17
|
-
'usedBy',
|
|
18
|
-
'produces',
|
|
19
|
-
'consumes',
|
|
20
|
-
'linksTo',
|
|
21
|
-
'supersedes',
|
|
22
|
-
'supersededBy',
|
|
23
|
-
'compatibleWith',
|
|
24
|
-
'extends',
|
|
25
|
-
'extendedBy',
|
|
26
|
-
'relatesTo',
|
|
27
|
-
'hasMember',
|
|
28
|
-
'memberOf',
|
|
29
|
-
'triggers',
|
|
30
|
-
'triggeredBy',
|
|
31
|
-
] as const;
|
|
5
|
+
export const PREDEFINED_ENTITY_TYPES = [
|
|
6
|
+
'service',
|
|
7
|
+
'domain',
|
|
8
|
+
'team',
|
|
9
|
+
'user',
|
|
10
|
+
'api-description',
|
|
11
|
+
'data-schema',
|
|
12
|
+
'api-operation',
|
|
13
|
+
];
|
|
32
14
|
|
|
33
15
|
export const reverseRelationMap: Record<EntityRelationType, EntityRelationType> = {
|
|
34
16
|
partOf: 'hasParts',
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { useState, useCallback } from 'react';
|
|
1
|
+
import { useState, useCallback, useRef } from 'react';
|
|
2
|
+
|
|
3
|
+
const DEFAULT_CONTROL_OPEN_DELAY = 300;
|
|
2
4
|
|
|
3
5
|
export type UseControlReturnType = {
|
|
4
6
|
isOpened: boolean;
|
|
@@ -8,9 +10,25 @@ export type UseControlReturnType = {
|
|
|
8
10
|
|
|
9
11
|
export const useControl = (initialVal = false): UseControlReturnType => {
|
|
10
12
|
const [isOpened, setIsOpened] = useState<boolean>(initialVal);
|
|
13
|
+
const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
14
|
+
|
|
15
|
+
const clearOpenTimer = useCallback(() => {
|
|
16
|
+
if (timeoutRef.current) {
|
|
17
|
+
clearTimeout(timeoutRef.current);
|
|
18
|
+
}
|
|
19
|
+
}, []);
|
|
20
|
+
|
|
21
|
+
const handleOpen = useCallback(() => {
|
|
22
|
+
clearOpenTimer();
|
|
23
|
+
timeoutRef.current = setTimeout(() => {
|
|
24
|
+
setIsOpened(true);
|
|
25
|
+
}, DEFAULT_CONTROL_OPEN_DELAY);
|
|
26
|
+
}, [clearOpenTimer]);
|
|
11
27
|
|
|
12
|
-
const
|
|
13
|
-
|
|
28
|
+
const handleClose = useCallback(() => {
|
|
29
|
+
clearOpenTimer();
|
|
30
|
+
setIsOpened(false);
|
|
31
|
+
}, [clearOpenTimer]);
|
|
14
32
|
|
|
15
33
|
return {
|
|
16
34
|
isOpened,
|
|
@@ -22,6 +22,7 @@ export { useMount } from '../hooks/use-mount';
|
|
|
22
22
|
export { GlobalStyle } from '../styles/global';
|
|
23
23
|
export { breakpoints } from '../utils/media-css';
|
|
24
24
|
export { isPrimitive } from '../utils/args-typecheck';
|
|
25
|
+
export { ClipboardService } from '../utils/clipboard-service';
|
|
25
26
|
export { getUserAgent } from '../utils/get-user-agent';
|
|
26
27
|
export { useFocusTrap } from '../hooks/use-focus-trap';
|
|
27
28
|
export { useThemeHooks } from '../hooks/use-theme-hooks';
|
|
@@ -33,4 +34,3 @@ export { useDialogHotKeys } from '../hooks/use-dialog-hotkeys';
|
|
|
33
34
|
export { SecurityVariablesEnvSuffix } from '../constants/environments';
|
|
34
35
|
export { isUndefined, isString, isNotNull, isObject } from '../utils/type-guards';
|
|
35
36
|
export { ThemeDataContext, type ThemeDataTransferObject } from '../contexts/ThemeDataContext';
|
|
36
|
-
export { ENTITY_RELATION_TYPES } from '../constants/catalog';
|
|
@@ -780,6 +780,25 @@ const apiReferenceDocs = css`
|
|
|
780
780
|
--fab-icon-color: var(--navbar-text-color); // @presenter Color
|
|
781
781
|
|
|
782
782
|
// @tokens End
|
|
783
|
+
|
|
784
|
+
/**
|
|
785
|
+
* @tokens OpenAPI Schema Catalog Link
|
|
786
|
+
*/
|
|
787
|
+
|
|
788
|
+
--schema-catalog-link-margin-bottom: var(--spacing-lg);
|
|
789
|
+
--schema-catalog-link-padding: 2px;
|
|
790
|
+
--schema-catalog-link-border-radius: var(--border-radius-md);
|
|
791
|
+
--schema-catalog-link-background-color: var(--layer-color);
|
|
792
|
+
--schema-catalog-link-color: var(--color-purple-7);
|
|
793
|
+
|
|
794
|
+
--schema-catalog-link-share-icon-color: var(--color-purple-7);
|
|
795
|
+
--schema-catalog-link-share-icon-background-color: var(--color-purple-1);
|
|
796
|
+
--schema-catalog-link-share-icon-border-radius: var(--border-radius-md);
|
|
797
|
+
--schema-catalog-link-share-icon-wrapper-size: var(--spacing-xl);
|
|
798
|
+
|
|
799
|
+
--schema-catalog-link-text-color: var(--text-color-primary);
|
|
800
|
+
|
|
801
|
+
// @tokens End
|
|
783
802
|
`;
|
|
784
803
|
|
|
785
804
|
const badges = css`
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { InfiniteData, UseInfiniteQueryResult } from '@tanstack/react-query';
|
|
2
2
|
import { CatalogEntityConfig, LayoutVariant } from '@redocly/config';
|
|
3
|
+
import { ENTITY_RELATION_TYPES } from '@redocly/config';
|
|
3
4
|
|
|
4
5
|
import type { CatalogFilterConfig } from '@redocly/theme/config';
|
|
5
6
|
|
|
6
|
-
import { ENTITY_RELATION_TYPES } from '../constants/catalog';
|
|
7
|
-
|
|
8
7
|
export type SortOption = 'title' | '-title' | 'type' | '-type';
|
|
9
8
|
|
|
10
9
|
export type UseCatalogResponse = {
|
package/src/core/types/l10n.ts
CHANGED
|
@@ -280,6 +280,9 @@ export type TranslationKey =
|
|
|
280
280
|
| 'openapi.requiredScopes'
|
|
281
281
|
| 'openapi.unsupportedLanguage'
|
|
282
282
|
| 'openapi.failedToGenerateCodeSample'
|
|
283
|
+
| 'openapi.schemaCatalogLink.title'
|
|
284
|
+
| 'openapi.schemaCatalogLink.copyButtonTooltip'
|
|
285
|
+
| 'openapi.schemaCatalogLink.copiedTooltip'
|
|
283
286
|
| 'asyncapi.download.description.title'
|
|
284
287
|
| 'asyncapi.info.title'
|
|
285
288
|
| 'graphql.queries'
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import type { IconProps } from '@redocly/theme/icons/types';
|
|
5
|
+
|
|
6
|
+
import { getCssColorVariable } from '@redocly/theme/core/utils';
|
|
7
|
+
|
|
8
|
+
const Icon = (props: IconProps) => (
|
|
9
|
+
<svg
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
width="8"
|
|
12
|
+
height="12"
|
|
13
|
+
viewBox="0 0 8 12"
|
|
14
|
+
fill="none"
|
|
15
|
+
{...props}
|
|
16
|
+
>
|
|
17
|
+
<path
|
|
18
|
+
d="M7.6375 3.4875L5.0125 0.8625C4.9375 0.7875 4.8625 0.75 4.75 0.75H1C0.5875 0.75 0.25 1.0875 0.25 1.5V10.5C0.25 10.9125 0.5875 11.25 1 11.25H7C7.4125 11.25 7.75 10.9125 7.75 10.5V3.75C7.75 3.6375 7.7125 3.5625 7.6375 3.4875ZM4.75 1.65L6.85 3.75H4.75V1.65ZM7 10.5H1V1.5H4V3.75C4 4.1625 4.3375 4.5 4.75 4.5H7V10.5Z"
|
|
19
|
+
fill="currentColor"
|
|
20
|
+
/>
|
|
21
|
+
<path d="M6.25 8.25H1.75V9H6.25V8.25Z" fill="currentColor" />
|
|
22
|
+
<path d="M6.25 6H1.75V6.75H6.25V6Z" fill="currentColor" />
|
|
23
|
+
</svg>
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
export const NoteIcon = styled(Icon).attrs(() => ({
|
|
27
|
+
'data-component-name': 'icons/NoteIcon/NoteIcon',
|
|
28
|
+
}))<IconProps>`
|
|
29
|
+
path {
|
|
30
|
+
fill: ${({ color }) => getCssColorVariable(color)};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
height: ${({ size }) => size || '16px'};
|
|
34
|
+
width: ${({ size }) => size || '16px'};
|
|
35
|
+
`;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import type { IconProps } from '@redocly/theme/icons/types';
|
|
5
|
+
|
|
6
|
+
import { getCssColorVariable } from '@redocly/theme/core/utils';
|
|
7
|
+
|
|
8
|
+
const Icon = (props: IconProps) => (
|
|
9
|
+
<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
10
|
+
<path d="M11.5 10.0001C11.1257 10.002 10.7566 10.0879 10.42 10.2514C10.0834 10.415 9.78776 10.652 9.55497 10.9451L5.89997 8.6601C6.03318 8.23018 6.03318 7.77002 5.89997 7.3401L9.55497 5.0551C9.92594 5.51446 10.4475 5.82769 11.0273 5.93931C11.6071 6.05092 12.2077 5.95372 12.7227 5.66491C13.2377 5.37611 13.6339 4.91435 13.841 4.36143C14.0482 3.8085 14.0529 3.20011 13.8544 2.64402C13.656 2.08793 13.2671 1.62003 12.7567 1.32322C12.2462 1.0264 11.6472 0.919827 11.0657 1.02237C10.4843 1.12491 9.95785 1.42996 9.57975 1.88346C9.20164 2.33697 8.99626 2.90966 8.99997 3.5001C9.00233 3.72369 9.03599 3.94585 9.09997 4.1601L5.44497 6.4451C5.12229 6.03889 4.68124 5.74313 4.18295 5.5988C3.68465 5.45447 3.1538 5.46873 2.66398 5.63961C2.17415 5.81048 1.74961 6.1295 1.44921 6.55245C1.14881 6.9754 0.987427 7.48133 0.987427 8.0001C0.987427 8.51888 1.14881 9.0248 1.44921 9.44775C1.74961 9.8707 2.17415 10.1897 2.66398 10.3606C3.1538 10.5315 3.68465 10.5457 4.18295 10.4014C4.68124 10.2571 5.12229 9.96131 5.44497 9.5551L9.09997 11.8401C9.03599 12.0544 9.00233 12.2765 8.99997 12.5001C8.99997 12.9946 9.14659 13.4779 9.4213 13.889C9.696 14.3002 10.0864 14.6206 10.5433 14.8098C11.0001 14.999 11.5027 15.0485 11.9877 14.9521C12.4726 14.8556 12.9181 14.6175 13.2677 14.2679C13.6174 13.9182 13.8555 13.4728 13.9519 12.9878C14.0484 12.5029 13.9989 12.0002 13.8097 11.5434C13.6204 11.0866 13.3 10.6961 12.8889 10.4214C12.4778 10.1467 11.9944 10.0001 11.5 10.0001ZM11.5 2.0001C11.7966 2.0001 12.0867 2.08808 12.3333 2.2529C12.58 2.41772 12.7723 2.65199 12.8858 2.92608C12.9993 3.20017 13.029 3.50177 12.9711 3.79274C12.9133 4.08371 12.7704 4.35098 12.5606 4.56076C12.3509 4.77054 12.0836 4.9134 11.7926 4.97128C11.5016 5.02916 11.2 4.99945 10.9259 4.88592C10.6519 4.77239 10.4176 4.58013 10.2528 4.33346C10.0879 4.08678 9.99997 3.79677 9.99997 3.5001C9.99997 3.10228 10.158 2.72075 10.4393 2.43944C10.7206 2.15814 11.1021 2.0001 11.5 2.0001ZM3.49997 9.5001C3.2033 9.5001 2.91329 9.41213 2.66661 9.24731C2.41994 9.08248 2.22768 8.84822 2.11415 8.57413C2.00062 8.30004 1.97091 7.99844 2.02879 7.70747C2.08667 7.4165 2.22953 7.14922 2.43931 6.93944C2.64909 6.72966 2.91636 6.5868 3.20733 6.52892C3.49831 6.47105 3.79991 6.50075 4.074 6.61428C4.34808 6.72781 4.58235 6.92007 4.74717 7.16675C4.912 7.41342 4.99997 7.70343 4.99997 8.0001C4.99997 8.39793 4.84193 8.77946 4.56063 9.06076C4.27933 9.34207 3.89779 9.5001 3.49997 9.5001ZM11.5 14.0001C11.2033 14.0001 10.9133 13.9121 10.6666 13.7473C10.4199 13.5825 10.2277 13.3482 10.1142 13.0741C10.0006 12.8 9.97091 12.4984 10.0288 12.2075C10.0867 11.9165 10.2295 11.6492 10.4393 11.4394C10.6491 11.2297 10.9164 11.0868 11.2073 11.0289C11.4983 10.971 11.7999 11.0008 12.074 11.1143C12.3481 11.2278 12.5824 11.4201 12.7472 11.6667C12.912 11.9134 13 12.2034 13 12.5001C13 12.8979 12.8419 13.2795 12.5606 13.5608C12.2793 13.8421 11.8978 14.0001 11.5 14.0001Z" />
|
|
11
|
+
</svg>
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
export const ShareIcon = styled(Icon).attrs(() => ({
|
|
15
|
+
'data-component-name': 'icons/ShareIcon/ShareIcon',
|
|
16
|
+
}))<IconProps>`
|
|
17
|
+
path {
|
|
18
|
+
fill: ${({ color }) => getCssColorVariable(color)};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
height: ${({ size }) => size || '16px'};
|
|
22
|
+
width: ${({ size }) => size || '16px'};
|
|
23
|
+
`;
|
package/src/index.ts
CHANGED
|
@@ -245,6 +245,7 @@ export * from '@redocly/theme/icons/MarkdownFullIcon/MarkdownFullIcon';
|
|
|
245
245
|
export * from '@redocly/theme/icons/DocumentBlankIcon/DocumentBlankIcon';
|
|
246
246
|
export * from '@redocly/theme/icons/WarningSquareIcon/WarningSquareIcon';
|
|
247
247
|
export * from '@redocly/theme/icons/MenuIcon/MenuIcon';
|
|
248
|
+
export * from '@redocly/theme/icons/NoteIcon/NoteIcon';
|
|
248
249
|
export * from '@redocly/theme/icons/GlobalOutlinedIcon/GlobalOutlinedIcon';
|
|
249
250
|
export * from '@redocly/theme/icons/FaceDissatisfiedIcon/FaceDissatisfiedIcon';
|
|
250
251
|
export * from '@redocly/theme/icons/FaceNeutralIcon/FaceNeutralIcon';
|
|
@@ -283,6 +284,7 @@ export * from '@redocly/theme/icons/AiStarsIcon/AiStarsIcon';
|
|
|
283
284
|
export * from '@redocly/theme/icons/AiStarsGradientIcon/AiStarsGradientIcon';
|
|
284
285
|
export * from '@redocly/theme/icons/WorkflowHierarchyIcon/WorkflowHierarchyIcon';
|
|
285
286
|
export * from '@redocly/theme/icons/GenericIcon/GenericIcon';
|
|
287
|
+
export * from '@redocly/theme/icons/ShareIcon/ShareIcon';
|
|
286
288
|
/* Layouts */
|
|
287
289
|
export * from '@redocly/theme/layouts/RootLayout';
|
|
288
290
|
export * from '@redocly/theme/layouts/PageLayout';
|