@redocly/theme 0.70.0-next.2 → 0.70.0-next.3
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/CodeBlock/CodeBlockControls.js +3 -5
- package/lib/components/Consent/Consent.d.ts +2 -0
- package/lib/components/Consent/Consent.js +17 -0
- package/lib/components/Consent/ConsentBanner.d.ts +2 -0
- package/lib/components/Consent/ConsentBanner.js +120 -0
- package/lib/components/Consent/ConsentDialog.d.ts +2 -0
- package/lib/components/Consent/ConsentDialog.js +128 -0
- package/lib/components/Consent/ConsentSettingsLink.d.ts +2 -0
- package/lib/components/Consent/ConsentSettingsLink.js +35 -0
- package/lib/components/Consent/variables.d.ts +1 -0
- package/lib/components/Consent/variables.js +31 -0
- package/lib/components/Footer/Footer.js +4 -1
- package/lib/components/JsonViewer/Helpers.d.ts +10 -2
- package/lib/components/JsonViewer/Helpers.js +29 -33
- package/lib/components/JsonViewer/JsonViewer.js +15 -18
- package/lib/components/Markdown/styles/base-table.js +14 -1
- package/lib/components/Markdown/variables.js +1 -0
- package/lib/components/Product/utils.js +1 -1
- package/lib/components/Search/SearchAiMessage.js +1 -1
- package/lib/components/Search/SearchAiResponse.js +1 -0
- package/lib/core/constants/consent.d.ts +2 -0
- package/lib/core/constants/consent.js +30 -0
- package/lib/core/constants/index.d.ts +1 -0
- package/lib/core/constants/index.js +1 -0
- package/lib/core/hooks/index.d.ts +2 -0
- package/lib/core/hooks/index.js +2 -0
- package/lib/core/hooks/use-consent-dialog.d.ts +12 -0
- package/lib/core/hooks/use-consent-dialog.js +36 -0
- package/lib/core/hooks/use-consent-telemetry.d.ts +1 -0
- package/lib/core/hooks/use-consent-telemetry.js +42 -0
- package/lib/core/hooks/use-theme-hooks.js +14 -0
- package/lib/core/styles/global.js +42 -40
- package/lib/core/types/consent.d.ts +54 -0
- package/lib/core/types/consent.js +3 -0
- package/lib/core/types/hooks.d.ts +2 -0
- package/lib/core/types/index.d.ts +1 -0
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/core/utils/consent-settings-link-placement.d.ts +3 -0
- package/lib/core/utils/consent-settings-link-placement.js +15 -0
- package/lib/core/utils/index.d.ts +1 -0
- package/lib/core/utils/index.js +1 -0
- package/lib/core/utils/mcp.js +1 -1
- package/lib/core/utils/menu.js +6 -5
- package/lib/core/utils/urls.js +3 -1
- package/lib/icons/ExpandCollapseIcon/ExpandCollapseIcon.d.ts +29 -0
- package/lib/icons/ExpandCollapseIcon/ExpandCollapseIcon.js +81 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/package.json +3 -3
- package/src/components/CodeBlock/CodeBlockControls.tsx +4 -7
- package/src/components/Consent/Consent.tsx +18 -0
- package/src/components/Consent/ConsentBanner.tsx +110 -0
- package/src/components/Consent/ConsentDialog.tsx +210 -0
- package/src/components/Consent/ConsentSettingsLink.tsx +44 -0
- package/src/components/Consent/variables.ts +28 -0
- package/src/components/Footer/Footer.tsx +2 -0
- package/src/components/JsonViewer/Helpers.tsx +46 -51
- package/src/components/JsonViewer/JsonViewer.tsx +23 -25
- package/src/components/Markdown/styles/base-table.ts +14 -1
- package/src/components/Markdown/variables.ts +1 -0
- package/src/components/Product/utils.ts +1 -1
- package/src/components/Search/SearchAiMessage.tsx +1 -1
- package/src/components/Search/SearchAiResponse.tsx +1 -0
- package/src/core/constants/consent.ts +29 -0
- package/src/core/constants/index.ts +1 -0
- package/src/core/hooks/__mocks__/use-theme-hooks.ts +15 -0
- package/src/core/hooks/index.ts +2 -0
- package/src/core/hooks/use-consent-dialog.ts +51 -0
- package/src/core/hooks/use-consent-telemetry.ts +56 -0
- package/src/core/hooks/use-theme-hooks.ts +14 -0
- package/src/core/styles/global.ts +2 -0
- package/src/core/types/consent.ts +51 -0
- package/src/core/types/hooks.ts +2 -0
- package/src/core/types/index.ts +1 -0
- package/src/core/types/l10n.ts +22 -1
- package/src/core/utils/consent-settings-link-placement.ts +18 -0
- package/src/core/utils/index.ts +1 -0
- package/src/core/utils/mcp.ts +1 -1
- package/src/core/utils/menu.ts +5 -6
- package/src/core/utils/urls.ts +3 -1
- package/src/icons/ExpandCollapseIcon/ExpandCollapseIcon.tsx +56 -0
- package/src/index.ts +1 -0
|
@@ -11,8 +11,7 @@ const CopyButton_1 = require("../../components/Buttons/CopyButton");
|
|
|
11
11
|
const Tooltip_1 = require("../../components/Tooltip/Tooltip");
|
|
12
12
|
const hooks_1 = require("../../core/hooks");
|
|
13
13
|
const DeselectIcon_1 = require("../../icons/DeselectIcon/DeselectIcon");
|
|
14
|
-
const
|
|
15
|
-
const MinimizeIcon_1 = require("../../icons/MinimizeIcon/MinimizeIcon");
|
|
14
|
+
const ExpandCollapseIcon_1 = require("../../icons/ExpandCollapseIcon/ExpandCollapseIcon");
|
|
16
15
|
const SelectIcon_1 = require("../../icons/SelectIcon/SelectIcon");
|
|
17
16
|
const WarningSquareIcon_1 = require("../../icons/WarningSquareIcon/WarningSquareIcon");
|
|
18
17
|
const Button_1 = require("../../components/Button/Button");
|
|
@@ -40,9 +39,8 @@ function CodeBlockControls({ children, className, title, controls, tabs, dropdow
|
|
|
40
39
|
dropdown && react_1.default.createElement(CodeBlockDropdown_1.CodeBlockDropdown, Object.assign({}, dropdown)),
|
|
41
40
|
report && !report.hidden && !((_a = report === null || report === void 0 ? void 0 : report.props) === null || _a === void 0 ? void 0 : _a.hide) ? (react_1.default.createElement(Tooltip_1.Tooltip, { tip: ((_b = report.props) === null || _b === void 0 ? void 0 : _b.tooltip) ||
|
|
42
41
|
translate('codeSnippet.report.tooltipText', 'Report a problem'), placement: "top", arrowPosition: "right" }, react_1.default.createElement(ControlButton, { variant: "text", size: "small", "data-testid": "report-button", icon: controlsType === 'icon' ? react_1.default.createElement(WarningSquareIcon_1.WarningSquareIcon, { size: "18px" }) : undefined, "aria-label": "Report a problem", onClick: (_c = report.props) === null || _c === void 0 ? void 0 : _c.onClick }, controlsType !== 'icon' && (((_d = report.props) === null || _d === void 0 ? void 0 : _d.buttonText) || 'Report')))) : null,
|
|
43
|
-
expand && !((_e = codeSnippet === null || codeSnippet === void 0 ? void 0 : codeSnippet.expand) === null || _e === void 0 ? void 0 : _e.hide) ? (react_1.default.createElement(Tooltip_1.Tooltip, { tip: ((_f = expand.props) === null || _f === void 0 ? void 0 : _f.tooltip) || translate('codeSnippet.expand.tooltipText', 'Expand all'), placement: "top", arrowPosition: "right" }, react_1.default.createElement(ControlButton, { variant: "text", size: "small", "data-testid": "expand-all", icon: controlsType === 'icon' ? react_1.default.createElement(
|
|
44
|
-
|
|
45
|
-
translate('codeSnippet.collapse.tooltipText', 'Collapse all'), placement: "top", arrowPosition: "right" }, react_1.default.createElement(ControlButton, { variant: "text", size: "small", "data-testid": "collapse-all", icon: controlsType === 'icon' ? react_1.default.createElement(MinimizeIcon_1.MinimizeIcon, null) : undefined, onClick: collapse === null || collapse === void 0 ? void 0 : collapse.onClick, "aria-label": "Collapse all" }, controlsType !== 'icon' && ((collapse === null || collapse === void 0 ? void 0 : collapse.label) || 'Collapse all')))) : null,
|
|
42
|
+
expand && !((_e = codeSnippet === null || codeSnippet === void 0 ? void 0 : codeSnippet.expand) === null || _e === void 0 ? void 0 : _e.hide) ? (react_1.default.createElement(Tooltip_1.Tooltip, { tip: ((_f = expand.props) === null || _f === void 0 ? void 0 : _f.tooltip) || translate('codeSnippet.expand.tooltipText', 'Expand all'), placement: "top", arrowPosition: "right" }, react_1.default.createElement(ControlButton, { variant: "text", size: "small", "data-testid": "expand-all", icon: controlsType === 'icon' ? react_1.default.createElement(ExpandCollapseIcon_1.ExpandCollapseIcon, null) : undefined, "aria-label": "Expand all", onClick: expand === null || expand === void 0 ? void 0 : expand.onClick }, controlsType !== 'icon' && ((expand === null || expand === void 0 ? void 0 : expand.label) || 'Expand all')))) : collapse && !((_g = codeSnippet === null || codeSnippet === void 0 ? void 0 : codeSnippet.collapse) === null || _g === void 0 ? void 0 : _g.hide) ? (react_1.default.createElement(Tooltip_1.Tooltip, { tip: ((_h = collapse.props) === null || _h === void 0 ? void 0 : _h.tooltip) ||
|
|
43
|
+
translate('codeSnippet.collapse.tooltipText', 'Collapse all'), placement: "top", arrowPosition: "right" }, react_1.default.createElement(ControlButton, { variant: "text", size: "small", "data-testid": "collapse-all", icon: controlsType === 'icon' ? react_1.default.createElement(ExpandCollapseIcon_1.ExpandCollapseIcon, { $collapse: true }) : undefined, onClick: collapse === null || collapse === void 0 ? void 0 : collapse.onClick, "aria-label": "Collapse all" }, controlsType !== 'icon' && ((collapse === null || collapse === void 0 ? void 0 : collapse.label) || 'Collapse all')))) : null,
|
|
46
44
|
select ? (react_1.default.createElement(ControlButton, { variant: "text", size: "small", "data-testid": "select-all", icon: controlsType === 'icon' ? react_1.default.createElement(SelectIcon_1.SelectIcon, null) : undefined, onClick: select === null || select === void 0 ? void 0 : select.onClick, "aria-label": "Select all" }, controlsType !== 'icon' && (select === null || select === void 0 ? void 0 : select.label) ? select.label : 'Select all')) : null,
|
|
47
45
|
deselect ? (react_1.default.createElement(ControlButton, { variant: "text", size: "small", "data-testid": "clear-all", icon: controlsType === 'icon' ? react_1.default.createElement(DeselectIcon_1.DeselectIcon, null) : undefined, onClick: deselect === null || deselect === void 0 ? void 0 : deselect.onClick, "aria-label": "Clear all" }, controlsType !== 'icon' && (deselect === null || deselect === void 0 ? void 0 : deselect.label) ? deselect.label : 'Clear all')) : null,
|
|
48
46
|
copy && !((_j = codeSnippet === null || codeSnippet === void 0 ? void 0 : codeSnippet.copy) === null || _j === void 0 ? void 0 : _j.hide) ? (react_1.default.createElement(Tooltip_1.Tooltip, { tip: translate('codeSnippet.copy.tooltipText', 'Copy to clipboard'), placement: "top", arrowPosition: "right" },
|
|
@@ -0,0 +1,17 @@
|
|
|
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.Consent = Consent;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const ConsentBanner_1 = require("../../components/Consent/ConsentBanner");
|
|
9
|
+
const ConsentDialog_1 = require("../../components/Consent/ConsentDialog");
|
|
10
|
+
const hooks_1 = require("../../core/hooks");
|
|
11
|
+
function Consent() {
|
|
12
|
+
(0, hooks_1.useConsentTelemetry)();
|
|
13
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
14
|
+
react_1.default.createElement(ConsentBanner_1.ConsentBanner, null),
|
|
15
|
+
react_1.default.createElement(ConsentDialog_1.ConsentDialog, null)));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=Consent.js.map
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.ConsentBanner = ConsentBanner;
|
|
40
|
+
const react_1 = __importDefault(require("react"));
|
|
41
|
+
const styled_components_1 = __importStar(require("styled-components"));
|
|
42
|
+
const Button_1 = require("../../components/Button/Button");
|
|
43
|
+
const Link_1 = require("../../components/Link/Link");
|
|
44
|
+
const hooks_1 = require("../../core/hooks");
|
|
45
|
+
function ConsentBanner() {
|
|
46
|
+
var _a;
|
|
47
|
+
const { useConsent, useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
48
|
+
const consent = useConsent();
|
|
49
|
+
const { translate } = useTranslate();
|
|
50
|
+
if (!consent.enabled || consent.mode !== 'opt-in' || consent.decided || consent.isDialogOpen) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
const title = translate('consent.title', 'We value your privacy');
|
|
54
|
+
return (react_1.default.createElement(BannerWrapper, { "data-component-name": "Consent/ConsentBanner", role: "region", "aria-label": title },
|
|
55
|
+
react_1.default.createElement(Title, null, title),
|
|
56
|
+
react_1.default.createElement(Message, null,
|
|
57
|
+
translate('consent.message', 'By selecting "Accept all cookies", you agree to the use of cookies to improve site navigation, understand how our site is used, and support our marketing efforts. Select "Customize" to choose which types of cookies you allow.'),
|
|
58
|
+
' ',
|
|
59
|
+
((_a = consent.config) === null || _a === void 0 ? void 0 : _a.privacyPolicyUrl) ? (react_1.default.createElement(Link_1.Link, { to: consent.config.privacyPolicyUrl, external: true }, translate('consent.privacyPolicy', 'Privacy policy'))) : null),
|
|
60
|
+
react_1.default.createElement(Actions, null,
|
|
61
|
+
react_1.default.createElement(MainActions, null,
|
|
62
|
+
react_1.default.createElement(Button_1.Button, { variant: "outlined", onClick: consent.reject }, translate('consent.rejectAll', 'Reject all')),
|
|
63
|
+
react_1.default.createElement(Button_1.Button, { variant: "primary", onClick: consent.accept }, translate('consent.acceptAllCookies', 'Accept all cookies'))),
|
|
64
|
+
react_1.default.createElement(Button_1.Button, { variant: "text", onClick: consent.openDialog }, translate('consent.customize', 'Customize')))));
|
|
65
|
+
}
|
|
66
|
+
const slideUp = (0, styled_components_1.keyframes) `
|
|
67
|
+
from {
|
|
68
|
+
opacity: 0;
|
|
69
|
+
transform: translateY(16px);
|
|
70
|
+
}
|
|
71
|
+
to {
|
|
72
|
+
opacity: 1;
|
|
73
|
+
transform: translateY(0);
|
|
74
|
+
}
|
|
75
|
+
`;
|
|
76
|
+
const BannerWrapper = styled_components_1.default.div `
|
|
77
|
+
position: fixed;
|
|
78
|
+
left: var(--consent-banner-offset);
|
|
79
|
+
bottom: var(--consent-banner-offset);
|
|
80
|
+
z-index: var(--consent-banner-z-index);
|
|
81
|
+
display: flex;
|
|
82
|
+
flex-direction: column;
|
|
83
|
+
gap: var(--consent-banner-gap);
|
|
84
|
+
width: var(--consent-banner-width);
|
|
85
|
+
max-width: calc(100vw - 2 * var(--consent-banner-offset));
|
|
86
|
+
padding: var(--consent-banner-padding);
|
|
87
|
+
border: 1px solid var(--consent-banner-border-color);
|
|
88
|
+
border-radius: var(--consent-banner-border-radius);
|
|
89
|
+
background: var(--consent-banner-bg-color);
|
|
90
|
+
color: var(--consent-banner-text-color);
|
|
91
|
+
box-shadow: var(--consent-banner-box-shadow);
|
|
92
|
+
font-family: var(--font-family-base);
|
|
93
|
+
|
|
94
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
95
|
+
animation: ${slideUp} 240ms ease-out;
|
|
96
|
+
}
|
|
97
|
+
`;
|
|
98
|
+
const Title = styled_components_1.default.h2 `
|
|
99
|
+
margin: 0;
|
|
100
|
+
font-size: var(--consent-banner-title-font-size);
|
|
101
|
+
font-weight: var(--font-weight-bold);
|
|
102
|
+
`;
|
|
103
|
+
const Message = styled_components_1.default.p `
|
|
104
|
+
margin: 0;
|
|
105
|
+
color: var(--text-color-secondary);
|
|
106
|
+
font-size: var(--consent-banner-font-size);
|
|
107
|
+
`;
|
|
108
|
+
const Actions = styled_components_1.default.div `
|
|
109
|
+
display: flex;
|
|
110
|
+
flex-wrap: wrap;
|
|
111
|
+
gap: var(--consent-banner-gap);
|
|
112
|
+
align-items: center;
|
|
113
|
+
justify-content: space-between;
|
|
114
|
+
`;
|
|
115
|
+
const MainActions = styled_components_1.default.div `
|
|
116
|
+
display: flex;
|
|
117
|
+
flex-wrap: wrap;
|
|
118
|
+
gap: var(--consent-banner-gap);
|
|
119
|
+
`;
|
|
120
|
+
//# sourceMappingURL=ConsentBanner.js.map
|
|
@@ -0,0 +1,128 @@
|
|
|
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.ConsentDialog = ConsentDialog;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const Button_1 = require("../../components/Button/Button");
|
|
10
|
+
const Link_1 = require("../../components/Link/Link");
|
|
11
|
+
const Portal_1 = require("../../components/Portal/Portal");
|
|
12
|
+
const Switch_1 = require("../../components/Switch/Switch");
|
|
13
|
+
const hooks_1 = require("../../core/hooks");
|
|
14
|
+
const CloseIcon_1 = require("../../icons/CloseIcon/CloseIcon");
|
|
15
|
+
const noop = () => { };
|
|
16
|
+
function ConsentDialog() {
|
|
17
|
+
const { useConsent } = (0, hooks_1.useThemeHooks)();
|
|
18
|
+
const consent = useConsent();
|
|
19
|
+
if (!consent.enabled || !consent.isDialogOpen) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
return react_1.default.createElement(ConsentDialogContent, { consent: consent });
|
|
23
|
+
}
|
|
24
|
+
function ConsentDialogContent({ consent }) {
|
|
25
|
+
var _a;
|
|
26
|
+
const { useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
27
|
+
const { translate } = useTranslate();
|
|
28
|
+
const { draft, setCategory, dialogRef, close, save, categories } = (0, hooks_1.useConsentDialog)(consent);
|
|
29
|
+
return (react_1.default.createElement(Portal_1.Portal, null,
|
|
30
|
+
react_1.default.createElement(Overlay, { className: "scroll-lock", "data-component-name": "Consent/ConsentDialog", onMouseDown: (event) => {
|
|
31
|
+
if (event.target === event.currentTarget)
|
|
32
|
+
close();
|
|
33
|
+
} },
|
|
34
|
+
react_1.default.createElement(Dialog, { ref: dialogRef, role: "dialog", "aria-modal": "true", "aria-labelledby": "redocly-consent-dialog-title", tabIndex: -1 },
|
|
35
|
+
react_1.default.createElement(TitleRow, null,
|
|
36
|
+
react_1.default.createElement(Title, { id: "redocly-consent-dialog-title" }, translate('consent.dialog.title', 'Cookie preferences')),
|
|
37
|
+
react_1.default.createElement(Button_1.Button, { variant: "ghost", size: "small", icon: react_1.default.createElement(CloseIcon_1.CloseIcon, null), "aria-label": translate('consent.dialog.close', 'Close'), onClick: close })),
|
|
38
|
+
react_1.default.createElement(Description, null,
|
|
39
|
+
translate('consent.dialog.description', 'Choose which cookies this site may use. You can change your choice at any time.'),
|
|
40
|
+
' ',
|
|
41
|
+
((_a = consent.config) === null || _a === void 0 ? void 0 : _a.privacyPolicyUrl) ? (react_1.default.createElement(Link_1.Link, { to: consent.config.privacyPolicyUrl, external: true }, translate('consent.privacyPolicy', 'Privacy policy'))) : null),
|
|
42
|
+
categories.map((category) => {
|
|
43
|
+
const gpcLocked = category.id === 'marketing' && consent.gpc;
|
|
44
|
+
return (react_1.default.createElement(Row, { key: category.id },
|
|
45
|
+
react_1.default.createElement(RowText, null,
|
|
46
|
+
react_1.default.createElement(RowTitle, null, translate(category.titleTranslationKey, category.titleDefault)),
|
|
47
|
+
react_1.default.createElement(RowDescription, null, translate(category.descriptionTranslationKey, category.descriptionDefault)),
|
|
48
|
+
gpcLocked ? (react_1.default.createElement(GpcNotice, null, translate('consent.gpcNotice', 'Your browser asked us not to share your data, so this stays off.'))) : null),
|
|
49
|
+
category.locked ? (react_1.default.createElement(SwitchGroup, { role: "group", "aria-label": translate('consent.alwaysOn', 'Always on') },
|
|
50
|
+
react_1.default.createElement(Switch_1.Switch, { value: true, disabled: true, onChange: noop }))) : gpcLocked ? (react_1.default.createElement(SwitchGroup, { role: "group", "aria-label": translate('consent.alwaysOff', 'Always off') },
|
|
51
|
+
react_1.default.createElement(Switch_1.Switch, { value: false, disabled: true, onChange: noop }))) : (react_1.default.createElement(Switch_1.Switch, { value: draft[category.id], onChange: (value) => setCategory(category.id, value) }))));
|
|
52
|
+
}),
|
|
53
|
+
react_1.default.createElement(Actions, null,
|
|
54
|
+
react_1.default.createElement(Button_1.Button, { variant: "outlined", onClick: consent.reject }, translate('consent.rejectAll', 'Reject all')),
|
|
55
|
+
react_1.default.createElement(Spacer, null),
|
|
56
|
+
react_1.default.createElement(Button_1.Button, { variant: "outlined", onClick: consent.accept }, translate('consent.acceptAll', 'Accept all')),
|
|
57
|
+
react_1.default.createElement(Button_1.Button, { variant: "primary", onClick: save }, translate('consent.savePreferences', 'Save preferences')))))));
|
|
58
|
+
}
|
|
59
|
+
const Overlay = styled_components_1.default.div `
|
|
60
|
+
position: fixed;
|
|
61
|
+
inset: 0;
|
|
62
|
+
z-index: var(--z-index-overlay);
|
|
63
|
+
display: flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
background: var(--bg-color-modal-overlay);
|
|
67
|
+
font-family: var(--font-family-base);
|
|
68
|
+
`;
|
|
69
|
+
const Dialog = styled_components_1.default.div `
|
|
70
|
+
width: var(--consent-dialog-width);
|
|
71
|
+
max-width: var(--consent-dialog-max-width);
|
|
72
|
+
padding: var(--consent-dialog-padding);
|
|
73
|
+
border-radius: var(--consent-dialog-border-radius);
|
|
74
|
+
background: var(--consent-dialog-bg-color);
|
|
75
|
+
box-shadow: var(--consent-dialog-box-shadow);
|
|
76
|
+
`;
|
|
77
|
+
const TitleRow = styled_components_1.default.div `
|
|
78
|
+
display: flex;
|
|
79
|
+
gap: var(--spacing-xs);
|
|
80
|
+
align-items: flex-start;
|
|
81
|
+
justify-content: space-between;
|
|
82
|
+
`;
|
|
83
|
+
const Title = styled_components_1.default.h2 `
|
|
84
|
+
margin: 0 0 var(--spacing-xs);
|
|
85
|
+
font-size: var(--font-size-lg);
|
|
86
|
+
`;
|
|
87
|
+
const Description = styled_components_1.default.p `
|
|
88
|
+
margin: 0 0 var(--spacing-base);
|
|
89
|
+
color: var(--consent-dialog-description-color);
|
|
90
|
+
font-size: var(--font-size-sm);
|
|
91
|
+
`;
|
|
92
|
+
const Row = styled_components_1.default.div `
|
|
93
|
+
display: flex;
|
|
94
|
+
gap: var(--spacing-base);
|
|
95
|
+
align-items: flex-start;
|
|
96
|
+
padding: var(--spacing-sm) 0;
|
|
97
|
+
border-top: 1px solid var(--consent-dialog-row-border-color);
|
|
98
|
+
`;
|
|
99
|
+
const RowText = styled_components_1.default.div `
|
|
100
|
+
flex: 1;
|
|
101
|
+
`;
|
|
102
|
+
const RowTitle = styled_components_1.default.div `
|
|
103
|
+
font-size: var(--font-size-base);
|
|
104
|
+
font-weight: var(--font-weight-bold);
|
|
105
|
+
`;
|
|
106
|
+
const RowDescription = styled_components_1.default.div `
|
|
107
|
+
color: var(--consent-dialog-description-color);
|
|
108
|
+
font-size: var(--font-size-sm);
|
|
109
|
+
`;
|
|
110
|
+
const GpcNotice = styled_components_1.default.div `
|
|
111
|
+
color: var(--consent-dialog-description-color);
|
|
112
|
+
font-size: var(--font-size-sm);
|
|
113
|
+
`;
|
|
114
|
+
const SwitchGroup = styled_components_1.default.div `
|
|
115
|
+
flex: none;
|
|
116
|
+
`;
|
|
117
|
+
const Actions = styled_components_1.default.div `
|
|
118
|
+
display: flex;
|
|
119
|
+
flex-wrap: wrap;
|
|
120
|
+
gap: var(--spacing-xs);
|
|
121
|
+
margin-top: var(--spacing-base);
|
|
122
|
+
padding-top: var(--spacing-base);
|
|
123
|
+
border-top: 1px solid var(--consent-dialog-row-border-color);
|
|
124
|
+
`;
|
|
125
|
+
const Spacer = styled_components_1.default.span `
|
|
126
|
+
flex: 1;
|
|
127
|
+
`;
|
|
128
|
+
//# sourceMappingURL=ConsentDialog.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
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.ConsentSettingsLink = ConsentSettingsLink;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const Button_1 = require("../../components/Button/Button");
|
|
10
|
+
const hooks_1 = require("../../core/hooks");
|
|
11
|
+
const utils_1 = require("../../core/utils");
|
|
12
|
+
function ConsentSettingsLink() {
|
|
13
|
+
const { useConsent, useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
14
|
+
const { consent: consentConfig, footer } = (0, hooks_1.useThemeConfig)() || {};
|
|
15
|
+
const consent = useConsent();
|
|
16
|
+
const { translate } = useTranslate();
|
|
17
|
+
if (!consent.enabled || (0, utils_1.resolveSettingsLinkPlacement)(consentConfig, footer) !== 'footer') {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
return (react_1.default.createElement(SettingsLinkButton, { variant: "link", size: "small", "data-component-name": "Consent/ConsentSettingsLink", onClick: consent.openDialog }, translate('consent.settingsLink', 'Cookie preferences')));
|
|
21
|
+
}
|
|
22
|
+
const SettingsLinkButton = (0, styled_components_1.default)(Button_1.Button) `
|
|
23
|
+
margin: var(--footer-link-padding-vertical) 0 var(--footer-link-padding-vertical) var(--spacing-sm);
|
|
24
|
+
padding: 0;
|
|
25
|
+
color: var(--footer-link-text-color);
|
|
26
|
+
font: inherit;
|
|
27
|
+
line-height: inherit;
|
|
28
|
+
|
|
29
|
+
&:hover,
|
|
30
|
+
&:focus-visible {
|
|
31
|
+
color: var(--footer-link-color-hover);
|
|
32
|
+
background: none;
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
//# sourceMappingURL=ConsentSettingsLink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const consent: import("styled-components").RuleSet<object>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.consent = void 0;
|
|
4
|
+
const styled_components_1 = require("styled-components");
|
|
5
|
+
exports.consent = (0, styled_components_1.css) `
|
|
6
|
+
/**
|
|
7
|
+
* @tokens Consent
|
|
8
|
+
*/
|
|
9
|
+
--consent-banner-width: 380px;
|
|
10
|
+
--consent-banner-offset: var(--spacing-base); // @presenter Spacing
|
|
11
|
+
--consent-banner-bg-color: var(--bg-color); // @presenter Color
|
|
12
|
+
--consent-banner-text-color: var(--text-color-primary); // @presenter Color
|
|
13
|
+
--consent-banner-border-color: var(--border-color-primary); // @presenter Color
|
|
14
|
+
--consent-banner-border-radius: var(--border-radius-lg);
|
|
15
|
+
--consent-banner-box-shadow: var(--bg-raised-shadow);
|
|
16
|
+
--consent-banner-padding: var(--spacing-base); // @presenter Spacing
|
|
17
|
+
--consent-banner-gap: var(--spacing-sm); // @presenter Spacing
|
|
18
|
+
--consent-banner-title-font-size: var(--font-size-base);
|
|
19
|
+
--consent-banner-font-size: var(--font-size-sm);
|
|
20
|
+
--consent-banner-z-index: var(--z-index-overlay);
|
|
21
|
+
|
|
22
|
+
--consent-dialog-width: 560px;
|
|
23
|
+
--consent-dialog-max-width: calc(100vw - 2 * var(--spacing-base));
|
|
24
|
+
--consent-dialog-padding: var(--spacing-lg); // @presenter Spacing
|
|
25
|
+
--consent-dialog-border-radius: var(--border-radius-lg);
|
|
26
|
+
--consent-dialog-bg-color: var(--modal-bg-color); // @presenter Color
|
|
27
|
+
--consent-dialog-box-shadow: var(--modal-box-shadow);
|
|
28
|
+
--consent-dialog-row-border-color: var(--border-color-primary); // @presenter Color
|
|
29
|
+
--consent-dialog-description-color: var(--text-color-secondary); // @presenter Color
|
|
30
|
+
`;
|
|
31
|
+
//# sourceMappingURL=variables.js.map
|
|
@@ -11,6 +11,7 @@ const utils_1 = require("../../core/utils");
|
|
|
11
11
|
const hooks_1 = require("../../core/hooks");
|
|
12
12
|
const FooterCopyright_1 = require("../../components/Footer/FooterCopyright");
|
|
13
13
|
const FooterColumn_1 = require("../../components/Footer/FooterColumn");
|
|
14
|
+
const ConsentSettingsLink_1 = require("../../components/Consent/ConsentSettingsLink");
|
|
14
15
|
function Footer({ className }) {
|
|
15
16
|
const { footer } = (0, hooks_1.useThemeConfig)() || {};
|
|
16
17
|
const { items = [], copyrightText } = footer || {};
|
|
@@ -22,7 +23,9 @@ function Footer({ className }) {
|
|
|
22
23
|
!!items.length && (react_1.default.createElement(FooterColumnsSection, null, withColumns
|
|
23
24
|
? items.map((column, index) => (react_1.default.createElement(FooterColumn_1.FooterColumn, { key: `${column.label}_${index}`, column: column })))
|
|
24
25
|
: items.map((item, index) => (react_1.default.createElement(FooterItem_1.FooterItem, { key: index, item: item }))))),
|
|
25
|
-
react_1.default.createElement(FooterCopyrightWrapper, null,
|
|
26
|
+
react_1.default.createElement(FooterCopyrightWrapper, null,
|
|
27
|
+
copyrightText && react_1.default.createElement(FooterCopyright_1.FooterCopyright, { copyrightText: copyrightText }),
|
|
28
|
+
react_1.default.createElement(ConsentSettingsLink_1.ConsentSettingsLink, null))));
|
|
26
29
|
}
|
|
27
30
|
const FooterCopyrightWrapper = styled_components_1.default.div `
|
|
28
31
|
display: flex;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
export type JsonFold = {
|
|
3
|
+
isExpanded: (path: string, level: number) => boolean;
|
|
4
|
+
setExpanded: (path: string, expanded: boolean) => void;
|
|
5
|
+
};
|
|
6
|
+
type Foldable = [path: string, level: number];
|
|
7
|
+
export declare function isFoldable(value: unknown): value is Record<string, unknown>;
|
|
8
|
+
export declare function collectFoldables(value: unknown, path?: string, level?: number): Foldable[];
|
|
2
9
|
export declare function JsonValue(props: {
|
|
3
10
|
value: any;
|
|
4
11
|
level: number;
|
|
12
|
+
path: string;
|
|
5
13
|
standalone?: boolean;
|
|
6
|
-
|
|
7
|
-
expandAllSignal: boolean | undefined;
|
|
14
|
+
fold: JsonFold;
|
|
8
15
|
maxStringLength?: number;
|
|
9
16
|
}): React.ReactNode;
|
|
17
|
+
export {};
|
|
@@ -3,30 +3,36 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.isFoldable = isFoldable;
|
|
7
|
+
exports.collectFoldables = collectFoldables;
|
|
6
8
|
exports.JsonValue = JsonValue;
|
|
7
9
|
const react_1 = __importDefault(require("react"));
|
|
8
10
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
11
|
const Button_1 = require("../../components/Button/Button");
|
|
10
12
|
const ShowMoreToggleButton_1 = require("../../components/Button/ShowMoreToggleButton");
|
|
11
13
|
const ChevronDownIcon_1 = require("../../icons/ChevronDownIcon/ChevronDownIcon");
|
|
14
|
+
function isFoldable(value) {
|
|
15
|
+
return (typeof value === 'object' &&
|
|
16
|
+
value !== null &&
|
|
17
|
+
Object.values(value).some((item) => item !== undefined));
|
|
18
|
+
}
|
|
19
|
+
function collectFoldables(value, path = '', level = 1) {
|
|
20
|
+
if (!isFoldable(value))
|
|
21
|
+
return [];
|
|
22
|
+
return Object.entries(value).flatMap(([key, child]) => {
|
|
23
|
+
const childPath = `${path}/${key}`;
|
|
24
|
+
return isFoldable(child)
|
|
25
|
+
? [[childPath, level], ...collectFoldables(child, childPath, level + 1)]
|
|
26
|
+
: [];
|
|
27
|
+
});
|
|
28
|
+
}
|
|
12
29
|
function JsonValue(props) {
|
|
13
|
-
const { standalone,
|
|
30
|
+
const { standalone, fold, level, path, value, maxStringLength } = props;
|
|
14
31
|
const indent = ' '.repeat(level * 2);
|
|
15
|
-
const
|
|
16
|
-
const isExpanded = expandAllSignal !== undefined && level > 0 ? expandAllSignal : isExpandedState;
|
|
17
|
-
const [prevExpandAllSignal, setPrevExpandAllSignal] = react_1.default.useState(expandAllSignal);
|
|
18
|
-
const [prevLevel, setPrevLevel] = react_1.default.useState(level);
|
|
19
|
-
if (prevExpandAllSignal !== expandAllSignal || prevLevel !== level) {
|
|
20
|
-
setPrevExpandAllSignal(expandAllSignal);
|
|
21
|
-
setPrevLevel(level);
|
|
22
|
-
if (expandAllSignal !== undefined && !(expandAllSignal === false && level === 0)) {
|
|
23
|
-
setExpanded(expandAllSignal);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
32
|
+
const isExpanded = fold.isExpanded(path, level);
|
|
26
33
|
const keys = (value && Object.keys(value).filter((key) => value[key] !== undefined)) || []; // filter out undefined properties
|
|
27
34
|
const valueType = typeof value;
|
|
28
|
-
|
|
29
|
-
if (isPrimitive) {
|
|
35
|
+
if (!isFoldable(value)) {
|
|
30
36
|
const isOversizedString = typeof value === 'string' && maxStringLength !== undefined && value.length > maxStringLength;
|
|
31
37
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
32
38
|
standalone ? indent : null,
|
|
@@ -36,14 +42,14 @@ function JsonValue(props) {
|
|
|
36
42
|
const closingPunctuation = Array.isArray(value) ? ']' : '}';
|
|
37
43
|
const valueElement = Array.isArray(value)
|
|
38
44
|
? value.map((item, index) => (react_1.default.createElement(react_1.default.Fragment, { key: index },
|
|
39
|
-
react_1.default.createElement(JsonValue, { value: item, level: level + 1,
|
|
45
|
+
react_1.default.createElement(JsonValue, { value: item, level: level + 1, path: `${path}/${index}`, standalone: true, fold: fold, maxStringLength: maxStringLength }),
|
|
40
46
|
index < value.length - 1 ? ',\n' : null)))
|
|
41
47
|
: keys.map((key, index) => (react_1.default.createElement(react_1.default.Fragment, { key: key },
|
|
42
|
-
react_1.default.createElement(JsonKeyValue, { name: key, value: value[key], level: level + 1,
|
|
48
|
+
react_1.default.createElement(JsonKeyValue, { name: key, value: value[key], level: level + 1, path: `${path}/${key}`, fold: fold, maxStringLength: maxStringLength }),
|
|
43
49
|
index < keys.length - 1 ? ',\n' : null)));
|
|
44
50
|
const openingPunctuationElement = standalone ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
45
51
|
indent,
|
|
46
|
-
level > 0 ? (react_1.default.createElement(ExpandIcon, { onClick: () => setExpanded(
|
|
52
|
+
level > 0 ? (react_1.default.createElement(ExpandIcon, { onClick: () => fold.setExpanded(path, !isExpanded), isExpanded: isExpanded })) : null,
|
|
47
53
|
openingPunctuation,
|
|
48
54
|
isExpanded ? '\n' : null)) : null;
|
|
49
55
|
const closingPunctuationElement = standalone ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
@@ -56,32 +62,22 @@ function JsonValue(props) {
|
|
|
56
62
|
closingPunctuationElement));
|
|
57
63
|
}
|
|
58
64
|
function JsonKeyValue(props) {
|
|
59
|
-
const {
|
|
65
|
+
const { fold, level, name, path, value, maxStringLength } = props;
|
|
60
66
|
const indent = ' '.repeat(level * 2);
|
|
61
|
-
const
|
|
62
|
-
const isCollapsible = typeof value === 'object' && value !== null && keys.length > 0;
|
|
63
|
-
const [isExpandedState, setExpanded] = react_1.default.useState(expandAllSignal !== null && expandAllSignal !== void 0 ? expandAllSignal : level < defaultExpandLevel);
|
|
64
|
-
const isExpanded = expandAllSignal !== undefined ? expandAllSignal : isExpandedState;
|
|
65
|
-
const [prevExpandAllSignal, setPrevExpandAllSignal] = react_1.default.useState(expandAllSignal);
|
|
66
|
-
if (prevExpandAllSignal !== expandAllSignal) {
|
|
67
|
-
setPrevExpandAllSignal(expandAllSignal);
|
|
68
|
-
if (expandAllSignal !== undefined) {
|
|
69
|
-
setExpanded(expandAllSignal);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
67
|
+
const isExpanded = fold.isExpanded(path, level);
|
|
72
68
|
const openingPunctuation = Array.isArray(value) ? '[' : '{';
|
|
73
69
|
const closingPunctuation = Array.isArray(value) ? ']' : '}';
|
|
74
|
-
const valueElement =
|
|
70
|
+
const valueElement = isFoldable(value) ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
75
71
|
openingPunctuation,
|
|
76
72
|
isExpanded ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
77
73
|
'\n',
|
|
78
|
-
react_1.default.createElement(JsonValue, { value: value, level: level,
|
|
74
|
+
react_1.default.createElement(JsonValue, { value: value, level: level, path: path, fold: fold, maxStringLength: maxStringLength }),
|
|
79
75
|
'\n')) : (' … '),
|
|
80
76
|
isExpanded ? indent : null,
|
|
81
|
-
closingPunctuation)) : (react_1.default.createElement(JsonValue, { value: value, level: level,
|
|
77
|
+
closingPunctuation)) : (react_1.default.createElement(JsonValue, { value: value, level: level, path: path, fold: fold, maxStringLength: maxStringLength }));
|
|
82
78
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
83
79
|
indent,
|
|
84
|
-
|
|
80
|
+
isFoldable(value) ? (react_1.default.createElement(ExpandIcon, { onClick: () => fold.setExpanded(path, !isExpanded), isExpanded: isExpanded })) : null,
|
|
85
81
|
react_1.default.createElement("span", { className: "property token string" }, `"${name}"`),
|
|
86
82
|
": ",
|
|
87
83
|
valueElement));
|
|
@@ -42,21 +42,18 @@ const styled_components_1 = __importDefault(require("styled-components"));
|
|
|
42
42
|
const CodeBlock_1 = require("../../components/CodeBlock/CodeBlock");
|
|
43
43
|
const Helpers_1 = require("../../components/JsonViewer/Helpers");
|
|
44
44
|
function JsonComponent({ data, expandLevel = 1, className, onCopyClick, onPanelToggle, title, controls = {}, maxStringLength, }) {
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
setExpandAllSignal(undefined);
|
|
52
|
-
});
|
|
45
|
+
const defaultExpandLevel = Math.max(1, expandLevel);
|
|
46
|
+
const foldables = react_1.default.useMemo(() => (0, Helpers_1.collectFoldables)(data), [data]);
|
|
47
|
+
const [expandedPaths, setExpandedPaths] = react_1.default.useState({});
|
|
48
|
+
const fold = {
|
|
49
|
+
isExpanded: (path, level) => { var _a; return (_a = expandedPaths[path]) !== null && _a !== void 0 ? _a : level < defaultExpandLevel; },
|
|
50
|
+
setExpanded: (path, expanded) => setExpandedPaths((prev) => (Object.assign(Object.assign({}, prev), { [path]: expanded }))),
|
|
53
51
|
};
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
});
|
|
52
|
+
const hasFoldables = foldables.length > 0;
|
|
53
|
+
const allExpanded = foldables.every(([path, level]) => fold.isExpanded(path, level));
|
|
54
|
+
const toggleAll = () => {
|
|
55
|
+
onPanelToggle === null || onPanelToggle === void 0 ? void 0 : onPanelToggle(!allExpanded);
|
|
56
|
+
setExpandedPaths(Object.fromEntries(foldables.map(([path]) => [path, !allExpanded])));
|
|
60
57
|
};
|
|
61
58
|
const source = JSON.stringify(data, null, 2);
|
|
62
59
|
const hasHeader = title || controls;
|
|
@@ -65,13 +62,13 @@ function JsonComponent({ data, expandLevel = 1, className, onCopyClick, onPanelT
|
|
|
65
62
|
? {
|
|
66
63
|
title,
|
|
67
64
|
className: 'code-block-header',
|
|
68
|
-
controls: controls && Object.assign(Object.assign({}, controls), { copy: Object.assign(Object.assign({}, controls.copy), { data, onClick: onCopyClick, handleOutside: true }), expand:
|
|
69
|
-
? Object.assign(Object.assign({}, controls.expand), { onClick:
|
|
70
|
-
? Object.assign(Object.assign({}, controls.collapse), { onClick:
|
|
65
|
+
controls: controls && Object.assign(Object.assign({}, controls), { copy: Object.assign(Object.assign({}, controls.copy), { data, onClick: onCopyClick, handleOutside: true }), expand: hasFoldables && !allExpanded
|
|
66
|
+
? Object.assign(Object.assign({}, controls.expand), { onClick: toggleAll }) : undefined, collapse: hasFoldables && allExpanded
|
|
67
|
+
? Object.assign(Object.assign({}, controls.collapse), { onClick: toggleAll }) : undefined }),
|
|
71
68
|
}
|
|
72
69
|
: undefined, source: source },
|
|
73
70
|
react_1.default.createElement(FoldingWrap, null,
|
|
74
|
-
react_1.default.createElement(Helpers_1.JsonValue, { value: data, level: 0,
|
|
71
|
+
react_1.default.createElement(Helpers_1.JsonValue, { value: data, level: 0, path: "", standalone: true, fold: fold, maxStringLength: maxStringLength })))));
|
|
75
72
|
}
|
|
76
73
|
exports.JsonViewer = (0, react_1.memo)(JsonComponent);
|
|
77
74
|
const FoldingWrap = styled_components_1.default.div `
|
|
@@ -23,7 +23,7 @@ exports.markdownBaseTableCss = (0, styled_components_1.css) `
|
|
|
23
23
|
color: var(--md-table-cell-text-color);
|
|
24
24
|
font-size: var(--md-table-font-size);
|
|
25
25
|
line-height: var(--md-table-line-height);
|
|
26
|
-
vertical-align:
|
|
26
|
+
vertical-align: var(--md-table-cell-vertical-align);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
thead td,
|
|
@@ -72,6 +72,19 @@ exports.markdownBaseTableCss = (0, styled_components_1.css) `
|
|
|
72
72
|
th[align='right'] {
|
|
73
73
|
text-align: right;
|
|
74
74
|
}
|
|
75
|
+
|
|
76
|
+
th[valign='top'],
|
|
77
|
+
td[valign='top'] {
|
|
78
|
+
vertical-align: top;
|
|
79
|
+
}
|
|
80
|
+
th[valign='middle'],
|
|
81
|
+
td[valign='middle'] {
|
|
82
|
+
vertical-align: middle;
|
|
83
|
+
}
|
|
84
|
+
th[valign='bottom'],
|
|
85
|
+
td[valign='bottom'] {
|
|
86
|
+
vertical-align: bottom;
|
|
87
|
+
}
|
|
75
88
|
}
|
|
76
89
|
`;
|
|
77
90
|
//# sourceMappingURL=base-table.js.map
|
|
@@ -53,6 +53,7 @@ exports.markdown = (0, styled_components_1.css) `
|
|
|
53
53
|
--md-table-cell-text-color: var(--text-color-secondary); // @presenter Color
|
|
54
54
|
--md-table-cell-padding: var(--spacing-xs) var(--spacing-sm); // @presenter Spacing
|
|
55
55
|
--md-table-footer-cell-padding: var(--spacing-xxs) var(--spacing-sm); // @presenter Spacing
|
|
56
|
+
--md-table-cell-vertical-align: top;
|
|
56
57
|
|
|
57
58
|
--md-table-head-bg-color: var(--md-table-bg-color); // @presenter Color
|
|
58
59
|
--md-table-head-text-color: var(--text-color-primary); // @presenter Color
|