@backstage/plugin-app-visualizer 0.1.24-next.0 → 0.1.24-next.2
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
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @backstage/plugin-app-visualizer
|
|
2
2
|
|
|
3
|
+
## 0.1.24-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 4406144: Ensure that the text rendering has react keys for all elements
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/core-components@0.18.2-next.3
|
|
10
|
+
- @backstage/frontend-plugin-api@0.12.1-next.2
|
|
11
|
+
|
|
12
|
+
## 0.1.24-next.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
- @backstage/core-components@0.18.2-next.1
|
|
18
|
+
- @backstage/core-plugin-api@1.11.1-next.0
|
|
19
|
+
- @backstage/frontend-plugin-api@0.12.1-next.1
|
|
20
|
+
|
|
3
21
|
## 0.1.24-next.0
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -30,15 +30,15 @@ function nodeToText(node, options) {
|
|
|
30
30
|
...[...node.edges.attachments.entries()].sort(([a], [b]) => a.localeCompare(b)).map(([key, v]) => {
|
|
31
31
|
const children = v.filter((e) => options?.showDisabled || e.instance).sort((a, b) => a.spec.id.localeCompare(b.spec.id));
|
|
32
32
|
if (children.length === 0) {
|
|
33
|
-
return mkDiv(`${key} []`, { indent: true });
|
|
33
|
+
return mkDiv(`${key} []`, { key, indent: true });
|
|
34
34
|
}
|
|
35
35
|
return mkDiv(
|
|
36
36
|
[
|
|
37
|
-
mkDiv(`${key} [
|
|
37
|
+
mkDiv(`${key} [`, { key: "start" }),
|
|
38
38
|
...children.map(
|
|
39
|
-
(e) => mkDiv(nodeToText(e, options), { indent: true })
|
|
39
|
+
(e) => mkDiv(nodeToText(e, options), { indent: true, key: e.spec.id })
|
|
40
40
|
),
|
|
41
|
-
mkDiv("]")
|
|
41
|
+
mkDiv("]", { key: "end" })
|
|
42
42
|
],
|
|
43
43
|
{ key, indent: true }
|
|
44
44
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextVisualizer.esm.js","sources":["../../../src/components/AppVisualizerPage/TextVisualizer.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 { AppNode, AppTree } from '@backstage/frontend-plugin-api';\nimport Box from '@material-ui/core/Box';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport Paper from '@material-ui/core/Paper';\nimport { ReactNode, useState } from 'react';\n\nfunction mkDiv(\n children: ReactNode,\n options?: { indent?: boolean; key?: string | number; color?: string },\n) {\n return (\n <div\n key={options?.key}\n style={{\n color: options?.color,\n marginLeft: options?.indent ? 16 : undefined,\n }}\n >\n {children}\n </div>\n );\n}\n\nfunction nodeToText(\n node: AppNode,\n options?: { showOutputs?: boolean; showDisabled?: boolean },\n): ReactNode {\n const dataRefIds =\n node.instance && [...node.instance.getDataRefs()].map(r => r.id);\n const out =\n options?.showOutputs && dataRefIds && dataRefIds.length > 0\n ? ` out=\"${[...dataRefIds].sort().join(', ')}\"`\n : '';\n const color = node.instance ? undefined : 'gray';\n\n if (node.edges.attachments.size === 0) {\n return mkDiv(`<${node.spec.id}${out}/>`, { color });\n }\n\n return mkDiv([\n mkDiv(`<${node.spec.id}${out}>`, { key: 'start', color }),\n ...[...node.edges.attachments.entries()]\n .sort(([a], [b]) => a.localeCompare(b))\n .map(([key, v]) => {\n const children = v\n .filter(e => options?.showDisabled || e.instance)\n .sort((a, b) => a.spec.id.localeCompare(b.spec.id));\n if (children.length === 0) {\n return mkDiv(`${key} []`, { indent: true });\n }\n return mkDiv(\n [\n mkDiv(`${key} [
|
|
1
|
+
{"version":3,"file":"TextVisualizer.esm.js","sources":["../../../src/components/AppVisualizerPage/TextVisualizer.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 { AppNode, AppTree } from '@backstage/frontend-plugin-api';\nimport Box from '@material-ui/core/Box';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport Paper from '@material-ui/core/Paper';\nimport { ReactNode, useState } from 'react';\n\nfunction mkDiv(\n children: ReactNode,\n options?: { indent?: boolean; key?: string | number; color?: string },\n) {\n return (\n <div\n key={options?.key}\n style={{\n color: options?.color,\n marginLeft: options?.indent ? 16 : undefined,\n }}\n >\n {children}\n </div>\n );\n}\n\nfunction nodeToText(\n node: AppNode,\n options?: { showOutputs?: boolean; showDisabled?: boolean },\n): ReactNode {\n const dataRefIds =\n node.instance && [...node.instance.getDataRefs()].map(r => r.id);\n const out =\n options?.showOutputs && dataRefIds && dataRefIds.length > 0\n ? ` out=\"${[...dataRefIds].sort().join(', ')}\"`\n : '';\n const color = node.instance ? undefined : 'gray';\n\n if (node.edges.attachments.size === 0) {\n return mkDiv(`<${node.spec.id}${out}/>`, { color });\n }\n\n return mkDiv([\n mkDiv(`<${node.spec.id}${out}>`, { key: 'start', color }),\n ...[...node.edges.attachments.entries()]\n .sort(([a], [b]) => a.localeCompare(b))\n .map(([key, v]) => {\n const children = v\n .filter(e => options?.showDisabled || e.instance)\n .sort((a, b) => a.spec.id.localeCompare(b.spec.id));\n if (children.length === 0) {\n return mkDiv(`${key} []`, { key, indent: true });\n }\n return mkDiv(\n [\n mkDiv(`${key} [`, { key: 'start' }),\n ...children.map(e =>\n mkDiv(nodeToText(e, options), { indent: true, key: e.spec.id }),\n ),\n mkDiv(']', { key: 'end' }),\n ],\n { key, indent: true },\n );\n }),\n mkDiv(`</${node.spec.id}>`, { key: 'end', color }),\n ]);\n}\n\nexport function TextVisualizer({ tree }: { tree: AppTree }) {\n const [showOutputs, setShowOutputs] = useState(false);\n const [showDisabled, setShowDisabled] = useState(false);\n\n return (\n <>\n <Box style={{ overflow: 'auto', flex: '1 0 0' }}>\n <div style={{ margin: 16, width: 'max-content' }}>\n {nodeToText(tree.root, { showOutputs, showDisabled })}\n </div>\n </Box>\n <Paper style={{ padding: '8px 16px' }}>\n <FormControlLabel\n control={\n <Checkbox\n checked={showOutputs}\n onChange={(_, value) => setShowOutputs(value)}\n />\n }\n label=\"Show Outputs\"\n />\n <FormControlLabel\n control={\n <Checkbox\n checked={showDisabled}\n onChange={(_, value) => setShowDisabled(value)}\n />\n }\n label=\"Show Disabled\"\n />\n </Paper>\n </>\n );\n}\n"],"names":[],"mappings":";;;;;;;AAuBA,SAAS,KAAA,CACP,UACA,OAAA,EACA;AACA,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MAEC,KAAA,EAAO;AAAA,QACL,OAAO,OAAA,EAAS,KAAA;AAAA,QAChB,UAAA,EAAY,OAAA,EAAS,MAAA,GAAS,EAAA,GAAK;AAAA,OACrC;AAAA,MAEC;AAAA,KAAA;AAAA,IANI,OAAA,EAAS;AAAA,GAOhB;AAEJ;AAEA,SAAS,UAAA,CACP,MACA,OAAA,EACW;A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,EAAQ,MAAM,OAAA,EAAQ,EAC5C,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,KAAA,EAAO,EAAE,QAAQ,EAAA,EAAI,KAAA,EAAO,aAAA,EAAc,EAC5C,QAAA,EAAA,UAAA,CAAW,IAAA,CAAK,IAAA,EAAM,EAAE,WAAA,EAAa,YAAA,EAAc,CAAA,EACtD,CAAA,EACF,CAAA;AAAA,yBACC,KAAA,EAAA,EAAM,KAAA,EAAO,EAAE,OAAA,EAAS,YAAW,EAClC,QAAA,EAAA;AAAA,sBAAA,GAAA;AAAA,QAAC,gBAAA;AAAA,QAAA;AAAA,UACC,OAAA,kBACE,GAAA;AAAA,YAAC,QAAA;AAAA,YAAA;AAAA,cACC,OAAA,EAAS,WAAA;AAAA,cACT,QAAA,EAAU,CAAC,CAAA,EAAG,KAAA,KAAU,eAAe,KAAK;AAAA;AAAA,WAC9C;AAAA,UAEF,KAAA,EAAM;AAAA;AAAA,OACR;AAAA,sBACA,GAAA;AAAA,QAAC,gBAAA;AAAA,QAAA;AAAA,UACC,OAAA,kBACE,GAAA;AAAA,YAAC,QAAA;AAAA,YAAA;AAAA,cACC,OAAA,EAAS,YAAA;AAAA,cACT,QAAA,EAAU,CAAC,CAAA,EAAG,KAAA,KAAU,gBAAgB,KAAK;AAAA;AAAA,WAC/C;AAAA,UAEF,KAAA,EAAM;AAAA;AAAA;AACR,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
package/dist/package.json.esm.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-app-visualizer",
|
|
3
|
-
"version": "0.1.24-next.
|
|
3
|
+
"version": "0.1.24-next.2",
|
|
4
4
|
"description": "Visualizes the Backstage app structure",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "frontend-plugin",
|
|
@@ -37,15 +37,15 @@
|
|
|
37
37
|
"test": "backstage-cli package test"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@backstage/core-components": "0.18.2-next.
|
|
41
|
-
"@backstage/core-plugin-api": "1.11.0",
|
|
42
|
-
"@backstage/frontend-plugin-api": "0.12.1-next.
|
|
40
|
+
"@backstage/core-components": "0.18.2-next.3",
|
|
41
|
+
"@backstage/core-plugin-api": "1.11.1-next.0",
|
|
42
|
+
"@backstage/frontend-plugin-api": "0.12.1-next.2",
|
|
43
43
|
"@material-ui/core": "^4.12.2",
|
|
44
44
|
"@material-ui/icons": "^4.9.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@backstage/cli": "0.34.4-next.
|
|
48
|
-
"@backstage/frontend-defaults": "0.3.2-next.
|
|
47
|
+
"@backstage/cli": "0.34.4-next.3",
|
|
48
|
+
"@backstage/frontend-defaults": "0.3.2-next.1",
|
|
49
49
|
"@types/react": "^18.0.0",
|
|
50
50
|
"react": "^18.0.2",
|
|
51
51
|
"react-dom": "^18.0.2",
|