@backstage/plugin-catalog 1.14.0-next.0 → 1.14.0-next.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 CHANGED
@@ -1,5 +1,27 @@
1
1
  # @backstage/plugin-catalog
2
2
 
3
+ ## 1.14.0-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 7c4a8e4d5f: Create an experimental `CatalogSearchResultItemExtension` for declarative integration with Backstage; it can be accessed via the `/alpha` import.
8
+ - e5a2956dd2: Migrate catalog api to declarative integration system, it is exported from `/alpha` subpath.
9
+ - Updated dependencies
10
+ - @backstage/frontend-plugin-api@0.1.1-next.1
11
+ - @backstage/core-components@0.13.6-next.1
12
+ - @backstage/plugin-search-react@1.7.1-next.1
13
+ - @backstage/integration-react@1.1.20-next.1
14
+ - @backstage/plugin-catalog-react@1.8.5-next.1
15
+ - @backstage/core-plugin-api@1.7.0-next.0
16
+ - @backstage/catalog-client@1.4.4
17
+ - @backstage/catalog-model@1.4.2
18
+ - @backstage/errors@1.2.2
19
+ - @backstage/theme@0.4.2
20
+ - @backstage/types@1.1.1
21
+ - @backstage/plugin-catalog-common@1.0.16
22
+ - @backstage/plugin-scaffolder-common@1.4.1
23
+ - @backstage/plugin-search-common@1.2.6
24
+
3
25
  ## 1.14.0-next.0
4
26
 
5
27
  ### Minor Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog",
3
- "version": "1.14.0-next.0",
3
+ "version": "1.14.0-next.1",
4
4
  "main": "../dist/alpha.esm.js",
5
5
  "module": "../dist/alpha.esm.js",
6
6
  "types": "../dist/alpha.d.ts"
package/dist/alpha.d.ts CHANGED
@@ -1,9 +1,14 @@
1
- import * as _backstage_core_plugin_api_alpha from '@backstage/core-plugin-api/alpha';
1
+ import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
2
2
 
3
3
  /** @alpha */
4
- declare const catalogTranslationRef: _backstage_core_plugin_api_alpha.TranslationRef<"catalog", {
5
- readonly catalog_page_title: "{{orgName}} Catalog";
6
- readonly catalog_page_create_button_title: "Create";
4
+ declare const CatalogApi: _backstage_frontend_plugin_api.Extension<{}>;
5
+ /** @alpha */
6
+ declare const StarredEntitiesApi: _backstage_frontend_plugin_api.Extension<{}>;
7
+ /** @alpha */
8
+ declare const CatalogSearchResultListItemExtension: _backstage_frontend_plugin_api.Extension<{
9
+ noTrack?: boolean | undefined;
7
10
  }>;
11
+ /** @alpha */
12
+ declare const _default: _backstage_frontend_plugin_api.BackstagePlugin;
8
13
 
9
- export { catalogTranslationRef };
14
+ export { CatalogApi, CatalogSearchResultListItemExtension, StarredEntitiesApi, _default as default };
package/dist/alpha.esm.js CHANGED
@@ -1,3 +1,45 @@
1
- export { c as catalogTranslationRef } from './esm/translation-9b5ef8ed.esm.js';
2
- import '@backstage/core-plugin-api/alpha';
1
+ import { createApiFactory, discoveryApiRef, fetchApiRef, storageApiRef } from '@backstage/core-plugin-api';
2
+ import { CatalogClient } from '@backstage/catalog-client';
3
+ import { createApiExtension, createPlugin } from '@backstage/frontend-plugin-api';
4
+ import { catalogApiRef, starredEntitiesApiRef } from '@backstage/plugin-catalog-react';
5
+ import { createSearchResultListItemExtension } from '@backstage/plugin-search-react/alpha';
6
+ import { D as DefaultStarredEntitiesApi } from './esm/DefaultStarredEntitiesApi-cc4feb80.esm.js';
7
+ import 'zen-observable';
8
+ import '@backstage/catalog-model';
9
+ import 'lodash';
10
+
11
+ const CatalogApi = createApiExtension({
12
+ factory: createApiFactory({
13
+ api: catalogApiRef,
14
+ deps: {
15
+ discoveryApi: discoveryApiRef,
16
+ fetchApi: fetchApiRef
17
+ },
18
+ factory: ({ discoveryApi, fetchApi }) => new CatalogClient({ discoveryApi, fetchApi })
19
+ })
20
+ });
21
+ const StarredEntitiesApi = createApiExtension({
22
+ factory: createApiFactory({
23
+ api: starredEntitiesApiRef,
24
+ deps: { storageApi: storageApiRef },
25
+ factory: ({ storageApi }) => new DefaultStarredEntitiesApi({ storageApi })
26
+ })
27
+ });
28
+ const CatalogSearchResultListItemExtension = createSearchResultListItemExtension({
29
+ id: "catalog",
30
+ predicate: (result) => result.type === "software-catalog",
31
+ component: () => import('./esm/index-3524e4e8.esm.js').then(
32
+ (m) => m.CatalogSearchResultListItem
33
+ )
34
+ });
35
+ var alpha = createPlugin({
36
+ id: "catalog",
37
+ extensions: [
38
+ CatalogApi,
39
+ StarredEntitiesApi,
40
+ CatalogSearchResultListItemExtension
41
+ ]
42
+ });
43
+
44
+ export { CatalogApi, CatalogSearchResultListItemExtension, StarredEntitiesApi, alpha as default };
3
45
  //# sourceMappingURL=alpha.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"alpha.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"alpha.esm.js","sources":["../src/alpha.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 {\n createApiFactory,\n discoveryApiRef,\n fetchApiRef,\n storageApiRef,\n} from '@backstage/core-plugin-api';\nimport { CatalogClient } from '@backstage/catalog-client';\nimport {\n createApiExtension,\n createPlugin,\n} from '@backstage/frontend-plugin-api';\nimport {\n catalogApiRef,\n starredEntitiesApiRef,\n} from '@backstage/plugin-catalog-react';\nimport { createSearchResultListItemExtension } from '@backstage/plugin-search-react/alpha';\nimport { DefaultStarredEntitiesApi } from './apis';\n\n/** @alpha */\nexport const CatalogApi = createApiExtension({\n factory: createApiFactory({\n api: catalogApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, fetchApi }) =>\n new CatalogClient({ discoveryApi, fetchApi }),\n }),\n});\n\n/** @alpha */\nexport const StarredEntitiesApi = createApiExtension({\n factory: createApiFactory({\n api: starredEntitiesApiRef,\n deps: { storageApi: storageApiRef },\n factory: ({ storageApi }) => new DefaultStarredEntitiesApi({ storageApi }),\n }),\n});\n\n/** @alpha */\nexport const CatalogSearchResultListItemExtension =\n createSearchResultListItemExtension({\n id: 'catalog',\n predicate: result => result.type === 'software-catalog',\n component: () =>\n import('./components/CatalogSearchResultListItem').then(\n m => m.CatalogSearchResultListItem,\n ),\n });\n\n/** @alpha */\nexport default createPlugin({\n id: 'catalog',\n extensions: [\n CatalogApi,\n StarredEntitiesApi,\n CatalogSearchResultListItemExtension,\n ],\n});\n"],"names":[],"mappings":";;;;;;;;;;AAmCO,MAAM,aAAa,kBAAmB,CAAA;AAAA,EAC3C,SAAS,gBAAiB,CAAA;AAAA,IACxB,GAAK,EAAA,aAAA;AAAA,IACL,IAAM,EAAA;AAAA,MACJ,YAAc,EAAA,eAAA;AAAA,MACd,QAAU,EAAA,WAAA;AAAA,KACZ;AAAA,IACA,OAAA,EAAS,CAAC,EAAE,YAAc,EAAA,QAAA,EACxB,KAAA,IAAI,aAAc,CAAA,EAAE,YAAc,EAAA,QAAA,EAAU,CAAA;AAAA,GAC/C,CAAA;AACH,CAAC,EAAA;AAGM,MAAM,qBAAqB,kBAAmB,CAAA;AAAA,EACnD,SAAS,gBAAiB,CAAA;AAAA,IACxB,GAAK,EAAA,qBAAA;AAAA,IACL,IAAA,EAAM,EAAE,UAAA,EAAY,aAAc,EAAA;AAAA,IAClC,OAAA,EAAS,CAAC,EAAE,UAAA,OAAiB,IAAI,yBAAA,CAA0B,EAAE,UAAA,EAAY,CAAA;AAAA,GAC1E,CAAA;AACH,CAAC,EAAA;AAGM,MAAM,uCACX,mCAAoC,CAAA;AAAA,EAClC,EAAI,EAAA,SAAA;AAAA,EACJ,SAAA,EAAW,CAAU,MAAA,KAAA,MAAA,CAAO,IAAS,KAAA,kBAAA;AAAA,EACrC,SAAW,EAAA,MACT,OAAO,6BAA0C,CAAE,CAAA,IAAA;AAAA,IACjD,OAAK,CAAE,CAAA,2BAAA;AAAA,GACT;AACJ,CAAC,EAAA;AAGH,YAAe,YAAa,CAAA;AAAA,EAC1B,EAAI,EAAA,SAAA;AAAA,EACJ,UAAY,EAAA;AAAA,IACV,UAAA;AAAA,IACA,kBAAA;AAAA,IACA,oCAAA;AAAA,GACF;AACF,CAAC,CAAA;;;;"}
@@ -0,0 +1,79 @@
1
+ import ObservableImpl from 'zen-observable';
2
+ import { stringifyEntityRef } from '@backstage/catalog-model';
3
+ import { isArray, isString } from 'lodash';
4
+
5
+ async function performMigrationToTheNewBucket({
6
+ storageApi
7
+ }) {
8
+ var _a;
9
+ const source = storageApi.forBucket("settings");
10
+ const target = storageApi.forBucket("starredEntities");
11
+ const oldStarredEntities = source.snapshot("starredEntities").value;
12
+ if (!isArray(oldStarredEntities)) {
13
+ return;
14
+ }
15
+ const targetEntities = new Set(
16
+ (_a = target.snapshot("entityRefs").value) != null ? _a : []
17
+ );
18
+ oldStarredEntities.filter(isString).map((old) => old.split(":")).filter((split) => split.length === 4 && split[0] === "entity").map(
19
+ ([_, kind, namespace, name]) => stringifyEntityRef({ kind, namespace, name })
20
+ ).forEach((e) => targetEntities.add(e));
21
+ await target.set("entityRefs", Array.from(targetEntities));
22
+ await source.remove("starredEntities");
23
+ }
24
+
25
+ var __defProp = Object.defineProperty;
26
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
27
+ var __publicField = (obj, key, value) => {
28
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
29
+ return value;
30
+ };
31
+ class DefaultStarredEntitiesApi {
32
+ constructor(opts) {
33
+ __publicField(this, "settingsStore");
34
+ __publicField(this, "starredEntities");
35
+ __publicField(this, "subscribers", /* @__PURE__ */ new Set());
36
+ __publicField(this, "observable", new ObservableImpl((subscriber) => {
37
+ subscriber.next(new Set(this.starredEntities));
38
+ this.subscribers.add(subscriber);
39
+ return () => {
40
+ this.subscribers.delete(subscriber);
41
+ };
42
+ }));
43
+ var _a;
44
+ performMigrationToTheNewBucket(opts).then();
45
+ this.settingsStore = opts.storageApi.forBucket("starredEntities");
46
+ this.starredEntities = new Set(
47
+ (_a = this.settingsStore.snapshot("entityRefs").value) != null ? _a : []
48
+ );
49
+ this.settingsStore.observe$("entityRefs").subscribe({
50
+ next: (next) => {
51
+ var _a2;
52
+ this.starredEntities = new Set((_a2 = next.value) != null ? _a2 : []);
53
+ this.notifyChanges();
54
+ }
55
+ });
56
+ }
57
+ async toggleStarred(entityRef) {
58
+ if (this.starredEntities.has(entityRef)) {
59
+ this.starredEntities.delete(entityRef);
60
+ } else {
61
+ this.starredEntities.add(entityRef);
62
+ }
63
+ await this.settingsStore.set(
64
+ "entityRefs",
65
+ Array.from(this.starredEntities)
66
+ );
67
+ }
68
+ starredEntitie$() {
69
+ return this.observable;
70
+ }
71
+ notifyChanges() {
72
+ for (const subscription of this.subscribers) {
73
+ subscription.next(new Set(this.starredEntities));
74
+ }
75
+ }
76
+ }
77
+
78
+ export { DefaultStarredEntitiesApi as D };
79
+ //# sourceMappingURL=DefaultStarredEntitiesApi-cc4feb80.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultStarredEntitiesApi-cc4feb80.esm.js","sources":["../../src/apis/StarredEntitiesApi/migration.ts","../../src/apis/StarredEntitiesApi/DefaultStarredEntitiesApi.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 { stringifyEntityRef } from '@backstage/catalog-model';\nimport { StorageApi } from '@backstage/core-plugin-api';\nimport { isArray, isString } from 'lodash';\n\n/**\n * Migrate the starred entities from the old format (entity:<kind>:<namespace>:<name>) from the\n * old storage location (/settings/starredEntities) to entity references in the new location\n * (/starredEntities/entityRefs).\n *\n * This will only be executed once since the old location is cleared.\n *\n * @param storageApi - the StorageApi to migrate\n */\nexport async function performMigrationToTheNewBucket({\n storageApi,\n}: {\n storageApi: StorageApi;\n}) {\n const source = storageApi.forBucket('settings');\n const target = storageApi.forBucket('starredEntities');\n\n const oldStarredEntities = source.snapshot('starredEntities').value;\n\n if (!isArray(oldStarredEntities)) {\n // nothing to do\n return;\n }\n const targetEntities = new Set(\n target.snapshot<string[]>('entityRefs').value ?? [],\n );\n\n oldStarredEntities\n .filter(isString)\n // extract the old format 'entity:<kind>:<namespace>:<name>'\n .map(old => old.split(':'))\n // check if the format is valid\n .filter(split => split.length === 4 && split[0] === 'entity')\n // convert to entity references\n .map(([_, kind, namespace, name]) =>\n stringifyEntityRef({ kind, namespace, name }),\n )\n .forEach(e => targetEntities.add(e));\n\n await target.set('entityRefs', Array.from(targetEntities));\n\n await source.remove('starredEntities');\n}\n","/*\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 { StorageApi } from '@backstage/core-plugin-api';\nimport { StarredEntitiesApi } from '@backstage/plugin-catalog-react';\nimport { Observable } from '@backstage/types';\nimport ObservableImpl from 'zen-observable';\nimport { performMigrationToTheNewBucket } from './migration';\n\n/**\n * Default implementation of the StarredEntitiesApi that is backed by the StorageApi.\n *\n * @public\n */\nexport class DefaultStarredEntitiesApi implements StarredEntitiesApi {\n private readonly settingsStore: StorageApi;\n private starredEntities: Set<string>;\n\n constructor(opts: { storageApi: StorageApi }) {\n // no need to await. The updated content will be caught by the observe$\n performMigrationToTheNewBucket(opts).then();\n\n this.settingsStore = opts.storageApi.forBucket('starredEntities');\n\n this.starredEntities = new Set(\n this.settingsStore.snapshot<string[]>('entityRefs').value ?? [],\n );\n\n this.settingsStore.observe$<string[]>('entityRefs').subscribe({\n next: next => {\n this.starredEntities = new Set(next.value ?? []);\n this.notifyChanges();\n },\n });\n }\n\n async toggleStarred(entityRef: string): Promise<void> {\n if (this.starredEntities.has(entityRef)) {\n this.starredEntities.delete(entityRef);\n } else {\n this.starredEntities.add(entityRef);\n }\n\n await this.settingsStore.set(\n 'entityRefs',\n Array.from(this.starredEntities),\n );\n }\n\n starredEntitie$(): Observable<Set<string>> {\n return this.observable;\n }\n\n private readonly subscribers = new Set<\n ZenObservable.SubscriptionObserver<Set<string>>\n >();\n\n private readonly observable = new ObservableImpl<Set<string>>(subscriber => {\n // forward the the latest value\n subscriber.next(new Set(this.starredEntities));\n\n this.subscribers.add(subscriber);\n return () => {\n this.subscribers.delete(subscriber);\n };\n });\n\n private notifyChanges() {\n for (const subscription of this.subscribers) {\n subscription.next(new Set(this.starredEntities));\n }\n }\n}\n"],"names":["_a"],"mappings":";;;;AA6BA,eAAsB,8BAA+B,CAAA;AAAA,EACnD,UAAA;AACF,CAEG,EAAA;AAjCH,EAAA,IAAA,EAAA,CAAA;AAkCE,EAAM,MAAA,MAAA,GAAS,UAAW,CAAA,SAAA,CAAU,UAAU,CAAA,CAAA;AAC9C,EAAM,MAAA,MAAA,GAAS,UAAW,CAAA,SAAA,CAAU,iBAAiB,CAAA,CAAA;AAErD,EAAA,MAAM,kBAAqB,GAAA,MAAA,CAAO,QAAS,CAAA,iBAAiB,C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,CAAA;AAAA,KACpC;AAEA,IAAA,MAAM,KAAK,aAAc,CAAA,GAAA;AAAA,MACvB,YAAA;AAAA,MACA,KAAA,CAAM,IAAK,CAAA,IAAA,CAAK,eAAe,CAAA;AAAA,KACjC,CAAA;AAAA,GACF;AAAA,EAEA,eAA2C,GAAA;AACzC,IAAA,OAAO,IAAK,CAAA,UAAA,CAAA;AAAA,GACd;AAAA,EAgBQ,aAAgB,GAAA;AACtB,IAAW,KAAA,MAAA,YAAA,IAAgB,KAAK,WAAa,EAAA;AAC3C,MAAA,YAAA,CAAa,IAAK,CAAA,IAAI,GAAI,CAAA,IAAA,CAAK,eAAe,CAAC,CAAA,CAAA;AAAA,KACjD;AAAA,GACF;AACF;;;;"}
@@ -1,4 +1,5 @@
1
- export { E as EntityLabelsCard, h as hasLabels } from './index-b55d524f.esm.js';
1
+ export { E as EntityLabelsCard, h as hasLabels } from './index-ba8d718c.esm.js';
2
+ import './DefaultStarredEntitiesApi-cc4feb80.esm.js';
2
3
  import 'zen-observable';
3
4
  import '@backstage/catalog-model';
4
5
  import 'lodash';
@@ -31,4 +32,4 @@ import '@material-ui/icons/Cancel';
31
32
  import '@backstage/errors';
32
33
  import '@backstage/catalog-client';
33
34
  import '@backstage/plugin-search-react';
34
- //# sourceMappingURL=index-4f564202.esm.js.map
35
+ //# sourceMappingURL=index-2f599706.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-2f599706.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -3,8 +3,9 @@ import LanguageIcon from '@material-ui/icons/Language';
3
3
  import React from 'react';
4
4
  import { makeStyles, Typography, Button } from '@material-ui/core';
5
5
  import { CodeSnippet, InfoCard } from '@backstage/core-components';
6
- import { L as LinksGridList } from './index-b55d524f.esm.js';
6
+ import { L as LinksGridList } from './index-ba8d718c.esm.js';
7
7
  import { useApp } from '@backstage/core-plugin-api';
8
+ import './DefaultStarredEntitiesApi-cc4feb80.esm.js';
8
9
  import 'zen-observable';
9
10
  import '@backstage/catalog-model';
10
11
  import 'lodash';
@@ -95,4 +96,4 @@ const EntityLinksCard = (props) => {
95
96
  };
96
97
 
97
98
  export { EntityLinksCard };
98
- //# sourceMappingURL=index-10c5b478.esm.js.map
99
+ //# sourceMappingURL=index-877315c2.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-10c5b478.esm.js","sources":["../../src/components/EntityLinksCard/EntityLinksEmptyState.tsx","../../src/components/EntityLinksCard/EntityLinksCard.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 { BackstageTheme } from '@backstage/theme';\nimport { Button, makeStyles, Typography } from '@material-ui/core';\nimport React from 'react';\nimport { CodeSnippet } from '@backstage/core-components';\n\nconst ENTITY_YAML = `metadata:\n name: example\n links:\n - url: https://dashboard.example.com\n title: My Dashboard\n icon: dashboard`;\n\n/** @public */\nexport type EntityLinksEmptyStateClassKey = 'code';\n\nconst useStyles = makeStyles<BackstageTheme>(\n theme => ({\n code: {\n borderRadius: 6,\n margin: theme.spacing(2, 0),\n background:\n theme.palette.type === 'dark' ? '#444' : theme.palette.common.white,\n },\n }),\n { name: 'PluginCatalogEntityLinksEmptyState' },\n);\n\nexport function EntityLinksEmptyState() {\n const classes = useStyles();\n\n return (\n <>\n <Typography variant=\"body1\">\n No links defined for this entity. You can add links to your entity YAML\n as shown in the highlighted example below:\n </Typography>\n <div className={classes.code}>\n <CodeSnippet\n text={ENTITY_YAML}\n language=\"yaml\"\n showLineNumbers\n highlightedNumbers={[3, 4, 5, 6]}\n customStyle={{ background: 'inherit', fontSize: '115%' }}\n />\n </div>\n <Button\n variant=\"contained\"\n color=\"primary\"\n target=\"_blank\"\n href=\"https://backstage.io/docs/features/software-catalog/descriptor-format#links-optional\"\n >\n Read more\n </Button>\n </>\n );\n}\n","/*\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 { useEntity } from '@backstage/plugin-catalog-react';\nimport LanguageIcon from '@material-ui/icons/Language';\nimport React from 'react';\nimport { EntityLinksEmptyState } from './EntityLinksEmptyState';\nimport { LinksGridList } from './LinksGridList';\nimport { ColumnBreakpoints } from './types';\nimport { IconComponent, useApp } from '@backstage/core-plugin-api';\nimport { InfoCard, InfoCardVariants } from '@backstage/core-components';\n\n/** @public */\nexport interface EntityLinksCardProps {\n cols?: ColumnBreakpoints | number;\n variant?: InfoCardVariants;\n}\n\nexport const EntityLinksCard = (props: EntityLinksCardProps) => {\n const { cols = undefined, variant } = props;\n const { entity } = useEntity();\n const app = useApp();\n\n const iconResolver = (key?: string): IconComponent =>\n key ? app.getSystemIcon(key) ?? LanguageIcon : LanguageIcon;\n\n const links = entity?.metadata?.links;\n\n return (\n <InfoCard title=\"Links\" variant={variant}>\n {!links || links.length === 0 ? (\n <EntityLinksEmptyState />\n ) : (\n <LinksGridList\n cols={cols}\n items={links.map(({ url, title, icon }) => ({\n text: title ?? url,\n href: url,\n Icon: iconResolver(icon),\n }))}\n />\n )}\n </InfoCard>\n );\n};\n"],"names":["_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,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A;AAAA,QACN,IAAA,EAAM,aAAa,IAAI,CAAA;AAAA,OACvB,CAAA,CAAA;AAAA,KAAA;AAAA,GAGR,CAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"index-877315c2.esm.js","sources":["../../src/components/EntityLinksCard/EntityLinksEmptyState.tsx","../../src/components/EntityLinksCard/EntityLinksCard.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 { BackstageTheme } from '@backstage/theme';\nimport { Button, makeStyles, Typography } from '@material-ui/core';\nimport React from 'react';\nimport { CodeSnippet } from '@backstage/core-components';\n\nconst ENTITY_YAML = `metadata:\n name: example\n links:\n - url: https://dashboard.example.com\n title: My Dashboard\n icon: dashboard`;\n\n/** @public */\nexport type EntityLinksEmptyStateClassKey = 'code';\n\nconst useStyles = makeStyles<BackstageTheme>(\n theme => ({\n code: {\n borderRadius: 6,\n margin: theme.spacing(2, 0),\n background:\n theme.palette.type === 'dark' ? '#444' : theme.palette.common.white,\n },\n }),\n { name: 'PluginCatalogEntityLinksEmptyState' },\n);\n\nexport function EntityLinksEmptyState() {\n const classes = useStyles();\n\n return (\n <>\n <Typography variant=\"body1\">\n No links defined for this entity. You can add links to your entity YAML\n as shown in the highlighted example below:\n </Typography>\n <div className={classes.code}>\n <CodeSnippet\n text={ENTITY_YAML}\n language=\"yaml\"\n showLineNumbers\n highlightedNumbers={[3, 4, 5, 6]}\n customStyle={{ background: 'inherit', fontSize: '115%' }}\n />\n </div>\n <Button\n variant=\"contained\"\n color=\"primary\"\n target=\"_blank\"\n href=\"https://backstage.io/docs/features/software-catalog/descriptor-format#links-optional\"\n >\n Read more\n </Button>\n </>\n );\n}\n","/*\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 { useEntity } from '@backstage/plugin-catalog-react';\nimport LanguageIcon from '@material-ui/icons/Language';\nimport React from 'react';\nimport { EntityLinksEmptyState } from './EntityLinksEmptyState';\nimport { LinksGridList } from './LinksGridList';\nimport { ColumnBreakpoints } from './types';\nimport { IconComponent, useApp } from '@backstage/core-plugin-api';\nimport { InfoCard, InfoCardVariants } from '@backstage/core-components';\n\n/** @public */\nexport interface EntityLinksCardProps {\n cols?: ColumnBreakpoints | number;\n variant?: InfoCardVariants;\n}\n\nexport const EntityLinksCard = (props: EntityLinksCardProps) => {\n const { cols = undefined, variant } = props;\n const { entity } = useEntity();\n const app = useApp();\n\n const iconResolver = (key?: string): IconComponent =>\n key ? app.getSystemIcon(key) ?? LanguageIcon : LanguageIcon;\n\n const links = entity?.metadata?.links;\n\n return (\n <InfoCard title=\"Links\" variant={variant}>\n {!links || links.length === 0 ? (\n <EntityLinksEmptyState />\n ) : (\n <LinksGridList\n cols={cols}\n items={links.map(({ url, title, icon }) => ({\n text: title ?? url,\n href: url,\n Icon: iconResolver(icon),\n }))}\n />\n )}\n </InfoCard>\n );\n};\n"],"names":["_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,WAAc,GAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAA,CAAA,CAAA;AAUpB,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB,CAAU,KAAA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-3,9 +3,9 @@ import { useOutlet } from 'react-router-dom';
3
3
  import { PageWithHeader, Content, ContentHeader, CreateButton, SupportButton } from '@backstage/core-components';
4
4
  import { useApi, configApiRef, useRouteRef } from '@backstage/core-plugin-api';
5
5
  import { EntityListProvider, CatalogFilterLayout, EntityKindPicker, EntityTypePicker, UserListPicker, EntityOwnerPicker, EntityLifecyclePicker, EntityTagPicker, EntityProcessingStatusPicker, EntityNamespacePicker } from '@backstage/plugin-catalog-react';
6
- import { c as createComponentRouteRef, C as CatalogTable } from './index-b55d524f.esm.js';
7
- import { c as catalogTranslationRef } from './translation-9b5ef8ed.esm.js';
8
- import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
6
+ import { c as createComponentRouteRef, C as CatalogTable } from './index-ba8d718c.esm.js';
7
+ import { createTranslationRef, useTranslationRef } from '@backstage/core-plugin-api/alpha';
8
+ import './DefaultStarredEntitiesApi-cc4feb80.esm.js';
9
9
  import 'zen-observable';
10
10
  import '@backstage/catalog-model';
11
11
  import 'lodash';
@@ -34,6 +34,14 @@ import '@backstage/errors';
34
34
  import '@backstage/catalog-client';
35
35
  import '@backstage/plugin-search-react';
36
36
 
37
+ const catalogTranslationRef = createTranslationRef({
38
+ id: "catalog",
39
+ messages: {
40
+ catalog_page_title: `{{orgName}} Catalog`,
41
+ catalog_page_create_button_title: "Create"
42
+ }
43
+ });
44
+
37
45
  function DefaultCatalogPage(props) {
38
46
  var _a;
39
47
  const {
@@ -71,4 +79,4 @@ function CatalogPage(props) {
71
79
  }
72
80
 
73
81
  export { CatalogPage, DefaultCatalogPage };
74
- //# sourceMappingURL=index-7c9aa369.esm.js.map
82
+ //# sourceMappingURL=index-a9833792.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-a9833792.esm.js","sources":["../../src/translation.ts","../../src/components/CatalogPage/DefaultCatalogPage.tsx","../../src/components/CatalogPage/CatalogPage.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 { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @alpha */\nexport const catalogTranslationRef = createTranslationRef({\n id: 'catalog',\n messages: {\n catalog_page_title: `{{orgName}} Catalog`,\n catalog_page_create_button_title: 'Create',\n },\n});\n","/*\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 {\n Content,\n ContentHeader,\n CreateButton,\n PageWithHeader,\n SupportButton,\n TableColumn,\n TableProps,\n} from '@backstage/core-components';\nimport { configApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api';\nimport {\n CatalogFilterLayout,\n EntityLifecyclePicker,\n EntityListProvider,\n EntityProcessingStatusPicker,\n EntityOwnerPicker,\n EntityTagPicker,\n EntityTypePicker,\n UserListFilterKind,\n UserListPicker,\n EntityKindPicker,\n EntityNamespacePicker,\n EntityOwnerPickerProps,\n} from '@backstage/plugin-catalog-react';\nimport React, { ReactNode } from 'react';\nimport { createComponentRouteRef } from '../../routes';\nimport { CatalogTable, CatalogTableRow } from '../CatalogTable';\nimport { catalogTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/**\n * Props for root catalog pages.\n *\n * @public\n */\nexport interface DefaultCatalogPageProps {\n initiallySelectedFilter?: UserListFilterKind;\n columns?: TableColumn<CatalogTableRow>[];\n actions?: TableProps<CatalogTableRow>['actions'];\n initialKind?: string;\n tableOptions?: TableProps<CatalogTableRow>['options'];\n emptyContent?: ReactNode;\n ownerPickerMode?: EntityOwnerPickerProps['mode'];\n}\n\nexport function DefaultCatalogPage(props: DefaultCatalogPageProps) {\n const {\n columns,\n actions,\n initiallySelectedFilter = 'owned',\n initialKind = 'component',\n tableOptions = {},\n emptyContent,\n ownerPickerMode,\n } = props;\n const orgName =\n useApi(configApiRef).getOptionalString('organization.name') ?? 'Backstage';\n const createComponentLink = useRouteRef(createComponentRouteRef);\n const { t } = useTranslationRef(catalogTranslationRef);\n\n return (\n <PageWithHeader title={t('catalog_page_title', { orgName })} themeId=\"home\">\n <Content>\n <ContentHeader title=\"\">\n <CreateButton\n title={t('catalog_page_create_button_title')}\n to={createComponentLink && createComponentLink()}\n />\n <SupportButton>All your software catalog entities</SupportButton>\n </ContentHeader>\n <EntityListProvider>\n <CatalogFilterLayout>\n <CatalogFilterLayout.Filters>\n <EntityKindPicker initialFilter={initialKind} />\n <EntityTypePicker />\n <UserListPicker initialFilter={initiallySelectedFilter} />\n <EntityOwnerPicker mode={ownerPickerMode} />\n <EntityLifecyclePicker />\n <EntityTagPicker />\n <EntityProcessingStatusPicker />\n <EntityNamespacePicker />\n </CatalogFilterLayout.Filters>\n <CatalogFilterLayout.Content>\n <CatalogTable\n columns={columns}\n actions={actions}\n tableOptions={tableOptions}\n emptyContent={emptyContent}\n />\n </CatalogFilterLayout.Content>\n </CatalogFilterLayout>\n </EntityListProvider>\n </Content>\n </PageWithHeader>\n );\n}\n","/*\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 from 'react';\nimport { useOutlet } from 'react-router-dom';\nimport {\n DefaultCatalogPage,\n DefaultCatalogPageProps,\n} from './DefaultCatalogPage';\n\nexport function CatalogPage(props: DefaultCatalogPageProps) {\n const outlet = useOutlet();\n\n return outlet || <DefaultCatalogPage {...props} />;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBO,MAAM,wBAAwB,oBAAqB,CAAA;AAAA,EACxD,EAAI,EAAA,SAAA;AAAA,EACJ,QAAU,EAAA;AAAA,IACR,kBAAoB,EAAA,CAAA,mBAAA,CAAA;AAAA,IACpB,gCAAkC,EAAA,QAAA;AAAA,GACpC;AACF,CAAC,CAAA;;ACoCM,SAAS,mBAAmB,KAAgC,EAAA;AA7DnE,EAAA,IAAA,EAAA,CAAA;AA8DE,EAAM,MAAA;AAAA,IACJ,OAAA;AAAA,IACA,OAAA;AAAA,IACA,uBAA0B,GAAA,OAAA;AAAA,IAC1B,WAAc,GAAA,WAAA;AAAA,IACd,eAAe,EAAC;AAAA,IAChB,YAAA;AAAA,IACA,eAAA;AAAA,GACE,GAAA,KAAA,CAAA;AACJ,EAAA,MAAM,WACJ,EAAO,GAAA,MAAA,CAAA,YAAY,EAAE,iBAAkB,CAAA,mBAAmB,MAA1D,IAA+D,GAAA,EAAA,GAAA,WAAA,CAAA;AACjE,EAAM,MAAA,mBAAA,GAAsB,YAAY,uBAAuB,CAAA,CAAA;AAC/D,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,qBAAqB,CAAA,CAAA;AAErD,EAAA,2CACG,cAAe,EAAA,EAAA,KAAA,EAAO,CAAE,CAAA,oBAAA,EAAsB,EAAE,OAAQ,EAAC,CAAG,EAAA,OAAA,EAAQ,0BAClE,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,I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CAAA;AAEzB,EAAA,OAAO,MAAU,oBAAA,KAAA,CAAA,aAAA,CAAC,kBAAoB,EAAA,EAAA,GAAG,KAAO,EAAA,CAAA,CAAA;AAClD;;;;"}
@@ -1,4 +1,5 @@
1
- export { A as AboutCard, a as AboutContent, b as AboutField } from './index-b55d524f.esm.js';
1
+ export { A as AboutCard, a as AboutContent, b as AboutField } from './index-ba8d718c.esm.js';
2
+ import './DefaultStarredEntitiesApi-cc4feb80.esm.js';
2
3
  import 'zen-observable';
3
4
  import '@backstage/catalog-model';
4
5
  import 'lodash';
@@ -31,4 +32,4 @@ import '@material-ui/icons/Cancel';
31
32
  import '@backstage/errors';
32
33
  import '@backstage/catalog-client';
33
34
  import '@backstage/plugin-search-react';
34
- //# sourceMappingURL=index-d2714295.esm.js.map
35
+ //# sourceMappingURL=index-b8cad66a.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-b8cad66a.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,5 @@
1
- import ObservableImpl from 'zen-observable';
2
- import { stringifyEntityRef, RELATION_PART_OF, RELATION_OWNED_BY, getEntitySourceLocation, ANNOTATION_EDIT_URL, parseEntityRef, DEFAULT_NAMESPACE, ANNOTATION_LOCATION, ANNOTATION_VIEW_URL } from '@backstage/catalog-model';
3
- import { isArray, isString, capitalize } from 'lodash';
1
+ import { D as DefaultStarredEntitiesApi } from './DefaultStarredEntitiesApi-cc4feb80.esm.js';
2
+ import { RELATION_PART_OF, RELATION_OWNED_BY, getEntitySourceLocation, ANNOTATION_EDIT_URL, parseEntityRef, DEFAULT_NAMESPACE, ANNOTATION_LOCATION, stringifyEntityRef, ANNOTATION_VIEW_URL } from '@backstage/catalog-model';
4
3
  import { makeStyles, Typography, Grid, Box, useMediaQuery, ImageList, ImageListItem, Chip, Card, CardHeader, IconButton, Divider, CardContent, createStyles, Select, InputBase, MenuItem, ListItemIcon, ListItemText, Tooltip, Popover, MenuList, Dialog, DialogTitle, DialogActions, Button } from '@material-ui/core';
5
4
  import { Link, MarkdownContent, HeaderIconLinkRow, OverflowTooltip, WarningPanel, CodeSnippet, Table, Page, Header, Progress, RoutedTabs, Content, HeaderLabel, ResponseErrorPanel, InfoCard } from '@backstage/core-components';
6
5
  import React, { useCallback, useMemo, useState, useEffect } from 'react';
@@ -19,6 +18,7 @@ import { withStyles, makeStyles as makeStyles$1 } from '@material-ui/core/styles
19
18
  import OpenInNew from '@material-ui/icons/OpenInNew';
20
19
  import Star from '@material-ui/icons/Star';
21
20
  import StarBorder from '@material-ui/icons/StarBorder';
21
+ import { capitalize } from 'lodash';
22
22
  import { Alert } from '@material-ui/lab';
23
23
  import { useLocation, useNavigate } from 'react-router-dom';
24
24
  import BugReportIcon from '@material-ui/icons/BugReport';
@@ -31,79 +31,6 @@ import { assertError } from '@backstage/errors';
31
31
  import { ENTITY_STATUS_CATALOG_PROCESSING_TYPE, CatalogClient } from '@backstage/catalog-client';
32
32
  import { createSearchResultListItemExtension } from '@backstage/plugin-search-react';
33
33
 
34
- async function performMigrationToTheNewBucket({
35
- storageApi
36
- }) {
37
- var _a;
38
- const source = storageApi.forBucket("settings");
39
- const target = storageApi.forBucket("starredEntities");
40
- const oldStarredEntities = source.snapshot("starredEntities").value;
41
- if (!isArray(oldStarredEntities)) {
42
- return;
43
- }
44
- const targetEntities = new Set(
45
- (_a = target.snapshot("entityRefs").value) != null ? _a : []
46
- );
47
- oldStarredEntities.filter(isString).map((old) => old.split(":")).filter((split) => split.length === 4 && split[0] === "entity").map(
48
- ([_, kind, namespace, name]) => stringifyEntityRef({ kind, namespace, name })
49
- ).forEach((e) => targetEntities.add(e));
50
- await target.set("entityRefs", Array.from(targetEntities));
51
- await source.remove("starredEntities");
52
- }
53
-
54
- var __defProp = Object.defineProperty;
55
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
56
- var __publicField = (obj, key, value) => {
57
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
58
- return value;
59
- };
60
- class DefaultStarredEntitiesApi {
61
- constructor(opts) {
62
- __publicField(this, "settingsStore");
63
- __publicField(this, "starredEntities");
64
- __publicField(this, "subscribers", /* @__PURE__ */ new Set());
65
- __publicField(this, "observable", new ObservableImpl((subscriber) => {
66
- subscriber.next(new Set(this.starredEntities));
67
- this.subscribers.add(subscriber);
68
- return () => {
69
- this.subscribers.delete(subscriber);
70
- };
71
- }));
72
- var _a;
73
- performMigrationToTheNewBucket(opts).then();
74
- this.settingsStore = opts.storageApi.forBucket("starredEntities");
75
- this.starredEntities = new Set(
76
- (_a = this.settingsStore.snapshot("entityRefs").value) != null ? _a : []
77
- );
78
- this.settingsStore.observe$("entityRefs").subscribe({
79
- next: (next) => {
80
- var _a2;
81
- this.starredEntities = new Set((_a2 = next.value) != null ? _a2 : []);
82
- this.notifyChanges();
83
- }
84
- });
85
- }
86
- async toggleStarred(entityRef) {
87
- if (this.starredEntities.has(entityRef)) {
88
- this.starredEntities.delete(entityRef);
89
- } else {
90
- this.starredEntities.add(entityRef);
91
- }
92
- await this.settingsStore.set(
93
- "entityRefs",
94
- Array.from(this.starredEntities)
95
- );
96
- }
97
- starredEntitie$() {
98
- return this.observable;
99
- }
100
- notifyChanges() {
101
- for (const subscription of this.subscribers) {
102
- subscription.next(new Set(this.starredEntities));
103
- }
104
- }
105
- }
106
-
107
34
  const createComponentRouteRef = createExternalRouteRef({
108
35
  id: "create-component",
109
36
  optional: true
@@ -1541,7 +1468,7 @@ const catalogPlugin = createPlugin({
1541
1468
  const CatalogIndexPage = catalogPlugin.provide(
1542
1469
  createRoutableExtension({
1543
1470
  name: "CatalogIndexPage",
1544
- component: () => import('./index-7c9aa369.esm.js').then((m) => m.CatalogPage),
1471
+ component: () => import('./index-a9833792.esm.js').then((m) => m.CatalogPage),
1545
1472
  mountPoint: rootRouteRef
1546
1473
  })
1547
1474
  );
@@ -1556,7 +1483,7 @@ const EntityAboutCard = catalogPlugin.provide(
1556
1483
  createComponentExtension({
1557
1484
  name: "EntityAboutCard",
1558
1485
  component: {
1559
- lazy: () => import('./index-d2714295.esm.js').then((m) => m.AboutCard)
1486
+ lazy: () => import('./index-b8cad66a.esm.js').then((m) => m.AboutCard)
1560
1487
  }
1561
1488
  })
1562
1489
  );
@@ -1564,7 +1491,7 @@ const EntityLinksCard = catalogPlugin.provide(
1564
1491
  createComponentExtension({
1565
1492
  name: "EntityLinksCard",
1566
1493
  component: {
1567
- lazy: () => import('./index-10c5b478.esm.js').then((m) => m.EntityLinksCard)
1494
+ lazy: () => import('./index-877315c2.esm.js').then((m) => m.EntityLinksCard)
1568
1495
  }
1569
1496
  })
1570
1497
  );
@@ -1572,7 +1499,7 @@ const EntityLabelsCard = catalogPlugin.provide(
1572
1499
  createComponentExtension({
1573
1500
  name: "EntityLabelsCard",
1574
1501
  component: {
1575
- lazy: () => import('./index-4f564202.esm.js').then((m) => m.EntityLabelsCard)
1502
+ lazy: () => import('./index-2f599706.esm.js').then((m) => m.EntityLabelsCard)
1576
1503
  }
1577
1504
  })
1578
1505
  );
@@ -1660,5 +1587,5 @@ const CatalogSearchResultListItem = catalogPlugin.provide(
1660
1587
  })
1661
1588
  );
1662
1589
 
1663
- export { AboutCard as A, EntitySwitch as B, CatalogTable as C, DefaultStarredEntitiesApi as D, EntityLabelsCard$1 as E, isKind as F, isNamespace as G, isComponentType as H, isResourceType as I, isEntityWith as J, FilteredEntityLayout as K, LinksGridList as L, FilterContainer as M, EntityListContainer as N, RelatedEntitiesCard as R, AboutContent as a, AboutField as b, createComponentRouteRef as c, CatalogEntityPage as d, CatalogIndexPage as e, catalogPlugin as f, EntityAboutCard as g, hasLabels as h, EntityDependencyOfComponentsCard as i, EntityDependsOnComponentsCard as j, EntityDependsOnResourcesCard as k, EntityHasComponentsCard as l, EntityHasResourcesCard as m, EntityHasSubcomponentsCard as n, EntityHasSystemsCard as o, EntityLinksCard as p, EntityLabelsCard as q, CatalogSearchResultListItem as r, CatalogKindHeader as s, EntityLayout as t, EntityOrphanWarning as u, isOrphan as v, EntityRelationWarning as w, hasRelationWarnings as x, EntityProcessingErrorsPanel as y, hasCatalogProcessingErrors as z };
1664
- //# sourceMappingURL=index-b55d524f.esm.js.map
1590
+ export { AboutCard as A, EntitySwitch as B, CatalogTable as C, isKind as D, EntityLabelsCard$1 as E, isNamespace as F, isComponentType as G, isResourceType as H, isEntityWith as I, FilteredEntityLayout as J, FilterContainer as K, LinksGridList as L, EntityListContainer as M, RelatedEntitiesCard as R, AboutContent as a, AboutField as b, createComponentRouteRef as c, CatalogEntityPage as d, CatalogIndexPage as e, catalogPlugin as f, EntityAboutCard as g, hasLabels as h, EntityDependencyOfComponentsCard as i, EntityDependsOnComponentsCard as j, EntityDependsOnResourcesCard as k, EntityHasComponentsCard as l, EntityHasResourcesCard as m, EntityHasSubcomponentsCard as n, EntityHasSystemsCard as o, EntityLinksCard as p, EntityLabelsCard as q, CatalogSearchResultListItem as r, CatalogKindHeader as s, EntityLayout as t, EntityOrphanWarning as u, isOrphan as v, EntityRelationWarning as w, hasRelationWarnings as x, EntityProcessingErrorsPanel as y, hasCatalogProcessingErrors as z };
1591
+ //# sourceMappingURL=index-ba8d718c.esm.js.map