@backstage/plugin-techdocs 1.12.1-next.0 → 1.12.1
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 +46 -0
- package/dist/Router.esm.js +7 -4
- package/dist/Router.esm.js.map +1 -1
- package/dist/index.d.ts +6 -4
- package/package.json +22 -22
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,51 @@
|
|
|
1
1
|
# @backstage/plugin-techdocs
|
|
2
2
|
|
|
3
|
+
## 1.12.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3710b35: Allow passing down `withSearch` prop to `EntityTechdocsContent` component since it was `true` by default, now user can use the `EntityTechdocsContent` component _without_ showing the search field on top of the content.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/plugin-catalog-react@1.15.1
|
|
10
|
+
- @backstage/frontend-plugin-api@0.9.4
|
|
11
|
+
- @backstage/core-plugin-api@1.10.3
|
|
12
|
+
- @backstage/core-components@0.16.3
|
|
13
|
+
- @backstage/integration@1.16.1
|
|
14
|
+
- @backstage/catalog-model@1.7.3
|
|
15
|
+
- @backstage/config@1.3.2
|
|
16
|
+
- @backstage/core-compat-api@0.3.5
|
|
17
|
+
- @backstage/errors@1.2.7
|
|
18
|
+
- @backstage/integration-react@1.2.3
|
|
19
|
+
- @backstage/theme@0.6.3
|
|
20
|
+
- @backstage/plugin-auth-react@0.1.11
|
|
21
|
+
- @backstage/plugin-search-common@1.2.17
|
|
22
|
+
- @backstage/plugin-search-react@1.8.5
|
|
23
|
+
- @backstage/plugin-techdocs-common@0.1.0
|
|
24
|
+
- @backstage/plugin-techdocs-react@1.2.13
|
|
25
|
+
|
|
26
|
+
## 1.12.1-next.1
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- 3710b35: Allow passing down `withSearch` prop to `EntityTechdocsContent` component since it was `true` by default, now user can use the `EntityTechdocsContent` component _without_ showing the search field on top of the content.
|
|
31
|
+
- Updated dependencies
|
|
32
|
+
- @backstage/frontend-plugin-api@0.9.4-next.0
|
|
33
|
+
- @backstage/core-plugin-api@1.10.3-next.0
|
|
34
|
+
- @backstage/core-compat-api@0.3.5-next.0
|
|
35
|
+
- @backstage/plugin-catalog-react@1.15.1-next.1
|
|
36
|
+
- @backstage/plugin-search-react@1.8.5-next.0
|
|
37
|
+
- @backstage/core-components@0.16.3-next.0
|
|
38
|
+
- @backstage/integration-react@1.2.3-next.0
|
|
39
|
+
- @backstage/plugin-auth-react@0.1.11-next.0
|
|
40
|
+
- @backstage/plugin-techdocs-react@1.2.13-next.0
|
|
41
|
+
- @backstage/catalog-model@1.7.3-next.0
|
|
42
|
+
- @backstage/config@1.3.2-next.0
|
|
43
|
+
- @backstage/errors@1.2.7-next.0
|
|
44
|
+
- @backstage/plugin-search-common@1.2.17-next.0
|
|
45
|
+
- @backstage/integration@1.16.1-next.0
|
|
46
|
+
- @backstage/theme@0.6.3
|
|
47
|
+
- @backstage/plugin-techdocs-common@0.1.0
|
|
48
|
+
|
|
3
49
|
## 1.12.1-next.0
|
|
4
50
|
|
|
5
51
|
### Patch Changes
|
package/dist/Router.esm.js
CHANGED
|
@@ -17,12 +17,12 @@ const Router = () => {
|
|
|
17
17
|
));
|
|
18
18
|
};
|
|
19
19
|
const EmbeddedDocsRouter = (props) => {
|
|
20
|
-
const { children, emptyState } = props;
|
|
20
|
+
const { children, emptyState, withSearch = true } = props;
|
|
21
21
|
const { entity } = useEntity();
|
|
22
22
|
const element = useRoutes([
|
|
23
23
|
{
|
|
24
24
|
path: "/*",
|
|
25
|
-
element: /* @__PURE__ */ React.createElement(EntityPageDocs, { entity }),
|
|
25
|
+
element: /* @__PURE__ */ React.createElement(EntityPageDocs, { entity, withSearch }),
|
|
26
26
|
children: [
|
|
27
27
|
{
|
|
28
28
|
path: "*",
|
|
@@ -37,8 +37,11 @@ const EmbeddedDocsRouter = (props) => {
|
|
|
37
37
|
}
|
|
38
38
|
return element;
|
|
39
39
|
};
|
|
40
|
-
const LegacyEmbeddedDocsRouter = (
|
|
41
|
-
|
|
40
|
+
const LegacyEmbeddedDocsRouter = ({
|
|
41
|
+
children,
|
|
42
|
+
withSearch = true
|
|
43
|
+
}) => {
|
|
44
|
+
return /* @__PURE__ */ React.createElement(EmbeddedDocsRouter, { children, withSearch });
|
|
42
45
|
};
|
|
43
46
|
|
|
44
47
|
export { EmbeddedDocsRouter, LegacyEmbeddedDocsRouter, Router, isTechDocsAvailable };
|
package/dist/Router.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Router.esm.js","sources":["../src/Router.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { PropsWithChildren } from 'react';\nimport { Route, Routes, useRoutes } from 'react-router-dom';\n\nimport { Entity } from '@backstage/catalog-model';\nimport { EntityPageDocs } from './EntityPageDocs';\nimport { TechDocsIndexPage } from './home/components/TechDocsIndexPage';\nimport { TechDocsReaderPage } from './reader/components/TechDocsReaderPage';\nimport {\n useEntity,\n MissingAnnotationEmptyState,\n} from '@backstage/plugin-catalog-react';\nimport {\n TECHDOCS_ANNOTATION,\n TECHDOCS_EXTERNAL_ANNOTATION,\n} from '@backstage/plugin-techdocs-common';\n\n/**\n * Helper that takes in entity and returns true/false if TechDocs is available for the entity\n *\n * @public\n */\nexport const isTechDocsAvailable = (entity: Entity) =>\n Boolean(entity?.metadata?.annotations?.[TECHDOCS_ANNOTATION]) ||\n Boolean(entity?.metadata?.annotations?.[TECHDOCS_EXTERNAL_ANNOTATION]);\n\n/**\n * Responsible for registering routes for TechDocs, TechDocs Homepage and separate TechDocs page\n *\n * @public\n */\nexport const Router = () => {\n return (\n <Routes>\n <Route path=\"/\" element={<TechDocsIndexPage />} />\n <Route\n path=\"/:namespace/:kind/:name/*\"\n element={<TechDocsReaderPage />}\n />\n </Routes>\n );\n};\n\nexport const EmbeddedDocsRouter = (\n props: PropsWithChildren<{
|
|
1
|
+
{"version":3,"file":"Router.esm.js","sources":["../src/Router.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { PropsWithChildren } from 'react';\nimport { Route, Routes, useRoutes } from 'react-router-dom';\n\nimport { Entity } from '@backstage/catalog-model';\nimport { EntityPageDocs } from './EntityPageDocs';\nimport { TechDocsIndexPage } from './home/components/TechDocsIndexPage';\nimport { TechDocsReaderPage } from './reader/components/TechDocsReaderPage';\nimport {\n useEntity,\n MissingAnnotationEmptyState,\n} from '@backstage/plugin-catalog-react';\nimport {\n TECHDOCS_ANNOTATION,\n TECHDOCS_EXTERNAL_ANNOTATION,\n} from '@backstage/plugin-techdocs-common';\n\n/**\n * Helper that takes in entity and returns true/false if TechDocs is available for the entity\n *\n * @public\n */\nexport const isTechDocsAvailable = (entity: Entity) =>\n Boolean(entity?.metadata?.annotations?.[TECHDOCS_ANNOTATION]) ||\n Boolean(entity?.metadata?.annotations?.[TECHDOCS_EXTERNAL_ANNOTATION]);\n\n/**\n * Responsible for registering routes for TechDocs, TechDocs Homepage and separate TechDocs page\n *\n * @public\n */\nexport const Router = () => {\n return (\n <Routes>\n <Route path=\"/\" element={<TechDocsIndexPage />} />\n <Route\n path=\"/:namespace/:kind/:name/*\"\n element={<TechDocsReaderPage />}\n />\n </Routes>\n );\n};\n\nexport const EmbeddedDocsRouter = (\n props: PropsWithChildren<{\n emptyState?: React.ReactElement;\n withSearch?: boolean;\n }>,\n) => {\n const { children, emptyState, withSearch = true } = props;\n const { entity } = useEntity();\n\n // Using objects instead of <Route> elements, otherwise \"outlet\" will be null on sub-pages and add-ons won't render\n const element = useRoutes([\n {\n path: '/*',\n element: <EntityPageDocs entity={entity} withSearch={withSearch} />,\n children: [\n {\n path: '*',\n element: children,\n },\n ],\n },\n ]);\n\n const projectId =\n entity.metadata.annotations?.[TECHDOCS_ANNOTATION] ||\n entity.metadata.annotations?.[TECHDOCS_EXTERNAL_ANNOTATION];\n\n if (!projectId) {\n return (\n emptyState ?? (\n <MissingAnnotationEmptyState annotation={[TECHDOCS_ANNOTATION]} />\n )\n );\n }\n\n return element;\n};\n\n/**\n * Responsible for registering route to view docs on Entity page\n *\n * @public\n */\nexport const LegacyEmbeddedDocsRouter = ({\n children,\n withSearch = true,\n}: PropsWithChildren<{ withSearch?: boolean }>) => {\n // Wrap the Router to avoid exposing the emptyState prop in the non-alpha\n // public API and make it easier for us to change later.\n return <EmbeddedDocsRouter children={children} withSearch={withSearch} />;\n};\n"],"names":[],"mappings":";;;;;;;;AAqCO,MAAM,mBAAsB,GAAA,CAAC,MAClC,KAAA,OAAA,CAAQ,QAAQ,QAAU,EAAA,WAAA,GAAc,mBAAmB,CAAC,KAC5D,OAAQ,CAAA,MAAA,EAAQ,QAAU,EAAA,WAAA,GAAc,4BAA4B,CAAC;AAOhE,MAAM,SAAS,MAAM;AAC1B,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,MACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,KAAM,EAAA,EAAA,IAAA,EAAK,KAAI,OAAS,kBAAA,KAAA,CAAA,aAAA,CAAC,iBAA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Page: () => React.JSX.Element;
|
|
|
588
588
|
*
|
|
589
589
|
* @public
|
|
590
590
|
*/
|
|
591
|
-
declare const EntityTechdocsContent: (
|
|
592
|
-
|
|
593
|
-
}) => React.JSX.Element;
|
|
591
|
+
declare const EntityTechdocsContent: ({ children, withSearch, }: React.PropsWithChildren<{
|
|
592
|
+
withSearch?: boolean | undefined;
|
|
593
|
+
}>) => React.JSX.Element;
|
|
594
594
|
/**
|
|
595
595
|
* Component which takes a custom tabs config object and renders a documentation landing page.
|
|
596
596
|
*
|
|
@@ -633,7 +633,9 @@ declare const Router: () => React__default.JSX.Element;
|
|
|
633
633
|
*
|
|
634
634
|
* @public
|
|
635
635
|
*/
|
|
636
|
-
declare const LegacyEmbeddedDocsRouter: (
|
|
636
|
+
declare const LegacyEmbeddedDocsRouter: ({ children, withSearch, }: React__default.PropsWithChildren<{
|
|
637
|
+
withSearch?: boolean | undefined;
|
|
638
|
+
}>) => React__default.JSX.Element;
|
|
637
639
|
|
|
638
640
|
/**
|
|
639
641
|
* The Backstage plugin that renders technical documentation for your components
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-techdocs",
|
|
3
|
-
"version": "1.12.1
|
|
3
|
+
"version": "1.12.1",
|
|
4
4
|
"description": "The Backstage plugin that renders technical documentation for your components",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "frontend-plugin",
|
|
@@ -68,22 +68,22 @@
|
|
|
68
68
|
"test": "backstage-cli package test"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@backstage/catalog-model": "1.7.
|
|
72
|
-
"@backstage/config": "1.3.
|
|
73
|
-
"@backstage/core-compat-api": "0.3.
|
|
74
|
-
"@backstage/core-components": "0.16.
|
|
75
|
-
"@backstage/core-plugin-api": "1.10.
|
|
76
|
-
"@backstage/errors": "1.2.
|
|
77
|
-
"@backstage/frontend-plugin-api": "0.9.
|
|
78
|
-
"@backstage/integration": "1.16.
|
|
79
|
-
"@backstage/integration-react": "1.2.
|
|
80
|
-
"@backstage/plugin-auth-react": "0.1.
|
|
81
|
-
"@backstage/plugin-catalog-react": "1.15.1
|
|
82
|
-
"@backstage/plugin-search-common": "1.2.
|
|
83
|
-
"@backstage/plugin-search-react": "1.8.
|
|
84
|
-
"@backstage/plugin-techdocs-common": "0.1.0",
|
|
85
|
-
"@backstage/plugin-techdocs-react": "1.2.
|
|
86
|
-
"@backstage/theme": "0.6.3",
|
|
71
|
+
"@backstage/catalog-model": "^1.7.3",
|
|
72
|
+
"@backstage/config": "^1.3.2",
|
|
73
|
+
"@backstage/core-compat-api": "^0.3.5",
|
|
74
|
+
"@backstage/core-components": "^0.16.3",
|
|
75
|
+
"@backstage/core-plugin-api": "^1.10.3",
|
|
76
|
+
"@backstage/errors": "^1.2.7",
|
|
77
|
+
"@backstage/frontend-plugin-api": "^0.9.4",
|
|
78
|
+
"@backstage/integration": "^1.16.1",
|
|
79
|
+
"@backstage/integration-react": "^1.2.3",
|
|
80
|
+
"@backstage/plugin-auth-react": "^0.1.11",
|
|
81
|
+
"@backstage/plugin-catalog-react": "^1.15.1",
|
|
82
|
+
"@backstage/plugin-search-common": "^1.2.17",
|
|
83
|
+
"@backstage/plugin-search-react": "^1.8.5",
|
|
84
|
+
"@backstage/plugin-techdocs-common": "^0.1.0",
|
|
85
|
+
"@backstage/plugin-techdocs-react": "^1.2.13",
|
|
86
|
+
"@backstage/theme": "^0.6.3",
|
|
87
87
|
"@material-ui/core": "^4.12.2",
|
|
88
88
|
"@material-ui/icons": "^4.9.1",
|
|
89
89
|
"@material-ui/lab": "4.0.0-alpha.61",
|
|
@@ -97,11 +97,11 @@
|
|
|
97
97
|
"react-use": "^17.2.4"
|
|
98
98
|
},
|
|
99
99
|
"devDependencies": {
|
|
100
|
-
"@backstage/cli": "0.29.5
|
|
101
|
-
"@backstage/core-app-api": "1.15.
|
|
102
|
-
"@backstage/dev-utils": "1.1.6
|
|
103
|
-
"@backstage/plugin-techdocs-module-addons-contrib": "1.1.20
|
|
104
|
-
"@backstage/test-utils": "1.7.
|
|
100
|
+
"@backstage/cli": "^0.29.5",
|
|
101
|
+
"@backstage/core-app-api": "^1.15.4",
|
|
102
|
+
"@backstage/dev-utils": "^1.1.6",
|
|
103
|
+
"@backstage/plugin-techdocs-module-addons-contrib": "^1.1.20",
|
|
104
|
+
"@backstage/test-utils": "^1.7.4",
|
|
105
105
|
"@testing-library/dom": "^10.0.0",
|
|
106
106
|
"@testing-library/jest-dom": "^6.0.0",
|
|
107
107
|
"@testing-library/react": "^16.0.0",
|