@backstage/plugin-config-schema 0.1.55 → 0.1.56-next.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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @backstage/plugin-config-schema
2
2
 
3
+ ## 0.1.56-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/core-components@0.14.8-next.0
9
+ - @backstage/core-plugin-api@1.9.2
10
+ - @backstage/errors@1.2.4
11
+ - @backstage/types@1.1.1
12
+
3
13
  ## 0.1.55
4
14
 
5
15
  ### Patch Changes
@@ -1,18 +1,11 @@
1
1
  import ObservableImpl from 'zen-observable';
2
2
  import { ResponseError } from '@backstage/errors';
3
3
 
4
- var __defProp = Object.defineProperty;
5
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __publicField = (obj, key, value) => {
7
- __defNormalProp(obj, key + "" , value);
8
- return value;
9
- };
10
4
  const DEFAULT_URL = "config-schema.json";
11
5
  class StaticSchemaLoader {
6
+ url;
12
7
  constructor(options = {}) {
13
- __publicField(this, "url");
14
- var _a;
15
- this.url = (_a = options == null ? void 0 : options.url) != null ? _a : DEFAULT_URL;
8
+ this.url = options?.url ?? DEFAULT_URL;
16
9
  }
17
10
  schema$() {
18
11
  return new ObservableImpl((subscriber) => {
@@ -1 +1 @@
1
- {"version":3,"file":"StaticSchemaLoader.esm.js","sources":["../../src/api/StaticSchemaLoader.ts"],"sourcesContent":["/*\n * Copyright 2021 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 ObservableImpl from 'zen-observable';\nimport { ResponseError } from '@backstage/errors';\nimport { Schema } from 'jsonschema';\nimport { ConfigSchemaApi, ConfigSchemaResult } from './types';\nimport { Observable } from '@backstage/types';\n\nconst DEFAULT_URL = 'config-schema.json';\n\n/**\n * A ConfigSchemaApi implementation that loads the configuration from a URL.\n *\n * @public\n */\nexport class StaticSchemaLoader implements ConfigSchemaApi {\n private readonly url: string;\n\n constructor(options: { url?: string } = {}) {\n this.url = options?.url ?? DEFAULT_URL;\n }\n\n schema$(): Observable<ConfigSchemaResult> {\n return new ObservableImpl(subscriber => {\n this.fetchSchema().then(\n schema => subscriber.next({ schema }),\n error => subscriber.error(error),\n );\n });\n }\n\n private async fetchSchema(): Promise<undefined | Schema> {\n const res = await fetch(this.url);\n\n if (!res.ok) {\n if (res.status === 404) {\n return undefined;\n }\n\n throw await ResponseError.fromResponse(res);\n }\n\n return await res.json();\n }\n}\n"],"names":[],"mappings":";;;;;;;;;AAsBA,MAAM,WAAc,GAAA,oBAAA,CAAA;AAOb,MAAM,kBAA8C,CAAA;AAAA,EAGzD,WAAA,CAAY,OAA4B,GAAA,EAAI,EAAA;AAF5C,IAAiB,aAAA,CAAA,IAAA,EAAA,KAAA,CAAA,CAAA;AA9BnB,IAAA,IAAA,EAAA,CAAA;AAiCI,IAAK,IAAA,CAAA,GAAA,GAAA,CAAM,EAAS,GAAA,OAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,OAAA,CAAA,GAAA,KAAT,IAAgB,GAAA,EAAA,GAAA,WAAA,CAAA;AAAA,GAC7B;AAAA,EAEA,OAA0C,GAAA;AACxC,IAAO,OAAA,IAAI,eAAe,CAAc,UAAA,KAAA;AACtC,MAAA,IAAA,CAAK,aAAc,CAAA,IAAA;AAAA,QACjB,CAAU,MAAA,KAAA,UAAA,CAAW,IAAK,CAAA,EAAE,QAAQ,CAAA;AAAA,QACpC,CAAA,KAAA,KAAS,UAAW,CAAA,KAAA,CAAM,KAAK,CAAA;AAAA,OACjC,CAAA;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AAAA,EAEA,MAAc,WAA2C,GAAA;AACvD,IAAA,MAAM,GAAM,GAAA,MAAM,KAAM,CAAA,IAAA,CAAK,GAAG,CAAA,CAAA;AAEhC,IAAI,IAAA,CAAC,IAAI,EAAI,EAAA;AACX,MAAI,IAAA,GAAA,CAAI,WAAW,GAAK,EAAA;AACtB,QAAO,OAAA,KAAA,CAAA,CAAA;AAAA,OACT;AAEA,MAAM,MAAA,MAAM,aAAc,CAAA,YAAA,CAAa,GAAG,CAAA,CAAA;AAAA,KAC5C;AAEA,IAAO,OAAA,MAAM,IAAI,IAAK,EAAA,CAAA;AAAA,GACxB;AACF;;;;"}
1
+ {"version":3,"file":"StaticSchemaLoader.esm.js","sources":["../../src/api/StaticSchemaLoader.ts"],"sourcesContent":["/*\n * Copyright 2021 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 ObservableImpl from 'zen-observable';\nimport { ResponseError } from '@backstage/errors';\nimport { Schema } from 'jsonschema';\nimport { ConfigSchemaApi, ConfigSchemaResult } from './types';\nimport { Observable } from '@backstage/types';\n\nconst DEFAULT_URL = 'config-schema.json';\n\n/**\n * A ConfigSchemaApi implementation that loads the configuration from a URL.\n *\n * @public\n */\nexport class StaticSchemaLoader implements ConfigSchemaApi {\n private readonly url: string;\n\n constructor(options: { url?: string } = {}) {\n this.url = options?.url ?? DEFAULT_URL;\n }\n\n schema$(): Observable<ConfigSchemaResult> {\n return new ObservableImpl(subscriber => {\n this.fetchSchema().then(\n schema => subscriber.next({ schema }),\n error => subscriber.error(error),\n );\n });\n }\n\n private async fetchSchema(): Promise<undefined | Schema> {\n const res = await fetch(this.url);\n\n if (!res.ok) {\n if (res.status === 404) {\n return undefined;\n }\n\n throw await ResponseError.fromResponse(res);\n }\n\n return await res.json();\n }\n}\n"],"names":[],"mappings":";;;AAsBA,MAAM,WAAc,GAAA,oBAAA,CAAA;AAOb,MAAM,kBAA8C,CAAA;AAAA,EACxC,GAAA,CAAA;AAAA,EAEjB,WAAA,CAAY,OAA4B,GAAA,EAAI,EAAA;AAC1C,IAAK,IAAA,CAAA,GAAA,GAAM,SAAS,GAAO,IAAA,WAAA,CAAA;AAAA,GAC7B;AAAA,EAEA,OAA0C,GAAA;AACxC,IAAO,OAAA,IAAI,eAAe,CAAc,UAAA,KAAA;AACtC,MAAA,IAAA,CAAK,aAAc,CAAA,IAAA;AAAA,QACjB,CAAU,MAAA,KAAA,UAAA,CAAW,IAAK,CAAA,EAAE,QAAQ,CAAA;AAAA,QACpC,CAAA,KAAA,KAAS,UAAW,CAAA,KAAA,CAAM,KAAK,CAAA;AAAA,OACjC,CAAA;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AAAA,EAEA,MAAc,WAA2C,GAAA;AACvD,IAAA,MAAM,GAAM,GAAA,MAAM,KAAM,CAAA,IAAA,CAAK,GAAG,CAAA,CAAA;AAEhC,IAAI,IAAA,CAAC,IAAI,EAAI,EAAA;AACX,MAAI,IAAA,GAAA,CAAI,WAAW,GAAK,EAAA;AACtB,QAAO,OAAA,KAAA,CAAA,CAAA;AAAA,OACT;AAEA,MAAM,MAAA,MAAM,aAAc,CAAA,YAAA,CAAa,GAAG,CAAA,CAAA;AAAA,KAC5C;AAEA,IAAO,OAAA,MAAM,IAAI,IAAK,EAAA,CAAA;AAAA,GACxB;AACF;;;;"}
@@ -40,9 +40,8 @@ function ChildView({
40
40
  const titleRef = useRef(null);
41
41
  const scroll = useScrollTargets();
42
42
  useEffect(() => {
43
- return scroll == null ? void 0 : scroll.setScrollListener(path, () => {
44
- var _a;
45
- (_a = titleRef.current) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth" });
43
+ return scroll?.setScrollListener(path, () => {
44
+ titleRef.current?.scrollIntoView({ behavior: "smooth" });
46
45
  });
47
46
  }, [scroll, path]);
48
47
  const chips = new Array();
@@ -52,7 +51,7 @@ function ChildView({
52
51
  /* @__PURE__ */ React.createElement(Chip, { label: "required", color: "default", key: "required", ...chipProps })
53
52
  );
54
53
  }
55
- const visibility = schema == null ? void 0 : schema.visibility;
54
+ const visibility = schema?.visibility;
56
55
  if (visibility === "frontend") {
57
56
  chips.push(
58
57
  /* @__PURE__ */ React.createElement(Chip, { label: "frontend", color: "primary", key: "visibility", ...chipProps })
@@ -1 +1 @@
1
- {"version":3,"file":"ChildView.esm.js","sources":["../../../src/components/SchemaView/ChildView.tsx"],"sourcesContent":["/*\n * Copyright 2021 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 { JsonValue } from '@backstage/types';\nimport Box from '@material-ui/core/Box';\nimport Chip from '@material-ui/core/Chip';\nimport Divider from '@material-ui/core/Divider';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { Schema } from 'jsonschema';\nimport React, { useEffect, useRef } from 'react';\nimport { useScrollTargets } from '../ScrollTargetsContext/ScrollTargetsContext';\nimport { SchemaView } from './SchemaView';\n\nexport interface MetadataViewRowProps {\n label: string;\n text?: string;\n data?: JsonValue;\n}\n\nfunction titleVariant(depth: number) {\n if (depth <= 1) {\n return 'h2';\n } else if (depth === 2) {\n return 'h3';\n } else if (depth === 3) {\n return 'h4';\n } else if (depth === 4) {\n return 'h5';\n }\n return 'h6';\n}\n\nconst useChildViewStyles = makeStyles(theme => ({\n title: {\n marginBottom: 0,\n },\n chip: {\n marginLeft: theme.spacing(1),\n marginRight: 0,\n marginBottom: 0,\n },\n}));\n\nexport function ChildView({\n path,\n depth,\n schema,\n required,\n lastChild,\n}: {\n path: string;\n depth: number;\n schema?: Schema;\n required?: boolean;\n lastChild?: boolean;\n}) {\n const classes = useChildViewStyles();\n const titleRef = useRef<HTMLElement>(null);\n const scroll = useScrollTargets();\n\n useEffect(() => {\n return scroll?.setScrollListener(path, () => {\n titleRef.current?.scrollIntoView({ behavior: 'smooth' });\n });\n }, [scroll, path]);\n\n const chips = new Array<JSX.Element>();\n const chipProps = { size: 'small' as const, classes: { root: classes.chip } };\n\n if (required) {\n chips.push(\n <Chip label=\"required\" color=\"default\" key=\"required\" {...chipProps} />,\n );\n }\n\n const visibility = (schema as { visibility?: string })?.visibility;\n if (visibility === 'frontend') {\n chips.push(\n <Chip label=\"frontend\" color=\"primary\" key=\"visibility\" {...chipProps} />,\n );\n } else if (visibility === 'secret') {\n chips.push(\n <Chip label=\"secret\" color=\"secondary\" key=\"visibility\" {...chipProps} />,\n );\n }\n\n return (\n <Box paddingBottom={lastChild ? 4 : 8} display=\"flex\" flexDirection=\"row\">\n <Divider orientation=\"vertical\" flexItem />\n <Box paddingLeft={2} flex={1}>\n <Box\n display=\"flex\"\n flexDirection=\"row\"\n marginBottom={2}\n alignItems=\"center\"\n >\n <Typography\n ref={titleRef}\n variant={titleVariant(depth)}\n classes={{ root: classes.title }}\n >\n {path}\n </Typography>\n {chips.length > 0 && <Box marginLeft={1} />}\n {chips}\n </Box>\n {schema && (\n <SchemaView path={path} depth={depth} schema={schema as Schema} />\n )}\n </Box>\n </Box>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;AAiCA,SAAS,aAAa,KAAe,EAAA;AACnC,EAAA,IAAI,SAAS,CAAG,EAA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A,WAAA,EAAa,CAAG,EAAA,IAAA,EAAM,CACzB,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,OAAQ,EAAA,MAAA;AAAA,MACR,aAAc,EAAA,KAAA;AAAA,MACd,YAAc,EAAA,CAAA;AAAA,MACd,UAAW,EAAA,QAAA;AAAA,KAAA;AAAA,oBAEX,KAAA,CAAA,aAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,GAAK,EAAA,QAAA;AAAA,QACL,OAAA,EAAS,aAAa,KAAK,CAAA;AAAA,QAC3B,OAAS,EAAA,EAAE,IAAM,EAAA,OAAA,CAAQ,KAAM,EAAA;AAAA,OAAA;AAAA,MAE9B,IAAA;AAAA,KACH;AAAA,IACC,MAAM,MAAS,GAAA,CAAA,oBAAM,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAI,YAAY,CAAG,EAAA,CAAA;AAAA,IACxC,KAAA;AAAA,GACH,EACC,0BACE,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,MAAY,KAAc,EAAA,MAAA,EAA0B,CAEpE,CACF,CAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"ChildView.esm.js","sources":["../../../src/components/SchemaView/ChildView.tsx"],"sourcesContent":["/*\n * Copyright 2021 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 { JsonValue } from '@backstage/types';\nimport Box from '@material-ui/core/Box';\nimport Chip from '@material-ui/core/Chip';\nimport Divider from '@material-ui/core/Divider';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { Schema } from 'jsonschema';\nimport React, { useEffect, useRef } from 'react';\nimport { useScrollTargets } from '../ScrollTargetsContext/ScrollTargetsContext';\nimport { SchemaView } from './SchemaView';\n\nexport interface MetadataViewRowProps {\n label: string;\n text?: string;\n data?: JsonValue;\n}\n\nfunction titleVariant(depth: number) {\n if (depth <= 1) {\n return 'h2';\n } else if (depth === 2) {\n return 'h3';\n } else if (depth === 3) {\n return 'h4';\n } else if (depth === 4) {\n return 'h5';\n }\n return 'h6';\n}\n\nconst useChildViewStyles = makeStyles(theme => ({\n title: {\n marginBottom: 0,\n },\n chip: {\n marginLeft: theme.spacing(1),\n marginRight: 0,\n marginBottom: 0,\n },\n}));\n\nexport function ChildView({\n path,\n depth,\n schema,\n required,\n lastChild,\n}: {\n path: string;\n depth: number;\n schema?: Schema;\n required?: boolean;\n lastChild?: boolean;\n}) {\n const classes = useChildViewStyles();\n const titleRef = useRef<HTMLElement>(null);\n const scroll = useScrollTargets();\n\n useEffect(() => {\n return scroll?.setScrollListener(path, () => {\n titleRef.current?.scrollIntoView({ behavior: 'smooth' });\n });\n }, [scroll, path]);\n\n const chips = new Array<JSX.Element>();\n const chipProps = { size: 'small' as const, classes: { root: classes.chip } };\n\n if (required) {\n chips.push(\n <Chip label=\"required\" color=\"default\" key=\"required\" {...chipProps} />,\n );\n }\n\n const visibility = (schema as { visibility?: string })?.visibility;\n if (visibility === 'frontend') {\n chips.push(\n <Chip label=\"frontend\" color=\"primary\" key=\"visibility\" {...chipProps} />,\n );\n } else if (visibility === 'secret') {\n chips.push(\n <Chip label=\"secret\" color=\"secondary\" key=\"visibility\" {...chipProps} />,\n );\n }\n\n return (\n <Box paddingBottom={lastChild ? 4 : 8} display=\"flex\" flexDirection=\"row\">\n <Divider orientation=\"vertical\" flexItem />\n <Box paddingLeft={2} flex={1}>\n <Box\n display=\"flex\"\n flexDirection=\"row\"\n marginBottom={2}\n alignItems=\"center\"\n >\n <Typography\n ref={titleRef}\n variant={titleVariant(depth)}\n classes={{ root: classes.title }}\n >\n {path}\n </Typography>\n {chips.length > 0 && <Box marginLeft={1} />}\n {chips}\n </Box>\n {schema && (\n <SchemaView path={path} depth={depth} schema={schema as Schema} />\n )}\n </Box>\n </Box>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;AAiCA,SAAS,aAAa,KAAe,EAAA;AACnC,EAAA,IAAI,SAAS,CAAG,EAAA;AACd,IAAO,OAAA,IAAA,CAAA;AAAA,GACT,MAAA,IAAW,UAAU,CAAG,EAAA;AACtB,IAAO,OAAA,IAAA,CAAA;AAAA,GACT,MAAA,IAAW,UAAU,CAAG,EAAA;AACtB,IAAO,OAAA,IAAA,CAAA;AAAA,GACT,MAAA,IAAW,UAAU,CAAG,EAAA;AACtB,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AACA,EAAO,OAAA,IAAA,CAAA;AACT,CAAA;AAEA,MAAM,kBAAA,GAAqB,WAAW,CAAU,KAAA,MAAA;AAAA,EAC9C,KAAO,EAAA;AAAA,IACL,YAAc,EAAA,CAAA;AAAA,GAChB;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,UAAA,EAAY,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IAC3B,WAAa,EAAA,CAAA;AAAA,IACb,YAAc,EAAA,CAAA;AAAA,GAChB;AACF,CAAE,CAAA,CAAA,CAAA;AAEK,SAAS,SAAU,CAAA;AAAA,EACxB,IAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AACF,CAMG,EAAA;AACD,EAAA,MAAM,UAAU,kBAAmB,EAAA,CAAA;AACnC,EAAM,MAAA,QAAA,GAAW,OAAoB,IAAI,CAAA,CAAA;AACzC,EAAA,MAAM,SAAS,gBAAiB,EAAA,CAAA;AAEhC,EAAA,SAAA,CAAU,MAAM;AACd,IAAO,OAAA,MAAA,EAAQ,iBAAkB,CAAA,IAAA,EAAM,MAAM;AAC3C,MAAA,QAA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AQ,WAAY,EAAA,UAAA,EAAW,UAAQ,IAAC,EAAA,CAAA,sCACxC,GAAI,EAAA,EAAA,WAAA,EAAa,CAAG,EAAA,IAAA,EAAM,CACzB,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,OAAQ,EAAA,MAAA;AAAA,MACR,aAAc,EAAA,KAAA;AAAA,MACd,YAAc,EAAA,CAAA;AAAA,MACd,UAAW,EAAA,QAAA;AAAA,KAAA;AAAA,oBAEX,KAAA,CAAA,aAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,GAAK,EAAA,QAAA;AAAA,QACL,OAAA,EAAS,aAAa,KAAK,CAAA;AAAA,QAC3B,OAAS,EAAA,EAAE,IAAM,EAAA,OAAA,CAAQ,KAAM,EAAA;AAAA,OAAA;AAAA,MAE9B,IAAA;AAAA,KACH;AAAA,IACC,MAAM,MAAS,GAAA,CAAA,oBAAM,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAI,YAAY,CAAG,EAAA,CAAA;AAAA,IACxC,KAAA;AAAA,GACH,EACC,0BACE,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,MAAY,KAAc,EAAA,MAAA,EAA0B,CAEpE,CACF,CAAA,CAAA;AAEJ;;;;"}
@@ -14,9 +14,8 @@ function isRequired(name, required) {
14
14
  return false;
15
15
  }
16
16
  function ObjectView({ path, depth, schema }) {
17
- var _a, _b;
18
- const properties = Object.entries((_a = schema.properties) != null ? _a : {});
19
- const patternProperties = Object.entries((_b = schema.patternProperties) != null ? _b : {});
17
+ const properties = Object.entries(schema.properties ?? {});
18
+ const patternProperties = Object.entries(schema.patternProperties ?? {});
20
19
  return /* @__PURE__ */ React.createElement(React.Fragment, null, depth > 0 && /* @__PURE__ */ React.createElement(Box, { marginBottom: 4 }, schema.description && /* @__PURE__ */ React.createElement(Box, { marginBottom: 4 }, /* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, schema.description)), /* @__PURE__ */ React.createElement(MetadataView, { schema })), properties.length > 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, depth > 0 && /* @__PURE__ */ React.createElement(Typography, { variant: "overline" }, "Properties"), properties.map(([name, propSchema], index) => /* @__PURE__ */ React.createElement(
21
20
  ChildView,
22
21
  {
@@ -1 +1 @@
1
- {"version":3,"file":"ObjectView.esm.js","sources":["../../../src/components/SchemaView/ObjectView.tsx"],"sourcesContent":["/*\n * Copyright 2021 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 Box from '@material-ui/core/Box';\nimport Typography from '@material-ui/core/Typography';\nimport React from 'react';\nimport { ChildView } from './ChildView';\nimport { MetadataView } from './MetadataView';\nimport { SchemaViewProps } from './types';\n\nfunction isRequired(name: string, required?: boolean | string[]) {\n if (required === true) {\n return true;\n }\n if (Array.isArray(required)) {\n return required.includes(name);\n }\n return false;\n}\n\nexport function ObjectView({ path, depth, schema }: SchemaViewProps) {\n const properties = Object.entries(schema.properties ?? {});\n const patternProperties = Object.entries(schema.patternProperties ?? {});\n\n return (\n <>\n {depth > 0 && (\n <Box marginBottom={4}>\n {schema.description && (\n <Box marginBottom={4}>\n <Typography variant=\"body1\">{schema.description}</Typography>\n </Box>\n )}\n <MetadataView schema={schema} />\n </Box>\n )}\n {properties.length > 0 && (\n <>\n {depth > 0 && <Typography variant=\"overline\">Properties</Typography>}\n {properties.map(([name, propSchema], index) => (\n <ChildView\n key={name}\n path={path ? `${path}.${name}` : name}\n depth={depth + 1}\n schema={propSchema}\n lastChild={index === properties.length - 1}\n required={isRequired(name, schema.required)}\n />\n ))}\n </>\n )}\n {patternProperties.length > 0 && (\n <>\n {depth > 0 && (\n <Typography variant=\"overline\">Pattern Properties</Typography>\n )}\n {patternProperties.map(([name, propSchema], index) => (\n <ChildView\n key={name}\n path={path ? `${path}.<${name}>` : name}\n depth={depth + 1}\n schema={propSchema}\n lastChild={index === patternProperties.length - 1}\n required={isRequired(name, schema.required)}\n />\n ))}\n </>\n )}\n {schema.additionalProperties && schema.additionalProperties !== true && (\n <>\n <Typography variant=\"overline\">Additional Properties</Typography>\n <ChildView\n path={`${path}.*`}\n depth={depth + 1}\n schema={schema.additionalProperties}\n lastChild\n />\n </>\n )}\n </>\n );\n}\n"],"names":[],"mappings":";;;;;;AAuBA,SAAS,UAAA,CAAW,MAAc,QAA+B,EAAA;AAC/D,EAAA,IAAI,aAAa,IAAM,EAAA;AACrB,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AACA,EAAI,IAAA,KAAA,CAAM,OAAQ,CAAA,QAAQ,CAAG,EAAA;AAC3B,IAAO,OAAA,QAAA,CAAS,SAAS,IAAI,CAAA,CAAA;AAAA,GAC/B;AACA,EAAO,OAAA,KAAA,CAAA;AACT,CAAA;AAEO,SAAS,UAAW,CAAA,EAAE,IAAM,EAAA,KAAA,EAAO,QAA2B,EAAA;AAjCrE,EAAA,IAAA,EAAA,EAAA,EAAA,CAAA;AAkCE,EAAA,MAAM,aAAa,MAAO,CAAA,OAAA,CAAA,CAAQ,YAAO,UAAP,KAAA,IAAA,GAAA,EAAA,GAAqB,EAAE,CAAA,CAAA;AACzD,EAAA,MAAM,oBAAoB,MAAO,CAAA,OAAA,CAAA,CAAQ,YAAO,iBAAP,KAAA,IAAA,GAAA,EAAA,GAA4B,EAAE,CAAA,CAAA;AAEvE,EACE,uBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EACG,QAAQ,CACP,oBAAA,KAAA,CAAA,aAAA,CAAC,OAAI,YAAc,EAAA,CAAA,EAAA,EAChB,OAAO,WACN,o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AAK,EAAA,IAAA;AAAA,MACL,MAAM,IAAO,GAAA,CAAA,EAAG,IAAI,CAAA,EAAA,EAAK,IAAI,CAAM,CAAA,CAAA,GAAA,IAAA;AAAA,MACnC,OAAO,KAAQ,GAAA,CAAA;AAAA,MACf,MAAQ,EAAA,UAAA;AAAA,MACR,SAAA,EAAW,KAAU,KAAA,iBAAA,CAAkB,MAAS,GAAA,CAAA;AAAA,MAChD,QAAU,EAAA,UAAA,CAAW,IAAM,EAAA,MAAA,CAAO,QAAQ,CAAA;AAAA,KAAA;AAAA,GAE7C,CACH,CAED,EAAA,MAAA,CAAO,wBAAwB,MAAO,CAAA,oBAAA,KAAyB,IAC9D,oBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBACG,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,OAAQ,EAAA,UAAA,EAAA,EAAW,uBAAqB,CACpD,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAM,GAAG,IAAI,CAAA,EAAA,CAAA;AAAA,MACb,OAAO,KAAQ,GAAA,CAAA;AAAA,MACf,QAAQ,MAAO,CAAA,oBAAA;AAAA,MACf,SAAS,EAAA,IAAA;AAAA,KAAA;AAAA,GAEb,CAEJ,CAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"ObjectView.esm.js","sources":["../../../src/components/SchemaView/ObjectView.tsx"],"sourcesContent":["/*\n * Copyright 2021 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 Box from '@material-ui/core/Box';\nimport Typography from '@material-ui/core/Typography';\nimport React from 'react';\nimport { ChildView } from './ChildView';\nimport { MetadataView } from './MetadataView';\nimport { SchemaViewProps } from './types';\n\nfunction isRequired(name: string, required?: boolean | string[]) {\n if (required === true) {\n return true;\n }\n if (Array.isArray(required)) {\n return required.includes(name);\n }\n return false;\n}\n\nexport function ObjectView({ path, depth, schema }: SchemaViewProps) {\n const properties = Object.entries(schema.properties ?? {});\n const patternProperties = Object.entries(schema.patternProperties ?? {});\n\n return (\n <>\n {depth > 0 && (\n <Box marginBottom={4}>\n {schema.description && (\n <Box marginBottom={4}>\n <Typography variant=\"body1\">{schema.description}</Typography>\n </Box>\n )}\n <MetadataView schema={schema} />\n </Box>\n )}\n {properties.length > 0 && (\n <>\n {depth > 0 && <Typography variant=\"overline\">Properties</Typography>}\n {properties.map(([name, propSchema], index) => (\n <ChildView\n key={name}\n path={path ? `${path}.${name}` : name}\n depth={depth + 1}\n schema={propSchema}\n lastChild={index === properties.length - 1}\n required={isRequired(name, schema.required)}\n />\n ))}\n </>\n )}\n {patternProperties.length > 0 && (\n <>\n {depth > 0 && (\n <Typography variant=\"overline\">Pattern Properties</Typography>\n )}\n {patternProperties.map(([name, propSchema], index) => (\n <ChildView\n key={name}\n path={path ? `${path}.<${name}>` : name}\n depth={depth + 1}\n schema={propSchema}\n lastChild={index === patternProperties.length - 1}\n required={isRequired(name, schema.required)}\n />\n ))}\n </>\n )}\n {schema.additionalProperties && schema.additionalProperties !== true && (\n <>\n <Typography variant=\"overline\">Additional Properties</Typography>\n <ChildView\n path={`${path}.*`}\n depth={depth + 1}\n schema={schema.additionalProperties}\n lastChild\n />\n </>\n )}\n </>\n );\n}\n"],"names":[],"mappings":";;;;;;AAuBA,SAAS,UAAA,CAAW,MAAc,QAA+B,EAAA;AAC/D,EAAA,IAAI,aAAa,IAAM,EAAA;AACrB,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AACA,EAAI,IAAA,KAAA,CAAM,OAAQ,CAAA,QAAQ,CA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,MACb,OAAO,KAAQ,GAAA,CAAA;AAAA,MACf,QAAQ,MAAO,CAAA,oBAAA;AAAA,MACf,SAAS,EAAA,IAAA;AAAA,KAAA;AAAA,GAEb,CAEJ,CAAA,CAAA;AAEJ;;;;"}
@@ -1,15 +1,7 @@
1
1
  import React, { createContext, useContext } from 'react';
2
2
 
3
- var __defProp = Object.defineProperty;
4
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5
- var __publicField = (obj, key, value) => {
6
- __defNormalProp(obj, key + "" , value);
7
- return value;
8
- };
9
3
  class ScrollTargetsForwarder {
10
- constructor() {
11
- __publicField(this, "listeners", /* @__PURE__ */ new Map());
12
- }
4
+ listeners = /* @__PURE__ */ new Map();
13
5
  setScrollListener(id, listener) {
14
6
  this.listeners.set(id, listener);
15
7
  return () => {
@@ -19,8 +11,7 @@ class ScrollTargetsForwarder {
19
11
  };
20
12
  }
21
13
  scrollTo(id) {
22
- var _a;
23
- (_a = this.listeners.get(id)) == null ? void 0 : _a();
14
+ this.listeners.get(id)?.();
24
15
  }
25
16
  }
26
17
  const ScrollTargetsContext = createContext(
@@ -1 +1 @@
1
- {"version":3,"file":"ScrollTargetsContext.esm.js","sources":["../../../src/components/ScrollTargetsContext/ScrollTargetsContext.tsx"],"sourcesContent":["/*\n * Copyright 2021 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, { createContext, ReactNode, useContext } from 'react';\n\nclass ScrollTargetsForwarder {\n private readonly listeners = new Map<string, () => void>();\n\n setScrollListener(id: string, listener: () => void): () => void {\n this.listeners.set(id, listener);\n\n return () => {\n if (this.listeners.get(id) === listener) {\n this.listeners.delete(id);\n }\n };\n }\n\n scrollTo(id: string) {\n this.listeners.get(id)?.();\n }\n}\n\nconst ScrollTargetsContext = createContext<ScrollTargetsForwarder | undefined>(\n undefined,\n);\n\nexport function ScrollTargetsProvider({ children }: { children: ReactNode }) {\n return (\n <ScrollTargetsContext.Provider\n value={new ScrollTargetsForwarder()}\n children={children}\n />\n );\n}\n\nexport function useScrollTargets() {\n return useContext(ScrollTargetsContext);\n}\n"],"names":[],"mappings":";;;;;;;;AAkBA,MAAM,sBAAuB,CAAA;AAAA,EAA7B,WAAA,GAAA;AACE,IAAiB,aAAA,CAAA,IAAA,EAAA,WAAA,sBAAgB,GAAwB,EAAA,CAAA,CAAA;AAAA,GAAA;AAAA,EAEzD,iBAAA,CAAkB,IAAY,QAAkC,EAAA;AAC9D,IAAK,IAAA,CAAA,SAAA,CAAU,GAAI,CAAA,EAAA,EAAI,QAAQ,CAAA,CAAA;AAE/B,IAAA,OAAO,MAAM;AACX,MAAA,IAAI,IAAK,CAAA,SAAA,CAAU,GAAI,CAAA,EAAE,MAAM,QAAU,EAAA;AACvC,QAAK,IAAA,CAAA,SAAA,CAAU,OAAO,EAAE,CAAA,CAAA;AAAA,OAC1B;AAAA,KACF,CAAA;AAAA,GACF;AAAA,EAEA,SAAS,EAAY,EAAA;AA/BvB,IAAA,IAAA,EAAA,CAAA;AAgCI,IAAK,CAAA,EAAA,GAAA,IAAA,CAAA,SAAA,CAAU,GAAI,CAAA,EAAE,CAArB,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,EAAA,CAAA;AAAA,GACF;AACF,CAAA;AAEA,MAAM,oBAAuB,GAAA,aAAA;AAAA,EAC3B,KAAA,CAAA;AACF,CAAA,CAAA;AAEgB,SAAA,qBAAA,CAAsB,EAAE,QAAA,EAAqC,EAAA;AAC3E,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,oBAAqB,CAAA,QAAA;AAAA,IAArB;AAAA,MACC,KAAA,EAAO,IAAI,sBAAuB,EAAA;AAAA,MAClC,QAAA;AAAA,KAAA;AAAA,GACF,CAAA;AAEJ,CAAA;AAEO,SAAS,gBAAmB,GAAA;AACjC,EAAA,OAAO,WAAW,oBAAoB,CAAA,CAAA;AACxC;;;;"}
1
+ {"version":3,"file":"ScrollTargetsContext.esm.js","sources":["../../../src/components/ScrollTargetsContext/ScrollTargetsContext.tsx"],"sourcesContent":["/*\n * Copyright 2021 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, { createContext, ReactNode, useContext } from 'react';\n\nclass ScrollTargetsForwarder {\n private readonly listeners = new Map<string, () => void>();\n\n setScrollListener(id: string, listener: () => void): () => void {\n this.listeners.set(id, listener);\n\n return () => {\n if (this.listeners.get(id) === listener) {\n this.listeners.delete(id);\n }\n };\n }\n\n scrollTo(id: string) {\n this.listeners.get(id)?.();\n }\n}\n\nconst ScrollTargetsContext = createContext<ScrollTargetsForwarder | undefined>(\n undefined,\n);\n\nexport function ScrollTargetsProvider({ children }: { children: ReactNode }) {\n return (\n <ScrollTargetsContext.Provider\n value={new ScrollTargetsForwarder()}\n children={children}\n />\n );\n}\n\nexport function useScrollTargets() {\n return useContext(ScrollTargetsContext);\n}\n"],"names":[],"mappings":";;AAkBA,MAAM,sBAAuB,CAAA;AAAA,EACV,SAAA,uBAAgB,GAAwB,EAAA,CAAA;AAAA,EAEzD,iBAAA,CAAkB,IAAY,QAAkC,EAAA;AAC9D,IAAK,IAAA,CAAA,SAAA,CAAU,GAAI,CAAA,EAAA,EAAI,QAAQ,CAAA,CAAA;AAE/B,IAAA,OAAO,MAAM;AACX,MAAA,IAAI,IAAK,CAAA,SAAA,CAAU,GAAI,CAAA,EAAE,MAAM,QAAU,EAAA;AACvC,QAAK,IAAA,CAAA,SAAA,CAAU,OAAO,EAAE,CAAA,CAAA;AAAA,OAC1B;AAAA,KACF,CAAA;AAAA,GACF;AAAA,EAEA,SAAS,EAAY,EAAA;AACnB,IAAK,IAAA,CAAA,SAAA,CAAU,GAAI,CAAA,EAAE,CAAI,IAAA,CAAA;AAAA,GAC3B;AACF,CAAA;AAEA,MAAM,oBAAuB,GAAA,aAAA;AAAA,EAC3B,KAAA,CAAA;AACF,CAAA,CAAA;AAEgB,SAAA,qBAAA,CAAsB,EAAE,QAAA,EAAqC,EAAA;AAC3E,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,oBAAqB,CAAA,QAAA;AAAA,IAArB;AAAA,MACC,KAAA,EAAO,IAAI,sBAAuB,EAAA;AAAA,MAClC,QAAA;AAAA,KAAA;AAAA,GACF,CAAA;AAEJ,CAAA;AAEO,SAAS,gBAAmB,GAAA;AACjC,EAAA,OAAO,WAAW,oBAAoB,CAAA,CAAA;AACxC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-config-schema",
3
- "version": "0.1.55",
3
+ "version": "0.1.56-next.0",
4
4
  "description": "A Backstage plugin that lets you browse the configuration schema of your app",
5
5
  "backstage": {
6
6
  "role": "frontend-plugin"
@@ -33,7 +33,7 @@
33
33
  "test": "backstage-cli package test"
34
34
  },
35
35
  "dependencies": {
36
- "@backstage/core-components": "^0.14.7",
36
+ "@backstage/core-components": "^0.14.8-next.0",
37
37
  "@backstage/core-plugin-api": "^1.9.2",
38
38
  "@backstage/errors": "^1.2.4",
39
39
  "@backstage/types": "^1.1.1",
@@ -46,8 +46,8 @@
46
46
  "zen-observable": "^0.10.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@backstage/cli": "^0.26.5",
50
- "@backstage/dev-utils": "^1.0.32",
49
+ "@backstage/cli": "^0.26.6-next.0",
50
+ "@backstage/dev-utils": "^1.0.33-next.0",
51
51
  "@testing-library/dom": "^10.0.0",
52
52
  "@testing-library/jest-dom": "^6.0.0",
53
53
  "@testing-library/react": "^15.0.0"