@backstage/plugin-scaffolder 1.10.1 → 1.11.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.
@@ -1,4 +1,4 @@
1
- import { E as EntityPicker, j as EntityPickerSchema, k as EntityNamePicker, m as entityNamePickerValidation, n as EntityNamePickerSchema, o as EntityTagsPicker, p as EntityTagsPickerSchema, R as RepoUrlPicker, q as repoPickerValidation, t as RepoUrlPickerSchema, O as OwnerPicker, u as OwnerPickerSchema, w as OwnedEntityPicker, x as OwnedEntityPickerSchema } from './index-4dbb353c.esm.js';
1
+ import { E as EntityPicker, i as EntityPickerSchema, j as EntityNamePicker, k as entityNamePickerValidation, m as EntityNamePickerSchema, n as EntityTagsPicker, o as EntityTagsPickerSchema, R as RepoUrlPicker, p as repoPickerValidation, q as RepoUrlPickerSchema, O as OwnerPicker, t as OwnerPickerSchema, u as OwnedEntityPicker, w as OwnedEntityPickerSchema } from './index-e0e59ed8.esm.js';
2
2
 
3
3
  const DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS = [
4
4
  {
@@ -36,4 +36,4 @@ const DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS = [
36
36
  ];
37
37
 
38
38
  export { DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS as D };
39
- //# sourceMappingURL=default-40114591.esm.js.map
39
+ //# sourceMappingURL=default-ad36f5e9.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"default-40114591.esm.js","sources":["../../src/extensions/default.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 */\nimport {\n EntityPicker,\n EntityPickerSchema,\n} from '../components/fields/EntityPicker/EntityPicker';\nimport {\n EntityNamePicker,\n EntityNamePickerSchema,\n} from '../components/fields/EntityNamePicker/EntityNamePicker';\nimport { entityNamePickerValidation } from '../components/fields/EntityNamePicker/validation';\nimport {\n EntityTagsPicker,\n EntityTagsPickerSchema,\n} from '../components/fields/EntityTagsPicker/EntityTagsPicker';\nimport {\n OwnerPicker,\n OwnerPickerSchema,\n} from '../components/fields/OwnerPicker/OwnerPicker';\nimport {\n RepoUrlPicker,\n RepoUrlPickerSchema,\n} from '../components/fields/RepoUrlPicker/RepoUrlPicker';\nimport { repoPickerValidation } from '../components/fields/RepoUrlPicker/validation';\nimport {\n OwnedEntityPicker,\n OwnedEntityPickerSchema,\n} from '../components/fields/OwnedEntityPicker/OwnedEntityPicker';\n\nexport const DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS = [\n {\n component: EntityPicker,\n name: 'EntityPicker',\n schema: EntityPickerSchema,\n },\n {\n component: EntityNamePicker,\n name: 'EntityNamePicker',\n validation: entityNamePickerValidation,\n schema: EntityNamePickerSchema,\n },\n {\n component: EntityTagsPicker,\n name: 'EntityTagsPicker',\n schema: EntityTagsPickerSchema,\n },\n {\n component: RepoUrlPicker,\n name: 'RepoUrlPicker',\n validation: repoPickerValidation,\n schema: RepoUrlPickerSchema,\n },\n {\n component: OwnerPicker,\n name: 'OwnerPicker',\n schema: OwnerPickerSchema,\n },\n {\n component: OwnedEntityPicker,\n name: 'OwnedEntityPicker',\n schema: OwnedEntityPickerSchema,\n },\n];\n"],"names":[],"mappings":";;AA0CO,MAAM,mCAAsC,GAAA;AAAA,EACjD;AAAA,IACE,SAAW,EAAA,YAAA;AAAA,IACX,IAAM,EAAA,cAAA;AAAA,IACN,MAAQ,EAAA,kBAAA;AAAA,GACV;AAAA,EACA;AAAA,IACE,SAAW,EAAA,gBAAA;AAAA,IACX,IAAM,EAAA,kBAAA;AAAA,IACN,UAAY,EAAA,0BAAA;AAAA,IACZ,MAAQ,EAAA,sBAAA;AAAA,GACV;AAAA,EACA;AAAA,IACE,SAAW,EAAA,gBAAA;AAAA,IACX,IAAM,EAAA,kBAAA;AAAA,IACN,MAAQ,EAAA,sBAAA;AAAA,GACV;AAAA,EACA;AAAA,IACE,SAAW,EAAA,aAAA;AAAA,IACX,IAAM,EAAA,eAAA;AAAA,IACN,UAAY,EAAA,oBAAA;AAAA,IACZ,MAAQ,EAAA,mBAAA;AAAA,GACV;AAAA,EACA;AAAA,IACE,SAAW,EAAA,WAAA;AAAA,IACX,IAAM,EAAA,aAAA;AAAA,IACN,MAAQ,EAAA,iBAAA;AAAA,GACV;AAAA,EACA;AAAA,IACE,SAAW,EAAA,iBAAA;AAAA,IACX,IAAM,EAAA,mBAAA;AAAA,IACN,MAAQ,EAAA,uBAAA;AAAA,GACV;AACF;;;;"}
1
+ {"version":3,"file":"default-ad36f5e9.esm.js","sources":["../../src/extensions/default.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 */\nimport {\n EntityPicker,\n EntityPickerSchema,\n} from '../components/fields/EntityPicker/EntityPicker';\nimport {\n EntityNamePicker,\n EntityNamePickerSchema,\n} from '../components/fields/EntityNamePicker/EntityNamePicker';\nimport { entityNamePickerValidation } from '../components/fields/EntityNamePicker/validation';\nimport {\n EntityTagsPicker,\n EntityTagsPickerSchema,\n} from '../components/fields/EntityTagsPicker/EntityTagsPicker';\nimport {\n OwnerPicker,\n OwnerPickerSchema,\n} from '../components/fields/OwnerPicker/OwnerPicker';\nimport {\n RepoUrlPicker,\n RepoUrlPickerSchema,\n} from '../components/fields/RepoUrlPicker/RepoUrlPicker';\nimport { repoPickerValidation } from '../components/fields/RepoUrlPicker/validation';\nimport {\n OwnedEntityPicker,\n OwnedEntityPickerSchema,\n} from '../components/fields/OwnedEntityPicker/OwnedEntityPicker';\n\nexport const DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS = [\n {\n component: EntityPicker,\n name: 'EntityPicker',\n schema: EntityPickerSchema,\n },\n {\n component: EntityNamePicker,\n name: 'EntityNamePicker',\n validation: entityNamePickerValidation,\n schema: EntityNamePickerSchema,\n },\n {\n component: EntityTagsPicker,\n name: 'EntityTagsPicker',\n schema: EntityTagsPickerSchema,\n },\n {\n component: RepoUrlPicker,\n name: 'RepoUrlPicker',\n validation: repoPickerValidation,\n schema: RepoUrlPickerSchema,\n },\n {\n component: OwnerPicker,\n name: 'OwnerPicker',\n schema: OwnerPickerSchema,\n },\n {\n component: OwnedEntityPicker,\n name: 'OwnedEntityPicker',\n schema: OwnedEntityPickerSchema,\n },\n];\n"],"names":[],"mappings":";;AA0CO,MAAM,mCAAsC,GAAA;AAAA,EACjD;AAAA,IACE,SAAW,EAAA,YAAA;AAAA,IACX,IAAM,EAAA,cAAA;AAAA,IACN,MAAQ,EAAA,kBAAA;AAAA,GACV;AAAA,EACA;AAAA,IACE,SAAW,EAAA,gBAAA;AAAA,IACX,IAAM,EAAA,kBAAA;AAAA,IACN,UAAY,EAAA,0BAAA;AAAA,IACZ,MAAQ,EAAA,sBAAA;AAAA,GACV;AAAA,EACA;AAAA,IACE,SAAW,EAAA,gBAAA;AAAA,IACX,IAAM,EAAA,kBAAA;AAAA,IACN,MAAQ,EAAA,sBAAA;AAAA,GACV;AAAA,EACA;AAAA,IACE,SAAW,EAAA,aAAA;AAAA,IACX,IAAM,EAAA,eAAA;AAAA,IACN,UAAY,EAAA,oBAAA;AAAA,IACZ,MAAQ,EAAA,mBAAA;AAAA,GACV;AAAA,EACA;AAAA,IACE,SAAW,EAAA,WAAA;AAAA,IACX,IAAM,EAAA,aAAA;AAAA,IACN,MAAQ,EAAA,iBAAA;AAAA,GACV;AAAA,EACA;AAAA,IACE,SAAW,EAAA,iBAAA;AAAA,IACX,IAAM,EAAA,mBAAA;AAAA,IACN,MAAQ,EAAA,uBAAA;AAAA,GACV;AACF;;;;"}
@@ -1,5 +1,5 @@
1
1
  import React, { useCallback } from 'react';
2
- import { Link, useNavigate, useOutlet, Routes, Route } from 'react-router-dom';
2
+ import { Link, useNavigate, Navigate, useOutlet, Routes, Route } from 'react-router-dom';
3
3
  import { Progress, Link as Link$1, DocsIcon, Page, Header, Content, ContentHeader, SupportButton } from '@backstage/core-components';
4
4
  import { useEntityTypeFilter, useEntityList, EntityListProvider, CatalogFilterLayout, EntitySearchBar, EntityKindPicker, UserListPicker, EntityTagPicker } from '@backstage/plugin-catalog-react';
5
5
  import capitalize from 'lodash/capitalize';
@@ -8,7 +8,7 @@ import CheckBoxIcon from '@material-ui/icons/CheckBox';
8
8
  import CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';
9
9
  import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
10
10
  import { Autocomplete } from '@material-ui/lab';
11
- import { useApi, alertApiRef, errorApiRef, useApp, useRouteRef } from '@backstage/core-plugin-api';
11
+ import { useApi, alertApiRef, errorApiRef, useApp, useRouteRef, useRouteRefParams, AnalyticsContext } from '@backstage/core-plugin-api';
12
12
  import Button from '@material-ui/core/Button';
13
13
  import IconButton from '@material-ui/core/IconButton';
14
14
  import useMediaQuery from '@material-ui/core/useMediaQuery';
@@ -16,9 +16,9 @@ import AddCircleOutline from '@material-ui/icons/AddCircleOutline';
16
16
  import { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common';
17
17
  import { usePermission } from '@backstage/plugin-permission-react';
18
18
  import { parseEntityRef, stringifyEntityRef } from '@backstage/catalog-model';
19
- import { TemplateGroup, useCustomFieldExtensions, SecretsContextProvider } from '@backstage/plugin-scaffolder-react';
20
- import { v as viewTechDocRouteRef, y as nextSelectedTemplateRouteRef, r as registerComponentRouteRef, z as TemplateWizardPage } from './index-4dbb353c.esm.js';
21
- import { D as DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS } from './default-40114591.esm.js';
19
+ import { TemplateGroup, useTemplateSecrets, scaffolderApiRef, Workflow, useCustomFieldExtensions, useCustomLayouts, SecretsContextProvider } from '@backstage/plugin-scaffolder-react';
20
+ import { v as viewTechDocRouteRef, x as nextSelectedTemplateRouteRef, r as registerComponentRouteRef, y as nextRouteRef, c as scaffolderTaskRouteRef, s as selectedTemplateRouteRef } from './index-e0e59ed8.esm.js';
21
+ import { D as DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS } from './default-ad36f5e9.esm.js';
22
22
  import '@backstage/errors';
23
23
  import 'qs';
24
24
  import 'zen-observable';
@@ -208,6 +208,50 @@ const TemplateListPage = (props) => {
208
208
  ))))));
209
209
  };
210
210
 
211
+ const TemplateWizardPage = (props) => {
212
+ const rootRef = useRouteRef(nextRouteRef);
213
+ const taskRoute = useRouteRef(scaffolderTaskRouteRef);
214
+ const { secrets } = useTemplateSecrets();
215
+ const scaffolderApi = useApi(scaffolderApiRef);
216
+ const navigate = useNavigate();
217
+ const { templateName, namespace } = useRouteRefParams(
218
+ selectedTemplateRouteRef
219
+ );
220
+ const templateRef = stringifyEntityRef({
221
+ kind: "Template",
222
+ namespace,
223
+ name: templateName
224
+ });
225
+ const onCreate = async (values) => {
226
+ const { taskId } = await scaffolderApi.scaffold({
227
+ templateRef,
228
+ values,
229
+ secrets
230
+ });
231
+ navigate(taskRoute({ taskId }));
232
+ };
233
+ const onError = () => /* @__PURE__ */ React.createElement(Navigate, { to: rootRef() });
234
+ return /* @__PURE__ */ React.createElement(AnalyticsContext, { attributes: { entityRef: templateRef } }, /* @__PURE__ */ React.createElement(Page, { themeId: "website" }, /* @__PURE__ */ React.createElement(
235
+ Header,
236
+ {
237
+ pageTitleOverride: "Create a new component",
238
+ title: "Create a new component",
239
+ subtitle: "Create new software components using standard templates in your organization"
240
+ }
241
+ ), /* @__PURE__ */ React.createElement(
242
+ Workflow,
243
+ {
244
+ namespace,
245
+ templateName,
246
+ onCreate,
247
+ onError,
248
+ extensions: props.customFieldExtensions,
249
+ FormProps: props.FormProps,
250
+ layouts: props.layouts
251
+ }
252
+ )));
253
+ };
254
+
211
255
  const Router = (props) => {
212
256
  const { components: { TemplateCardComponent } = {} } = props;
213
257
  const outlet = useOutlet() || props.children;
@@ -220,6 +264,7 @@ const Router = (props) => {
220
264
  )
221
265
  )
222
266
  ];
267
+ const customLayouts = useCustomLayouts(outlet);
223
268
  return /* @__PURE__ */ React.createElement(Routes, null, /* @__PURE__ */ React.createElement(
224
269
  Route,
225
270
  {
@@ -240,6 +285,7 @@ const Router = (props) => {
240
285
  TemplateWizardPage,
241
286
  {
242
287
  customFieldExtensions: fieldExtensions,
288
+ layouts: customLayouts,
243
289
  FormProps: props.FormProps
244
290
  }
245
291
  ))
@@ -248,4 +294,4 @@ const Router = (props) => {
248
294
  };
249
295
 
250
296
  export { Router };
251
- //# sourceMappingURL=index-690bf85d.esm.js.map
297
+ //# sourceMappingURL=index-203b9f93.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-203b9f93.esm.js","sources":["../../src/next/TemplateListPage/CategoryPicker.tsx","../../src/next/TemplateListPage/RegisterExistingButton.tsx","../../src/next/TemplateListPage/TemplateGroups.tsx","../../src/next/TemplateListPage/TemplateListPage.tsx","../../src/next/TemplateWizardPage/TemplateWizardPage.tsx","../../src/next/Router/Router.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 from 'react';\nimport capitalize from 'lodash/capitalize';\nimport { Progress } from '@backstage/core-components';\nimport {\n Box,\n Checkbox,\n FormControlLabel,\n TextField,\n Typography,\n} from '@material-ui/core';\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\nimport CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport { Autocomplete } from '@material-ui/lab';\nimport { useEntityTypeFilter } from '@backstage/plugin-catalog-react';\nimport { alertApiRef, useApi } from '@backstage/core-plugin-api';\n\nconst icon = <CheckBoxOutlineBlankIcon fontSize=\"small\" />;\nconst checkedIcon = <CheckBoxIcon fontSize=\"small\" />;\n\n/**\n * The Category Picker that is rendered on the left side for picking\n * categories and filtering the template list.\n */\nexport const CategoryPicker = () => {\n const alertApi = useApi(alertApiRef);\n const { error, loading, availableTypes, selectedTypes, setSelectedTypes } =\n useEntityTypeFilter();\n\n if (loading) return <Progress />;\n\n if (error) {\n alertApi.post({\n message: `Failed to load entity types with error: ${error}`,\n severity: 'error',\n });\n return null;\n }\n\n if (!availableTypes) return null;\n\n return (\n <Box pb={1} pt={1}>\n <Typography variant=\"button\">Categories</Typography>\n <Autocomplete\n multiple\n aria-label=\"Categories\"\n options={availableTypes}\n value={selectedTypes}\n onChange={(_: object, value: string[]) => setSelectedTypes(value)}\n renderOption={(option, { selected }) => (\n <FormControlLabel\n control={\n <Checkbox\n icon={icon}\n checkedIcon={checkedIcon}\n checked={selected}\n />\n }\n label={capitalize(option)}\n />\n )}\n size=\"small\"\n popupIcon={<ExpandMoreIcon />}\n renderInput={params => <TextField {...params} variant=\"outlined\" />}\n />\n </Box>\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 { BackstageTheme } from '@backstage/theme';\nimport Button from '@material-ui/core/Button';\nimport IconButton from '@material-ui/core/IconButton';\nimport useMediaQuery from '@material-ui/core/useMediaQuery';\nimport React from 'react';\nimport { Link as RouterLink, LinkProps } from 'react-router-dom';\nimport AddCircleOutline from '@material-ui/icons/AddCircleOutline';\nimport { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common';\nimport { usePermission } from '@backstage/plugin-permission-react';\n\n/**\n * Properties for {@link RegisterExistingButton}\n *\n * @alpha\n */\nexport type RegisterExistingButtonProps = {\n title: string;\n} & Partial<Pick<LinkProps, 'to'>>;\n\n/**\n * A button that helps users to register an existing component.\n * @alpha\n */\nexport const RegisterExistingButton = (props: RegisterExistingButtonProps) => {\n const { title, to } = props;\n const { allowed } = usePermission({\n permission: catalogEntityCreatePermission,\n });\n const isXSScreen = useMediaQuery<BackstageTheme>(theme =>\n theme.breakpoints.down('xs'),\n );\n\n if (!to || !allowed) {\n return null;\n }\n\n return isXSScreen ? (\n <IconButton\n component={RouterLink}\n color=\"primary\"\n title={title}\n size=\"small\"\n to={to}\n >\n <AddCircleOutline />\n </IconButton>\n ) : (\n <Button component={RouterLink} variant=\"contained\" color=\"primary\" to={to}>\n {title}\n </Button>\n );\n};\n","/*\n * Copyright 2022 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 */\nimport React, { useCallback } from 'react';\n\nimport {\n Entity,\n parseEntityRef,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { useEntityList } from '@backstage/plugin-catalog-react';\nimport { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport { Progress, Link, DocsIcon } from '@backstage/core-components';\nimport { Typography } from '@material-ui/core';\nimport {\n errorApiRef,\n useApi,\n useApp,\n useRouteRef,\n} from '@backstage/core-plugin-api';\nimport { TemplateGroup } from '@backstage/plugin-scaffolder-react';\nimport { viewTechDocRouteRef } from '../../routes';\nimport { nextSelectedTemplateRouteRef } from '../routes';\nimport { useNavigate } from 'react-router-dom';\n\n/**\n * @alpha\n */\nexport type TemplateGroupFilter = {\n title?: React.ReactNode;\n filter: (entity: Entity) => boolean;\n};\n\nexport interface TemplateGroupsProps {\n groups: TemplateGroupFilter[];\n TemplateCardComponent?: React.ComponentType<{\n template: TemplateEntityV1beta3;\n }>;\n}\n\nexport const TemplateGroups = (props: TemplateGroupsProps) => {\n const { loading, error, entities } = useEntityList();\n const { groups, TemplateCardComponent } = props;\n const errorApi = useApi(errorApiRef);\n const app = useApp();\n const viewTechDocsLink = useRouteRef(viewTechDocRouteRef);\n const templateRoute = useRouteRef(nextSelectedTemplateRouteRef);\n const navigate = useNavigate();\n const onSelected = useCallback(\n (template: TemplateEntityV1beta3) => {\n const { namespace, name } = parseEntityRef(stringifyEntityRef(template));\n navigate(templateRoute({ namespace, templateName: name }));\n },\n [navigate, templateRoute],\n );\n\n if (loading) {\n return <Progress />;\n }\n\n if (error) {\n errorApi.post(error);\n return null;\n }\n\n if (!entities || !entities.length) {\n return (\n <Typography variant=\"body2\">\n No templates found that match your filter. Learn more about{' '}\n <Link to=\"https://backstage.io/docs/features/software-templates/adding-templates\">\n adding templates\n </Link>\n .\n </Typography>\n );\n }\n\n return (\n <>\n {groups.map(({ title, filter }, index) => {\n const templates = entities\n .filter((e): e is TemplateEntityV1beta3 => filter(e))\n .map(template => {\n const { kind, namespace, name } = parseEntityRef(\n stringifyEntityRef(template),\n );\n const additionalLinks =\n template.metadata.annotations?.['backstage.io/techdocs-ref'] &&\n viewTechDocsLink\n ? [\n {\n icon: app.getSystemIcon('docs') ?? DocsIcon,\n text: 'View TechDocs',\n url: viewTechDocsLink({ kind, namespace, name }),\n },\n ]\n : [];\n\n return {\n template,\n additionalLinks,\n };\n });\n\n return (\n <TemplateGroup\n key={index}\n templates={templates}\n title={title}\n components={{ CardComponent: TemplateCardComponent }}\n onSelected={onSelected}\n />\n );\n })}\n </>\n );\n};\n","/*\n * Copyright 2022 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 { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\n\nimport {\n Content,\n ContentHeader,\n Header,\n Page,\n SupportButton,\n} from '@backstage/core-components';\nimport {\n EntityKindPicker,\n EntityListProvider,\n EntitySearchBar,\n EntityTagPicker,\n CatalogFilterLayout,\n UserListPicker,\n} from '@backstage/plugin-catalog-react';\nimport { CategoryPicker } from './CategoryPicker';\nimport { RegisterExistingButton } from './RegisterExistingButton';\nimport { useRouteRef } from '@backstage/core-plugin-api';\nimport { TemplateGroupFilter, TemplateGroups } from './TemplateGroups';\nimport { registerComponentRouteRef } from '../../routes';\n\nexport type TemplateListPageProps = {\n TemplateCardComponent?: React.ComponentType<{\n template: TemplateEntityV1beta3;\n }>;\n groups?: TemplateGroupFilter[];\n};\n\nconst defaultGroup: TemplateGroupFilter = {\n title: 'All Templates',\n filter: () => true,\n};\n\nexport const TemplateListPage = (props: TemplateListPageProps) => {\n const registerComponentLink = useRouteRef(registerComponentRouteRef);\n const { TemplateCardComponent, groups = [] } = props;\n\n return (\n <EntityListProvider>\n <Page themeId=\"website\">\n <Header\n pageTitleOverride=\"Create a new component\"\n title=\"Create a new component\"\n subtitle=\"Create new software components using standard templates in your organization\"\n />\n <Content>\n <ContentHeader title=\"Available Templates\">\n <RegisterExistingButton\n title=\"Register Existing Component\"\n to={registerComponentLink && registerComponentLink()}\n />\n <SupportButton>\n Create new software components using standard templates. Different\n templates create different kinds of components (services,\n websites, documentation, ...).\n </SupportButton>\n </ContentHeader>\n\n <CatalogFilterLayout>\n <CatalogFilterLayout.Filters>\n <EntitySearchBar />\n <EntityKindPicker initialFilter=\"template\" hidden />\n <UserListPicker\n initialFilter=\"all\"\n availableFilters={['all', 'starred']}\n />\n <CategoryPicker />\n <EntityTagPicker />\n </CatalogFilterLayout.Filters>\n <CatalogFilterLayout.Content>\n <TemplateGroups\n groups={[...groups, defaultGroup]}\n TemplateCardComponent={TemplateCardComponent}\n />\n </CatalogFilterLayout.Content>\n </CatalogFilterLayout>\n </Content>\n </Page>\n </EntityListProvider>\n );\n};\n","/*\n * Copyright 2022 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 */\nimport React from 'react';\nimport { Navigate, useNavigate } from 'react-router-dom';\nimport { stringifyEntityRef } from '@backstage/catalog-model';\nimport {\n AnalyticsContext,\n useApi,\n useRouteRef,\n useRouteRefParams,\n} from '@backstage/core-plugin-api';\nimport {\n scaffolderApiRef,\n useTemplateSecrets,\n Workflow,\n type LayoutOptions,\n} from '@backstage/plugin-scaffolder-react';\nimport { NextFieldExtensionOptions } from '@backstage/plugin-scaffolder-react';\nimport { JsonValue } from '@backstage/types';\nimport { type FormProps } from '../types';\nimport { nextRouteRef } from '../routes';\nimport { scaffolderTaskRouteRef, selectedTemplateRouteRef } from '../../routes';\nimport { Header, Page } from '@backstage/core-components';\n\nexport type TemplateWizardPageProps = {\n customFieldExtensions: NextFieldExtensionOptions<any, any>[];\n layouts?: LayoutOptions[];\n FormProps?: FormProps;\n};\n\nexport const TemplateWizardPage = (props: TemplateWizardPageProps) => {\n const rootRef = useRouteRef(nextRouteRef);\n const taskRoute = useRouteRef(scaffolderTaskRouteRef);\n const { secrets } = useTemplateSecrets();\n const scaffolderApi = useApi(scaffolderApiRef);\n const navigate = useNavigate();\n const { templateName, namespace } = useRouteRefParams(\n selectedTemplateRouteRef,\n );\n\n const templateRef = stringifyEntityRef({\n kind: 'Template',\n namespace,\n name: templateName,\n });\n\n const onCreate = async (values: Record<string, JsonValue>) => {\n const { taskId } = await scaffolderApi.scaffold({\n templateRef,\n values,\n secrets,\n });\n\n navigate(taskRoute({ taskId }));\n };\n\n const onError = () => <Navigate to={rootRef()} />;\n\n return (\n <AnalyticsContext attributes={{ entityRef: templateRef }}>\n <Page themeId=\"website\">\n <Header\n pageTitleOverride=\"Create a new component\"\n title=\"Create a new component\"\n subtitle=\"Create new software components using standard templates in your organization\"\n />\n <Workflow\n namespace={namespace}\n templateName={templateName}\n onCreate={onCreate}\n onError={onError}\n extensions={props.customFieldExtensions}\n FormProps={props.FormProps}\n layouts={props.layouts}\n />\n </Page>\n </AnalyticsContext>\n );\n};\n","/*\n * Copyright 2022 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 */\nimport React, { PropsWithChildren } from 'react';\nimport { Routes, Route, useOutlet } from 'react-router-dom';\nimport { TemplateListPage } from '../TemplateListPage';\nimport { TemplateWizardPage } from '../TemplateWizardPage';\nimport {\n NextFieldExtensionOptions,\n SecretsContextProvider,\n useCustomFieldExtensions,\n useCustomLayouts,\n type FormProps,\n} from '@backstage/plugin-scaffolder-react';\n\nimport { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport { TemplateGroupFilter } from '../TemplateListPage/TemplateGroups';\nimport { DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS } from '../../extensions/default';\nimport { nextSelectedTemplateRouteRef } from '../routes';\n\n/**\n * The Props for the Scaffolder Router\n *\n * @alpha\n */\nexport type NextRouterProps = {\n components?: {\n TemplateCardComponent?: React.ComponentType<{\n template: TemplateEntityV1beta3;\n }>;\n TaskPageComponent?: React.ComponentType<{}>;\n };\n groups?: TemplateGroupFilter[];\n FormProps?: FormProps;\n};\n\n/**\n * The Scaffolder Router\n *\n * @alpha\n */\nexport const Router = (props: PropsWithChildren<NextRouterProps>) => {\n const { components: { TemplateCardComponent } = {} } = props;\n const outlet = useOutlet() || props.children;\n const customFieldExtensions =\n useCustomFieldExtensions<NextFieldExtensionOptions>(outlet);\n const fieldExtensions = [\n ...customFieldExtensions,\n ...DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS.filter(\n ({ name }) =>\n !customFieldExtensions.some(\n customFieldExtension => customFieldExtension.name === name,\n ),\n ),\n ] as NextFieldExtensionOptions[];\n\n const customLayouts = useCustomLayouts(outlet);\n\n return (\n <Routes>\n <Route\n path=\"/\"\n element={\n <TemplateListPage\n TemplateCardComponent={TemplateCardComponent}\n groups={props.groups}\n />\n }\n />\n <Route\n path={nextSelectedTemplateRouteRef.path}\n element={\n <SecretsContextProvider>\n <TemplateWizardPage\n customFieldExtensions={fieldExtensions}\n layouts={customLayouts}\n FormProps={props.FormProps}\n />\n </SecretsContextProvider>\n }\n />\n </Routes>\n );\n};\n"],"names":["Rou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 import { parseEntityRef, KubernetesValidatorFunctions, RELATION_OWNED_BY, makeValidator } from '@backstage/catalog-model';
2
2
  import { ResponseError } from '@backstage/errors';
3
3
  import qs from 'qs';
4
4
  import ObservableImpl from 'zen-observable';
5
- import { attachComponentData, useApi, identityApiRef, createExternalRouteRef, createRouteRef, createSubRouteRef, useRouteRef, useRouteRefParams, errorApiRef, AnalyticsContext, createPlugin, createApiFactory, discoveryApiRef, fetchApiRef, createRoutableExtension, alertApiRef, useApp } from '@backstage/core-plugin-api';
6
5
  import { scmIntegrationsApiRef, scmAuthApiRef } from '@backstage/integration-react';
7
- import { scaffolderApiRef as scaffolderApiRef$1, useTemplateSecrets as useTemplateSecrets$1, Stepper, createScaffolderFieldExtension as createScaffolderFieldExtension$1, ScaffolderFieldExtensions as ScaffolderFieldExtensions$1 } from '@backstage/plugin-scaffolder-react';
6
+ import { scaffolderApiRef as scaffolderApiRef$1, useTemplateSecrets as useTemplateSecrets$1, createScaffolderFieldExtension as createScaffolderFieldExtension$1, ScaffolderFieldExtensions as ScaffolderFieldExtensions$1, createScaffolderLayout as createScaffolderLayout$1, ScaffolderLayouts as ScaffolderLayouts$1 } from '@backstage/plugin-scaffolder-react';
7
+ import { useApi, identityApiRef, createExternalRouteRef, createRouteRef, createSubRouteRef, createPlugin, createApiFactory, discoveryApiRef, fetchApiRef, createRoutableExtension, alertApiRef, useApp, useRouteRef, useRouteRefParams } from '@backstage/core-plugin-api';
8
8
  import { catalogApiRef, humanizeEntityRef, useEntityTypeFilter, entityRouteRef } from '@backstage/plugin-catalog-react';
9
- import { TextField, FormControl as FormControl$1, makeStyles, Box, Typography, FormControlLabel, Checkbox, Grid, StepButton, Paper, Button, CircularProgress } from '@material-ui/core';
9
+ import { TextField, FormControl as FormControl$1, Box, Typography, FormControlLabel, Checkbox, makeStyles, Grid, StepButton, Paper, Button, CircularProgress } from '@material-ui/core';
10
10
  import FormControl from '@material-ui/core/FormControl';
11
11
  import Autocomplete from '@material-ui/lab/Autocomplete';
12
12
  import React, { useCallback, useEffect, useState, useMemo, useRef, memo } from 'react';
@@ -16,11 +16,11 @@ import zodToJsonSchema from 'zod-to-json-schema';
16
16
  import FormHelperText from '@material-ui/core/FormHelperText';
17
17
  import Input from '@material-ui/core/Input';
18
18
  import InputLabel from '@material-ui/core/InputLabel';
19
- import { Select, Progress, Page, Header, Content, InfoCard, MarkdownContent, DismissableBanner, Link, ErrorPage, LogViewer } from '@backstage/core-components';
19
+ import { Select, Progress, DismissableBanner, Link, Page, Header, Content, ErrorPage, LogViewer } from '@backstage/core-components';
20
20
  import useDebounce from 'react-use/lib/useDebounce';
21
21
  import useEffectOnce from 'react-use/lib/useEffectOnce';
22
22
  import { Autocomplete as Autocomplete$1 } from '@material-ui/lab';
23
- import { useNavigate, Navigate } from 'react-router-dom';
23
+ import { useNavigate } from 'react-router-dom';
24
24
  import capitalize from 'lodash/capitalize';
25
25
  import CheckBoxIcon from '@material-ui/icons/CheckBox';
26
26
  import CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';
@@ -34,7 +34,7 @@ import '@backstage/plugin-permission-react';
34
34
  import Grid$1 from '@material-ui/core/Grid';
35
35
  import Step from '@material-ui/core/Step';
36
36
  import StepLabel from '@material-ui/core/StepLabel';
37
- import Stepper$1 from '@material-ui/core/Stepper';
37
+ import Stepper from '@material-ui/core/Stepper';
38
38
  import { makeStyles as makeStyles$1, createStyles } from '@material-ui/core/styles';
39
39
  import Typography$1 from '@material-ui/core/Typography';
40
40
  import Cancel from '@material-ui/icons/Cancel';
@@ -242,20 +242,6 @@ class ScaffolderClient {
242
242
  }
243
243
  }
244
244
 
245
- const LAYOUTS_KEY = "scaffolder.layout.v1";
246
- const LAYOUTS_WRAPPER_KEY = "scaffolder.layouts.wrapper.v1";
247
- function createScaffolderLayout(options) {
248
- return {
249
- expose() {
250
- const LayoutDataHolder = () => null;
251
- attachComponentData(LayoutDataHolder, LAYOUTS_KEY, options);
252
- return LayoutDataHolder;
253
- }
254
- };
255
- }
256
- const ScaffolderLayouts = () => null;
257
- attachComponentData(ScaffolderLayouts, LAYOUTS_WRAPPER_KEY, true);
258
-
259
245
  function makeFieldSchemaFromZod(returnSchema, uiOptionsSchema) {
260
246
  return {
261
247
  schema: {
@@ -1279,92 +1265,6 @@ const nextScaffolderTaskRouteRef = createSubRouteRef({
1279
1265
  path: "/tasks/:taskId"
1280
1266
  });
1281
1267
 
1282
- const useStyles$2 = makeStyles(() => ({
1283
- markdown: {
1284
- /** to make the styles for React Markdown not leak into the description */
1285
- "& :first-child": {
1286
- marginTop: 0
1287
- },
1288
- "& :last-child": {
1289
- marginBottom: 0
1290
- }
1291
- }
1292
- }));
1293
- const useTemplateParameterSchema = (templateRef) => {
1294
- const scaffolderApi = useApi(scaffolderApiRef$1);
1295
- const { value, loading, error } = useAsync(
1296
- () => scaffolderApi.getTemplateParameterSchema(templateRef),
1297
- [scaffolderApi, templateRef]
1298
- );
1299
- return { manifest: value, loading, error };
1300
- };
1301
- const TemplateWizardPage = (props) => {
1302
- var _a;
1303
- const styles = useStyles$2();
1304
- const rootRef = useRouteRef(nextRouteRef);
1305
- const taskRoute = useRouteRef(scaffolderTaskRouteRef);
1306
- const { secrets } = useTemplateSecrets$1();
1307
- const scaffolderApi = useApi(scaffolderApiRef$1);
1308
- const navigate = useNavigate();
1309
- const { templateName, namespace } = useRouteRefParams(
1310
- selectedTemplateRouteRef
1311
- );
1312
- const templateRef = stringifyEntityRef({
1313
- kind: "Template",
1314
- namespace,
1315
- name: templateName
1316
- });
1317
- const errorApi = useApi(errorApiRef);
1318
- const { loading, manifest, error } = useTemplateParameterSchema(templateRef);
1319
- const onComplete = async (values) => {
1320
- const { taskId } = await scaffolderApi.scaffold({
1321
- templateRef,
1322
- values,
1323
- secrets
1324
- });
1325
- navigate(taskRoute({ taskId }));
1326
- };
1327
- useEffect(() => {
1328
- if (error) {
1329
- errorApi.post(new Error(`Failed to load template, ${error}`));
1330
- }
1331
- }, [error, errorApi]);
1332
- if (error) {
1333
- return /* @__PURE__ */ React.createElement(Navigate, { to: rootRef() });
1334
- }
1335
- return /* @__PURE__ */ React.createElement(AnalyticsContext, { attributes: { entityRef: templateRef } }, /* @__PURE__ */ React.createElement(Page, { themeId: "website" }, /* @__PURE__ */ React.createElement(
1336
- Header,
1337
- {
1338
- pageTitleOverride: "Create a new component",
1339
- title: "Create a new component",
1340
- subtitle: "Create new software components using standard templates in your organization"
1341
- }
1342
- ), /* @__PURE__ */ React.createElement(Content, null, loading && /* @__PURE__ */ React.createElement(Progress, null), manifest && /* @__PURE__ */ React.createElement(
1343
- InfoCard,
1344
- {
1345
- title: manifest.title,
1346
- subheader: /* @__PURE__ */ React.createElement(
1347
- MarkdownContent,
1348
- {
1349
- className: styles.markdown,
1350
- content: (_a = manifest.description) != null ? _a : "No description"
1351
- }
1352
- ),
1353
- noPadding: true,
1354
- titleTypographyProps: { component: "h2" }
1355
- },
1356
- /* @__PURE__ */ React.createElement(
1357
- Stepper,
1358
- {
1359
- manifest,
1360
- extensions: props.customFieldExtensions,
1361
- onComplete,
1362
- FormProps: props.FormProps
1363
- }
1364
- )
1365
- ))));
1366
- };
1367
-
1368
1268
  const scaffolderPlugin = createPlugin({
1369
1269
  id: "scaffolder",
1370
1270
  apis: [
@@ -1427,7 +1327,7 @@ const OwnerPickerFieldExtension = scaffolderPlugin.provide(
1427
1327
  const ScaffolderPage = scaffolderPlugin.provide(
1428
1328
  createRoutableExtension({
1429
1329
  name: "ScaffolderPage",
1430
- component: () => import('./Router-77e86b6b.esm.js').then((m) => m.Router),
1330
+ component: () => import('./Router-aedb6d68.esm.js').then((m) => m.Router),
1431
1331
  mountPoint: rootRouteRef$1
1432
1332
  })
1433
1333
  );
@@ -1448,7 +1348,7 @@ const EntityTagsPickerFieldExtension = scaffolderPlugin.provide(
1448
1348
  const NextScaffolderPage = scaffolderPlugin.provide(
1449
1349
  createRoutableExtension({
1450
1350
  name: "NextScaffolderPage",
1451
- component: () => import('./index-690bf85d.esm.js').then((m) => m.Router),
1351
+ component: () => import('./index-203b9f93.esm.js').then((m) => m.Router),
1452
1352
  mountPoint: nextRouteRef
1453
1353
  })
1454
1354
  );
@@ -1773,7 +1673,7 @@ const TaskStatusStepper = memo(
1773
1673
  const { steps, currentStepId, onUserStepChange } = props;
1774
1674
  const classes = useStyles(props);
1775
1675
  return /* @__PURE__ */ React.createElement("div", { className: classes.root }, /* @__PURE__ */ React.createElement(
1776
- Stepper$1,
1676
+ Stepper,
1777
1677
  {
1778
1678
  activeStep: steps.findIndex((s) => s.id === currentStepId),
1779
1679
  orientation: "vertical",
@@ -1906,6 +1806,8 @@ const createScaffolderFieldExtension = createScaffolderFieldExtension$1;
1906
1806
  const ScaffolderFieldExtensions = ScaffolderFieldExtensions$1;
1907
1807
  const useTemplateSecrets = useTemplateSecrets$1;
1908
1808
  const scaffolderApiRef = scaffolderApiRef$1;
1809
+ const createScaffolderLayout = createScaffolderLayout$1;
1810
+ const ScaffolderLayouts = ScaffolderLayouts$1;
1909
1811
 
1910
- export { ScaffolderFieldExtensions as $, createScaffolderLayout as A, ScaffolderLayouts as B, EntityPickerFieldExtension as C, EntityNamePickerFieldExtension as D, EntityPicker as E, EntityTagsPickerFieldExtension as F, OwnerPickerFieldExtension as G, OwnedEntityPickerFieldExtension as H, RepoUrlPickerFieldExtension as I, ScaffolderPage as J, scaffolderPlugin as K, LAYOUTS_WRAPPER_KEY as L, nextRouteRef as M, NextScaffolderPage as N, OwnerPicker as O, nextScaffolderTaskRouteRef as P, makeFieldSchemaFromZod as Q, RepoUrlPicker as R, ScaffolderClient as S, TemplateTypePicker as T, EntityPickerFieldSchema as U, OwnerPickerFieldSchema as V, RepoUrlPickerFieldSchema as W, OwnedEntityPickerFieldSchema as X, EntityTagsPickerFieldSchema as Y, rootRouteRef as Z, createScaffolderFieldExtension as _, actionsRouteRef as a, useTemplateSecrets as a0, scaffolderApiRef as a1, scaffolderListTaskRouteRef as b, scaffolderTaskRouteRef as c, rootRouteRef$1 as d, editRouteRef as e, TaskStatusStepper as f, TaskPageLinks as g, LAYOUTS_KEY as h, TaskPage as i, EntityPickerSchema as j, EntityNamePicker as k, legacySelectedTemplateRouteRef as l, entityNamePickerValidation as m, EntityNamePickerSchema as n, EntityTagsPicker as o, EntityTagsPickerSchema as p, repoPickerValidation as q, registerComponentRouteRef as r, selectedTemplateRouteRef as s, RepoUrlPickerSchema as t, OwnerPickerSchema as u, viewTechDocRouteRef as v, OwnedEntityPicker as w, OwnedEntityPickerSchema as x, nextSelectedTemplateRouteRef as y, TemplateWizardPage as z };
1911
- //# sourceMappingURL=index-4dbb353c.esm.js.map
1812
+ export { EntityNamePickerFieldExtension as A, EntityTagsPickerFieldExtension as B, OwnerPickerFieldExtension as C, OwnedEntityPickerFieldExtension as D, EntityPicker as E, RepoUrlPickerFieldExtension as F, ScaffolderPage as G, scaffolderPlugin as H, nextScaffolderTaskRouteRef as I, makeFieldSchemaFromZod as J, EntityPickerFieldSchema as K, OwnerPickerFieldSchema as L, RepoUrlPickerFieldSchema as M, NextScaffolderPage as N, OwnerPicker as O, OwnedEntityPickerFieldSchema as P, EntityTagsPickerFieldSchema as Q, RepoUrlPicker as R, ScaffolderClient as S, TemplateTypePicker as T, rootRouteRef as U, createScaffolderFieldExtension as V, ScaffolderFieldExtensions as W, useTemplateSecrets as X, scaffolderApiRef as Y, createScaffolderLayout as Z, ScaffolderLayouts as _, actionsRouteRef as a, scaffolderListTaskRouteRef as b, scaffolderTaskRouteRef as c, rootRouteRef$1 as d, editRouteRef as e, TaskStatusStepper as f, TaskPageLinks as g, TaskPage as h, EntityPickerSchema as i, EntityNamePicker as j, entityNamePickerValidation as k, legacySelectedTemplateRouteRef as l, EntityNamePickerSchema as m, EntityTagsPicker as n, EntityTagsPickerSchema as o, repoPickerValidation as p, RepoUrlPickerSchema as q, registerComponentRouteRef as r, selectedTemplateRouteRef as s, OwnerPickerSchema as t, OwnedEntityPicker as u, viewTechDocRouteRef as v, OwnedEntityPickerSchema as w, nextSelectedTemplateRouteRef as x, nextRouteRef as y, EntityPickerFieldExtension as z };
1813
+ //# sourceMappingURL=index-e0e59ed8.esm.js.map