@backstage/plugin-techdocs 0.13.3-next.0 → 0.14.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/dist/index.esm.js CHANGED
@@ -1,15 +1,15 @@
1
- import { createApiRef, createRouteRef, useRouteRef, useApi, configApiRef, createPlugin, createApiFactory, discoveryApiRef, identityApiRef, fetchApiRef, createRoutableExtension, createComponentExtension } from '@backstage/core-plugin-api';
1
+ import { createApiRef, createRouteRef, useRouteRef, useApi, configApiRef, createPlugin, createApiFactory, discoveryApiRef, identityApiRef, fetchApiRef, createRoutableExtension, createComponentExtension, useApp } from '@backstage/core-plugin-api';
2
2
  import { ResponseError, NotFoundError } from '@backstage/errors';
3
3
  import { EventSourcePolyfill } from 'event-source-polyfill';
4
4
  import React, { useEffect, useState, useReducer, useRef, useMemo, createContext, useContext, useCallback } from 'react';
5
- import { makeStyles, ListItemText, ListItem, Divider, Card, CardMedia, CardContent, CardActions, Grid, TextField, InputAdornment, IconButton, CircularProgress, createStyles, Button as Button$1, Drawer, Typography, useTheme } from '@material-ui/core';
5
+ import { makeStyles, ListItemText, ListItem, Divider, Card, CardMedia, CardContent, CardActions, TextField, InputAdornment, IconButton, CircularProgress, createStyles, Button as Button$1, Drawer, Grid, Typography, useTheme, lighten, alpha } from '@material-ui/core';
6
6
  import { Link, SubvalueCell, Table, EmptyState, Button, WarningPanel, CodeSnippet, PageWithHeader, Content, ContentHeader, SupportButton, ItemCardGrid, ItemCardHeader, Progress, LogViewer, ErrorPage, SidebarPinStateContext, HeaderLabel, Header, Page, HeaderTabs, MissingAnnotationEmptyState } from '@backstage/core-components';
7
7
  import TextTruncate from 'react-text-truncate';
8
8
  import { FilteredEntityLayout, FilterContainer, EntityListContainer } from '@backstage/plugin-catalog';
9
- import { favoriteEntityIcon, favoriteEntityTooltip, EntityRefLinks, getEntityRelations, formatEntityRefTitle, useEntityListProvider, useStarredEntities, CATALOG_FILTER_EXISTS, EntityListProvider, UserListPicker, EntityOwnerPicker, EntityTagPicker, EntityRefLink, catalogApiRef, useOwnUser, isOwnerOf, useEntity } from '@backstage/plugin-catalog-react';
9
+ import { favoriteEntityIcon, favoriteEntityTooltip, EntityRefLinks, getEntityRelations, formatEntityRefTitle, useEntityList, useStarredEntities, CATALOG_FILTER_EXISTS, EntityListProvider, UserListPicker, EntityOwnerPicker, EntityTagPicker, EntityRefLink, catalogApiRef, isOwnerOf, useEntity } from '@backstage/plugin-catalog-react';
10
10
  import useCopyToClipboard from 'react-use/lib/useCopyToClipboard';
11
11
  import { capitalize } from 'lodash';
12
- import { RELATION_OWNED_BY } from '@backstage/catalog-model';
12
+ import { RELATION_OWNED_BY, parseEntityRef, DEFAULT_NAMESPACE } from '@backstage/catalog-model';
13
13
  import ShareIcon from '@material-ui/icons/Share';
14
14
  import { useNavigate as useNavigate$1, useParams, Routes, Route } from 'react-router-dom';
15
15
  import { scmIntegrationsApiRef } from '@backstage/integration-react';
@@ -148,7 +148,7 @@ class TechDocsStorageClient {
148
148
  }
149
149
  }
150
150
 
151
- const useStyles$2 = makeStyles({
151
+ const useStyles$3 = makeStyles({
152
152
  flexContainer: {
153
153
  flexWrap: "wrap"
154
154
  },
@@ -164,7 +164,7 @@ const DocsResultListItem = ({
164
164
  asLink = true,
165
165
  title
166
166
  }) => {
167
- const classes = useStyles$2();
167
+ const classes = useStyles$3();
168
168
  const TextItem = () => {
169
169
  var _a;
170
170
  return /* @__PURE__ */ React.createElement(ListItemText, {
@@ -345,7 +345,7 @@ const EntityListDocsTable = ({
345
345
  actions
346
346
  }) => {
347
347
  var _a, _b;
348
- const { loading, error, entities, filters } = useEntityListProvider();
348
+ const { loading, error, entities, filters } = useEntityList();
349
349
  const { isStarredEntity, toggleStarredEntity } = useStarredEntities();
350
350
  const [, copyToClipboard] = useCopyToClipboard();
351
351
  const title = capitalize((_b = (_a = filters.user) == null ? void 0 : _a.value) != null ? _b : "all");
@@ -392,7 +392,7 @@ class TechDocsFilter {
392
392
  }
393
393
  }
394
394
  const TechDocsPicker = () => {
395
- const { updateFilters } = useEntityListProvider();
395
+ const { updateFilters } = useEntityList();
396
396
  useEffect(() => {
397
397
  updateFilters({
398
398
  techdocs: new TechDocsFilter()
@@ -449,7 +449,7 @@ var DocsCardGrid$2 = /*#__PURE__*/Object.freeze({
449
449
  });
450
450
 
451
451
  const EntityListDocsGrid = () => {
452
- const { loading, error, entities } = useEntityListProvider();
452
+ const { loading, error, entities } = useEntityList();
453
453
  if (error) {
454
454
  return /* @__PURE__ */ React.createElement(WarningPanel, {
455
455
  severity: "error",
@@ -710,7 +710,7 @@ const removeMkdocsHeader = () => {
710
710
  const simplifyMkdocsFooter = () => {
711
711
  return (dom) => {
712
712
  var _a;
713
- (_a = dom.querySelector(".md-footer-copyright")) == null ? void 0 : _a.remove();
713
+ (_a = dom.querySelector(".md-footer .md-copyright")) == null ? void 0 : _a.remove();
714
714
  return dom;
715
715
  };
716
716
  };
@@ -830,6 +830,11 @@ const transform = async (html, transformers) => {
830
830
  return dom;
831
831
  };
832
832
 
833
+ const useStyles$2 = makeStyles({
834
+ root: {
835
+ width: "100%"
836
+ }
837
+ });
833
838
  const TechDocsSearchBar = ({
834
839
  entityId,
835
840
  debounceTime = 150
@@ -841,6 +846,7 @@ const TechDocsSearchBar = ({
841
846
  setTerm,
842
847
  result: { loading, value: searchVal }
843
848
  } = useSearch();
849
+ const classes = useStyles$2();
844
850
  const [options, setOptions] = useState([]);
845
851
  useEffect(() => {
846
852
  let mounted = true;
@@ -866,10 +872,8 @@ const TechDocsSearchBar = ({
866
872
  navigate(location);
867
873
  }
868
874
  };
869
- return /* @__PURE__ */ React.createElement(Grid, {
870
- item: true,
871
- xs: 12
872
- }, /* @__PURE__ */ React.createElement(Autocomplete, {
875
+ return /* @__PURE__ */ React.createElement(Autocomplete, {
876
+ classes: { root: classes.root },
873
877
  "data-testid": "techdocs-search-bar",
874
878
  size: "small",
875
879
  open,
@@ -918,7 +922,7 @@ const TechDocsSearchBar = ({
918
922
  }) : null, params.InputProps.endAdornment)
919
923
  }
920
924
  })
921
- }));
925
+ });
922
926
  };
923
927
  const TechDocsSearch = (props) => {
924
928
  const initialState = {
@@ -1014,7 +1018,10 @@ const TechDocsNotFound = ({ errorMessage }) => {
1014
1018
  });
1015
1019
  };
1016
1020
 
1017
- const useStyles$1 = makeStyles(() => ({
1021
+ const useStyles$1 = makeStyles((theme) => ({
1022
+ root: {
1023
+ marginBottom: theme.spacing(2)
1024
+ },
1018
1025
  message: {
1019
1026
  wordBreak: "break-word",
1020
1027
  overflowWrap: "anywhere"
@@ -1033,6 +1040,7 @@ const TechDocsStateIndicator = () => {
1033
1040
  const ReaderProgress = state === "CHECKING" ? /* @__PURE__ */ React.createElement(Progress, null) : null;
1034
1041
  if (state === "INITIAL_BUILD") {
1035
1042
  StateAlert = /* @__PURE__ */ React.createElement(Alert, {
1043
+ classes: { root: classes.root },
1036
1044
  variant: "outlined",
1037
1045
  severity: "info",
1038
1046
  icon: /* @__PURE__ */ React.createElement(CircularProgress, {
@@ -1052,7 +1060,8 @@ const TechDocsStateIndicator = () => {
1052
1060
  }),
1053
1061
  action: /* @__PURE__ */ React.createElement(TechDocsBuildLogs, {
1054
1062
  buildLog
1055
- })
1063
+ }),
1064
+ classes: { root: classes.root }
1056
1065
  }, "A newer version of this documentation is being prepared and will be available shortly.");
1057
1066
  }
1058
1067
  if (state === "CONTENT_STALE_READY") {
@@ -1062,7 +1071,8 @@ const TechDocsStateIndicator = () => {
1062
1071
  action: /* @__PURE__ */ React.createElement(Button$1, {
1063
1072
  color: "inherit",
1064
1073
  onClick: () => contentReload()
1065
- }, "Refresh")
1074
+ }, "Refresh"),
1075
+ classes: { root: classes.root }
1066
1076
  }, "A newer version of this documentation is now available, please refresh to view.");
1067
1077
  }
1068
1078
  if (state === "CONTENT_STALE_ERROR") {
@@ -1072,7 +1082,7 @@ const TechDocsStateIndicator = () => {
1072
1082
  action: /* @__PURE__ */ React.createElement(TechDocsBuildLogs, {
1073
1083
  buildLog
1074
1084
  }),
1075
- classes: { message: classes.message }
1085
+ classes: { root: classes.root, message: classes.message }
1076
1086
  }, "Building a newer version of this documentation failed.", " ", syncErrorMessage);
1077
1087
  }
1078
1088
  if (state === "CONTENT_NOT_FOUND") {
@@ -1082,7 +1092,7 @@ const TechDocsStateIndicator = () => {
1082
1092
  action: /* @__PURE__ */ React.createElement(TechDocsBuildLogs, {
1083
1093
  buildLog
1084
1094
  }),
1085
- classes: { message: classes.message }
1095
+ classes: { root: classes.root, message: classes.message }
1086
1096
  }, "Building a newer version of this documentation failed.", " ", syncErrorMessage), /* @__PURE__ */ React.createElement(TechDocsNotFound, {
1087
1097
  errorMessage: contentErrorMessage
1088
1098
  }));
@@ -1238,12 +1248,13 @@ function useReaderState(kind, namespace, name, path) {
1238
1248
 
1239
1249
  const useStyles = makeStyles((theme) => ({
1240
1250
  searchBar: {
1241
- marginLeft: "20rem",
1242
- maxWidth: "calc(100% - 20rem * 2 - 3rem)",
1243
- marginTop: theme.spacing(1),
1251
+ maxWidth: "calc(100% - 16rem * 2 - 2.4rem)",
1252
+ marginTop: 0,
1253
+ marginBottom: theme.spacing(1),
1254
+ marginLeft: "calc(16rem + 1.2rem)",
1244
1255
  "@media screen and (max-width: 76.1875em)": {
1245
- marginLeft: "10rem",
1246
- maxWidth: "calc(100% - 10rem)"
1256
+ marginLeft: "calc(10rem + 0.8rem)",
1257
+ maxWidth: "calc(100% - 10rem - 1.6rem)"
1247
1258
  }
1248
1259
  }
1249
1260
  }));
@@ -1265,6 +1276,7 @@ const withTechDocsReaderProvider = (Component, entityRef) => (props) => /* @__PU
1265
1276
  ...props
1266
1277
  }));
1267
1278
  const useTechDocsReader = () => useContext(TechDocsReaderContext);
1279
+ const headings = ["h1", "h2", "h3", "h4", "h5", "h6"];
1268
1280
  const useTechDocsReaderDom = (entityRef) => {
1269
1281
  const navigate = useNavigate$1();
1270
1282
  const theme = useTheme();
@@ -1273,6 +1285,7 @@ const useTechDocsReaderDom = (entityRef) => {
1273
1285
  const techdocsSanitizer = useApi(configApiRef);
1274
1286
  const { namespace = "", kind = "", name = "" } = entityRef;
1275
1287
  const { state, path, content: rawPage } = useTechDocsReader();
1288
+ const isDarkTheme = theme.palette.type === "dark";
1276
1289
  const [sidebars, setSidebars] = useState();
1277
1290
  const [dom, setDom] = useState(null);
1278
1291
  const { isPinned } = useContext(SidebarPinStateContext);
@@ -1326,147 +1339,423 @@ const useTechDocsReaderDom = (entityRef) => {
1326
1339
  addGitFeedbackLink(scmIntegrationsApi),
1327
1340
  injectCss({
1328
1341
  css: `
1329
- body {
1330
- font-family: ${theme.typography.fontFamily};
1331
- --md-text-color: ${theme.palette.text.primary};
1332
- --md-text-link-color: ${theme.palette.primary.main};
1342
+ /*
1343
+ As the MkDocs output is rendered in shadow DOM, the CSS variable definitions on the root selector are not applied. Instead, they have to be applied on :host.
1344
+ As there is no way to transform the served main*.css yet (for example in the backend), we have to copy from main*.css and modify them.
1345
+ */
1346
+ :host {
1347
+ /* FONT */
1348
+ --md-default-fg-color: ${theme.palette.text.primary};
1349
+ --md-default-fg-color--light: ${theme.palette.text.secondary};
1350
+ --md-default-fg-color--lighter: ${lighten(theme.palette.text.secondary, 0.7)};
1351
+ --md-default-fg-color--lightest: ${lighten(theme.palette.text.secondary, 0.3)};
1352
+
1353
+ /* BACKGROUND */
1354
+ --md-default-bg-color:${theme.palette.background.default};
1355
+ --md-default-bg-color--light: ${theme.palette.background.paper};
1356
+ --md-default-bg-color--lighter: ${lighten(theme.palette.background.paper, 0.7)};
1357
+ --md-default-bg-color--lightest: ${lighten(theme.palette.background.paper, 0.3)};
1358
+
1359
+ /* PRIMARY */
1360
+ --md-primary-fg-color: ${theme.palette.primary.main};
1361
+ --md-primary-fg-color--light: ${theme.palette.primary.light};
1362
+ --md-primary-fg-color--dark: ${theme.palette.primary.dark};
1363
+ --md-primary-bg-color: ${theme.palette.primary.contrastText};
1364
+ --md-primary-bg-color--light: ${lighten(theme.palette.primary.contrastText, 0.7)};
1365
+
1366
+ /* ACCENT */
1367
+ --md-accent-fg-color: var(--md-primary-fg-color);
1333
1368
 
1369
+ /* SHADOW */
1370
+ --md-shadow-z1: ${theme.shadows[1]};
1371
+ --md-shadow-z2: ${theme.shadows[2]};
1372
+ --md-shadow-z3: ${theme.shadows[3]};
1373
+
1374
+ /* EXTENSIONS */
1375
+ --md-admonition-fg-color: var(--md-default-fg-color);
1376
+ --md-admonition-bg-color: var(--md-default-bg-color);
1377
+ /* Admonitions and others are using SVG masks to define icons. These masks are defined as CSS variables. */
1378
+ --md-admonition-icon--note: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>');
1379
+ --md-admonition-icon--abstract: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 5h16v2H4V5m0 4h16v2H4V9m0 4h16v2H4v-2m0 4h10v2H4v-2z"/></svg>');
1380
+ --md-admonition-icon--info: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 9h-2V7h2m0 10h-2v-6h2m-1-9A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10A10 10 0 0012 2z"/></svg>');
1381
+ --md-admonition-icon--tip: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.55 11.2c-.23-.3-.5-.56-.76-.82-.65-.6-1.4-1.03-2.03-1.66C13.3 7.26 13 4.85 13.91 3c-.91.23-1.75.75-2.45 1.32-2.54 2.08-3.54 5.75-2.34 8.9.04.1.08.2.08.33 0 .22-.15.42-.35.5-.22.1-.46.04-.64-.12a.83.83 0 01-.15-.17c-1.1-1.43-1.28-3.48-.53-5.12C5.89 10 5 12.3 5.14 14.47c.04.5.1 1 .27 1.5.14.6.4 1.2.72 1.73 1.04 1.73 2.87 2.97 4.84 3.22 2.1.27 4.35-.12 5.96-1.6 1.8-1.66 2.45-4.32 1.5-6.6l-.13-.26c-.2-.46-.47-.87-.8-1.25l.05-.01m-3.1 6.3c-.28.24-.73.5-1.08.6-1.1.4-2.2-.16-2.87-.82 1.19-.28 1.89-1.16 2.09-2.05.17-.8-.14-1.46-.27-2.23-.12-.74-.1-1.37.18-2.06.17.38.37.76.6 1.06.76 1 1.95 1.44 2.2 2.8.04.14.06.28.06.43.03.82-.32 1.72-.92 2.27h.01z"/></svg>');
1382
+ --md-admonition-icon--success: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2m-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
1383
+ --md-admonition-icon--question: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.07 11.25l-.9.92C13.45 12.89 13 13.5 13 15h-2v-.5c0-1.11.45-2.11 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41a2 2 0 00-2-2 2 2 0 00-2 2H8a4 4 0 014-4 4 4 0 014 4 3.2 3.2 0 01-.93 2.25M13 19h-2v-2h2M12 2A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10c0-5.53-4.5-10-10-10z"/></svg>');
1384
+ --md-admonition-icon--warning: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 14h-2v-4h2m0 8h-2v-2h2M1 21h22L12 2 1 21z"/></svg>');
1385
+ --md-admonition-icon--failure: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2c5.53 0 10 4.47 10 10s-4.47 10-10 10S2 17.53 2 12 6.47 2 12 2m3.59 5L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41 15.59 7z"/></svg>');
1386
+ --md-admonition-icon--danger: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.5 20l4.86-9.73H13V4l-5 9.73h3.5V20M12 2c2.75 0 5.1 1 7.05 2.95C21 6.9 22 9.25 22 12s-1 5.1-2.95 7.05C17.1 21 14.75 22 12 22s-5.1-1-7.05-2.95C3 17.1 2 14.75 2 12s1-5.1 2.95-7.05C6.9 3 9.25 2 12 2z"/></svg>');
1387
+ --md-admonition-icon--bug: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 12h-4v-2h4m0 6h-4v-2h4m6-6h-2.81a5.985 5.985 0 00-1.82-1.96L17 4.41 15.59 3l-2.17 2.17a6.002 6.002 0 00-2.83 0L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8z"/></svg>');
1388
+ --md-admonition-icon--example: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 13v-2h14v2H7m0 6v-2h14v2H7M7 7V5h14v2H7M3 8V5H2V4h2v4H3m-1 9v-1h3v4H2v-1h2v-.5H3v-1h1V17H2m2.25-7a.75.75 0 01.75.75c0 .2-.08.39-.21.52L3.12 13H5v1H2v-.92L4 11H2v-1h2.25z"/></svg>');
1389
+ --md-admonition-icon--quote: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 17h3l2-4V7h-6v6h3M6 17h3l2-4V7H5v6h3l-2 4z"/></svg>');
1390
+ --md-footnotes-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.42L5.83 13H21V7h-2z"/></svg>');
1391
+ --md-details-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
1392
+ --md-tasklist-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/></svg>');
1393
+ --md-tasklist-icon--checked: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
1394
+ --md-nav-icon--prev: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>');
1395
+ --md-nav-icon--next: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
1396
+ --md-toc-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 9h14V7H3v2m0 4h14v-2H3v2m0 4h14v-2H3v2m16 0h2v-2h-2v2m0-10v2h2V7h-2m0 6h2v-2h-2v2z"/></svg>');
1397
+ --md-clipboard-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12V1z"/></svg>');
1398
+ --md-search-result-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h7c-.41-.25-.8-.56-1.14-.9-.33-.33-.61-.7-.86-1.1H6V4h7v5h5v1.18c.71.16 1.39.43 2 .82V8l-6-6m6.31 16.9c1.33-2.11.69-4.9-1.4-6.22-2.11-1.33-4.91-.68-6.22 1.4-1.34 2.11-.69 4.89 1.4 6.22 1.46.93 3.32.93 4.79.02L22 23.39 23.39 22l-3.08-3.1m-3.81.1a2.5 2.5 0 0 1-2.5-2.5 2.5 2.5 0 0 1 2.5-2.5 2.5 2.5 0 0 1 2.5 2.5 2.5 2.5 0 0 1-2.5 2.5z"/></svg>');
1399
+ --md-source-forks-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm0 2.122a2.25 2.25 0 1 0-1.5 0v.878A2.25 2.25 0 0 0 5.75 8.5h1.5v2.128a2.251 2.251 0 1 0 1.5 0V8.5h1.5a2.25 2.25 0 0 0 2.25-2.25v-.878a2.25 2.25 0 1 0-1.5 0v.878a.75.75 0 0 1-.75.75h-4.5A.75.75 0 0 1 5 6.25v-.878zm3.75 7.378a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm3-8.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5z"/></svg>');
1400
+ --md-source-repositories-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 1 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 0 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 0 1 1-1h8zM5 12.25v3.25a.25.25 0 0 0 .4.2l1.45-1.087a.25.25 0 0 1 .3 0L8.6 15.7a.25.25 0 0 0 .4-.2v-3.25a.25.25 0 0 0-.25-.25h-3.5a.25.25 0 0 0-.25.25z"/></svg>');
1401
+ --md-source-stars-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.75.75 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694v.001z"/></svg>');
1402
+ --md-source-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2.5 7.775V2.75a.25.25 0 0 1 .25-.25h5.025a.25.25 0 0 1 .177.073l6.25 6.25a.25.25 0 0 1 0 .354l-5.025 5.025a.25.25 0 0 1-.354 0l-6.25-6.25a.25.25 0 0 1-.073-.177zm-1.5 0V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.75 1.75 0 0 1 1 7.775zM6 5a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>');
1403
+ --md-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="m310.6 246.6-127.1 128c-7.1 6.3-15.3 9.4-23.5 9.4s-16.38-3.125-22.63-9.375l-127.1-128C.224 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75s3.12 25.75-6.08 34.85z"/></svg>');
1404
+ }
1405
+
1406
+ :host > * {
1407
+ /* CODE */
1334
1408
  --md-code-fg-color: ${theme.palette.text.primary};
1335
1409
  --md-code-bg-color: ${theme.palette.background.paper};
1336
- --md-accent-fg-color: ${theme.palette.primary.main};
1337
- --md-default-fg-color--lightest: ${theme.palette.textVerySubtle};
1338
- }
1339
- .md-main__inner { margin-top: 0; }
1340
- .md-sidebar { position: fixed; bottom: 100px; width: 20rem; }
1341
- .md-sidebar--secondary { right: 2rem; }
1342
- .md-content { margin-bottom: 50px }
1343
- .md-footer { position: fixed; bottom: 0px; }
1344
- .md-footer-nav__link { width: 20rem;}
1345
- .md-content { margin-left: 20rem; max-width: calc(100% - 20rem * 2 - 3rem); }
1346
- .md-typeset { font-size: 1rem; }
1347
- .md-typeset h1, .md-typeset h2, .md-typeset h3 { font-weight: bold; }
1348
- .md-nav { font-size: 1rem; }
1349
- .md-grid { max-width: 90vw; margin: 0 }
1350
- .md-typeset blockquote {
1351
- color: ${theme.palette.textSubtle};
1352
- border-left: 0.2rem solid ${theme.palette.textVerySubtle};
1353
- }
1354
- .md-typeset hr {
1355
- border-bottom: 0.05rem dotted ${theme.palette.textVerySubtle};
1356
- }
1357
- .md-typeset table:not([class]) {
1358
- font-size: 1rem;
1359
- border: 1px solid ${theme.palette.text.primary};
1360
- border-bottom: none;
1361
- border-collapse: collapse;
1362
- }
1363
- .md-typeset table:not([class]) td, .md-typeset table:not([class]) th {
1364
- border-bottom: 1px solid ${theme.palette.text.primary};
1365
- }
1366
- .md-typeset table:not([class]) th { font-weight: bold; }
1367
- .md-typeset .admonition, .md-typeset details {
1368
- font-size: 1rem;
1410
+ --md-code-hl-color: ${alpha(theme.palette.warning.main, 0.5)};
1411
+ --md-code-hl-keyword-color: ${isDarkTheme ? theme.palette.primary.light : theme.palette.primary.dark};
1412
+ --md-code-hl-function-color: ${isDarkTheme ? theme.palette.secondary.light : theme.palette.secondary.dark};
1413
+ --md-code-hl-string-color: ${isDarkTheme ? theme.palette.success.light : theme.palette.success.dark};
1414
+ --md-code-hl-number-color: ${isDarkTheme ? theme.palette.error.light : theme.palette.error.dark};
1415
+ --md-code-hl-constant-color: var(--md-code-hl-function-color);
1416
+ --md-code-hl-special-color: var(--md-code-hl-function-color);
1417
+ --md-code-hl-name-color: var(--md-code-fg-color);
1418
+ --md-code-hl-comment-color: var(--md-default-fg-color--light);
1419
+ --md-code-hl-generic-color: var(--md-default-fg-color--light);
1420
+ --md-code-hl-variable-color: var(--md-default-fg-color--light);
1421
+ --md-code-hl-operator-color: var(--md-default-fg-color--light);
1422
+ --md-code-hl-punctuation-color: var(--md-default-fg-color--light);
1423
+
1424
+ /* TYPESET */
1425
+ --md-typeset-font-size: 1rem;
1426
+ --md-typeset-color: var(--md-default-fg-color);
1427
+ --md-typeset-a-color: var(--md-accent-fg-color);
1428
+ --md-typeset-table-color: ${theme.palette.text.primary};
1429
+ --md-typeset-del-color: ${isDarkTheme ? alpha(theme.palette.error.dark, 0.5) : alpha(theme.palette.error.light, 0.5)};
1430
+ --md-typeset-ins-color: ${isDarkTheme ? alpha(theme.palette.success.dark, 0.5) : alpha(theme.palette.success.light, 0.5)};
1431
+ --md-typeset-mark-color: ${isDarkTheme ? alpha(theme.palette.warning.dark, 0.5) : alpha(theme.palette.warning.light, 0.5)};
1369
1432
  }
1370
-
1371
- /* style the checkmarks of the task list */
1372
- .md-typeset .task-list-control .task-list-indicator::before {
1373
- background-color: ${theme.palette.action.disabledBackground};
1433
+
1434
+ @media screen and (max-width: 76.1875em) {
1435
+ :host > * {
1436
+ /* TYPESET */
1437
+ --md-typeset-font-size: .9rem;
1438
+ }
1374
1439
  }
1375
- .md-typeset .task-list-control [type="checkbox"]:checked + .task-list-indicator:before {
1376
- background-color: ${theme.palette.success.main};
1440
+
1441
+ @media screen and (max-width: 600px) {
1442
+ :host > * {
1443
+ /* TYPESET */
1444
+ --md-typeset-font-size: .7rem;
1445
+ }
1377
1446
  }
1378
- /**/
1447
+ `
1448
+ }),
1449
+ injectCss({
1450
+ css: `
1451
+ body {
1452
+ --md-text-color: var(--md-default-fg-color);
1453
+ --md-text-link-color: var(--md-accent-fg-color);
1454
+ --md-text-font-family: ${theme.typography.fontFamily};
1455
+ font-family: var(--md-text-font-family);
1456
+ background-color: unset;
1457
+ }
1458
+ `
1459
+ }),
1460
+ injectCss({
1461
+ css: `
1462
+ .md-grid {
1463
+ max-width: 100%;
1464
+ margin: 0;
1465
+ }
1379
1466
 
1380
- @media screen and (max-width: 76.1875em) {
1381
1467
  .md-nav {
1382
- background-color: ${theme.palette.background.default};
1383
- transition: none !important
1468
+ font-size: calc(var(--md-typeset-font-size) * 0.9);
1469
+ }
1470
+ .md-nav__icon {
1471
+ width: auto !important;
1472
+ height: auto !important;
1473
+ }
1474
+ .md-nav__icon:after {
1475
+ width: 20px !important;
1476
+ height: 20px !important;
1477
+ }
1478
+
1479
+ .md-main__inner {
1480
+ margin-top: 0;
1481
+ }
1482
+
1483
+ .md-sidebar {
1484
+ position: fixed;
1485
+ bottom: 100px;
1486
+ width: 16rem;
1384
1487
  }
1385
- .md-sidebar--secondary { display: none; }
1386
- .md-sidebar--primary { left: ${isPinned ? "242px" : "72px"}; width: 10rem }
1387
- .md-content { margin-left: 10rem; max-width: calc(100% - 10rem); }
1388
- .md-content__inner { font-size: 0.9rem }
1488
+ .md-sidebar--secondary {
1489
+ right: ${theme.spacing(3)}px;
1490
+ }
1491
+
1492
+ .md-content {
1493
+ max-width: calc(100% - 16rem * 2);
1494
+ margin-left: 16rem;
1495
+ margin-bottom: 50px;
1496
+ }
1497
+
1389
1498
  .md-footer {
1390
- position: static;
1391
- padding-left: 10rem;
1499
+ position: fixed;
1500
+ bottom: 0px;
1501
+ }
1502
+ .md-footer__title {
1503
+ background-color: unset;
1392
1504
  }
1393
1505
  .md-footer-nav__link {
1394
- /* footer links begin to overlap at small sizes without setting width */
1395
- width: 50%;
1506
+ width: 16rem;
1396
1507
  }
1397
- .md-nav--primary .md-nav__title {
1398
- white-space: normal;
1399
- height: auto;
1400
- line-height: 1rem;
1401
- cursor: auto;
1508
+
1509
+ .md-dialog {
1510
+ background-color: unset;
1402
1511
  }
1403
- .md-nav--primary > .md-nav__title [for="none"] {
1404
- padding-top: 0;
1512
+
1513
+ @media screen and (max-width: 76.1875em) {
1514
+ .md-nav {
1515
+ transition: none !important;
1516
+ background-color: var(--md-default-bg-color)
1517
+ }
1518
+ .md-nav--primary .md-nav__title {
1519
+ cursor: auto;
1520
+ color: var(--md-default-fg-color);
1521
+ font-weight: 700;
1522
+ white-space: normal;
1523
+ line-height: 1rem;
1524
+ height: auto;
1525
+ display: flex;
1526
+ flex-flow: column;
1527
+ row-gap: 1.6rem;
1528
+ padding: 1.2rem .8rem .8rem;
1529
+ background-color: var(--md-default-bg-color);
1530
+ }
1531
+ .md-nav--primary .md-nav__title~.md-nav__list {
1532
+ box-shadow: none;
1533
+ }
1534
+ .md-nav--primary .md-nav__title ~ .md-nav__list > :first-child {
1535
+ border-top: none;
1536
+ }
1537
+ .md-nav--primary .md-nav__title .md-nav__button {
1538
+ display: none;
1539
+ }
1540
+ .md-nav--primary .md-nav__title .md-nav__icon {
1541
+ color: var(--md-default-fg-color);
1542
+ position: static;
1543
+ height: auto;
1544
+ margin: 0 0 0 -0.2rem;
1545
+ }
1546
+ .md-nav--primary > .md-nav__title [for="none"] {
1547
+ padding-top: 0;
1548
+ }
1549
+ .md-nav--primary .md-nav__item {
1550
+ border-top: none;
1551
+ }
1552
+ .md-nav--primary :is(.md-nav__title,.md-nav__item) {
1553
+ font-size : var(--md-typeset-font-size);
1554
+ }
1555
+ .md-nav .md-source {
1556
+ display: none;
1557
+ }
1558
+
1559
+ .md-sidebar--primary {
1560
+ width: 10rem !important;
1561
+ left: ${isPinned ? "242px" : "72px"} !important;
1562
+ }
1563
+ .md-sidebar--secondary:not([hidden]) {
1564
+ display: none;
1565
+ }
1566
+
1567
+ .md-content {
1568
+ max-width: calc(100% - 10rem);
1569
+ margin-left: 10rem;
1570
+ }
1571
+
1572
+ .md-footer {
1573
+ position: static;
1574
+ padding-left: 10rem;
1575
+ }
1576
+ .md-footer-nav__link {
1577
+ /* footer links begin to overlap at small sizes without setting width */
1578
+ width: 50%;
1579
+ }
1405
1580
  }
1406
- }
1407
- `
1408
- }),
1409
- injectCss({
1410
- css: `
1411
- .md-nav__link, .md-typeset a, .md-typeset a::before, .md-typeset .headerlink {
1412
- transition: none;
1581
+
1582
+ @media screen and (max-width: 600px) {
1583
+ .md-sidebar--primary {
1584
+ left: 1rem !important;
1585
+ }
1413
1586
  }
1414
1587
  `
1415
1588
  }),
1416
1589
  injectCss({
1417
- css: `
1590
+ css: `
1591
+ .md-typeset {
1592
+ font-size: var(--md-typeset-font-size);
1593
+ }
1594
+
1595
+ ${headings.reduce((style, heading) => {
1596
+ const styles = theme.typography[heading];
1597
+ const { lineHeight, fontFamily, fontWeight, fontSize } = styles;
1598
+ const calculate = (value) => {
1599
+ let factor = 1;
1600
+ if (typeof value === "number") {
1601
+ factor = value / 16 * 0.6;
1602
+ }
1603
+ if (typeof value === "string") {
1604
+ factor = value.replace("rem", "");
1605
+ }
1606
+ return `calc(${factor} * var(--md-typeset-font-size))`;
1607
+ };
1608
+ return style.concat(`
1609
+ .md-typeset ${heading} {
1610
+ color: var(--md-default-fg-color);
1611
+ line-height: ${lineHeight};
1612
+ font-family: ${fontFamily};
1613
+ font-weight: ${fontWeight};
1614
+ font-size: ${calculate(fontSize)};
1615
+ }
1616
+ `);
1617
+ }, "")}
1618
+
1619
+ .md-typeset .md-content__button {
1620
+ color: var(--md-default-fg-color);
1621
+ }
1622
+
1623
+ .md-typeset hr {
1624
+ border-bottom: 0.05rem dotted ${theme.palette.divider};
1625
+ }
1626
+
1627
+ .md-typeset details {
1628
+ font-size: var(--md-typeset-font-size) !important;
1629
+ }
1630
+ .md-typeset details summary {
1631
+ padding-left: 2.5rem !important;
1632
+ }
1633
+ .md-typeset details summary:before,
1634
+ .md-typeset details summary:after {
1635
+ top: 50% !important;
1636
+ width: 20px !important;
1637
+ height: 20px !important;
1638
+ transform: rotate(0deg) translateY(-50%) !important;
1639
+ }
1640
+ .md-typeset details[open] > summary:after {
1641
+ transform: rotate(90deg) translateX(-50%) !important;
1642
+ }
1643
+
1644
+ .md-typeset blockquote {
1645
+ color: var(--md-default-fg-color--light);
1646
+ border-left: 0.2rem solid var(--md-default-fg-color--light);
1647
+ }
1648
+
1649
+ .md-typeset table:not([class]) {
1650
+ font-size: var(--md-typeset-font-size);
1651
+ border: 1px solid var(--md-default-fg-color);
1652
+ border-bottom: none;
1653
+ border-collapse: collapse;
1654
+ }
1655
+ .md-typeset table:not([class]) th {
1656
+ font-weight: bold;
1657
+ }
1658
+ .md-typeset table:not([class]) td, .md-typeset table:not([class]) th {
1659
+ border-bottom: 1px solid var(--md-default-fg-color);
1660
+ }
1661
+
1418
1662
  .md-typeset pre > code::-webkit-scrollbar-thumb {
1419
1663
  background-color: hsla(0, 0%, 0%, 0.32);
1420
1664
  }
1421
1665
  .md-typeset pre > code::-webkit-scrollbar-thumb:hover {
1422
1666
  background-color: hsla(0, 0%, 0%, 0.87);
1423
1667
  }
1424
- `
1668
+ `
1425
1669
  }),
1426
1670
  injectCss({
1427
1671
  css: `
1428
- :host {
1429
- --md-admonition-icon--note: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>');
1430
- --md-admonition-icon--abstract: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 5h16v2H4V5m0 4h16v2H4V9m0 4h16v2H4v-2m0 4h10v2H4v-2z"/></svg>');
1431
- --md-admonition-icon--info: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 9h-2V7h2m0 10h-2v-6h2m-1-9A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10A10 10 0 0012 2z"/></svg>');
1432
- --md-admonition-icon--tip: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.55 11.2c-.23-.3-.5-.56-.76-.82-.65-.6-1.4-1.03-2.03-1.66C13.3 7.26 13 4.85 13.91 3c-.91.23-1.75.75-2.45 1.32-2.54 2.08-3.54 5.75-2.34 8.9.04.1.08.2.08.33 0 .22-.15.42-.35.5-.22.1-.46.04-.64-.12a.83.83 0 01-.15-.17c-1.1-1.43-1.28-3.48-.53-5.12C5.89 10 5 12.3 5.14 14.47c.04.5.1 1 .27 1.5.14.6.4 1.2.72 1.73 1.04 1.73 2.87 2.97 4.84 3.22 2.1.27 4.35-.12 5.96-1.6 1.8-1.66 2.45-4.32 1.5-6.6l-.13-.26c-.2-.46-.47-.87-.8-1.25l.05-.01m-3.1 6.3c-.28.24-.73.5-1.08.6-1.1.4-2.2-.16-2.87-.82 1.19-.28 1.89-1.16 2.09-2.05.17-.8-.14-1.46-.27-2.23-.12-.74-.1-1.37.18-2.06.17.38.37.76.6 1.06.76 1 1.95 1.44 2.2 2.8.04.14.06.28.06.43.03.82-.32 1.72-.92 2.27h.01z"/></svg>');
1433
- --md-admonition-icon--success: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2m-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
1434
- --md-admonition-icon--question: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.07 11.25l-.9.92C13.45 12.89 13 13.5 13 15h-2v-.5c0-1.11.45-2.11 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41a2 2 0 00-2-2 2 2 0 00-2 2H8a4 4 0 014-4 4 4 0 014 4 3.2 3.2 0 01-.93 2.25M13 19h-2v-2h2M12 2A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10c0-5.53-4.5-10-10-10z"/></svg>');
1435
- --md-admonition-icon--warning: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 14h-2v-4h2m0 8h-2v-2h2M1 21h22L12 2 1 21z"/></svg>');
1436
- --md-admonition-icon--failure: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2c5.53 0 10 4.47 10 10s-4.47 10-10 10S2 17.53 2 12 6.47 2 12 2m3.59 5L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41 15.59 7z"/></svg>');
1437
- --md-admonition-icon--danger: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.5 20l4.86-9.73H13V4l-5 9.73h3.5V20M12 2c2.75 0 5.1 1 7.05 2.95C21 6.9 22 9.25 22 12s-1 5.1-2.95 7.05C17.1 21 14.75 22 12 22s-5.1-1-7.05-2.95C3 17.1 2 14.75 2 12s1-5.1 2.95-7.05C6.9 3 9.25 2 12 2z"/></svg>');
1438
- --md-admonition-icon--bug: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 12h-4v-2h4m0 6h-4v-2h4m6-6h-2.81a5.985 5.985 0 00-1.82-1.96L17 4.41 15.59 3l-2.17 2.17a6.002 6.002 0 00-2.83 0L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8z"/></svg>');
1439
- --md-admonition-icon--example: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 13v-2h14v2H7m0 6v-2h14v2H7M7 7V5h14v2H7M3 8V5H2V4h2v4H3m-1 9v-1h3v4H2v-1h2v-.5H3v-1h1V17H2m2.25-7a.75.75 0 01.75.75c0 .2-.08.39-.21.52L3.12 13H5v1H2v-.92L4 11H2v-1h2.25z"/></svg>');
1440
- --md-admonition-icon--quote: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 17h3l2-4V7h-6v6h3M6 17h3l2-4V7H5v6h3l-2 4z"/></svg>');
1672
+ /*
1673
+ Disable CSS animations on link colors as they lead to issues in dark mode.
1674
+ The dark mode color theme is applied later and theirfore there is always an animation from light to dark mode when navigation between pages.
1675
+ */
1676
+ .md-dialog, .md-nav__link, .md-footer__link, .md-typeset a, .md-typeset a::before, .md-typeset .headerlink {
1677
+ transition: none;
1441
1678
  }
1442
- :host {
1443
- --md-footnotes-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.42L5.83 13H21V7h-2z"/></svg>');
1679
+ `
1680
+ }),
1681
+ injectCss({
1682
+ css: `
1683
+ /* HIGHLIGHT */
1684
+ .highlight .md-clipboard:after {
1685
+ content: unset;
1686
+ }
1687
+
1688
+ .highlight .nx {
1689
+ color: ${isDarkTheme ? "#ff53a3" : "#ec407a"};
1690
+ }
1691
+
1692
+ /* CODE HILITE */
1693
+ .codehilite .gd {
1694
+ background-color: ${isDarkTheme ? "rgba(248,81,73,0.65)" : "#fdd"};
1695
+ }
1696
+
1697
+ .codehilite .gi {
1698
+ background-color: ${isDarkTheme ? "rgba(46,160,67,0.65)" : "#dfd"};
1699
+ }
1700
+
1701
+ /* TABBED */
1702
+ .tabbed-set>input:nth-child(1):checked~.tabbed-labels>:nth-child(1),
1703
+ .tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),
1704
+ .tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),
1705
+ .tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),
1706
+ .tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),
1707
+ .tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),
1708
+ .tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),
1709
+ .tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),
1710
+ .tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9),
1711
+ .tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),
1712
+ .tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),
1713
+ .tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),
1714
+ .tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),
1715
+ .tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),
1716
+ .tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),
1717
+ .tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),
1718
+ .tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),
1719
+ .tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),
1720
+ .tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),
1721
+ .tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20) {
1722
+ color: var(--md-accent-fg-color);
1723
+ border-color: var(--md-accent-fg-color);
1444
1724
  }
1445
- :host {
1446
- --md-details-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.59 16.58L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z"/></svg>');
1725
+
1726
+ /* TASK-LIST */
1727
+ .task-list-control .task-list-indicator::before {
1728
+ background-color: ${theme.palette.action.disabledBackground};
1729
+ }
1730
+ .task-list-control [type="checkbox"]:checked + .task-list-indicator:before {
1731
+ background-color: ${theme.palette.success.main};
1732
+ }
1733
+
1734
+ /* ADMONITION */
1735
+ .admonition {
1736
+ font-size: var(--md-typeset-font-size) !important;
1447
1737
  }
1448
- :host {
1449
- --md-tasklist-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/></svg>');
1450
- --md-tasklist-icon--checked: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
1738
+ .admonition .admonition-title {
1739
+ padding-left: 2.5rem !important;
1451
1740
  }
1452
- `
1741
+
1742
+ .admonition .admonition-title:before {
1743
+ top: 50% !important;
1744
+ width: 20px !important;
1745
+ height: 20px !important;
1746
+ transform: translateY(-50%) !important;
1747
+ }
1748
+ `
1453
1749
  })
1454
1750
  ]), [
1455
1751
  kind,
1456
1752
  name,
1457
1753
  namespace,
1458
1754
  scmIntegrationsApi,
1459
- techdocsStorageApi,
1460
1755
  techdocsSanitizer,
1461
- theme.palette.action.disabledBackground,
1462
- theme.palette.background.default,
1463
- theme.palette.background.paper,
1464
- theme.palette.primary.main,
1465
- theme.palette.success.main,
1466
- theme.palette.text.primary,
1467
- theme.palette.textSubtle,
1468
- theme.palette.textVerySubtle,
1469
- theme.typography.fontFamily,
1756
+ techdocsStorageApi,
1757
+ theme,
1758
+ isDarkTheme,
1470
1759
  isPinned
1471
1760
  ]);
1472
1761
  const postRender = useCallback(async (transformedElement) => transform(transformedElement, [
@@ -1579,7 +1868,8 @@ const Reader = ({
1579
1868
  const TechDocsPageHeader = ({
1580
1869
  entityRef,
1581
1870
  entityMetadata,
1582
- techDocsMetadata
1871
+ techDocsMetadata,
1872
+ children
1583
1873
  }) => {
1584
1874
  const { name } = entityRef;
1585
1875
  const { site_name: siteName, site_description: siteDescription } = techDocsMetadata || {};
@@ -1620,7 +1910,7 @@ const TechDocsPageHeader = ({
1620
1910
  subtitle: siteDescription && siteDescription !== "None" ? siteDescription : "",
1621
1911
  type: "Docs",
1622
1912
  typeLink: docsRootLink
1623
- }, labels);
1913
+ }, labels, children);
1624
1914
  };
1625
1915
 
1626
1916
  const LegacyTechDocsPage = () => {
@@ -1667,6 +1957,7 @@ const LegacyTechDocsPage = () => {
1667
1957
  };
1668
1958
 
1669
1959
  const TechDocsPage = ({ children }) => {
1960
+ const { NotFoundErrorPage } = useApp().getComponents();
1670
1961
  const outlet = useOutlet();
1671
1962
  const [documentReady, setDocumentReady] = useState(false);
1672
1963
  const { namespace, kind, name } = useParams();
@@ -1683,11 +1974,8 @@ const TechDocsPage = ({ children }) => {
1683
1974
  const onReady = useCallback(() => {
1684
1975
  setDocumentReady(true);
1685
1976
  }, [setDocumentReady]);
1686
- if (entityMetadataError) {
1687
- return /* @__PURE__ */ React.createElement(TechDocsNotFound, {
1688
- errorMessage: entityMetadataError.message
1689
- });
1690
- }
1977
+ if (entityMetadataError)
1978
+ return /* @__PURE__ */ React.createElement(NotFoundErrorPage, null);
1691
1979
  if (!children)
1692
1980
  return outlet || /* @__PURE__ */ React.createElement(LegacyTechDocsPage, null);
1693
1981
  return /* @__PURE__ */ React.createElement(Page, {
@@ -1799,6 +2087,17 @@ const TechDocsCustomHome = ({
1799
2087
  index
1800
2088
  }))));
1801
2089
  };
2090
+ function useOwnUser() {
2091
+ const catalogApi = useApi(catalogApiRef);
2092
+ const identityApi = useApi(identityApiRef);
2093
+ return useAsync(async () => {
2094
+ const identity = await identityApi.getBackstageIdentity();
2095
+ return catalogApi.getEntityByName(parseEntityRef(identity.userEntityRef, {
2096
+ defaultKind: "User",
2097
+ defaultNamespace: DEFAULT_NAMESPACE
2098
+ }));
2099
+ }, [catalogApi, identityApi]);
2100
+ }
1802
2101
 
1803
2102
  var TechDocsCustomHome$1 = /*#__PURE__*/Object.freeze({
1804
2103
  __proto__: null,