@redocly/theme 0.64.0-next.5 → 0.64.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/Banner/Banner.d.ts +5 -0
- package/lib/components/Banner/Banner.js +22 -5
- package/lib/components/Sidebar/Sidebar.js +2 -2
- package/lib/core/contexts/MarkdownLinkContext.d.ts +1 -1
- package/lib/core/hooks/index.d.ts +1 -0
- package/lib/core/hooks/index.js +1 -0
- package/lib/core/hooks/use-banner-telemetry.d.ts +7 -0
- package/lib/core/hooks/use-banner-telemetry.js +64 -0
- package/lib/core/hooks/use-telemetry-fallback.d.ts +3 -0
- package/lib/core/hooks/use-telemetry-fallback.js +3 -0
- package/lib/icons/AnthropicIcon/AnthropicIcon.d.ts +9 -0
- package/lib/icons/AnthropicIcon/AnthropicIcon.js +20 -0
- package/lib/icons/BotIcon/BotIcon.d.ts +9 -0
- package/lib/icons/BotIcon/BotIcon.js +21 -0
- package/lib/icons/GeminiIcon/GeminiIcon.d.ts +9 -0
- package/lib/icons/GeminiIcon/GeminiIcon.js +95 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +3 -0
- package/lib/layouts/PageLayout.js +1 -1
- package/lib/markdoc/components/MarkdownLink/MarkdownLink.js +2 -2
- package/package.json +3 -3
- package/src/components/Banner/Banner.tsx +44 -13
- package/src/components/Sidebar/Sidebar.tsx +2 -2
- package/src/core/contexts/MarkdownLinkContext.tsx +1 -1
- package/src/core/hooks/index.ts +1 -0
- package/src/core/hooks/use-banner-telemetry.ts +66 -0
- package/src/core/hooks/use-telemetry-fallback.ts +3 -0
- package/src/icons/AnthropicIcon/AnthropicIcon.tsx +25 -0
- package/src/icons/BotIcon/BotIcon.tsx +25 -0
- package/src/icons/GeminiIcon/GeminiIcon.tsx +265 -0
- package/src/index.ts +3 -0
- package/src/layouts/PageLayout.tsx +1 -1
- package/src/markdoc/components/MarkdownLink/MarkdownLink.tsx +2 -2
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
import type { ResolvedBannerConfig } from '@redocly/config';
|
|
1
2
|
import type { JSX } from 'react';
|
|
2
3
|
type BannerProps = {
|
|
3
4
|
className?: string;
|
|
4
5
|
};
|
|
6
|
+
export type DisplayBanner = ResolvedBannerConfig & {
|
|
7
|
+
color: NonNullable<ResolvedBannerConfig['color']>;
|
|
8
|
+
dismissible: NonNullable<ResolvedBannerConfig['dismissible']>;
|
|
9
|
+
};
|
|
5
10
|
export declare function Banner({ className }: BannerProps): JSX.Element | null;
|
|
6
11
|
export {};
|
|
@@ -38,10 +38,15 @@ const react_1 = __importStar(require("react"));
|
|
|
38
38
|
const styled_components_1 = __importStar(require("styled-components"));
|
|
39
39
|
const hooks_1 = require("../../core/hooks");
|
|
40
40
|
const utils_1 = require("../../core/utils");
|
|
41
|
+
const contexts_1 = require("../../core/contexts");
|
|
41
42
|
const Markdown_1 = require("../../components/Markdown/Markdown");
|
|
42
43
|
const CloseIcon_1 = require("../../icons/CloseIcon/CloseIcon");
|
|
43
44
|
const Button_1 = require("../../components/Button/Button");
|
|
44
45
|
const ANIMATION_DURATION = 0.4;
|
|
46
|
+
function toDisplayBanner(banner) {
|
|
47
|
+
var _a, _b;
|
|
48
|
+
return Object.assign(Object.assign({}, banner), { color: (_a = banner.color) !== null && _a !== void 0 ? _a : 'info', dismissible: (_b = banner.dismissible) !== null && _b !== void 0 ? _b : false });
|
|
49
|
+
}
|
|
45
50
|
function setBannerHeight(height) {
|
|
46
51
|
document.documentElement.style.setProperty('--banner-height', `${height}px`);
|
|
47
52
|
}
|
|
@@ -50,11 +55,12 @@ function Banner({ className }) {
|
|
|
50
55
|
const { banner, dismissBanner } = useBanner();
|
|
51
56
|
const [displayBanner, setDisplayBanner] = (0, react_1.useState)(undefined);
|
|
52
57
|
const [isVisible, setIsVisible] = (0, react_1.useState)(false);
|
|
58
|
+
const { sendBannerViewedMessage, sendBannerDismissedMessage, sendBannerLinkClickedMessage } = (0, hooks_1.useBannerTelemetry)(displayBanner);
|
|
53
59
|
const markdownContent = useMarkdocRenderer(displayBanner === null || displayBanner === void 0 ? void 0 : displayBanner.ast);
|
|
54
60
|
const bannerRef = (0, react_1.useRef)(null);
|
|
55
61
|
(0, react_1.useEffect)(() => {
|
|
56
62
|
if (banner) {
|
|
57
|
-
setDisplayBanner(banner);
|
|
63
|
+
setDisplayBanner(toDisplayBanner(banner));
|
|
58
64
|
requestAnimationFrame(() => {
|
|
59
65
|
requestAnimationFrame(() => {
|
|
60
66
|
setIsVisible(true);
|
|
@@ -110,14 +116,25 @@ function Banner({ className }) {
|
|
|
110
116
|
resizeObserver.disconnect();
|
|
111
117
|
};
|
|
112
118
|
}, [displayBanner, isVisible]);
|
|
119
|
+
(0, react_1.useEffect)(() => {
|
|
120
|
+
if (isVisible) {
|
|
121
|
+
sendBannerViewedMessage();
|
|
122
|
+
}
|
|
123
|
+
}, [isVisible, sendBannerViewedMessage]);
|
|
124
|
+
const markdownLinkContextValue = (0, react_1.useMemo)(() => ({
|
|
125
|
+
onMarkdownLinkClick: sendBannerLinkClickedMessage,
|
|
126
|
+
}), [sendBannerLinkClickedMessage]);
|
|
113
127
|
if (!displayBanner) {
|
|
114
128
|
return null;
|
|
115
129
|
}
|
|
116
|
-
|
|
117
|
-
return (react_1.default.createElement(BannerWrapper, { ref: bannerRef, "data-component-name": "Banner/Banner", className: className, "$color": bannerColor, "$isVisible": isVisible },
|
|
130
|
+
return (react_1.default.createElement(BannerWrapper, { ref: bannerRef, "data-component-name": "Banner/Banner", className: className, "$color": displayBanner.color, "$isVisible": isVisible },
|
|
118
131
|
react_1.default.createElement(BannerContent, null,
|
|
119
|
-
react_1.default.createElement(
|
|
120
|
-
|
|
132
|
+
react_1.default.createElement(contexts_1.MarkdownLinkContext.Provider, { value: markdownLinkContextValue },
|
|
133
|
+
react_1.default.createElement(Markdown_1.Markdown, { compact: true }, markdownContent))),
|
|
134
|
+
displayBanner.dismissible && (react_1.default.createElement(DismissButton, { variant: "ghost", size: "var(--banner-button-size)", icon: react_1.default.createElement(CloseIcon_1.CloseIcon, { color: `var(--banner-${displayBanner.color}-icon-color)`, size: "16px" }), onClick: () => {
|
|
135
|
+
dismissBanner(displayBanner.hash);
|
|
136
|
+
sendBannerDismissedMessage();
|
|
137
|
+
}, "aria-label": "Dismiss banner" }))));
|
|
121
138
|
}
|
|
122
139
|
const BannerContent = styled_components_1.default.div `
|
|
123
140
|
flex: 1;
|
|
@@ -74,8 +74,8 @@ const SidebarContent = styled_components_1.default.aside `
|
|
|
74
74
|
flex-direction: column;
|
|
75
75
|
width: 100%;
|
|
76
76
|
-webkit-font-smoothing: antialiased;
|
|
77
|
-
top: var(--navbar-height);
|
|
78
|
-
height: calc(100vh - var(--navbar-height));
|
|
77
|
+
top: calc(var(--navbar-height) + var(--banner-height));
|
|
78
|
+
height: calc(100vh - var(--navbar-height) - var(--banner-height));
|
|
79
79
|
overflow-x: hidden;
|
|
80
80
|
${({ opened }) => `
|
|
81
81
|
display: ${opened ? 'flex' : 'none'}
|
package/lib/core/hooks/index.js
CHANGED
|
@@ -69,4 +69,5 @@ __exportStar(require("./use-store"), exports);
|
|
|
69
69
|
__exportStar(require("./use-is-truncated"), exports);
|
|
70
70
|
__exportStar(require("./use-toast"), exports);
|
|
71
71
|
__exportStar(require("./use-toast-logic"), exports);
|
|
72
|
+
__exportStar(require("./use-banner-telemetry"), exports);
|
|
72
73
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DisplayBanner } from '../../components/Banner/Banner';
|
|
2
|
+
export type BannerTelemetryActions = {
|
|
3
|
+
sendBannerViewedMessage: () => void;
|
|
4
|
+
sendBannerDismissedMessage: () => void;
|
|
5
|
+
sendBannerLinkClickedMessage: (href: string) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare function useBannerTelemetry(displayBanner: DisplayBanner | undefined): BannerTelemetryActions;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.useBannerTelemetry = useBannerTelemetry;
|
|
15
|
+
const react_1 = require("react");
|
|
16
|
+
const use_theme_hooks_1 = require("./use-theme-hooks");
|
|
17
|
+
const noop = () => { };
|
|
18
|
+
const noopLink = (_href) => { };
|
|
19
|
+
function getCurrentPageUri() {
|
|
20
|
+
return window.location.href;
|
|
21
|
+
}
|
|
22
|
+
function useBannerTelemetry(displayBanner) {
|
|
23
|
+
const { useTelemetry } = (0, use_theme_hooks_1.useThemeHooks)();
|
|
24
|
+
const telemetry = useTelemetry();
|
|
25
|
+
return (0, react_1.useMemo)(() => {
|
|
26
|
+
if (!displayBanner) {
|
|
27
|
+
return {
|
|
28
|
+
sendBannerViewedMessage: noop,
|
|
29
|
+
sendBannerDismissedMessage: noop,
|
|
30
|
+
sendBannerLinkClickedMessage: noopLink,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const bannerUri = 'urn:redocly:realm:ui:banner:banner-id';
|
|
34
|
+
const payload = {
|
|
35
|
+
id: 'banner-id',
|
|
36
|
+
object: 'banner',
|
|
37
|
+
uri: bannerUri,
|
|
38
|
+
trackingId: displayBanner.trackingId,
|
|
39
|
+
hash: displayBanner.hash,
|
|
40
|
+
color: displayBanner.color,
|
|
41
|
+
target: displayBanner.target,
|
|
42
|
+
dismissible: displayBanner.dismissible,
|
|
43
|
+
};
|
|
44
|
+
return {
|
|
45
|
+
sendBannerViewedMessage: () => {
|
|
46
|
+
const pageUri = getCurrentPageUri();
|
|
47
|
+
const page = { id: pageUri, object: 'page', uri: pageUri };
|
|
48
|
+
telemetry.sendBannerViewedMessage([payload, page]);
|
|
49
|
+
},
|
|
50
|
+
sendBannerDismissedMessage: () => {
|
|
51
|
+
const pageUri = getCurrentPageUri();
|
|
52
|
+
const page = { id: pageUri, object: 'page', uri: pageUri };
|
|
53
|
+
const { dismissible: _ } = payload, dismissedPayload = __rest(payload, ["dismissible"]);
|
|
54
|
+
telemetry.sendBannerDismissedMessage([dismissedPayload, page]);
|
|
55
|
+
},
|
|
56
|
+
sendBannerLinkClickedMessage: (href) => {
|
|
57
|
+
const pageUri = getCurrentPageUri();
|
|
58
|
+
const page = { id: pageUri, object: 'page', uri: pageUri };
|
|
59
|
+
telemetry.sendBannerLinkClickedMessage([Object.assign(Object.assign({}, payload), { href }), page]);
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
}, [displayBanner, telemetry]);
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=use-banner-telemetry.js.map
|
|
@@ -68,4 +68,7 @@ export declare const useTelemetryFallback: () => {
|
|
|
68
68
|
sendGraphqlDocsReferencedInLinkClickedMessage: () => void;
|
|
69
69
|
sendGraphqlDocsRequiredScopesModalOpenedMessage: () => void;
|
|
70
70
|
sendGraphqlDocsDownloadDefinitionClickedMessage: () => void;
|
|
71
|
+
sendBannerViewedMessage: () => void;
|
|
72
|
+
sendBannerLinkClickedMessage: () => void;
|
|
73
|
+
sendBannerDismissedMessage: () => void;
|
|
71
74
|
};
|
|
@@ -73,6 +73,9 @@ const useTelemetryFallback = () => ({
|
|
|
73
73
|
sendGraphqlDocsReferencedInLinkClickedMessage: () => { },
|
|
74
74
|
sendGraphqlDocsRequiredScopesModalOpenedMessage: () => { },
|
|
75
75
|
sendGraphqlDocsDownloadDefinitionClickedMessage: () => { },
|
|
76
|
+
sendBannerViewedMessage: () => { },
|
|
77
|
+
sendBannerLinkClickedMessage: () => { },
|
|
78
|
+
sendBannerDismissedMessage: () => { },
|
|
76
79
|
});
|
|
77
80
|
exports.useTelemetryFallback = useTelemetryFallback;
|
|
78
81
|
//# sourceMappingURL=use-telemetry-fallback.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { IconProps } from '../../icons/types';
|
|
3
|
+
export declare const AnthropicIcon: 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,20 @@
|
|
|
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.AnthropicIcon = 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("g", { transform: "translate(2.15065 3.876255)" },
|
|
12
|
+
react_1.default.createElement("path", { d: "M8.43781 0.000244141H6.64874L9.90967 8.24774H11.6987L8.43781 0.000244141ZM3.26092 0.000244141L-7.62939e-06 8.24774H1.82713L2.49962 6.52211H5.91281L6.57261 8.24774H8.39975L5.13881 0.000244141H3.26092ZM3.08329 4.9868L4.19987 2.09384L5.31645 4.9868H3.08329Z", fill: "currentColor" }))));
|
|
13
|
+
exports.AnthropicIcon = (0, styled_components_1.default)(Icon).attrs(() => ({
|
|
14
|
+
'data-component-name': 'icons/AnthropicIcon/AnthropicIcon',
|
|
15
|
+
})) `
|
|
16
|
+
color: ${({ color }) => (0, utils_1.getCssColorVariable)(color)};
|
|
17
|
+
height: ${({ size }) => size || '16px'};
|
|
18
|
+
width: ${({ size }) => size || '16px'};
|
|
19
|
+
`;
|
|
20
|
+
//# sourceMappingURL=AnthropicIcon.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { IconProps } from '../../icons/types';
|
|
3
|
+
export declare const BotIcon: 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,21 @@
|
|
|
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.BotIcon = 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 10.5 12.25", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
11
|
+
react_1.default.createElement("path", { d: "M7 3.5H6.125V4.375H7V3.5Z", fill: "currentColor" }),
|
|
12
|
+
react_1.default.createElement("path", { d: "M4.375 3.5H3.5V4.375H4.375V3.5Z", fill: "currentColor" }),
|
|
13
|
+
react_1.default.createElement("path", { d: "M9.625 7.875H7.4375V7H7.875C8.10698 6.99973 8.32939 6.90746 8.49342 6.74342C8.65746 6.57939 8.74973 6.35698 8.75 6.125V4.375H9.625V3.5H8.75V2.625C8.74973 2.39302 8.65746 2.17061 8.49342 2.00658C8.32939 1.84254 8.10698 1.75027 7.875 1.75H7V0H6.125V1.75H4.375V0H3.5V1.75H2.625C2.39302 1.75027 2.17061 1.84254 2.00658 2.00658C1.84254 2.17061 1.75027 2.39302 1.75 2.625V3.5H0.875V4.375H1.75V6.125C1.75027 6.35698 1.84254 6.57939 2.00658 6.74342C2.17061 6.90746 2.39302 6.99973 2.625 7H3.0625V7.875H0.875C0.643017 7.87527 0.420612 7.96754 0.256576 8.13158C0.092539 8.29561 0.000266321 8.51802 0 8.75V12.25H0.875V8.75H9.625V12.25H10.5V8.75C10.4997 8.51802 10.4075 8.29561 10.2434 8.13158C10.0794 7.96754 9.85698 7.87527 9.625 7.875ZM2.625 2.625H7.875V6.125H2.625V2.625ZM3.9375 7H6.5625V7.875H3.9375V7Z", fill: "currentColor" })));
|
|
14
|
+
exports.BotIcon = (0, styled_components_1.default)(Icon).attrs(() => ({
|
|
15
|
+
'data-component-name': 'icons/BotIcon/BotIcon',
|
|
16
|
+
})) `
|
|
17
|
+
color: ${({ color }) => (0, utils_1.getCssColorVariable)(color)};
|
|
18
|
+
height: ${({ size }) => size || '16px'};
|
|
19
|
+
width: ${({ size }) => size || '16px'};
|
|
20
|
+
`;
|
|
21
|
+
//# sourceMappingURL=BotIcon.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { IconProps } from '../../icons/types';
|
|
3
|
+
export declare const GeminiIcon: 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,95 @@
|
|
|
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.GeminiIcon = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const Icon = (props) => (react_1.default.createElement("svg", Object.assign({ viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
10
|
+
react_1.default.createElement("g", { clipPath: "url(#clip0_5333_7017)" },
|
|
11
|
+
react_1.default.createElement("mask", { id: "mask0_5333_7017", style: { maskType: 'alpha' }, maskUnits: "userSpaceOnUse", x: "0", y: "0", width: "14", height: "14" },
|
|
12
|
+
react_1.default.createElement("path", { d: "M6.98858 0.876221C7.11667 0.876221 7.22837 0.96381 7.25964 1.08813C7.3552 1.46837 7.48112 1.84033 7.63618 2.20043C8.04154 3.14225 8.59778 3.96654 9.30396 4.67271C10.0105 5.37908 10.8346 5.93532 11.7763 6.34069C12.1364 6.4957 12.5085 6.62162 12.8887 6.71723C13.0131 6.7485 13.1005 6.86001 13.1005 6.9881C13.1005 7.11618 13.0131 7.22788 12.8885 7.25915C12.5083 7.35471 12.1363 7.48063 11.7763 7.63569C10.8344 8.04106 10.0103 8.5973 9.30396 9.30348C8.59778 10.01 8.04154 10.8341 7.63618 11.7758C7.48109 12.1359 7.35511 12.508 7.25945 12.8882C7.24431 12.9487 7.20945 13.0023 7.16038 13.0406C7.11132 13.079 7.05086 13.0999 6.98858 13.1C6.8605 13.1 6.74898 13.0126 6.71772 12.8881C6.62209 12.5078 6.49611 12.1359 6.34099 11.7758C5.93581 10.8339 5.37976 10.0098 4.6732 9.30348C3.96684 8.5973 3.14274 8.04106 2.20091 7.63569C1.8408 7.48062 1.46885 7.35464 1.08862 7.25896C1.02821 7.24387 0.974561 7.20905 0.936177 7.16002C0.897792 7.11099 0.876864 7.05055 0.876709 6.98828C0.876709 6.8602 0.964299 6.74868 1.08862 6.71742C1.46887 6.6218 1.84082 6.49582 2.20091 6.34069C3.14274 5.93551 3.96702 5.37927 4.6732 4.6729C5.37957 3.96672 5.93581 3.14244 6.34117 2.20061C6.49619 1.8405 6.62211 1.46854 6.71772 1.08832C6.73278 1.02784 6.76762 0.97413 6.81669 0.935705C6.86576 0.89728 6.92626 0.876345 6.98858 0.876221Z", fill: "black" }),
|
|
13
|
+
react_1.default.createElement("path", { d: "M6.98858 0.876221C7.11667 0.876221 7.22837 0.96381 7.25964 1.08813C7.3552 1.46837 7.48112 1.84033 7.63618 2.20043C8.04154 3.14225 8.59778 3.96654 9.30396 4.67271C10.0105 5.37908 10.8346 5.93532 11.7763 6.34069C12.1364 6.4957 12.5085 6.62162 12.8887 6.71723C13.0131 6.7485 13.1005 6.86001 13.1005 6.9881C13.1005 7.11618 13.0131 7.22788 12.8885 7.25915C12.5083 7.35471 12.1363 7.48063 11.7763 7.63569C10.8344 8.04106 10.0103 8.5973 9.30396 9.30348C8.59778 10.01 8.04154 10.8341 7.63618 11.7758C7.48109 12.1359 7.35511 12.508 7.25945 12.8882C7.24431 12.9487 7.20945 13.0023 7.16038 13.0406C7.11132 13.079 7.05086 13.0999 6.98858 13.1C6.8605 13.1 6.74898 13.0126 6.71772 12.8881C6.62209 12.5078 6.49611 12.1359 6.34099 11.7758C5.93581 10.8339 5.37976 10.0098 4.6732 9.30348C3.96684 8.5973 3.14274 8.04106 2.20091 7.63569C1.8408 7.48062 1.46885 7.35464 1.08862 7.25896C1.02821 7.24387 0.974561 7.20905 0.936177 7.16002C0.897792 7.11099 0.876864 7.05055 0.876709 6.98828C0.876709 6.8602 0.964299 6.74868 1.08862 6.71742C1.46887 6.6218 1.84082 6.49582 2.20091 6.34069C3.14274 5.93551 3.96702 5.37927 4.6732 4.6729C5.37957 3.96672 5.93581 3.14244 6.34117 2.20061C6.49619 1.8405 6.62211 1.46854 6.71772 1.08832C6.73278 1.02784 6.76762 0.97413 6.81669 0.935705C6.86576 0.89728 6.92626 0.876345 6.98858 0.876221Z", fill: "url(#paint0_linear_5333_7017)" })),
|
|
14
|
+
react_1.default.createElement("g", { mask: "url(#mask0_5333_7017)" },
|
|
15
|
+
react_1.default.createElement("g", { filter: "url(#filter0_f_5333_7017)" },
|
|
16
|
+
react_1.default.createElement("path", { d: "M-0.227015 10.4326C1.18534 10.9342 2.80867 9.99369 3.39882 8.33193C3.98897 6.67037 3.32234 4.91669 1.90998 4.41507C0.497625 3.91346 -1.1257 4.85396 -1.71604 6.51553C-2.306 8.17729 -1.63937 9.93096 -0.227015 10.4326Z", fill: "#FFE432" })),
|
|
17
|
+
react_1.default.createElement("g", { filter: "url(#filter1_f_5333_7017)" },
|
|
18
|
+
react_1.default.createElement("path", { d: "M6.04409 4.95442C7.98425 4.95442 9.55728 3.34672 9.55728 1.3638C9.55728 -0.619301 7.98443 -2.22681 6.04409 -2.22681C4.10374 -2.22681 2.53052 -0.619113 2.53052 1.3638C2.53052 3.34672 4.10355 4.95442 6.04409 4.95442Z", fill: "#FC413D" })),
|
|
19
|
+
react_1.default.createElement("g", { filter: "url(#filter2_f_5333_7017)" },
|
|
20
|
+
react_1.default.createElement("path", { d: "M4.67843 16.4367C6.70392 16.3378 8.24192 14.1304 8.11364 11.5065C7.98556 8.88254 6.23941 6.83558 4.21393 6.93466C2.18844 7.03374 0.650439 9.241 0.778715 11.8649C0.906992 14.4888 2.65295 16.5358 4.67843 16.4367Z", fill: "#00B95C" })),
|
|
21
|
+
react_1.default.createElement("g", { filter: "url(#filter3_f_5333_7017)" },
|
|
22
|
+
react_1.default.createElement("path", { d: "M4.67843 16.4367C6.70392 16.3378 8.24192 14.1304 8.11364 11.5065C7.98556 8.88254 6.23941 6.83558 4.21393 6.93466C2.18844 7.03374 0.650439 9.241 0.778715 11.8649C0.906992 14.4888 2.65295 16.5358 4.67843 16.4367Z", fill: "#00B95C" })),
|
|
23
|
+
react_1.default.createElement("g", { filter: "url(#filter4_f_5333_7017)" },
|
|
24
|
+
react_1.default.createElement("path", { d: "M6.70714 14.8494C8.40506 13.8162 8.85958 11.4634 7.72223 9.59402C6.58489 7.7245 4.28627 7.04658 2.58816 8.07957C0.890051 9.11294 0.435527 11.4658 1.57287 13.3353C2.7106 15.2047 5.00903 15.8826 6.70714 14.8494Z", fill: "#00B95C" })),
|
|
25
|
+
react_1.default.createElement("g", { filter: "url(#filter5_f_5333_7017)" },
|
|
26
|
+
react_1.default.createElement("path", { d: "M13.5707 8.97502C15.4792 8.97502 17.0265 7.48505 17.0265 5.64736C17.0265 3.80949 15.4792 2.31952 13.5707 2.31952C11.6622 2.31952 10.115 3.80949 10.115 5.64736C10.115 7.48524 11.6622 8.97502 13.5707 8.97502Z", fill: "#3186FF" })),
|
|
27
|
+
react_1.default.createElement("g", { filter: "url(#filter6_f_5333_7017)" },
|
|
28
|
+
react_1.default.createElement("path", { d: "M-1.5844 8.58873C0.17304 9.92499 2.74027 9.50587 4.1498 7.65218C5.55933 5.79867 5.27754 3.2126 3.5201 1.87634C1.76265 0.539895 -0.804385 0.959007 -2.21411 2.81271C-3.62364 4.66622 -3.34166 7.25247 -1.5844 8.58873Z", fill: "#FBBC04" })),
|
|
29
|
+
react_1.default.createElement("g", { filter: "url(#filter7_f_5333_7017)" },
|
|
30
|
+
react_1.default.createElement("path", { d: "M7.42033 10.5639C9.51777 12.006 12.2982 11.6044 13.6303 9.66653C14.9626 7.72883 14.3422 4.98906 12.2445 3.54694C10.1469 2.10444 7.36664 2.50641 6.03434 4.44393C4.70222 6.38183 5.32251 9.12159 7.42014 10.5639H7.42033Z", fill: "#3186FF" })),
|
|
31
|
+
react_1.default.createElement("g", { filter: "url(#filter8_f_5333_7017)" },
|
|
32
|
+
react_1.default.createElement("path", { d: "M11.2336 0.436156C11.7673 1.16174 11.0814 2.57221 9.70202 3.58694C8.32243 4.60166 6.77163 4.83598 6.23799 4.11059C5.70435 3.38482 6.39 1.97416 7.76939 0.959622C9.14898 -0.0550994 10.7 -0.289425 11.2334 0.435968L11.2336 0.436156Z", fill: "#749BFF" })),
|
|
33
|
+
react_1.default.createElement("g", { filter: "url(#filter9_f_5333_7017)" },
|
|
34
|
+
react_1.default.createElement("path", { d: "M6.85291 3.9097C8.98633 1.93074 9.7185 -0.748558 8.48848 -2.07465C7.25846 -3.40074 4.53169 -2.87181 2.39827 -0.892846C0.264845 1.08612 -0.467518 3.76542 0.762693 5.09151C1.99272 6.41759 4.71949 5.88867 6.85291 3.9097Z", fill: "#FC413D" })),
|
|
35
|
+
react_1.default.createElement("g", { filter: "url(#filter10_f_5333_7017)" },
|
|
36
|
+
react_1.default.createElement("path", { d: "M2.47959 11.0173C3.74766 11.9248 5.20334 12.0627 5.73114 11.3254C6.25894 10.588 5.65881 9.25455 4.39074 8.34701C3.12285 7.43947 1.66698 7.30159 1.13937 8.03885C0.611574 8.77629 1.21152 10.1097 2.47959 11.0173Z", fill: "#FFEE48" })))),
|
|
37
|
+
react_1.default.createElement("defs", null,
|
|
38
|
+
react_1.default.createElement("filter", { id: "filter0_f_5333_7017", x: "-2.85766", y: "3.3534", width: "7.39819", height: "8.14086", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" },
|
|
39
|
+
react_1.default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
40
|
+
react_1.default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "BackgroundImageFix", result: "shape" }),
|
|
41
|
+
react_1.default.createElement("feGaussianBlur", { stdDeviation: "0.463378", result: "effect1_foregroundBlur_5333_7017" })),
|
|
42
|
+
react_1.default.createElement("filter", { id: "filter1_f_5333_7017", x: "-1.94918", y: "-6.7065", width: "15.9862", height: "16.1406", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" },
|
|
43
|
+
react_1.default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
44
|
+
react_1.default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "BackgroundImageFix", result: "shape" }),
|
|
45
|
+
react_1.default.createElement("feGaussianBlur", { stdDeviation: "2.23985", result: "effect1_foregroundBlur_5333_7017" })),
|
|
46
|
+
react_1.default.createElement("filter", { id: "filter2_f_5333_7017", x: "-3.03712", y: "3.12285", width: "14.9666", height: "17.1257", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" },
|
|
47
|
+
react_1.default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
48
|
+
react_1.default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "BackgroundImageFix", result: "shape" }),
|
|
49
|
+
react_1.default.createElement("feGaussianBlur", { stdDeviation: "1.90418", result: "effect1_foregroundBlur_5333_7017" })),
|
|
50
|
+
react_1.default.createElement("filter", { id: "filter3_f_5333_7017", x: "-3.03712", y: "3.12285", width: "14.9666", height: "17.1257", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" },
|
|
51
|
+
react_1.default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
52
|
+
react_1.default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "BackgroundImageFix", result: "shape" }),
|
|
53
|
+
react_1.default.createElement("feGaussianBlur", { stdDeviation: "1.90418", result: "effect1_foregroundBlur_5333_7017" })),
|
|
54
|
+
react_1.default.createElement("filter", { id: "filter4_f_5333_7017", x: "-2.86183", y: "3.78807", width: "15.0188", height: "15.3529", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" },
|
|
55
|
+
react_1.default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
56
|
+
react_1.default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "BackgroundImageFix", result: "shape" }),
|
|
57
|
+
react_1.default.createElement("feGaussianBlur", { stdDeviation: "1.90418", result: "effect1_foregroundBlur_5333_7017" })),
|
|
58
|
+
react_1.default.createElement("filter", { id: "filter5_f_5333_7017", x: "6.49612", y: "-1.29935", width: "14.1491", height: "13.8932", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" },
|
|
59
|
+
react_1.default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
60
|
+
react_1.default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "BackgroundImageFix", result: "shape" }),
|
|
61
|
+
react_1.default.createElement("feGaussianBlur", { stdDeviation: "1.80943", result: "effect1_foregroundBlur_5333_7017" })),
|
|
62
|
+
react_1.default.createElement("filter", { id: "filter6_f_5333_7017", x: "-6.39114", y: "-2.1852", width: "14.7181", height: "14.8353", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" },
|
|
63
|
+
react_1.default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
64
|
+
react_1.default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "BackgroundImageFix", result: "shape" }),
|
|
65
|
+
react_1.default.createElement("feGaussianBlur", { stdDeviation: "1.6399", result: "effect1_foregroundBlur_5333_7017" })),
|
|
66
|
+
react_1.default.createElement("filter", { id: "filter7_f_5333_7017", x: "2.40345", y: "-0.247677", width: "14.8579", height: "14.606", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" },
|
|
67
|
+
react_1.default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
68
|
+
react_1.default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "BackgroundImageFix", result: "shape" }),
|
|
69
|
+
react_1.default.createElement("feGaussianBlur", { stdDeviation: "1.46454", result: "effect1_foregroundBlur_5333_7017" })),
|
|
70
|
+
react_1.default.createElement("filter", { id: "filter8_f_5333_7017", x: "3.43598", y: "-2.60638", width: "10.5997", height: "9.75933", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" },
|
|
71
|
+
react_1.default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
72
|
+
react_1.default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "BackgroundImageFix", result: "shape" }),
|
|
73
|
+
react_1.default.createElement("feGaussianBlur", { stdDeviation: "1.31045", result: "effect1_foregroundBlur_5333_7017" })),
|
|
74
|
+
react_1.default.createElement("filter", { id: "filter9_f_5333_7017", x: "-2.04789", y: "-5.01896", width: "13.3468", height: "13.0548", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" },
|
|
75
|
+
react_1.default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
76
|
+
react_1.default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "BackgroundImageFix", result: "shape" }),
|
|
77
|
+
react_1.default.createElement("feGaussianBlur", { stdDeviation: "1.10683", result: "effect1_foregroundBlur_5333_7017" })),
|
|
78
|
+
react_1.default.createElement("filter", { id: "filter10_f_5333_7017", x: "-1.7922", y: "4.82486", width: "10.455", height: "9.71453", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" },
|
|
79
|
+
react_1.default.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
80
|
+
react_1.default.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "BackgroundImageFix", result: "shape" }),
|
|
81
|
+
react_1.default.createElement("feGaussianBlur", { stdDeviation: "1.36998", result: "effect1_foregroundBlur_5333_7017" })),
|
|
82
|
+
react_1.default.createElement("linearGradient", { id: "paint0_linear_5333_7017", x1: "4.35148", y1: "9.05502", x2: "10.7005", y2: "3.70245", gradientUnits: "userSpaceOnUse" },
|
|
83
|
+
react_1.default.createElement("stop", { stopColor: "#4893FC" }),
|
|
84
|
+
react_1.default.createElement("stop", { offset: "0.27", stopColor: "#4893FC" }),
|
|
85
|
+
react_1.default.createElement("stop", { offset: "0.777", stopColor: "#969DFF" }),
|
|
86
|
+
react_1.default.createElement("stop", { offset: "1", stopColor: "#BD99FE" })),
|
|
87
|
+
react_1.default.createElement("clipPath", { id: "clip0_5333_7017" },
|
|
88
|
+
react_1.default.createElement("rect", { width: "14", height: "14", fill: "white" })))));
|
|
89
|
+
exports.GeminiIcon = (0, styled_components_1.default)(Icon).attrs(() => ({
|
|
90
|
+
'data-component-name': 'icons/GeminiIcon/GeminiIcon',
|
|
91
|
+
})) `
|
|
92
|
+
height: ${({ size }) => size || '16px'};
|
|
93
|
+
width: ${({ size }) => size || '16px'};
|
|
94
|
+
`;
|
|
95
|
+
//# sourceMappingURL=GeminiIcon.js.map
|
package/lib/index.d.ts
CHANGED
|
@@ -266,6 +266,9 @@ export * from './icons/RabbitMQIcon/RabbitMQIcon';
|
|
|
266
266
|
export * from './icons/CurveAutoColonIcon/CurveAutoColonIcon';
|
|
267
267
|
export * from './icons/AiStarsIcon/AiStarsIcon';
|
|
268
268
|
export * from './icons/AiStarsGradientIcon/AiStarsGradientIcon';
|
|
269
|
+
export * from './icons/BotIcon/BotIcon';
|
|
270
|
+
export * from './icons/AnthropicIcon/AnthropicIcon';
|
|
271
|
+
export * from './icons/GeminiIcon/GeminiIcon';
|
|
269
272
|
export * from './icons/RedoclyIcon/RedoclyIcon';
|
|
270
273
|
export * from './icons/WorkflowHierarchyIcon/WorkflowHierarchyIcon';
|
|
271
274
|
export * from './icons/GenericIcon/GenericIcon';
|
package/lib/index.js
CHANGED
|
@@ -329,6 +329,9 @@ __exportStar(require("./icons/RabbitMQIcon/RabbitMQIcon"), exports);
|
|
|
329
329
|
__exportStar(require("./icons/CurveAutoColonIcon/CurveAutoColonIcon"), exports);
|
|
330
330
|
__exportStar(require("./icons/AiStarsIcon/AiStarsIcon"), exports);
|
|
331
331
|
__exportStar(require("./icons/AiStarsGradientIcon/AiStarsGradientIcon"), exports);
|
|
332
|
+
__exportStar(require("./icons/BotIcon/BotIcon"), exports);
|
|
333
|
+
__exportStar(require("./icons/AnthropicIcon/AnthropicIcon"), exports);
|
|
334
|
+
__exportStar(require("./icons/GeminiIcon/GeminiIcon"), exports);
|
|
332
335
|
__exportStar(require("./icons/RedoclyIcon/RedoclyIcon"), exports);
|
|
333
336
|
__exportStar(require("./icons/WorkflowHierarchyIcon/WorkflowHierarchyIcon"), exports);
|
|
334
337
|
__exportStar(require("./icons/GenericIcon/GenericIcon"), exports);
|
|
@@ -16,7 +16,7 @@ function PageLayout({ sidebar, children, }) {
|
|
|
16
16
|
const Container = styled_components_1.default.div `
|
|
17
17
|
display: flex;
|
|
18
18
|
flex-direction: row;
|
|
19
|
-
min-height: calc(100vh - var(--navbar-height));
|
|
19
|
+
min-height: calc(100vh - var(--navbar-height) - var(--banner-height));
|
|
20
20
|
|
|
21
21
|
@media screen and (min-width: ${utils_1.breakpoints.max}) {
|
|
22
22
|
max-width: var(--container-max-width);
|
|
@@ -53,8 +53,8 @@ function MarkdownLink(_a) {
|
|
|
53
53
|
const markdownLinkContext = (0, react_1.useContext)(contexts_1.MarkdownLinkContext);
|
|
54
54
|
const onClick = (0, react_1.useCallback)(() => {
|
|
55
55
|
var _a;
|
|
56
|
-
(_a = markdownLinkContext === null || markdownLinkContext === void 0 ? void 0 : markdownLinkContext.onMarkdownLinkClick) === null || _a === void 0 ? void 0 : _a.call(markdownLinkContext);
|
|
57
|
-
}, [markdownLinkContext]);
|
|
56
|
+
(_a = markdownLinkContext === null || markdownLinkContext === void 0 ? void 0 : markdownLinkContext.onMarkdownLinkClick) === null || _a === void 0 ? void 0 : _a.call(markdownLinkContext, href);
|
|
57
|
+
}, [markdownLinkContext, href]);
|
|
58
58
|
const linkProps = Object.assign(Object.assign({}, props), { languageInsensitive: true, onClick });
|
|
59
59
|
return react_1.default.createElement(Link_1.Link, Object.assign({ to: href }, linkProps));
|
|
60
60
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/theme",
|
|
3
|
-
"version": "0.64.0
|
|
3
|
+
"version": "0.64.0",
|
|
4
4
|
"description": "Shared UI components lib",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"theme",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"vitest": "4.0.10",
|
|
64
64
|
"vitest-when": "0.6.2",
|
|
65
65
|
"webpack": "5.105.2",
|
|
66
|
-
"@redocly/realm-asyncapi-sdk": "0.10.0
|
|
66
|
+
"@redocly/realm-asyncapi-sdk": "0.10.0"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@tanstack/react-query": "5.62.3",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"openapi-sampler": "^1.7.2",
|
|
82
82
|
"react-calendar": "5.1.0",
|
|
83
83
|
"react-date-picker": "11.0.0",
|
|
84
|
-
"@redocly/config": "0.
|
|
84
|
+
"@redocly/config": "0.48.0"
|
|
85
85
|
},
|
|
86
86
|
"scripts": {
|
|
87
87
|
"watch": "tsc -p tsconfig.build.json && (concurrently \"tsc -w -p tsconfig.build.json\" \"tsc-alias -w -p tsconfig.build.json\")",
|
|
@@ -1,23 +1,35 @@
|
|
|
1
|
-
import React, { useRef, useEffect, useState } from 'react';
|
|
1
|
+
import React, { useRef, useEffect, useState, useMemo } from 'react';
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
3
|
|
|
4
4
|
import type { ResolvedBannerConfig } from '@redocly/config';
|
|
5
5
|
import type { JSX } from 'react';
|
|
6
6
|
|
|
7
|
-
import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
7
|
+
import { useThemeHooks, useBannerTelemetry } from '@redocly/theme/core/hooks';
|
|
8
8
|
import { getNavbarElement } from '@redocly/theme/core/utils';
|
|
9
|
+
import { MarkdownLinkContext } from '@redocly/theme/core/contexts';
|
|
9
10
|
import { Markdown } from '@redocly/theme/components/Markdown/Markdown';
|
|
10
11
|
import { CloseIcon } from '@redocly/theme/icons/CloseIcon/CloseIcon';
|
|
11
12
|
import { Button } from '@redocly/theme/components/Button/Button';
|
|
12
13
|
|
|
13
14
|
const ANIMATION_DURATION = 0.4;
|
|
14
15
|
|
|
15
|
-
type BannerColor = 'info' | 'success' | 'warning' | 'error';
|
|
16
|
-
|
|
17
16
|
type BannerProps = {
|
|
18
17
|
className?: string;
|
|
19
18
|
};
|
|
20
19
|
|
|
20
|
+
export type DisplayBanner = ResolvedBannerConfig & {
|
|
21
|
+
color: NonNullable<ResolvedBannerConfig['color']>;
|
|
22
|
+
dismissible: NonNullable<ResolvedBannerConfig['dismissible']>;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
function toDisplayBanner(banner: ResolvedBannerConfig): DisplayBanner {
|
|
26
|
+
return {
|
|
27
|
+
...banner,
|
|
28
|
+
color: banner.color ?? 'info',
|
|
29
|
+
dismissible: banner.dismissible ?? false,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
21
33
|
function setBannerHeight(height: number): void {
|
|
22
34
|
document.documentElement.style.setProperty('--banner-height', `${height}px`);
|
|
23
35
|
}
|
|
@@ -25,15 +37,18 @@ function setBannerHeight(height: number): void {
|
|
|
25
37
|
export function Banner({ className }: BannerProps): JSX.Element | null {
|
|
26
38
|
const { useBanner, useMarkdocRenderer } = useThemeHooks();
|
|
27
39
|
const { banner, dismissBanner } = useBanner();
|
|
28
|
-
const [displayBanner, setDisplayBanner] = useState<
|
|
40
|
+
const [displayBanner, setDisplayBanner] = useState<DisplayBanner | undefined>(undefined);
|
|
29
41
|
const [isVisible, setIsVisible] = useState(false);
|
|
30
42
|
|
|
43
|
+
const { sendBannerViewedMessage, sendBannerDismissedMessage, sendBannerLinkClickedMessage } =
|
|
44
|
+
useBannerTelemetry(displayBanner);
|
|
45
|
+
|
|
31
46
|
const markdownContent = useMarkdocRenderer(displayBanner?.ast);
|
|
32
47
|
const bannerRef = useRef<HTMLDivElement>(null);
|
|
33
48
|
|
|
34
49
|
useEffect(() => {
|
|
35
50
|
if (banner) {
|
|
36
|
-
setDisplayBanner(banner);
|
|
51
|
+
setDisplayBanner(toDisplayBanner(banner));
|
|
37
52
|
requestAnimationFrame(() => {
|
|
38
53
|
requestAnimationFrame(() => {
|
|
39
54
|
setIsVisible(true);
|
|
@@ -98,29 +113,45 @@ export function Banner({ className }: BannerProps): JSX.Element | null {
|
|
|
98
113
|
};
|
|
99
114
|
}, [displayBanner, isVisible]);
|
|
100
115
|
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
if (isVisible) {
|
|
118
|
+
sendBannerViewedMessage();
|
|
119
|
+
}
|
|
120
|
+
}, [isVisible, sendBannerViewedMessage]);
|
|
121
|
+
|
|
122
|
+
const markdownLinkContextValue = useMemo(
|
|
123
|
+
() => ({
|
|
124
|
+
onMarkdownLinkClick: sendBannerLinkClickedMessage,
|
|
125
|
+
}),
|
|
126
|
+
[sendBannerLinkClickedMessage],
|
|
127
|
+
);
|
|
128
|
+
|
|
101
129
|
if (!displayBanner) {
|
|
102
130
|
return null;
|
|
103
131
|
}
|
|
104
132
|
|
|
105
|
-
const bannerColor = displayBanner.color || 'info';
|
|
106
|
-
|
|
107
133
|
return (
|
|
108
134
|
<BannerWrapper
|
|
109
135
|
ref={bannerRef}
|
|
110
136
|
data-component-name="Banner/Banner"
|
|
111
137
|
className={className}
|
|
112
|
-
$color={
|
|
138
|
+
$color={displayBanner.color}
|
|
113
139
|
$isVisible={isVisible}
|
|
114
140
|
>
|
|
115
141
|
<BannerContent>
|
|
116
|
-
<
|
|
142
|
+
<MarkdownLinkContext.Provider value={markdownLinkContextValue}>
|
|
143
|
+
<Markdown compact>{markdownContent}</Markdown>
|
|
144
|
+
</MarkdownLinkContext.Provider>
|
|
117
145
|
</BannerContent>
|
|
118
146
|
{displayBanner.dismissible && (
|
|
119
147
|
<DismissButton
|
|
120
148
|
variant="ghost"
|
|
121
149
|
size="var(--banner-button-size)"
|
|
122
|
-
icon={<CloseIcon color={`var(--banner-${
|
|
123
|
-
onClick={() =>
|
|
150
|
+
icon={<CloseIcon color={`var(--banner-${displayBanner.color}-icon-color)`} size="16px" />}
|
|
151
|
+
onClick={() => {
|
|
152
|
+
dismissBanner(displayBanner.hash);
|
|
153
|
+
sendBannerDismissedMessage();
|
|
154
|
+
}}
|
|
124
155
|
aria-label="Dismiss banner"
|
|
125
156
|
/>
|
|
126
157
|
)}
|
|
@@ -162,7 +193,7 @@ const BannerContent = styled.div`
|
|
|
162
193
|
}
|
|
163
194
|
`;
|
|
164
195
|
|
|
165
|
-
const BannerWrapper = styled.div<{ $color?:
|
|
196
|
+
const BannerWrapper = styled.div<{ $color?: DisplayBanner['color']; $isVisible?: boolean }>`
|
|
166
197
|
display: flex;
|
|
167
198
|
align-items: center;
|
|
168
199
|
justify-content: space-between;
|
|
@@ -88,8 +88,8 @@ const SidebarContent = styled.aside<{ opened?: boolean; collapsed?: boolean }>`
|
|
|
88
88
|
flex-direction: column;
|
|
89
89
|
width: 100%;
|
|
90
90
|
-webkit-font-smoothing: antialiased;
|
|
91
|
-
top: var(--navbar-height);
|
|
92
|
-
height: calc(100vh - var(--navbar-height));
|
|
91
|
+
top: calc(var(--navbar-height) + var(--banner-height));
|
|
92
|
+
height: calc(100vh - var(--navbar-height) - var(--banner-height));
|
|
93
93
|
overflow-x: hidden;
|
|
94
94
|
${({ opened }) => `
|
|
95
95
|
display: ${opened ? 'flex' : 'none'}
|
package/src/core/hooks/index.ts
CHANGED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
|
|
3
|
+
import type { DisplayBanner } from '@redocly/theme/components/Banner/Banner';
|
|
4
|
+
|
|
5
|
+
import { useThemeHooks } from './use-theme-hooks';
|
|
6
|
+
|
|
7
|
+
const noop = (): void => {};
|
|
8
|
+
const noopLink = (_href: string): void => {};
|
|
9
|
+
|
|
10
|
+
export type BannerTelemetryActions = {
|
|
11
|
+
sendBannerViewedMessage: () => void;
|
|
12
|
+
sendBannerDismissedMessage: () => void;
|
|
13
|
+
sendBannerLinkClickedMessage: (href: string) => void;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
function getCurrentPageUri(): string {
|
|
17
|
+
return window.location.href;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function useBannerTelemetry(
|
|
21
|
+
displayBanner: DisplayBanner | undefined,
|
|
22
|
+
): BannerTelemetryActions {
|
|
23
|
+
const { useTelemetry } = useThemeHooks();
|
|
24
|
+
const telemetry = useTelemetry();
|
|
25
|
+
|
|
26
|
+
return useMemo(() => {
|
|
27
|
+
if (!displayBanner) {
|
|
28
|
+
return {
|
|
29
|
+
sendBannerViewedMessage: noop,
|
|
30
|
+
sendBannerDismissedMessage: noop,
|
|
31
|
+
sendBannerLinkClickedMessage: noopLink,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const bannerUri = 'urn:redocly:realm:ui:banner:banner-id';
|
|
36
|
+
const payload = {
|
|
37
|
+
id: 'banner-id' as const,
|
|
38
|
+
object: 'banner' as const,
|
|
39
|
+
uri: bannerUri,
|
|
40
|
+
trackingId: displayBanner.trackingId,
|
|
41
|
+
hash: displayBanner.hash,
|
|
42
|
+
color: displayBanner.color,
|
|
43
|
+
target: displayBanner.target,
|
|
44
|
+
dismissible: displayBanner.dismissible,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
sendBannerViewedMessage: () => {
|
|
49
|
+
const pageUri = getCurrentPageUri();
|
|
50
|
+
const page = { id: pageUri, object: 'page' as const, uri: pageUri };
|
|
51
|
+
telemetry.sendBannerViewedMessage([payload, page]);
|
|
52
|
+
},
|
|
53
|
+
sendBannerDismissedMessage: () => {
|
|
54
|
+
const pageUri = getCurrentPageUri();
|
|
55
|
+
const page = { id: pageUri, object: 'page' as const, uri: pageUri };
|
|
56
|
+
const { dismissible: _, ...dismissedPayload } = payload;
|
|
57
|
+
telemetry.sendBannerDismissedMessage([dismissedPayload, page]);
|
|
58
|
+
},
|
|
59
|
+
sendBannerLinkClickedMessage: (href: string) => {
|
|
60
|
+
const pageUri = getCurrentPageUri();
|
|
61
|
+
const page = { id: pageUri, object: 'page' as const, uri: pageUri };
|
|
62
|
+
telemetry.sendBannerLinkClickedMessage([{ ...payload, href }, page]);
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
}, [displayBanner, telemetry]);
|
|
66
|
+
}
|
|
@@ -70,4 +70,7 @@ export const useTelemetryFallback = () => ({
|
|
|
70
70
|
sendGraphqlDocsReferencedInLinkClickedMessage: () => {},
|
|
71
71
|
sendGraphqlDocsRequiredScopesModalOpenedMessage: () => {},
|
|
72
72
|
sendGraphqlDocsDownloadDefinitionClickedMessage: () => {},
|
|
73
|
+
sendBannerViewedMessage: () => {},
|
|
74
|
+
sendBannerLinkClickedMessage: () => {},
|
|
75
|
+
sendBannerDismissedMessage: () => {},
|
|
73
76
|
});
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
<g transform="translate(2.15065 3.876255)">
|
|
11
|
+
<path
|
|
12
|
+
d="M8.43781 0.000244141H6.64874L9.90967 8.24774H11.6987L8.43781 0.000244141ZM3.26092 0.000244141L-7.62939e-06 8.24774H1.82713L2.49962 6.52211H5.91281L6.57261 8.24774H8.39975L5.13881 0.000244141H3.26092ZM3.08329 4.9868L4.19987 2.09384L5.31645 4.9868H3.08329Z"
|
|
13
|
+
fill="currentColor"
|
|
14
|
+
/>
|
|
15
|
+
</g>
|
|
16
|
+
</svg>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
export const AnthropicIcon = styled(Icon).attrs(() => ({
|
|
20
|
+
'data-component-name': 'icons/AnthropicIcon/AnthropicIcon',
|
|
21
|
+
}))<IconProps>`
|
|
22
|
+
color: ${({ color }) => getCssColorVariable(color)};
|
|
23
|
+
height: ${({ size }) => size || '16px'};
|
|
24
|
+
width: ${({ size }) => size || '16px'};
|
|
25
|
+
`;
|
|
@@ -0,0 +1,25 @@
|
|
|
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 10.5 12.25" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
10
|
+
<path d="M7 3.5H6.125V4.375H7V3.5Z" fill="currentColor" />
|
|
11
|
+
<path d="M4.375 3.5H3.5V4.375H4.375V3.5Z" fill="currentColor" />
|
|
12
|
+
<path
|
|
13
|
+
d="M9.625 7.875H7.4375V7H7.875C8.10698 6.99973 8.32939 6.90746 8.49342 6.74342C8.65746 6.57939 8.74973 6.35698 8.75 6.125V4.375H9.625V3.5H8.75V2.625C8.74973 2.39302 8.65746 2.17061 8.49342 2.00658C8.32939 1.84254 8.10698 1.75027 7.875 1.75H7V0H6.125V1.75H4.375V0H3.5V1.75H2.625C2.39302 1.75027 2.17061 1.84254 2.00658 2.00658C1.84254 2.17061 1.75027 2.39302 1.75 2.625V3.5H0.875V4.375H1.75V6.125C1.75027 6.35698 1.84254 6.57939 2.00658 6.74342C2.17061 6.90746 2.39302 6.99973 2.625 7H3.0625V7.875H0.875C0.643017 7.87527 0.420612 7.96754 0.256576 8.13158C0.092539 8.29561 0.000266321 8.51802 0 8.75V12.25H0.875V8.75H9.625V12.25H10.5V8.75C10.4997 8.51802 10.4075 8.29561 10.2434 8.13158C10.0794 7.96754 9.85698 7.87527 9.625 7.875ZM2.625 2.625H7.875V6.125H2.625V2.625ZM3.9375 7H6.5625V7.875H3.9375V7Z"
|
|
14
|
+
fill="currentColor"
|
|
15
|
+
/>
|
|
16
|
+
</svg>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
export const BotIcon = styled(Icon).attrs(() => ({
|
|
20
|
+
'data-component-name': 'icons/BotIcon/BotIcon',
|
|
21
|
+
}))<IconProps>`
|
|
22
|
+
color: ${({ color }) => getCssColorVariable(color)};
|
|
23
|
+
height: ${({ size }) => size || '16px'};
|
|
24
|
+
width: ${({ size }) => size || '16px'};
|
|
25
|
+
`;
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import type { IconProps } from '@redocly/theme/icons/types';
|
|
5
|
+
|
|
6
|
+
const Icon = (props: IconProps) => (
|
|
7
|
+
<svg viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
8
|
+
<g clipPath="url(#clip0_5333_7017)">
|
|
9
|
+
<mask
|
|
10
|
+
id="mask0_5333_7017"
|
|
11
|
+
style={{ maskType: 'alpha' }}
|
|
12
|
+
maskUnits="userSpaceOnUse"
|
|
13
|
+
x="0"
|
|
14
|
+
y="0"
|
|
15
|
+
width="14"
|
|
16
|
+
height="14"
|
|
17
|
+
>
|
|
18
|
+
<path
|
|
19
|
+
d="M6.98858 0.876221C7.11667 0.876221 7.22837 0.96381 7.25964 1.08813C7.3552 1.46837 7.48112 1.84033 7.63618 2.20043C8.04154 3.14225 8.59778 3.96654 9.30396 4.67271C10.0105 5.37908 10.8346 5.93532 11.7763 6.34069C12.1364 6.4957 12.5085 6.62162 12.8887 6.71723C13.0131 6.7485 13.1005 6.86001 13.1005 6.9881C13.1005 7.11618 13.0131 7.22788 12.8885 7.25915C12.5083 7.35471 12.1363 7.48063 11.7763 7.63569C10.8344 8.04106 10.0103 8.5973 9.30396 9.30348C8.59778 10.01 8.04154 10.8341 7.63618 11.7758C7.48109 12.1359 7.35511 12.508 7.25945 12.8882C7.24431 12.9487 7.20945 13.0023 7.16038 13.0406C7.11132 13.079 7.05086 13.0999 6.98858 13.1C6.8605 13.1 6.74898 13.0126 6.71772 12.8881C6.62209 12.5078 6.49611 12.1359 6.34099 11.7758C5.93581 10.8339 5.37976 10.0098 4.6732 9.30348C3.96684 8.5973 3.14274 8.04106 2.20091 7.63569C1.8408 7.48062 1.46885 7.35464 1.08862 7.25896C1.02821 7.24387 0.974561 7.20905 0.936177 7.16002C0.897792 7.11099 0.876864 7.05055 0.876709 6.98828C0.876709 6.8602 0.964299 6.74868 1.08862 6.71742C1.46887 6.6218 1.84082 6.49582 2.20091 6.34069C3.14274 5.93551 3.96702 5.37927 4.6732 4.6729C5.37957 3.96672 5.93581 3.14244 6.34117 2.20061C6.49619 1.8405 6.62211 1.46854 6.71772 1.08832C6.73278 1.02784 6.76762 0.97413 6.81669 0.935705C6.86576 0.89728 6.92626 0.876345 6.98858 0.876221Z"
|
|
20
|
+
fill="black"
|
|
21
|
+
/>
|
|
22
|
+
<path
|
|
23
|
+
d="M6.98858 0.876221C7.11667 0.876221 7.22837 0.96381 7.25964 1.08813C7.3552 1.46837 7.48112 1.84033 7.63618 2.20043C8.04154 3.14225 8.59778 3.96654 9.30396 4.67271C10.0105 5.37908 10.8346 5.93532 11.7763 6.34069C12.1364 6.4957 12.5085 6.62162 12.8887 6.71723C13.0131 6.7485 13.1005 6.86001 13.1005 6.9881C13.1005 7.11618 13.0131 7.22788 12.8885 7.25915C12.5083 7.35471 12.1363 7.48063 11.7763 7.63569C10.8344 8.04106 10.0103 8.5973 9.30396 9.30348C8.59778 10.01 8.04154 10.8341 7.63618 11.7758C7.48109 12.1359 7.35511 12.508 7.25945 12.8882C7.24431 12.9487 7.20945 13.0023 7.16038 13.0406C7.11132 13.079 7.05086 13.0999 6.98858 13.1C6.8605 13.1 6.74898 13.0126 6.71772 12.8881C6.62209 12.5078 6.49611 12.1359 6.34099 11.7758C5.93581 10.8339 5.37976 10.0098 4.6732 9.30348C3.96684 8.5973 3.14274 8.04106 2.20091 7.63569C1.8408 7.48062 1.46885 7.35464 1.08862 7.25896C1.02821 7.24387 0.974561 7.20905 0.936177 7.16002C0.897792 7.11099 0.876864 7.05055 0.876709 6.98828C0.876709 6.8602 0.964299 6.74868 1.08862 6.71742C1.46887 6.6218 1.84082 6.49582 2.20091 6.34069C3.14274 5.93551 3.96702 5.37927 4.6732 4.6729C5.37957 3.96672 5.93581 3.14244 6.34117 2.20061C6.49619 1.8405 6.62211 1.46854 6.71772 1.08832C6.73278 1.02784 6.76762 0.97413 6.81669 0.935705C6.86576 0.89728 6.92626 0.876345 6.98858 0.876221Z"
|
|
24
|
+
fill="url(#paint0_linear_5333_7017)"
|
|
25
|
+
/>
|
|
26
|
+
</mask>
|
|
27
|
+
<g mask="url(#mask0_5333_7017)">
|
|
28
|
+
<g filter="url(#filter0_f_5333_7017)">
|
|
29
|
+
<path
|
|
30
|
+
d="M-0.227015 10.4326C1.18534 10.9342 2.80867 9.99369 3.39882 8.33193C3.98897 6.67037 3.32234 4.91669 1.90998 4.41507C0.497625 3.91346 -1.1257 4.85396 -1.71604 6.51553C-2.306 8.17729 -1.63937 9.93096 -0.227015 10.4326Z"
|
|
31
|
+
fill="#FFE432"
|
|
32
|
+
/>
|
|
33
|
+
</g>
|
|
34
|
+
<g filter="url(#filter1_f_5333_7017)">
|
|
35
|
+
<path
|
|
36
|
+
d="M6.04409 4.95442C7.98425 4.95442 9.55728 3.34672 9.55728 1.3638C9.55728 -0.619301 7.98443 -2.22681 6.04409 -2.22681C4.10374 -2.22681 2.53052 -0.619113 2.53052 1.3638C2.53052 3.34672 4.10355 4.95442 6.04409 4.95442Z"
|
|
37
|
+
fill="#FC413D"
|
|
38
|
+
/>
|
|
39
|
+
</g>
|
|
40
|
+
<g filter="url(#filter2_f_5333_7017)">
|
|
41
|
+
<path
|
|
42
|
+
d="M4.67843 16.4367C6.70392 16.3378 8.24192 14.1304 8.11364 11.5065C7.98556 8.88254 6.23941 6.83558 4.21393 6.93466C2.18844 7.03374 0.650439 9.241 0.778715 11.8649C0.906992 14.4888 2.65295 16.5358 4.67843 16.4367Z"
|
|
43
|
+
fill="#00B95C"
|
|
44
|
+
/>
|
|
45
|
+
</g>
|
|
46
|
+
<g filter="url(#filter3_f_5333_7017)">
|
|
47
|
+
<path
|
|
48
|
+
d="M4.67843 16.4367C6.70392 16.3378 8.24192 14.1304 8.11364 11.5065C7.98556 8.88254 6.23941 6.83558 4.21393 6.93466C2.18844 7.03374 0.650439 9.241 0.778715 11.8649C0.906992 14.4888 2.65295 16.5358 4.67843 16.4367Z"
|
|
49
|
+
fill="#00B95C"
|
|
50
|
+
/>
|
|
51
|
+
</g>
|
|
52
|
+
<g filter="url(#filter4_f_5333_7017)">
|
|
53
|
+
<path
|
|
54
|
+
d="M6.70714 14.8494C8.40506 13.8162 8.85958 11.4634 7.72223 9.59402C6.58489 7.7245 4.28627 7.04658 2.58816 8.07957C0.890051 9.11294 0.435527 11.4658 1.57287 13.3353C2.7106 15.2047 5.00903 15.8826 6.70714 14.8494Z"
|
|
55
|
+
fill="#00B95C"
|
|
56
|
+
/>
|
|
57
|
+
</g>
|
|
58
|
+
<g filter="url(#filter5_f_5333_7017)">
|
|
59
|
+
<path
|
|
60
|
+
d="M13.5707 8.97502C15.4792 8.97502 17.0265 7.48505 17.0265 5.64736C17.0265 3.80949 15.4792 2.31952 13.5707 2.31952C11.6622 2.31952 10.115 3.80949 10.115 5.64736C10.115 7.48524 11.6622 8.97502 13.5707 8.97502Z"
|
|
61
|
+
fill="#3186FF"
|
|
62
|
+
/>
|
|
63
|
+
</g>
|
|
64
|
+
<g filter="url(#filter6_f_5333_7017)">
|
|
65
|
+
<path
|
|
66
|
+
d="M-1.5844 8.58873C0.17304 9.92499 2.74027 9.50587 4.1498 7.65218C5.55933 5.79867 5.27754 3.2126 3.5201 1.87634C1.76265 0.539895 -0.804385 0.959007 -2.21411 2.81271C-3.62364 4.66622 -3.34166 7.25247 -1.5844 8.58873Z"
|
|
67
|
+
fill="#FBBC04"
|
|
68
|
+
/>
|
|
69
|
+
</g>
|
|
70
|
+
<g filter="url(#filter7_f_5333_7017)">
|
|
71
|
+
<path
|
|
72
|
+
d="M7.42033 10.5639C9.51777 12.006 12.2982 11.6044 13.6303 9.66653C14.9626 7.72883 14.3422 4.98906 12.2445 3.54694C10.1469 2.10444 7.36664 2.50641 6.03434 4.44393C4.70222 6.38183 5.32251 9.12159 7.42014 10.5639H7.42033Z"
|
|
73
|
+
fill="#3186FF"
|
|
74
|
+
/>
|
|
75
|
+
</g>
|
|
76
|
+
<g filter="url(#filter8_f_5333_7017)">
|
|
77
|
+
<path
|
|
78
|
+
d="M11.2336 0.436156C11.7673 1.16174 11.0814 2.57221 9.70202 3.58694C8.32243 4.60166 6.77163 4.83598 6.23799 4.11059C5.70435 3.38482 6.39 1.97416 7.76939 0.959622C9.14898 -0.0550994 10.7 -0.289425 11.2334 0.435968L11.2336 0.436156Z"
|
|
79
|
+
fill="#749BFF"
|
|
80
|
+
/>
|
|
81
|
+
</g>
|
|
82
|
+
<g filter="url(#filter9_f_5333_7017)">
|
|
83
|
+
<path
|
|
84
|
+
d="M6.85291 3.9097C8.98633 1.93074 9.7185 -0.748558 8.48848 -2.07465C7.25846 -3.40074 4.53169 -2.87181 2.39827 -0.892846C0.264845 1.08612 -0.467518 3.76542 0.762693 5.09151C1.99272 6.41759 4.71949 5.88867 6.85291 3.9097Z"
|
|
85
|
+
fill="#FC413D"
|
|
86
|
+
/>
|
|
87
|
+
</g>
|
|
88
|
+
<g filter="url(#filter10_f_5333_7017)">
|
|
89
|
+
<path
|
|
90
|
+
d="M2.47959 11.0173C3.74766 11.9248 5.20334 12.0627 5.73114 11.3254C6.25894 10.588 5.65881 9.25455 4.39074 8.34701C3.12285 7.43947 1.66698 7.30159 1.13937 8.03885C0.611574 8.77629 1.21152 10.1097 2.47959 11.0173Z"
|
|
91
|
+
fill="#FFEE48"
|
|
92
|
+
/>
|
|
93
|
+
</g>
|
|
94
|
+
</g>
|
|
95
|
+
</g>
|
|
96
|
+
<defs>
|
|
97
|
+
<filter
|
|
98
|
+
id="filter0_f_5333_7017"
|
|
99
|
+
x="-2.85766"
|
|
100
|
+
y="3.3534"
|
|
101
|
+
width="7.39819"
|
|
102
|
+
height="8.14086"
|
|
103
|
+
filterUnits="userSpaceOnUse"
|
|
104
|
+
colorInterpolationFilters="sRGB"
|
|
105
|
+
>
|
|
106
|
+
<feFlood floodOpacity="0" result="BackgroundImageFix" />
|
|
107
|
+
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape" />
|
|
108
|
+
<feGaussianBlur stdDeviation="0.463378" result="effect1_foregroundBlur_5333_7017" />
|
|
109
|
+
</filter>
|
|
110
|
+
<filter
|
|
111
|
+
id="filter1_f_5333_7017"
|
|
112
|
+
x="-1.94918"
|
|
113
|
+
y="-6.7065"
|
|
114
|
+
width="15.9862"
|
|
115
|
+
height="16.1406"
|
|
116
|
+
filterUnits="userSpaceOnUse"
|
|
117
|
+
colorInterpolationFilters="sRGB"
|
|
118
|
+
>
|
|
119
|
+
<feFlood floodOpacity="0" result="BackgroundImageFix" />
|
|
120
|
+
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape" />
|
|
121
|
+
<feGaussianBlur stdDeviation="2.23985" result="effect1_foregroundBlur_5333_7017" />
|
|
122
|
+
</filter>
|
|
123
|
+
<filter
|
|
124
|
+
id="filter2_f_5333_7017"
|
|
125
|
+
x="-3.03712"
|
|
126
|
+
y="3.12285"
|
|
127
|
+
width="14.9666"
|
|
128
|
+
height="17.1257"
|
|
129
|
+
filterUnits="userSpaceOnUse"
|
|
130
|
+
colorInterpolationFilters="sRGB"
|
|
131
|
+
>
|
|
132
|
+
<feFlood floodOpacity="0" result="BackgroundImageFix" />
|
|
133
|
+
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape" />
|
|
134
|
+
<feGaussianBlur stdDeviation="1.90418" result="effect1_foregroundBlur_5333_7017" />
|
|
135
|
+
</filter>
|
|
136
|
+
<filter
|
|
137
|
+
id="filter3_f_5333_7017"
|
|
138
|
+
x="-3.03712"
|
|
139
|
+
y="3.12285"
|
|
140
|
+
width="14.9666"
|
|
141
|
+
height="17.1257"
|
|
142
|
+
filterUnits="userSpaceOnUse"
|
|
143
|
+
colorInterpolationFilters="sRGB"
|
|
144
|
+
>
|
|
145
|
+
<feFlood floodOpacity="0" result="BackgroundImageFix" />
|
|
146
|
+
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape" />
|
|
147
|
+
<feGaussianBlur stdDeviation="1.90418" result="effect1_foregroundBlur_5333_7017" />
|
|
148
|
+
</filter>
|
|
149
|
+
<filter
|
|
150
|
+
id="filter4_f_5333_7017"
|
|
151
|
+
x="-2.86183"
|
|
152
|
+
y="3.78807"
|
|
153
|
+
width="15.0188"
|
|
154
|
+
height="15.3529"
|
|
155
|
+
filterUnits="userSpaceOnUse"
|
|
156
|
+
colorInterpolationFilters="sRGB"
|
|
157
|
+
>
|
|
158
|
+
<feFlood floodOpacity="0" result="BackgroundImageFix" />
|
|
159
|
+
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape" />
|
|
160
|
+
<feGaussianBlur stdDeviation="1.90418" result="effect1_foregroundBlur_5333_7017" />
|
|
161
|
+
</filter>
|
|
162
|
+
<filter
|
|
163
|
+
id="filter5_f_5333_7017"
|
|
164
|
+
x="6.49612"
|
|
165
|
+
y="-1.29935"
|
|
166
|
+
width="14.1491"
|
|
167
|
+
height="13.8932"
|
|
168
|
+
filterUnits="userSpaceOnUse"
|
|
169
|
+
colorInterpolationFilters="sRGB"
|
|
170
|
+
>
|
|
171
|
+
<feFlood floodOpacity="0" result="BackgroundImageFix" />
|
|
172
|
+
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape" />
|
|
173
|
+
<feGaussianBlur stdDeviation="1.80943" result="effect1_foregroundBlur_5333_7017" />
|
|
174
|
+
</filter>
|
|
175
|
+
<filter
|
|
176
|
+
id="filter6_f_5333_7017"
|
|
177
|
+
x="-6.39114"
|
|
178
|
+
y="-2.1852"
|
|
179
|
+
width="14.7181"
|
|
180
|
+
height="14.8353"
|
|
181
|
+
filterUnits="userSpaceOnUse"
|
|
182
|
+
colorInterpolationFilters="sRGB"
|
|
183
|
+
>
|
|
184
|
+
<feFlood floodOpacity="0" result="BackgroundImageFix" />
|
|
185
|
+
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape" />
|
|
186
|
+
<feGaussianBlur stdDeviation="1.6399" result="effect1_foregroundBlur_5333_7017" />
|
|
187
|
+
</filter>
|
|
188
|
+
<filter
|
|
189
|
+
id="filter7_f_5333_7017"
|
|
190
|
+
x="2.40345"
|
|
191
|
+
y="-0.247677"
|
|
192
|
+
width="14.8579"
|
|
193
|
+
height="14.606"
|
|
194
|
+
filterUnits="userSpaceOnUse"
|
|
195
|
+
colorInterpolationFilters="sRGB"
|
|
196
|
+
>
|
|
197
|
+
<feFlood floodOpacity="0" result="BackgroundImageFix" />
|
|
198
|
+
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape" />
|
|
199
|
+
<feGaussianBlur stdDeviation="1.46454" result="effect1_foregroundBlur_5333_7017" />
|
|
200
|
+
</filter>
|
|
201
|
+
<filter
|
|
202
|
+
id="filter8_f_5333_7017"
|
|
203
|
+
x="3.43598"
|
|
204
|
+
y="-2.60638"
|
|
205
|
+
width="10.5997"
|
|
206
|
+
height="9.75933"
|
|
207
|
+
filterUnits="userSpaceOnUse"
|
|
208
|
+
colorInterpolationFilters="sRGB"
|
|
209
|
+
>
|
|
210
|
+
<feFlood floodOpacity="0" result="BackgroundImageFix" />
|
|
211
|
+
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape" />
|
|
212
|
+
<feGaussianBlur stdDeviation="1.31045" result="effect1_foregroundBlur_5333_7017" />
|
|
213
|
+
</filter>
|
|
214
|
+
<filter
|
|
215
|
+
id="filter9_f_5333_7017"
|
|
216
|
+
x="-2.04789"
|
|
217
|
+
y="-5.01896"
|
|
218
|
+
width="13.3468"
|
|
219
|
+
height="13.0548"
|
|
220
|
+
filterUnits="userSpaceOnUse"
|
|
221
|
+
colorInterpolationFilters="sRGB"
|
|
222
|
+
>
|
|
223
|
+
<feFlood floodOpacity="0" result="BackgroundImageFix" />
|
|
224
|
+
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape" />
|
|
225
|
+
<feGaussianBlur stdDeviation="1.10683" result="effect1_foregroundBlur_5333_7017" />
|
|
226
|
+
</filter>
|
|
227
|
+
<filter
|
|
228
|
+
id="filter10_f_5333_7017"
|
|
229
|
+
x="-1.7922"
|
|
230
|
+
y="4.82486"
|
|
231
|
+
width="10.455"
|
|
232
|
+
height="9.71453"
|
|
233
|
+
filterUnits="userSpaceOnUse"
|
|
234
|
+
colorInterpolationFilters="sRGB"
|
|
235
|
+
>
|
|
236
|
+
<feFlood floodOpacity="0" result="BackgroundImageFix" />
|
|
237
|
+
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape" />
|
|
238
|
+
<feGaussianBlur stdDeviation="1.36998" result="effect1_foregroundBlur_5333_7017" />
|
|
239
|
+
</filter>
|
|
240
|
+
<linearGradient
|
|
241
|
+
id="paint0_linear_5333_7017"
|
|
242
|
+
x1="4.35148"
|
|
243
|
+
y1="9.05502"
|
|
244
|
+
x2="10.7005"
|
|
245
|
+
y2="3.70245"
|
|
246
|
+
gradientUnits="userSpaceOnUse"
|
|
247
|
+
>
|
|
248
|
+
<stop stopColor="#4893FC" />
|
|
249
|
+
<stop offset="0.27" stopColor="#4893FC" />
|
|
250
|
+
<stop offset="0.777" stopColor="#969DFF" />
|
|
251
|
+
<stop offset="1" stopColor="#BD99FE" />
|
|
252
|
+
</linearGradient>
|
|
253
|
+
<clipPath id="clip0_5333_7017">
|
|
254
|
+
<rect width="14" height="14" fill="white" />
|
|
255
|
+
</clipPath>
|
|
256
|
+
</defs>
|
|
257
|
+
</svg>
|
|
258
|
+
);
|
|
259
|
+
|
|
260
|
+
export const GeminiIcon = styled(Icon).attrs(() => ({
|
|
261
|
+
'data-component-name': 'icons/GeminiIcon/GeminiIcon',
|
|
262
|
+
}))<IconProps>`
|
|
263
|
+
height: ${({ size }) => size || '16px'};
|
|
264
|
+
width: ${({ size }) => size || '16px'};
|
|
265
|
+
`;
|
package/src/index.ts
CHANGED
|
@@ -293,6 +293,9 @@ export * from '@redocly/theme/icons/RabbitMQIcon/RabbitMQIcon';
|
|
|
293
293
|
export * from '@redocly/theme/icons/CurveAutoColonIcon/CurveAutoColonIcon';
|
|
294
294
|
export * from '@redocly/theme/icons/AiStarsIcon/AiStarsIcon';
|
|
295
295
|
export * from '@redocly/theme/icons/AiStarsGradientIcon/AiStarsGradientIcon';
|
|
296
|
+
export * from '@redocly/theme/icons/BotIcon/BotIcon';
|
|
297
|
+
export * from '@redocly/theme/icons/AnthropicIcon/AnthropicIcon';
|
|
298
|
+
export * from '@redocly/theme/icons/GeminiIcon/GeminiIcon';
|
|
296
299
|
export * from '@redocly/theme/icons/RedoclyIcon/RedoclyIcon';
|
|
297
300
|
export * from '@redocly/theme/icons/WorkflowHierarchyIcon/WorkflowHierarchyIcon';
|
|
298
301
|
export * from '@redocly/theme/icons/GenericIcon/GenericIcon';
|
|
@@ -27,7 +27,7 @@ export function PageLayout({
|
|
|
27
27
|
const Container = styled.div`
|
|
28
28
|
display: flex;
|
|
29
29
|
flex-direction: row;
|
|
30
|
-
min-height: calc(100vh - var(--navbar-height));
|
|
30
|
+
min-height: calc(100vh - var(--navbar-height) - var(--banner-height));
|
|
31
31
|
|
|
32
32
|
@media screen and (min-width: ${breakpoints.max}) {
|
|
33
33
|
max-width: var(--container-max-width);
|
|
@@ -12,8 +12,8 @@ type MarkdownLinkProps = Omit<ComponentProps<typeof Link>, 'to' | 'onClick'> & {
|
|
|
12
12
|
export function MarkdownLink({ href, ...props }: MarkdownLinkProps): ReactElement {
|
|
13
13
|
const markdownLinkContext = useContext(MarkdownLinkContext);
|
|
14
14
|
const onClick = useCallback(() => {
|
|
15
|
-
markdownLinkContext?.onMarkdownLinkClick?.();
|
|
16
|
-
}, [markdownLinkContext]);
|
|
15
|
+
markdownLinkContext?.onMarkdownLinkClick?.(href);
|
|
16
|
+
}, [markdownLinkContext, href]);
|
|
17
17
|
|
|
18
18
|
const linkProps = { ...props, languageInsensitive: true, onClick };
|
|
19
19
|
|