@backstage/plugin-techdocs 0.12.4 → 0.12.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/index.esm.js +106 -104
- package/dist/index.esm.js.map +1 -1
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @backstage/plugin-techdocs
|
|
2
2
|
|
|
3
|
+
## 0.12.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fe5738fe1c: Lazy load `LazyLog` as it is rarely used.
|
|
8
|
+
- 53c9ad7e04: Update font weight for headings in TechDocs
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
- @backstage/core-components@0.7.3
|
|
11
|
+
- @backstage/theme@0.2.13
|
|
12
|
+
- @backstage/plugin-search@0.4.17
|
|
13
|
+
- @backstage/core-plugin-api@0.1.13
|
|
14
|
+
- @backstage/plugin-catalog-react@0.6.3
|
|
15
|
+
|
|
3
16
|
## 0.12.4
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/index.esm.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { createApiRef, createRouteRef, useRouteRef, useApi, configApiRef, createPlugin, createApiFactory, discoveryApiRef, identityApiRef, createRoutableExtension, createComponentExtension } from '@backstage/core-plugin-api';
|
|
2
2
|
import { ResponseError, NotFoundError } from '@backstage/errors';
|
|
3
3
|
import { EventSourcePolyfill } from 'event-source-polyfill';
|
|
4
|
-
import
|
|
5
|
-
import React__default, { useEffect, useState, useReducer, useRef, useMemo, useContext, createContext, useCallback } from 'react';
|
|
4
|
+
import React, { useEffect, useState, Suspense, useReducer, useRef, useMemo, useContext, createContext, useCallback } from 'react';
|
|
6
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';
|
|
7
6
|
import { Link, SubvalueCell, Table, EmptyState, Button, WarningPanel, CodeSnippet, PageWithHeader, Content, ContentHeader, SupportButton, ItemCardGrid, ItemCardHeader, Progress, ErrorPage, HeaderLabel, Header, Page, HeaderTabs, MissingAnnotationEmptyState } from '@backstage/core-components';
|
|
8
7
|
import TextTruncate from 'react-text-truncate';
|
|
@@ -25,7 +24,6 @@ import Autocomplete from '@material-ui/lab/Autocomplete';
|
|
|
25
24
|
import { useNavigate, useOutlet } from 'react-router';
|
|
26
25
|
import { Alert } from '@material-ui/lab';
|
|
27
26
|
import Close from '@material-ui/icons/Close';
|
|
28
|
-
import { LazyLog } from 'react-lazylog';
|
|
29
27
|
import CodeIcon from '@material-ui/icons/Code';
|
|
30
28
|
|
|
31
29
|
const techdocsStorageApiRef = createApiRef({
|
|
@@ -183,11 +181,11 @@ const DocsResultListItem = ({
|
|
|
183
181
|
const classes = useStyles$2();
|
|
184
182
|
const TextItem = () => {
|
|
185
183
|
var _a;
|
|
186
|
-
return /* @__PURE__ */
|
|
184
|
+
return /* @__PURE__ */ React.createElement(ListItemText, {
|
|
187
185
|
className: classes.itemText,
|
|
188
186
|
primaryTypographyProps: {variant: "h6"},
|
|
189
187
|
primary: title ? title : `${result.title} | ${(_a = result.entityTitle) != null ? _a : result.name} docs`,
|
|
190
|
-
secondary: /* @__PURE__ */
|
|
188
|
+
secondary: /* @__PURE__ */ React.createElement(TextTruncate, {
|
|
191
189
|
line: lineClamp,
|
|
192
190
|
truncateText: "\u2026",
|
|
193
191
|
text: result.text,
|
|
@@ -195,16 +193,16 @@ const DocsResultListItem = ({
|
|
|
195
193
|
})
|
|
196
194
|
});
|
|
197
195
|
};
|
|
198
|
-
const LinkWrapper = ({children}) => asLink ? /* @__PURE__ */
|
|
196
|
+
const LinkWrapper = ({children}) => asLink ? /* @__PURE__ */ React.createElement(Link, {
|
|
199
197
|
to: result.location
|
|
200
|
-
}, children) : /* @__PURE__ */
|
|
201
|
-
const ListItemWrapper = ({children}) => asListItem ? /* @__PURE__ */
|
|
198
|
+
}, children) : /* @__PURE__ */ React.createElement(React.Fragment, null, children);
|
|
199
|
+
const ListItemWrapper = ({children}) => asListItem ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ListItem, {
|
|
202
200
|
alignItems: "flex-start",
|
|
203
201
|
className: classes.flexContainer
|
|
204
|
-
}, children), /* @__PURE__ */
|
|
202
|
+
}, children), /* @__PURE__ */ React.createElement(Divider, {
|
|
205
203
|
component: "li"
|
|
206
|
-
})) : /* @__PURE__ */
|
|
207
|
-
return /* @__PURE__ */
|
|
204
|
+
})) : /* @__PURE__ */ React.createElement(React.Fragment, null, children);
|
|
205
|
+
return /* @__PURE__ */ React.createElement(LinkWrapper, null, /* @__PURE__ */ React.createElement(ListItemWrapper, null, /* @__PURE__ */ React.createElement(TextItem, null)));
|
|
208
206
|
};
|
|
209
207
|
|
|
210
208
|
const rootRouteRef = createRouteRef({
|
|
@@ -224,7 +222,7 @@ const rootCatalogDocsRouteRef = createRouteRef({
|
|
|
224
222
|
function createCopyDocsUrlAction(copyToClipboard) {
|
|
225
223
|
return (row) => {
|
|
226
224
|
return {
|
|
227
|
-
icon: () => /* @__PURE__ */
|
|
225
|
+
icon: () => /* @__PURE__ */ React.createElement(ShareIcon, {
|
|
228
226
|
fontSize: "small"
|
|
229
227
|
}),
|
|
230
228
|
tooltip: "Click to copy documentation link to clipboard",
|
|
@@ -258,8 +256,8 @@ function createNameColumn() {
|
|
|
258
256
|
title: "Document",
|
|
259
257
|
field: "entity.metadata.name",
|
|
260
258
|
highlight: true,
|
|
261
|
-
render: (row) => /* @__PURE__ */
|
|
262
|
-
value: /* @__PURE__ */
|
|
259
|
+
render: (row) => /* @__PURE__ */ React.createElement(SubvalueCell, {
|
|
260
|
+
value: /* @__PURE__ */ React.createElement(Link, {
|
|
263
261
|
to: row.resolved.docsUrl
|
|
264
262
|
}, customTitle(row.entity)),
|
|
265
263
|
subvalue: row.entity.metadata.description
|
|
@@ -270,7 +268,7 @@ function createOwnerColumn() {
|
|
|
270
268
|
return {
|
|
271
269
|
title: "Owner",
|
|
272
270
|
field: "resolved.ownedByRelationsTitle",
|
|
273
|
-
render: ({resolved}) => /* @__PURE__ */
|
|
271
|
+
render: ({resolved}) => /* @__PURE__ */ React.createElement(EntityRefLinks, {
|
|
274
272
|
entityRefs: resolved.ownedByRelations,
|
|
275
273
|
defaultKind: "group"
|
|
276
274
|
})
|
|
@@ -326,7 +324,7 @@ const DocsTable$1 = ({
|
|
|
326
324
|
const defaultActions = [
|
|
327
325
|
createCopyDocsUrlAction(copyToClipboard)
|
|
328
326
|
];
|
|
329
|
-
return /* @__PURE__ */
|
|
327
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, loading || documents && documents.length > 0 ? /* @__PURE__ */ React.createElement(Table, {
|
|
330
328
|
isLoading: loading,
|
|
331
329
|
options: {
|
|
332
330
|
paging: true,
|
|
@@ -338,11 +336,11 @@ const DocsTable$1 = ({
|
|
|
338
336
|
columns: columns || defaultColumns,
|
|
339
337
|
actions: actions || defaultActions,
|
|
340
338
|
title: title ? `${title} (${documents.length})` : `All (${documents.length})`
|
|
341
|
-
}) : /* @__PURE__ */
|
|
339
|
+
}) : /* @__PURE__ */ React.createElement(EmptyState, {
|
|
342
340
|
missing: "data",
|
|
343
341
|
title: "No documents to show",
|
|
344
342
|
description: "Create your own document. Check out our Getting Started Information",
|
|
345
|
-
action: /* @__PURE__ */
|
|
343
|
+
action: /* @__PURE__ */ React.createElement(Button, {
|
|
346
344
|
color: "primary",
|
|
347
345
|
to: "https://backstage.io/docs/features/techdocs/getting-started",
|
|
348
346
|
variant: "contained"
|
|
@@ -369,15 +367,15 @@ const EntityListDocsTable = ({
|
|
|
369
367
|
createStarEntityAction(isStarredEntity, toggleStarredEntity)
|
|
370
368
|
];
|
|
371
369
|
if (error) {
|
|
372
|
-
return /* @__PURE__ */
|
|
370
|
+
return /* @__PURE__ */ React.createElement(WarningPanel, {
|
|
373
371
|
severity: "error",
|
|
374
372
|
title: "Could not load available documentation."
|
|
375
|
-
}, /* @__PURE__ */
|
|
373
|
+
}, /* @__PURE__ */ React.createElement(CodeSnippet, {
|
|
376
374
|
language: "text",
|
|
377
375
|
text: error.toString()
|
|
378
376
|
}));
|
|
379
377
|
}
|
|
380
|
-
return /* @__PURE__ */
|
|
378
|
+
return /* @__PURE__ */ React.createElement(DocsTable$1, {
|
|
381
379
|
title,
|
|
382
380
|
entities,
|
|
383
381
|
loading,
|
|
@@ -392,7 +390,7 @@ const TechDocsPageWrapper = ({children}) => {
|
|
|
392
390
|
var _a;
|
|
393
391
|
const configApi = useApi(configApiRef);
|
|
394
392
|
const generatedSubtitle = `Documentation available in ${(_a = configApi.getOptionalString("organization.name")) != null ? _a : "Backstage"}`;
|
|
395
|
-
return /* @__PURE__ */
|
|
393
|
+
return /* @__PURE__ */ React.createElement(PageWithHeader, {
|
|
396
394
|
title: "Documentation",
|
|
397
395
|
subtitle: generatedSubtitle,
|
|
398
396
|
themeId: "documentation"
|
|
@@ -421,11 +419,11 @@ const DefaultTechDocsHome = ({
|
|
|
421
419
|
columns,
|
|
422
420
|
actions
|
|
423
421
|
}) => {
|
|
424
|
-
return /* @__PURE__ */
|
|
422
|
+
return /* @__PURE__ */ React.createElement(TechDocsPageWrapper, null, /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(ContentHeader, {
|
|
425
423
|
title: ""
|
|
426
|
-
}, /* @__PURE__ */
|
|
424
|
+
}, /* @__PURE__ */ React.createElement(SupportButton, null, "Discover documentation in your ecosystem.")), /* @__PURE__ */ React.createElement(EntityListProvider, null, /* @__PURE__ */ React.createElement(FilteredEntityLayout, null, /* @__PURE__ */ React.createElement(FilterContainer, null, /* @__PURE__ */ React.createElement(TechDocsPicker, null), /* @__PURE__ */ React.createElement(UserListPicker, {
|
|
427
425
|
initialFilter
|
|
428
|
-
}), /* @__PURE__ */
|
|
426
|
+
}), /* @__PURE__ */ React.createElement(EntityOwnerPicker, null), /* @__PURE__ */ React.createElement(EntityTagPicker, null)), /* @__PURE__ */ React.createElement(EntityListContainer, null, /* @__PURE__ */ React.createElement(EntityListDocsTable, {
|
|
429
427
|
actions,
|
|
430
428
|
columns
|
|
431
429
|
}))))));
|
|
@@ -438,15 +436,15 @@ const DocsCardGrid$1 = ({
|
|
|
438
436
|
const toLowerMaybe = useApi(configApiRef).getOptionalBoolean("techdocs.legacyUseCaseSensitiveTripletPaths") ? (str) => str : (str) => str.toLocaleLowerCase();
|
|
439
437
|
if (!entities)
|
|
440
438
|
return null;
|
|
441
|
-
return /* @__PURE__ */
|
|
439
|
+
return /* @__PURE__ */ React.createElement(ItemCardGrid, {
|
|
442
440
|
"data-testid": "docs-explore"
|
|
443
441
|
}, !(entities == null ? void 0 : entities.length) ? null : entities.map((entity, index) => {
|
|
444
442
|
var _a, _b;
|
|
445
|
-
return /* @__PURE__ */
|
|
443
|
+
return /* @__PURE__ */ React.createElement(Card, {
|
|
446
444
|
key: index
|
|
447
|
-
}, /* @__PURE__ */
|
|
445
|
+
}, /* @__PURE__ */ React.createElement(CardMedia, null, /* @__PURE__ */ React.createElement(ItemCardHeader, {
|
|
448
446
|
title: (_a = entity.metadata.title) != null ? _a : entity.metadata.name
|
|
449
|
-
})), /* @__PURE__ */
|
|
447
|
+
})), /* @__PURE__ */ React.createElement(CardContent, null, entity.metadata.description), /* @__PURE__ */ React.createElement(CardActions, null, /* @__PURE__ */ React.createElement(Button, {
|
|
450
448
|
to: getRouteToReaderPageFor({
|
|
451
449
|
namespace: toLowerMaybe((_b = entity.metadata.namespace) != null ? _b : "default"),
|
|
452
450
|
kind: toLowerMaybe(entity.kind),
|
|
@@ -466,22 +464,22 @@ var DocsCardGrid$2 = /*#__PURE__*/Object.freeze({
|
|
|
466
464
|
const EntityListDocsGrid = () => {
|
|
467
465
|
const {loading, error, entities} = useEntityListProvider();
|
|
468
466
|
if (error) {
|
|
469
|
-
return /* @__PURE__ */
|
|
467
|
+
return /* @__PURE__ */ React.createElement(WarningPanel, {
|
|
470
468
|
severity: "error",
|
|
471
469
|
title: "Could not load available documentation."
|
|
472
|
-
}, /* @__PURE__ */
|
|
470
|
+
}, /* @__PURE__ */ React.createElement(CodeSnippet, {
|
|
473
471
|
language: "text",
|
|
474
472
|
text: error.toString()
|
|
475
473
|
}));
|
|
476
474
|
}
|
|
477
475
|
if (loading || !entities) {
|
|
478
|
-
return /* @__PURE__ */
|
|
476
|
+
return /* @__PURE__ */ React.createElement(Progress, null);
|
|
479
477
|
}
|
|
480
478
|
entities.sort((a, b) => {
|
|
481
479
|
var _a, _b;
|
|
482
480
|
return ((_a = a.metadata.title) != null ? _a : a.metadata.name).localeCompare((_b = b.metadata.title) != null ? _b : b.metadata.name);
|
|
483
481
|
});
|
|
484
|
-
return /* @__PURE__ */
|
|
482
|
+
return /* @__PURE__ */ React.createElement(DocsCardGrid$1, {
|
|
485
483
|
entities
|
|
486
484
|
});
|
|
487
485
|
};
|
|
@@ -635,7 +633,7 @@ Feedback:`);
|
|
|
635
633
|
default:
|
|
636
634
|
return dom;
|
|
637
635
|
}
|
|
638
|
-
ReactDOM.render(
|
|
636
|
+
ReactDOM.render(React.createElement(FeedbackOutlinedIcon), feedbackLink);
|
|
639
637
|
feedbackLink.style.paddingLeft = "5px";
|
|
640
638
|
feedbackLink.title = "Leave feedback for this page";
|
|
641
639
|
feedbackLink.id = "git-feedback-link";
|
|
@@ -836,10 +834,10 @@ const TechDocsSearchBar = ({
|
|
|
836
834
|
navigate(location);
|
|
837
835
|
}
|
|
838
836
|
};
|
|
839
|
-
return /* @__PURE__ */
|
|
837
|
+
return /* @__PURE__ */ React.createElement(Grid, {
|
|
840
838
|
item: true,
|
|
841
839
|
xs: 12
|
|
842
|
-
}, /* @__PURE__ */
|
|
840
|
+
}, /* @__PURE__ */ React.createElement(Autocomplete, {
|
|
843
841
|
"data-testid": "techdocs-search-bar",
|
|
844
842
|
size: "small",
|
|
845
843
|
open,
|
|
@@ -858,7 +856,7 @@ const TechDocsSearchBar = ({
|
|
|
858
856
|
noOptionsText: "No results found",
|
|
859
857
|
value: null,
|
|
860
858
|
options,
|
|
861
|
-
renderOption: ({document}) => /* @__PURE__ */
|
|
859
|
+
renderOption: ({document}) => /* @__PURE__ */ React.createElement(DocsResultListItem, {
|
|
862
860
|
result: document,
|
|
863
861
|
lineClamp: 3,
|
|
864
862
|
asListItem: false,
|
|
@@ -866,7 +864,7 @@ const TechDocsSearchBar = ({
|
|
|
866
864
|
title: document.title
|
|
867
865
|
}),
|
|
868
866
|
loading,
|
|
869
|
-
renderInput: (params) => /* @__PURE__ */
|
|
867
|
+
renderInput: (params) => /* @__PURE__ */ React.createElement(TextField, {
|
|
870
868
|
...params,
|
|
871
869
|
"data-testid": "techdocs-search-bar-input",
|
|
872
870
|
variant: "outlined",
|
|
@@ -876,13 +874,13 @@ const TechDocsSearchBar = ({
|
|
|
876
874
|
onChange: handleQuery,
|
|
877
875
|
InputProps: {
|
|
878
876
|
...params.InputProps,
|
|
879
|
-
startAdornment: /* @__PURE__ */
|
|
877
|
+
startAdornment: /* @__PURE__ */ React.createElement(InputAdornment, {
|
|
880
878
|
position: "start"
|
|
881
|
-
}, /* @__PURE__ */
|
|
879
|
+
}, /* @__PURE__ */ React.createElement(IconButton, {
|
|
882
880
|
"aria-label": "Query",
|
|
883
881
|
disabled: true
|
|
884
|
-
}, /* @__PURE__ */
|
|
885
|
-
endAdornment: /* @__PURE__ */
|
|
882
|
+
}, /* @__PURE__ */ React.createElement(SearchIcon, null))),
|
|
883
|
+
endAdornment: /* @__PURE__ */ React.createElement(React.Fragment, null, loading ? /* @__PURE__ */ React.createElement(CircularProgress, {
|
|
886
884
|
color: "inherit",
|
|
887
885
|
size: 20
|
|
888
886
|
}) : null, params.InputProps.endAdornment)
|
|
@@ -897,13 +895,14 @@ const TechDocsSearch = (props) => {
|
|
|
897
895
|
pageCursor: "",
|
|
898
896
|
filters: props.entityId
|
|
899
897
|
};
|
|
900
|
-
return /* @__PURE__ */
|
|
898
|
+
return /* @__PURE__ */ React.createElement(SearchContextProvider, {
|
|
901
899
|
initialState
|
|
902
|
-
}, /* @__PURE__ */
|
|
900
|
+
}, /* @__PURE__ */ React.createElement(TechDocsSearchBar, {
|
|
903
901
|
...props
|
|
904
902
|
}));
|
|
905
903
|
};
|
|
906
904
|
|
|
905
|
+
const LazyLog = React.lazy(() => import('react-lazylog/build/LazyLog'));
|
|
907
906
|
const useDrawerStyles = makeStyles((theme) => createStyles({
|
|
908
907
|
paper: {
|
|
909
908
|
width: "100%",
|
|
@@ -945,13 +944,15 @@ const TechDocsBuildLogsDrawerContent = ({
|
|
|
945
944
|
title: "Close the drawer",
|
|
946
945
|
onClick: onClose,
|
|
947
946
|
color: "inherit"
|
|
948
|
-
}, /* @__PURE__ */ React.createElement(Close, null))), /* @__PURE__ */ React.createElement(
|
|
947
|
+
}, /* @__PURE__ */ React.createElement(Close, null))), /* @__PURE__ */ React.createElement(Suspense, {
|
|
948
|
+
fallback: /* @__PURE__ */ React.createElement(Progress, null)
|
|
949
|
+
}, /* @__PURE__ */ React.createElement(LazyLog, {
|
|
949
950
|
text: buildLog.length === 0 ? "Waiting for logs..." : buildLog.join("\n"),
|
|
950
951
|
extraLines: 1,
|
|
951
952
|
follow: true,
|
|
952
953
|
selectableLines: true,
|
|
953
954
|
enableSearch: true
|
|
954
|
-
}));
|
|
955
|
+
})));
|
|
955
956
|
};
|
|
956
957
|
const TechDocsBuildLogs = ({buildLog}) => {
|
|
957
958
|
const classes = useDrawerStyles();
|
|
@@ -976,7 +977,7 @@ const TechDocsNotFound = ({errorMessage}) => {
|
|
|
976
977
|
if (techdocsBuilder !== "local") {
|
|
977
978
|
additionalInfo = "Note that techdocs.builder is not set to 'local' in your config, which means this Backstage app will not generate docs if they are not found. Make sure the project's docs are generated and published by some external process (e.g. CI/CD pipeline). Or change techdocs.builder to 'local' to generate docs from this Backstage instance.";
|
|
978
979
|
}
|
|
979
|
-
return /* @__PURE__ */
|
|
980
|
+
return /* @__PURE__ */ React.createElement(ErrorPage, {
|
|
980
981
|
status: "404",
|
|
981
982
|
statusMessage: errorMessage || "Documentation not found",
|
|
982
983
|
additionalInfo
|
|
@@ -999,64 +1000,64 @@ const TechDocsStateIndicator = () => {
|
|
|
999
1000
|
syncErrorMessage,
|
|
1000
1001
|
buildLog
|
|
1001
1002
|
} = useTechDocsReader();
|
|
1002
|
-
const ReaderProgress = state === "CHECKING" ? /* @__PURE__ */
|
|
1003
|
+
const ReaderProgress = state === "CHECKING" ? /* @__PURE__ */ React.createElement(Progress, null) : null;
|
|
1003
1004
|
if (state === "INITIAL_BUILD") {
|
|
1004
|
-
StateAlert = /* @__PURE__ */
|
|
1005
|
+
StateAlert = /* @__PURE__ */ React.createElement(Alert, {
|
|
1005
1006
|
variant: "outlined",
|
|
1006
1007
|
severity: "info",
|
|
1007
|
-
icon: /* @__PURE__ */
|
|
1008
|
+
icon: /* @__PURE__ */ React.createElement(CircularProgress, {
|
|
1008
1009
|
size: "24px"
|
|
1009
1010
|
}),
|
|
1010
|
-
action: /* @__PURE__ */
|
|
1011
|
+
action: /* @__PURE__ */ React.createElement(TechDocsBuildLogs, {
|
|
1011
1012
|
buildLog
|
|
1012
1013
|
})
|
|
1013
1014
|
}, "Documentation is accessed for the first time and is being prepared. The subsequent loads are much faster.");
|
|
1014
1015
|
}
|
|
1015
1016
|
if (state === "CONTENT_STALE_REFRESHING") {
|
|
1016
|
-
StateAlert = /* @__PURE__ */
|
|
1017
|
+
StateAlert = /* @__PURE__ */ React.createElement(Alert, {
|
|
1017
1018
|
variant: "outlined",
|
|
1018
1019
|
severity: "info",
|
|
1019
|
-
icon: /* @__PURE__ */
|
|
1020
|
+
icon: /* @__PURE__ */ React.createElement(CircularProgress, {
|
|
1020
1021
|
size: "24px"
|
|
1021
1022
|
}),
|
|
1022
|
-
action: /* @__PURE__ */
|
|
1023
|
+
action: /* @__PURE__ */ React.createElement(TechDocsBuildLogs, {
|
|
1023
1024
|
buildLog
|
|
1024
1025
|
})
|
|
1025
1026
|
}, "A newer version of this documentation is being prepared and will be available shortly.");
|
|
1026
1027
|
}
|
|
1027
1028
|
if (state === "CONTENT_STALE_READY") {
|
|
1028
|
-
StateAlert = /* @__PURE__ */
|
|
1029
|
+
StateAlert = /* @__PURE__ */ React.createElement(Alert, {
|
|
1029
1030
|
variant: "outlined",
|
|
1030
1031
|
severity: "success",
|
|
1031
|
-
action: /* @__PURE__ */
|
|
1032
|
+
action: /* @__PURE__ */ React.createElement(Button$1, {
|
|
1032
1033
|
color: "inherit",
|
|
1033
1034
|
onClick: () => contentReload()
|
|
1034
1035
|
}, "Refresh")
|
|
1035
1036
|
}, "A newer version of this documentation is now available, please refresh to view.");
|
|
1036
1037
|
}
|
|
1037
1038
|
if (state === "CONTENT_STALE_ERROR") {
|
|
1038
|
-
StateAlert = /* @__PURE__ */
|
|
1039
|
+
StateAlert = /* @__PURE__ */ React.createElement(Alert, {
|
|
1039
1040
|
variant: "outlined",
|
|
1040
1041
|
severity: "error",
|
|
1041
|
-
action: /* @__PURE__ */
|
|
1042
|
+
action: /* @__PURE__ */ React.createElement(TechDocsBuildLogs, {
|
|
1042
1043
|
buildLog
|
|
1043
1044
|
}),
|
|
1044
1045
|
classes: {message: classes.message}
|
|
1045
1046
|
}, "Building a newer version of this documentation failed.", " ", syncErrorMessage);
|
|
1046
1047
|
}
|
|
1047
1048
|
if (state === "CONTENT_NOT_FOUND") {
|
|
1048
|
-
StateAlert = /* @__PURE__ */
|
|
1049
|
+
StateAlert = /* @__PURE__ */ React.createElement(React.Fragment, null, syncErrorMessage && /* @__PURE__ */ React.createElement(Alert, {
|
|
1049
1050
|
variant: "outlined",
|
|
1050
1051
|
severity: "error",
|
|
1051
|
-
action: /* @__PURE__ */
|
|
1052
|
+
action: /* @__PURE__ */ React.createElement(TechDocsBuildLogs, {
|
|
1052
1053
|
buildLog
|
|
1053
1054
|
}),
|
|
1054
1055
|
classes: {message: classes.message}
|
|
1055
|
-
}, "Building a newer version of this documentation failed.", " ", syncErrorMessage), /* @__PURE__ */
|
|
1056
|
+
}, "Building a newer version of this documentation failed.", " ", syncErrorMessage), /* @__PURE__ */ React.createElement(TechDocsNotFound, {
|
|
1056
1057
|
errorMessage: contentErrorMessage
|
|
1057
1058
|
}));
|
|
1058
1059
|
}
|
|
1059
|
-
return /* @__PURE__ */
|
|
1060
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, ReaderProgress, StateAlert);
|
|
1060
1061
|
};
|
|
1061
1062
|
|
|
1062
1063
|
function calculateDisplayState({
|
|
@@ -1220,11 +1221,11 @@ const TechDocsReaderContext = createContext({});
|
|
|
1220
1221
|
const TechDocsReaderProvider = ({children}) => {
|
|
1221
1222
|
const {namespace = "", kind = "", name = "", "*": path} = useParams();
|
|
1222
1223
|
const value = useReaderState(kind, namespace, name, path);
|
|
1223
|
-
return /* @__PURE__ */
|
|
1224
|
+
return /* @__PURE__ */ React.createElement(TechDocsReaderContext.Provider, {
|
|
1224
1225
|
value
|
|
1225
1226
|
}, children);
|
|
1226
1227
|
};
|
|
1227
|
-
const withTechDocsReaderProvider = (Component) => (props) => /* @__PURE__ */
|
|
1228
|
+
const withTechDocsReaderProvider = (Component) => (props) => /* @__PURE__ */ React.createElement(TechDocsReaderProvider, null, /* @__PURE__ */ React.createElement(Component, {
|
|
1228
1229
|
...props
|
|
1229
1230
|
}));
|
|
1230
1231
|
const useTechDocsReader = () => useContext(TechDocsReaderContext);
|
|
@@ -1288,6 +1289,7 @@ const useTechDocsReaderDom = () => {
|
|
|
1288
1289
|
.md-footer-nav__link { width: 20rem;}
|
|
1289
1290
|
.md-content { margin-left: 20rem; max-width: calc(100% - 20rem * 2 - 3rem); }
|
|
1290
1291
|
.md-typeset { font-size: 1rem; }
|
|
1292
|
+
.md-typeset h1, .md-typeset h2, .md-typeset h3 { font-weight: bold; }
|
|
1291
1293
|
.md-nav { font-size: 1rem; }
|
|
1292
1294
|
.md-grid { max-width: 90vw; margin: 0 }
|
|
1293
1295
|
.md-typeset table:not([class]) {
|
|
@@ -1460,12 +1462,12 @@ const TheReader = ({
|
|
|
1460
1462
|
shadowRoot.appendChild(dom);
|
|
1461
1463
|
onReadyRef.current();
|
|
1462
1464
|
}, [dom]);
|
|
1463
|
-
return /* @__PURE__ */
|
|
1465
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(TechDocsStateIndicator, null), withSearch && ((_b = (_a = shadowDomRef == null ? void 0 : shadowDomRef.current) == null ? void 0 : _a.shadowRoot) == null ? void 0 : _b.innerHTML) && /* @__PURE__ */ React.createElement(Grid, {
|
|
1464
1466
|
container: true,
|
|
1465
1467
|
className: classes.searchBar
|
|
1466
|
-
}, /* @__PURE__ */
|
|
1468
|
+
}, /* @__PURE__ */ React.createElement(TechDocsSearch, {
|
|
1467
1469
|
entityId: entityRef
|
|
1468
|
-
})), /* @__PURE__ */
|
|
1470
|
+
})), /* @__PURE__ */ React.createElement("div", {
|
|
1469
1471
|
"data-testid": "techdocs-content-shadowroot",
|
|
1470
1472
|
ref: shadowDomRef
|
|
1471
1473
|
}));
|
|
@@ -1475,7 +1477,7 @@ const Reader = ({
|
|
|
1475
1477
|
onReady = () => {
|
|
1476
1478
|
},
|
|
1477
1479
|
withSearch = true
|
|
1478
|
-
}) => /* @__PURE__ */
|
|
1480
|
+
}) => /* @__PURE__ */ React.createElement(TechDocsReaderProvider, null, /* @__PURE__ */ React.createElement(TheReader, {
|
|
1479
1481
|
entityRef,
|
|
1480
1482
|
onReady,
|
|
1481
1483
|
withSearch
|
|
@@ -1492,34 +1494,34 @@ const TechDocsPageHeader = ({
|
|
|
1492
1494
|
const lifecycle = spec == null ? void 0 : spec.lifecycle;
|
|
1493
1495
|
const ownedByRelations = entityMetadata ? getEntityRelations(entityMetadata, RELATION_OWNED_BY) : [];
|
|
1494
1496
|
const docsRootLink = useRouteRef(rootRouteRef)();
|
|
1495
|
-
const labels = /* @__PURE__ */
|
|
1497
|
+
const labels = /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(HeaderLabel, {
|
|
1496
1498
|
label: "Component",
|
|
1497
|
-
value: /* @__PURE__ */
|
|
1499
|
+
value: /* @__PURE__ */ React.createElement(EntityRefLink, {
|
|
1498
1500
|
color: "inherit",
|
|
1499
1501
|
entityRef,
|
|
1500
1502
|
defaultKind: "Component"
|
|
1501
1503
|
})
|
|
1502
|
-
}), ownedByRelations.length > 0 && /* @__PURE__ */
|
|
1504
|
+
}), ownedByRelations.length > 0 && /* @__PURE__ */ React.createElement(HeaderLabel, {
|
|
1503
1505
|
label: "Owner",
|
|
1504
|
-
value: /* @__PURE__ */
|
|
1506
|
+
value: /* @__PURE__ */ React.createElement(EntityRefLinks, {
|
|
1505
1507
|
color: "inherit",
|
|
1506
1508
|
entityRefs: ownedByRelations,
|
|
1507
1509
|
defaultKind: "group"
|
|
1508
1510
|
})
|
|
1509
|
-
}), lifecycle ? /* @__PURE__ */
|
|
1511
|
+
}), lifecycle ? /* @__PURE__ */ React.createElement(HeaderLabel, {
|
|
1510
1512
|
label: "Lifecycle",
|
|
1511
1513
|
value: lifecycle
|
|
1512
|
-
}) : null, locationMetadata && locationMetadata.type !== "dir" && locationMetadata.type !== "file" ? /* @__PURE__ */
|
|
1514
|
+
}) : null, locationMetadata && locationMetadata.type !== "dir" && locationMetadata.type !== "file" ? /* @__PURE__ */ React.createElement(HeaderLabel, {
|
|
1513
1515
|
label: "",
|
|
1514
|
-
value: /* @__PURE__ */
|
|
1516
|
+
value: /* @__PURE__ */ React.createElement("a", {
|
|
1515
1517
|
href: locationMetadata.target,
|
|
1516
1518
|
target: "_blank",
|
|
1517
1519
|
rel: "noopener noreferrer"
|
|
1518
|
-
}, /* @__PURE__ */
|
|
1520
|
+
}, /* @__PURE__ */ React.createElement(CodeIcon, {
|
|
1519
1521
|
style: {marginTop: "-25px", fill: "#fff"}
|
|
1520
1522
|
}))
|
|
1521
1523
|
}) : null);
|
|
1522
|
-
return /* @__PURE__ */
|
|
1524
|
+
return /* @__PURE__ */ React.createElement(Header, {
|
|
1523
1525
|
title: siteName ? siteName : ".",
|
|
1524
1526
|
pageTitleOverride: siteName || name,
|
|
1525
1527
|
subtitle: siteDescription && siteDescription !== "None" ? siteDescription : "",
|
|
@@ -1545,13 +1547,13 @@ const LegacyTechDocsPage = () => {
|
|
|
1545
1547
|
setDocumentReady(true);
|
|
1546
1548
|
}, [setDocumentReady]);
|
|
1547
1549
|
if (entityMetadataError) {
|
|
1548
|
-
return /* @__PURE__ */
|
|
1550
|
+
return /* @__PURE__ */ React.createElement(TechDocsNotFound, {
|
|
1549
1551
|
errorMessage: entityMetadataError.message
|
|
1550
1552
|
});
|
|
1551
1553
|
}
|
|
1552
|
-
return /* @__PURE__ */
|
|
1554
|
+
return /* @__PURE__ */ React.createElement(Page, {
|
|
1553
1555
|
themeId: "documentation"
|
|
1554
|
-
}, /* @__PURE__ */
|
|
1556
|
+
}, /* @__PURE__ */ React.createElement(TechDocsPageHeader, {
|
|
1555
1557
|
techDocsMetadata: techdocsMetadataValue,
|
|
1556
1558
|
entityMetadata: entityMetadataValue,
|
|
1557
1559
|
entityRef: {
|
|
@@ -1559,9 +1561,9 @@ const LegacyTechDocsPage = () => {
|
|
|
1559
1561
|
namespace,
|
|
1560
1562
|
name
|
|
1561
1563
|
}
|
|
1562
|
-
}), /* @__PURE__ */
|
|
1564
|
+
}), /* @__PURE__ */ React.createElement(Content, {
|
|
1563
1565
|
"data-testid": "techdocs-content"
|
|
1564
|
-
}, /* @__PURE__ */
|
|
1566
|
+
}, /* @__PURE__ */ React.createElement(Reader, {
|
|
1565
1567
|
onReady,
|
|
1566
1568
|
entityRef: {
|
|
1567
1569
|
kind,
|
|
@@ -1589,13 +1591,13 @@ const TechDocsPage = ({children}) => {
|
|
|
1589
1591
|
setDocumentReady(true);
|
|
1590
1592
|
}, [setDocumentReady]);
|
|
1591
1593
|
if (entityMetadataError) {
|
|
1592
|
-
return /* @__PURE__ */
|
|
1594
|
+
return /* @__PURE__ */ React.createElement(TechDocsNotFound, {
|
|
1593
1595
|
errorMessage: entityMetadataError.message
|
|
1594
1596
|
});
|
|
1595
1597
|
}
|
|
1596
1598
|
if (!children)
|
|
1597
|
-
return outlet || /* @__PURE__ */
|
|
1598
|
-
return /* @__PURE__ */
|
|
1599
|
+
return outlet || /* @__PURE__ */ React.createElement(LegacyTechDocsPage, null);
|
|
1600
|
+
return /* @__PURE__ */ React.createElement(Page, {
|
|
1599
1601
|
themeId: "documentation"
|
|
1600
1602
|
}, children instanceof Function ? children({
|
|
1601
1603
|
techdocsMetadataValue,
|
|
@@ -1637,12 +1639,12 @@ const CustomPanel = ({
|
|
|
1637
1639
|
}
|
|
1638
1640
|
return typeof config.filterPredicate === "function" && config.filterPredicate(entity);
|
|
1639
1641
|
});
|
|
1640
|
-
return /* @__PURE__ */
|
|
1642
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ContentHeader, {
|
|
1641
1643
|
title: config.title,
|
|
1642
1644
|
description: config.description
|
|
1643
|
-
}, index === 0 ? /* @__PURE__ */
|
|
1645
|
+
}, index === 0 ? /* @__PURE__ */ React.createElement(SupportButton, null, "Discover documentation in your ecosystem.") : null), /* @__PURE__ */ React.createElement("div", {
|
|
1644
1646
|
className: classes.panelContainer
|
|
1645
|
-
}, /* @__PURE__ */
|
|
1647
|
+
}, /* @__PURE__ */ React.createElement(Panel, {
|
|
1646
1648
|
"data-testid": "techdocs-custom-panel",
|
|
1647
1649
|
entities: shownEntities
|
|
1648
1650
|
})));
|
|
@@ -1677,27 +1679,27 @@ const TechDocsCustomHome = ({
|
|
|
1677
1679
|
});
|
|
1678
1680
|
const currentTabConfig = tabsConfig[selectedTab];
|
|
1679
1681
|
if (loading) {
|
|
1680
|
-
return /* @__PURE__ */
|
|
1682
|
+
return /* @__PURE__ */ React.createElement(TechDocsPageWrapper, null, /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(Progress, null)));
|
|
1681
1683
|
}
|
|
1682
1684
|
if (error) {
|
|
1683
|
-
return /* @__PURE__ */
|
|
1685
|
+
return /* @__PURE__ */ React.createElement(TechDocsPageWrapper, null, /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(WarningPanel, {
|
|
1684
1686
|
severity: "error",
|
|
1685
1687
|
title: "Could not load available documentation."
|
|
1686
|
-
}, /* @__PURE__ */
|
|
1688
|
+
}, /* @__PURE__ */ React.createElement(CodeSnippet, {
|
|
1687
1689
|
language: "text",
|
|
1688
1690
|
text: error.toString()
|
|
1689
1691
|
}))));
|
|
1690
1692
|
}
|
|
1691
|
-
return /* @__PURE__ */
|
|
1693
|
+
return /* @__PURE__ */ React.createElement(TechDocsPageWrapper, null, /* @__PURE__ */ React.createElement(HeaderTabs, {
|
|
1692
1694
|
selectedIndex: selectedTab,
|
|
1693
1695
|
onChange: (index) => setSelectedTab(index),
|
|
1694
1696
|
tabs: tabsConfig.map(({label}, index) => ({
|
|
1695
1697
|
id: index.toString(),
|
|
1696
1698
|
label
|
|
1697
1699
|
}))
|
|
1698
|
-
}), /* @__PURE__ */
|
|
1700
|
+
}), /* @__PURE__ */ React.createElement(Content, {
|
|
1699
1701
|
"data-testid": "techdocs-content"
|
|
1700
|
-
}, currentTabConfig.panels.map((config, index) => /* @__PURE__ */
|
|
1702
|
+
}, currentTabConfig.panels.map((config, index) => /* @__PURE__ */ React.createElement(CustomPanel, {
|
|
1701
1703
|
key: index,
|
|
1702
1704
|
config,
|
|
1703
1705
|
entities: !!entities ? entities : [],
|
|
@@ -1735,14 +1737,14 @@ const LegacyTechDocsHome = () => {
|
|
|
1735
1737
|
]
|
|
1736
1738
|
}
|
|
1737
1739
|
];
|
|
1738
|
-
return /* @__PURE__ */
|
|
1740
|
+
return /* @__PURE__ */ React.createElement(TechDocsCustomHome, {
|
|
1739
1741
|
tabsConfig
|
|
1740
1742
|
});
|
|
1741
1743
|
};
|
|
1742
1744
|
|
|
1743
1745
|
const TechDocsIndexPage = () => {
|
|
1744
1746
|
const outlet = useOutlet();
|
|
1745
|
-
return outlet || /* @__PURE__ */
|
|
1747
|
+
return outlet || /* @__PURE__ */ React.createElement(LegacyTechDocsHome, null);
|
|
1746
1748
|
};
|
|
1747
1749
|
|
|
1748
1750
|
var TechDocsIndexPage$1 = /*#__PURE__*/Object.freeze({
|
|
@@ -1752,7 +1754,7 @@ var TechDocsIndexPage$1 = /*#__PURE__*/Object.freeze({
|
|
|
1752
1754
|
|
|
1753
1755
|
const EntityPageDocs = ({entity}) => {
|
|
1754
1756
|
var _a;
|
|
1755
|
-
return /* @__PURE__ */
|
|
1757
|
+
return /* @__PURE__ */ React.createElement(Reader, {
|
|
1756
1758
|
withSearch: false,
|
|
1757
1759
|
entityRef: {
|
|
1758
1760
|
kind: entity.kind,
|
|
@@ -1768,12 +1770,12 @@ const isTechDocsAvailable = (entity) => {
|
|
|
1768
1770
|
return Boolean((_b = (_a = entity == null ? void 0 : entity.metadata) == null ? void 0 : _a.annotations) == null ? void 0 : _b[TECHDOCS_ANNOTATION]);
|
|
1769
1771
|
};
|
|
1770
1772
|
const Router = () => {
|
|
1771
|
-
return /* @__PURE__ */
|
|
1773
|
+
return /* @__PURE__ */ React.createElement(Routes, null, /* @__PURE__ */ React.createElement(Route, {
|
|
1772
1774
|
path: "/",
|
|
1773
|
-
element: /* @__PURE__ */
|
|
1774
|
-
}), /* @__PURE__ */
|
|
1775
|
+
element: /* @__PURE__ */ React.createElement(TechDocsIndexPage, null)
|
|
1776
|
+
}), /* @__PURE__ */ React.createElement(Route, {
|
|
1775
1777
|
path: "/:namespace/:kind/:name/*",
|
|
1776
|
-
element: /* @__PURE__ */
|
|
1778
|
+
element: /* @__PURE__ */ React.createElement(TechDocsPage, null)
|
|
1777
1779
|
}));
|
|
1778
1780
|
};
|
|
1779
1781
|
const EmbeddedDocsRouter = (_props) => {
|
|
@@ -1781,13 +1783,13 @@ const EmbeddedDocsRouter = (_props) => {
|
|
|
1781
1783
|
const {entity} = useEntity();
|
|
1782
1784
|
const projectId = (_a = entity.metadata.annotations) == null ? void 0 : _a[TECHDOCS_ANNOTATION];
|
|
1783
1785
|
if (!projectId) {
|
|
1784
|
-
return /* @__PURE__ */
|
|
1786
|
+
return /* @__PURE__ */ React.createElement(MissingAnnotationEmptyState, {
|
|
1785
1787
|
annotation: TECHDOCS_ANNOTATION
|
|
1786
1788
|
});
|
|
1787
1789
|
}
|
|
1788
|
-
return /* @__PURE__ */
|
|
1790
|
+
return /* @__PURE__ */ React.createElement(Routes, null, /* @__PURE__ */ React.createElement(Route, {
|
|
1789
1791
|
path: "/*",
|
|
1790
|
-
element: /* @__PURE__ */
|
|
1792
|
+
element: /* @__PURE__ */ React.createElement(EntityPageDocs, {
|
|
1791
1793
|
entity
|
|
1792
1794
|
})
|
|
1793
1795
|
}));
|