@backstage/plugin-scaffolder 1.9.0-next.0 → 1.9.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.
@@ -3,7 +3,7 @@ import { useNavigate, Navigate, useOutlet, Routes, Route } from 'react-router';
3
3
  import { ItemCardHeader, MarkdownContent, Button, Link, ContentHeader, Progress, WarningPanel, Content, ItemCardGrid, Page, Header, CreateButton, SupportButton, StructuredMetadataTable, InfoCard, ErrorPage, ErrorPanel, LogViewer, StatusError, StatusOK, StatusPending, Lifecycle, EmptyState, Table as Table$1 } from '@backstage/core-components';
4
4
  import { useApp, useRouteRef, useApi, useRouteRefParams, useAnalytics, errorApiRef, featureFlagsApiRef, useApiHolder, AnalyticsContext, alertApiRef, useElementFilter } from '@backstage/core-plugin-api';
5
5
  import { getEntityRelations, getEntitySourceLocation, FavoriteEntity, EntityRefLinks, useEntityList, EntityListProvider, CatalogFilterLayout, EntitySearchBar, EntityKindPicker, UserListPicker, EntityTagPicker, catalogApiRef, humanizeEntityRef, EntityRefLink } from '@backstage/plugin-catalog-react';
6
- import { s as selectedTemplateRouteRef, v as viewTechDocRouteRef, e as editRouteRef, a as actionsRouteRef, b as scaffolderListTaskRouteRef, r as registerComponentRouteRef, T as TemplateTypePicker, S as SecretsContext, c as scaffolderApiRef, d as scaffolderTaskRouteRef, f as rootRouteRef, g as TaskStatusStepper, h as TaskPageLinks, F as FIELD_EXTENSION_WRAPPER_KEY, i as FIELD_EXTENSION_KEY, L as LAYOUTS_WRAPPER_KEY, j as LAYOUTS_KEY, l as legacySelectedTemplateRouteRef, k as SecretsContextProvider, m as TaskPage } from './index-ed1a1fba.esm.js';
6
+ import { s as selectedTemplateRouteRef, v as viewTechDocRouteRef, e as editRouteRef, a as actionsRouteRef, b as scaffolderListTaskRouteRef, r as registerComponentRouteRef, T as TemplateTypePicker, S as SecretsContext, c as scaffolderApiRef, d as scaffolderTaskRouteRef, f as rootRouteRef, g as TaskStatusStepper, h as TaskPageLinks, F as FIELD_EXTENSION_WRAPPER_KEY, i as FIELD_EXTENSION_KEY, L as LAYOUTS_WRAPPER_KEY, j as LAYOUTS_KEY, l as legacySelectedTemplateRouteRef, k as SecretsContextProvider, m as TaskPage } from './index-102258f6.esm.js';
7
7
  import { RELATION_OWNED_BY, parseEntityRef, stringifyEntityRef, DEFAULT_NAMESPACE } from '@backstage/catalog-model';
8
8
  import { makeStyles, useTheme, Card, CardMedia, CardContent, Box, Typography, Chip, CardActions, Tooltip, IconButton, Paper, Button as Button$1, Stepper, Step, StepLabel, StepContent, LinearProgress, TableContainer, Table, TableHead, TableRow, TableCell, TableBody, FormControl, InputLabel, Select, MenuItem as MenuItem$1, CardHeader, Divider as Divider$1, List as List$2, ListItemIcon as ListItemIcon$1, ListItemText as ListItemText$1 } from '@material-ui/core';
9
9
  import { scmIntegrationsApiRef, ScmIntegrationIcon } from '@backstage/integration-react';
@@ -27,7 +27,7 @@ import useAsync from 'react-use/lib/useAsync';
27
27
  import { withTheme } from '@rjsf/core';
28
28
  import { Theme } from '@rjsf/material-ui';
29
29
  import cloneDeep from 'lodash/cloneDeep';
30
- import { e as extractSchemaFromStep, D as DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS } from './schema-b28a29ab.esm.js';
30
+ import { e as extractSchemaFromStep, D as DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS } from './schema-4db0f1ff.esm.js';
31
31
  import classNames from 'classnames';
32
32
  import { StreamLanguage } from '@codemirror/language';
33
33
  import { yaml as yaml$1 } from '@codemirror/legacy-modes/mode/yaml';
@@ -157,17 +157,15 @@ const getTemplateCardProps = (template) => {
157
157
  };
158
158
  const DeprecationWarning = () => {
159
159
  const styles = useDeprecationStyles();
160
- const Title = /* @__PURE__ */ React.createElement(Typography, {
161
- style: { padding: 10, maxWidth: 300 }
162
- }, "This template uses a syntax that has been deprecated, and should be migrated to a newer syntax. Click for more info.");
163
- return /* @__PURE__ */ React.createElement("div", {
164
- className: styles.deprecationIcon
165
- }, /* @__PURE__ */ React.createElement(Tooltip, {
166
- title: Title
167
- }, /* @__PURE__ */ React.createElement(Link, {
168
- to: "https://backstage.io/docs/features/software-templates/migrating-from-v1beta2-to-v1beta3",
169
- className: styles.link
170
- }, /* @__PURE__ */ React.createElement(WarningIcon, null))));
160
+ const Title = /* @__PURE__ */ React.createElement(Typography, { style: { padding: 10, maxWidth: 300 } }, "This template uses a syntax that has been deprecated, and should be migrated to a newer syntax. Click for more info.");
161
+ return /* @__PURE__ */ React.createElement("div", { className: styles.deprecationIcon }, /* @__PURE__ */ React.createElement(Tooltip, { title: Title }, /* @__PURE__ */ React.createElement(
162
+ Link,
163
+ {
164
+ to: "https://backstage.io/docs/features/software-templates/migrating-from-v1beta2-to-v1beta3",
165
+ className: styles.link
166
+ },
167
+ /* @__PURE__ */ React.createElement(WarningIcon, null)
168
+ )));
171
169
  };
172
170
  const TemplateCard = ({ template, deprecated }) => {
173
171
  var _a, _b, _c;
@@ -197,73 +195,71 @@ const TemplateCard = ({ template, deprecated }) => {
197
195
  };
198
196
  const scmIntegrationsApi = useApi(scmIntegrationsApiRef);
199
197
  const sourceLocation = getEntitySourceLocation(template, scmIntegrationsApi);
200
- return /* @__PURE__ */ React.createElement(Card, null, /* @__PURE__ */ React.createElement(CardMedia, {
201
- className: classes.cardHeader
202
- }, /* @__PURE__ */ React.createElement(FavoriteEntity, {
203
- className: classes.starButton,
204
- entity: template
205
- }), deprecated && /* @__PURE__ */ React.createElement(DeprecationWarning, null), /* @__PURE__ */ React.createElement(ItemCardHeader, {
206
- title: templateProps.title,
207
- subtitle: templateProps.type,
208
- classes: { root: classes.title }
209
- })), /* @__PURE__ */ React.createElement(CardContent, {
210
- style: { display: "flex", flexDirection: "column", gap: "16px" }
211
- }, /* @__PURE__ */ React.createElement(Box, {
212
- className: classes.box
213
- }, /* @__PURE__ */ React.createElement(Typography, {
214
- variant: "body2",
215
- className: classes.label
216
- }, "Description"), /* @__PURE__ */ React.createElement(MarkdownContent, {
217
- className: classes.description,
218
- content: templateProps.description
219
- })), /* @__PURE__ */ React.createElement(Box, {
220
- className: classes.box
221
- }, /* @__PURE__ */ React.createElement(Typography, {
222
- variant: "body2",
223
- className: classes.label
224
- }, "Owner"), /* @__PURE__ */ React.createElement(EntityRefLinks, {
225
- entityRefs: ownedByRelations,
226
- defaultKind: "Group"
227
- })), /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Typography, {
228
- style: { marginBottom: "4px" },
229
- variant: "body2",
230
- className: classes.label
231
- }, "Tags"), (_b = templateProps.tags) == null ? void 0 : _b.map((tag) => /* @__PURE__ */ React.createElement(Chip, {
232
- size: "small",
233
- label: tag,
234
- key: tag
235
- })))), /* @__PURE__ */ React.createElement(Typography, {
236
- variant: "body2",
237
- className: [classes.label, classes.linksLabel].join(" ")
238
- }, "Links"), /* @__PURE__ */ React.createElement(CardActions, null, /* @__PURE__ */ React.createElement("div", {
239
- className: classes.leftButton
240
- }, sourceLocation && /* @__PURE__ */ React.createElement(Tooltip, {
241
- title: sourceLocation.integrationType || sourceLocation.locationTargetUrl
242
- }, /* @__PURE__ */ React.createElement(IconButton, {
243
- className: classes.leftButton,
244
- href: sourceLocation.locationTargetUrl
245
- }, /* @__PURE__ */ React.createElement(ScmIntegrationIcon, {
246
- type: sourceLocation.integrationType
247
- }))), viewTechDocsLink && /* @__PURE__ */ React.createElement(Tooltip, {
248
- title: "View TechDocs"
249
- }, /* @__PURE__ */ React.createElement(IconButton, {
250
- className: classes.leftButton,
251
- href: viewTechDocsLink
252
- }, /* @__PURE__ */ React.createElement(MuiIcon, {
253
- icon: iconResolver("docs")
254
- }))), (_c = templateProps.links) == null ? void 0 : _c.map((link, i) => /* @__PURE__ */ React.createElement(Tooltip, {
255
- key: `${link.url}_${i}`,
256
- title: link.title || link.url
257
- }, /* @__PURE__ */ React.createElement(IconButton, {
258
- size: "medium",
259
- href: link.url
260
- }, /* @__PURE__ */ React.createElement(MuiIcon, {
261
- icon: iconResolver(link.icon)
262
- }))))), /* @__PURE__ */ React.createElement(Button, {
263
- color: "primary",
264
- to: href,
265
- "aria-label": `Choose ${templateProps.title}`
266
- }, "Choose")));
198
+ return /* @__PURE__ */ React.createElement(Card, null, /* @__PURE__ */ React.createElement(CardMedia, { className: classes.cardHeader }, /* @__PURE__ */ React.createElement(FavoriteEntity, { className: classes.starButton, entity: template }), deprecated && /* @__PURE__ */ React.createElement(DeprecationWarning, null), /* @__PURE__ */ React.createElement(
199
+ ItemCardHeader,
200
+ {
201
+ title: templateProps.title,
202
+ subtitle: templateProps.type,
203
+ classes: { root: classes.title }
204
+ }
205
+ )), /* @__PURE__ */ React.createElement(
206
+ CardContent,
207
+ {
208
+ style: { display: "flex", flexDirection: "column", gap: "16px" }
209
+ },
210
+ /* @__PURE__ */ React.createElement(Box, { className: classes.box }, /* @__PURE__ */ React.createElement(Typography, { variant: "body2", className: classes.label }, "Description"), /* @__PURE__ */ React.createElement(
211
+ MarkdownContent,
212
+ {
213
+ className: classes.description,
214
+ content: templateProps.description
215
+ }
216
+ )),
217
+ /* @__PURE__ */ React.createElement(Box, { className: classes.box }, /* @__PURE__ */ React.createElement(Typography, { variant: "body2", className: classes.label }, "Owner"), /* @__PURE__ */ React.createElement(EntityRefLinks, { entityRefs: ownedByRelations, defaultKind: "Group" })),
218
+ /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(
219
+ Typography,
220
+ {
221
+ style: { marginBottom: "4px" },
222
+ variant: "body2",
223
+ className: classes.label
224
+ },
225
+ "Tags"
226
+ ), (_b = templateProps.tags) == null ? void 0 : _b.map((tag) => /* @__PURE__ */ React.createElement(Chip, { size: "small", label: tag, key: tag })))
227
+ ), /* @__PURE__ */ React.createElement(
228
+ Typography,
229
+ {
230
+ variant: "body2",
231
+ className: [classes.label, classes.linksLabel].join(" ")
232
+ },
233
+ "Links"
234
+ ), /* @__PURE__ */ React.createElement(CardActions, null, /* @__PURE__ */ React.createElement("div", { className: classes.leftButton }, sourceLocation && /* @__PURE__ */ React.createElement(
235
+ Tooltip,
236
+ {
237
+ title: sourceLocation.integrationType || sourceLocation.locationTargetUrl
238
+ },
239
+ /* @__PURE__ */ React.createElement(
240
+ IconButton,
241
+ {
242
+ className: classes.leftButton,
243
+ href: sourceLocation.locationTargetUrl
244
+ },
245
+ /* @__PURE__ */ React.createElement(ScmIntegrationIcon, { type: sourceLocation.integrationType })
246
+ )
247
+ ), viewTechDocsLink && /* @__PURE__ */ React.createElement(Tooltip, { title: "View TechDocs" }, /* @__PURE__ */ React.createElement(
248
+ IconButton,
249
+ {
250
+ className: classes.leftButton,
251
+ href: viewTechDocsLink
252
+ },
253
+ /* @__PURE__ */ React.createElement(MuiIcon, { icon: iconResolver("docs") })
254
+ )), (_c = templateProps.links) == null ? void 0 : _c.map((link, i) => /* @__PURE__ */ React.createElement(Tooltip, { key: `${link.url}_${i}`, title: link.title || link.url }, /* @__PURE__ */ React.createElement(IconButton, { size: "medium", href: link.url }, /* @__PURE__ */ React.createElement(MuiIcon, { icon: iconResolver(link.icon) }))))), /* @__PURE__ */ React.createElement(
255
+ Button,
256
+ {
257
+ color: "primary",
258
+ to: href,
259
+ "aria-label": `Choose ${templateProps.title}`
260
+ },
261
+ "Choose"
262
+ )));
267
263
  };
268
264
 
269
265
  const TemplateList = ({
@@ -276,30 +272,23 @@ const TemplateList = ({
276
272
  const titleComponent = (() => {
277
273
  if (group && group.title) {
278
274
  if (typeof group.title === "string") {
279
- return /* @__PURE__ */ React.createElement(ContentHeader, {
280
- title: group.title
281
- });
275
+ return /* @__PURE__ */ React.createElement(ContentHeader, { title: group.title });
282
276
  }
283
277
  return group.title;
284
278
  }
285
- return /* @__PURE__ */ React.createElement(ContentHeader, {
286
- title: "Other Templates"
287
- });
279
+ return /* @__PURE__ */ React.createElement(ContentHeader, { title: "Other Templates" });
288
280
  })();
289
281
  if (group && maybeFilteredEntities.length === 0) {
290
282
  return null;
291
283
  }
292
- return /* @__PURE__ */ React.createElement(React.Fragment, null, loading && /* @__PURE__ */ React.createElement(Progress, null), error && /* @__PURE__ */ React.createElement(WarningPanel, {
293
- title: "Oops! Something went wrong loading the templates"
294
- }, error.message), !error && !loading && !entities.length && /* @__PURE__ */ React.createElement(Typography, {
295
- variant: "body2"
296
- }, "No templates found that match your filter. Learn more about", " ", /* @__PURE__ */ React.createElement(Link, {
297
- to: "https://backstage.io/docs/features/software-templates/adding-templates"
298
- }, "adding templates"), "."), /* @__PURE__ */ React.createElement(Content, null, titleComponent, /* @__PURE__ */ React.createElement(ItemCardGrid, null, maybeFilteredEntities && (maybeFilteredEntities == null ? void 0 : maybeFilteredEntities.length) > 0 && maybeFilteredEntities.map((template) => /* @__PURE__ */ React.createElement(Card, {
299
- key: stringifyEntityRef(template),
300
- template,
301
- deprecated: template.apiVersion === "backstage.io/v1beta2"
302
- })))));
284
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, loading && /* @__PURE__ */ React.createElement(Progress, null), error && /* @__PURE__ */ React.createElement(WarningPanel, { title: "Oops! Something went wrong loading the templates" }, error.message), !error && !loading && !entities.length && /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, "No templates found that match your filter. Learn more about", " ", /* @__PURE__ */ React.createElement(Link, { to: "https://backstage.io/docs/features/software-templates/adding-templates" }, "adding templates"), "."), /* @__PURE__ */ React.createElement(Content, null, titleComponent, /* @__PURE__ */ React.createElement(ItemCardGrid, null, maybeFilteredEntities && (maybeFilteredEntities == null ? void 0 : maybeFilteredEntities.length) > 0 && maybeFilteredEntities.map((template) => /* @__PURE__ */ React.createElement(
285
+ Card,
286
+ {
287
+ key: stringifyEntityRef(template),
288
+ template,
289
+ deprecated: template.apiVersion === "backstage.io/v1beta2"
290
+ }
291
+ )))));
303
292
  };
304
293
 
305
294
  const useStyles$e = makeStyles$1({
@@ -326,39 +315,29 @@ function ScaffolderPageContextMenu(props) {
326
315
  const onClose = () => {
327
316
  setAnchorEl(void 0);
328
317
  };
329
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(IconButton$1, {
330
- "aria-label": "more",
331
- "aria-controls": "long-menu",
332
- "aria-haspopup": "true",
333
- onClick: onOpen,
334
- "data-testid": "menu-button",
335
- color: "inherit",
336
- className: classes.button
337
- }, /* @__PURE__ */ React.createElement(MoreVert, null)), /* @__PURE__ */ React.createElement(Popover, {
338
- open: Boolean(anchorEl),
339
- onClose,
340
- anchorEl,
341
- anchorOrigin: { vertical: "bottom", horizontal: "right" },
342
- transformOrigin: { vertical: "top", horizontal: "right" }
343
- }, /* @__PURE__ */ React.createElement(MenuList, null, showEditor && /* @__PURE__ */ React.createElement(MenuItem, {
344
- onClick: () => navigate(editLink())
345
- }, /* @__PURE__ */ React.createElement(ListItemIcon, null, /* @__PURE__ */ React.createElement(Edit, {
346
- fontSize: "small"
347
- })), /* @__PURE__ */ React.createElement(ListItemText, {
348
- primary: "Template Editor"
349
- })), showActions && /* @__PURE__ */ React.createElement(MenuItem, {
350
- onClick: () => navigate(actionsLink())
351
- }, /* @__PURE__ */ React.createElement(ListItemIcon, null, /* @__PURE__ */ React.createElement(Description, {
352
- fontSize: "small"
353
- })), /* @__PURE__ */ React.createElement(ListItemText, {
354
- primary: "Installed Actions"
355
- })), showTasks && /* @__PURE__ */ React.createElement(MenuItem, {
356
- onClick: () => navigate(tasksLink())
357
- }, /* @__PURE__ */ React.createElement(ListItemIcon, null, /* @__PURE__ */ React.createElement(List, {
358
- fontSize: "small"
359
- })), /* @__PURE__ */ React.createElement(ListItemText, {
360
- primary: "Task List"
361
- })))));
318
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
319
+ IconButton$1,
320
+ {
321
+ "aria-label": "more",
322
+ "aria-controls": "long-menu",
323
+ "aria-haspopup": "true",
324
+ onClick: onOpen,
325
+ "data-testid": "menu-button",
326
+ color: "inherit",
327
+ className: classes.button
328
+ },
329
+ /* @__PURE__ */ React.createElement(MoreVert, null)
330
+ ), /* @__PURE__ */ React.createElement(
331
+ Popover,
332
+ {
333
+ open: Boolean(anchorEl),
334
+ onClose,
335
+ anchorEl,
336
+ anchorOrigin: { vertical: "bottom", horizontal: "right" },
337
+ transformOrigin: { vertical: "top", horizontal: "right" }
338
+ },
339
+ /* @__PURE__ */ React.createElement(MenuList, null, showEditor && /* @__PURE__ */ React.createElement(MenuItem, { onClick: () => navigate(editLink()) }, /* @__PURE__ */ React.createElement(ListItemIcon, null, /* @__PURE__ */ React.createElement(Edit, { fontSize: "small" })), /* @__PURE__ */ React.createElement(ListItemText, { primary: "Template Editor" })), showActions && /* @__PURE__ */ React.createElement(MenuItem, { onClick: () => navigate(actionsLink()) }, /* @__PURE__ */ React.createElement(ListItemIcon, null, /* @__PURE__ */ React.createElement(Description, { fontSize: "small" })), /* @__PURE__ */ React.createElement(ListItemText, { primary: "Installed Actions" })), showTasks && /* @__PURE__ */ React.createElement(MenuItem, { onClick: () => navigate(tasksLink()) }, /* @__PURE__ */ React.createElement(ListItemIcon, null, /* @__PURE__ */ React.createElement(List, { fontSize: "small" })), /* @__PURE__ */ React.createElement(ListItemText, { primary: "Task List" })))
340
+ ));
362
341
  }
363
342
 
364
343
  const ScaffolderPageContents = ({
@@ -378,47 +357,57 @@ const ScaffolderPageContents = ({
378
357
  const { allowed } = usePermission({
379
358
  permission: catalogEntityCreatePermission
380
359
  });
381
- return /* @__PURE__ */ React.createElement(Page, {
382
- themeId: "home"
383
- }, /* @__PURE__ */ React.createElement(Header, {
384
- pageTitleOverride: "Create a New Component",
385
- title: "Create a New Component",
386
- subtitle: "Create new software components using standard templates",
387
- ...headerOptions
388
- }, /* @__PURE__ */ React.createElement(ScaffolderPageContextMenu, {
389
- ...contextMenu
390
- })), /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(ContentHeader, {
391
- title: "Available Templates"
392
- }, allowed && /* @__PURE__ */ React.createElement(CreateButton, {
393
- title: "Register Existing Component",
394
- to: registerComponentLink && registerComponentLink()
395
- }), /* @__PURE__ */ React.createElement(SupportButton, null, "Create new software components using standard templates. Different templates create different kinds of components (services, websites, documentation, ...).")), /* @__PURE__ */ React.createElement(CatalogFilterLayout, null, /* @__PURE__ */ React.createElement(CatalogFilterLayout.Filters, null, /* @__PURE__ */ React.createElement(EntitySearchBar, null), /* @__PURE__ */ React.createElement(EntityKindPicker, {
396
- initialFilter: "template",
397
- hidden: true
398
- }), /* @__PURE__ */ React.createElement(UserListPicker, {
399
- initialFilter: "all",
400
- availableFilters: ["all", "starred"]
401
- }), /* @__PURE__ */ React.createElement(TemplateTypePicker, null), /* @__PURE__ */ React.createElement(EntityTagPicker, null)), /* @__PURE__ */ React.createElement(CatalogFilterLayout.Content, null, groups && groups.map((group, index) => /* @__PURE__ */ React.createElement(TemplateList, {
402
- key: index,
403
- TemplateCardComponent,
404
- group
405
- })), /* @__PURE__ */ React.createElement(TemplateList, {
406
- key: "other",
407
- TemplateCardComponent,
408
- group: otherTemplatesGroup
409
- })))));
360
+ return /* @__PURE__ */ React.createElement(Page, { themeId: "home" }, /* @__PURE__ */ React.createElement(
361
+ Header,
362
+ {
363
+ pageTitleOverride: "Create a New Component",
364
+ title: "Create a New Component",
365
+ subtitle: "Create new software components using standard templates",
366
+ ...headerOptions
367
+ },
368
+ /* @__PURE__ */ React.createElement(ScaffolderPageContextMenu, { ...contextMenu })
369
+ ), /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(ContentHeader, { title: "Available Templates" }, allowed && /* @__PURE__ */ React.createElement(
370
+ CreateButton,
371
+ {
372
+ title: "Register Existing Component",
373
+ to: registerComponentLink && registerComponentLink()
374
+ }
375
+ ), /* @__PURE__ */ React.createElement(SupportButton, null, "Create new software components using standard templates. Different templates create different kinds of components (services, websites, documentation, ...).")), /* @__PURE__ */ React.createElement(CatalogFilterLayout, null, /* @__PURE__ */ React.createElement(CatalogFilterLayout.Filters, null, /* @__PURE__ */ React.createElement(EntitySearchBar, null), /* @__PURE__ */ React.createElement(EntityKindPicker, { initialFilter: "template", hidden: true }), /* @__PURE__ */ React.createElement(
376
+ UserListPicker,
377
+ {
378
+ initialFilter: "all",
379
+ availableFilters: ["all", "starred"]
380
+ }
381
+ ), /* @__PURE__ */ React.createElement(TemplateTypePicker, null), /* @__PURE__ */ React.createElement(EntityTagPicker, null)), /* @__PURE__ */ React.createElement(CatalogFilterLayout.Content, null, groups && groups.map((group, index) => /* @__PURE__ */ React.createElement(
382
+ TemplateList,
383
+ {
384
+ key: index,
385
+ TemplateCardComponent,
386
+ group
387
+ }
388
+ )), /* @__PURE__ */ React.createElement(
389
+ TemplateList,
390
+ {
391
+ key: "other",
392
+ TemplateCardComponent,
393
+ group: otherTemplatesGroup
394
+ }
395
+ )))));
410
396
  };
411
397
  const ScaffolderPage = ({
412
398
  TemplateCardComponent,
413
399
  groups,
414
400
  contextMenu,
415
401
  headerOptions
416
- }) => /* @__PURE__ */ React.createElement(EntityListProvider, null, /* @__PURE__ */ React.createElement(ScaffolderPageContents, {
417
- TemplateCardComponent,
418
- groups,
419
- contextMenu,
420
- headerOptions
421
- }));
402
+ }) => /* @__PURE__ */ React.createElement(EntityListProvider, null, /* @__PURE__ */ React.createElement(
403
+ ScaffolderPageContents,
404
+ {
405
+ TemplateCardComponent,
406
+ groups,
407
+ contextMenu,
408
+ headerOptions
409
+ }
410
+ ));
422
411
 
423
412
  function isObject$1(value) {
424
413
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -509,10 +498,7 @@ function transformSchemaToProps(inputSchema, layouts = []) {
509
498
  return { schema, uiSchema };
510
499
  }
511
500
 
512
- const DescriptionField = ({ description }) => description && /* @__PURE__ */ React.createElement(MarkdownContent, {
513
- content: description,
514
- linkTarget: "_blank"
515
- });
501
+ const DescriptionField = ({ description }) => description && /* @__PURE__ */ React.createElement(MarkdownContent, { content: description, linkTarget: "_blank" });
516
502
 
517
503
  var fieldOverrides = /*#__PURE__*/Object.freeze({
518
504
  __proto__: null,
@@ -572,28 +558,22 @@ const ReviewStep = (props) => {
572
558
  handleReset,
573
559
  steps
574
560
  } = props;
575
- return /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(Paper, {
576
- square: true,
577
- elevation: 0
578
- }, /* @__PURE__ */ React.createElement(Typography, {
579
- variant: "h6"
580
- }, "Review and create"), /* @__PURE__ */ React.createElement(StructuredMetadataTable, {
581
- dense: true,
582
- metadata: getReviewData(formData, getUiSchemasFromSteps(steps))
583
- }), /* @__PURE__ */ React.createElement(Box, {
584
- mb: 4
585
- }), /* @__PURE__ */ React.createElement(Button$1, {
586
- onClick: handleBack,
587
- disabled: disableButtons
588
- }, "Back"), /* @__PURE__ */ React.createElement(Button$1, {
589
- onClick: handleReset,
590
- disabled: disableButtons
591
- }, "Reset"), /* @__PURE__ */ React.createElement(Button$1, {
592
- variant: "contained",
593
- color: "primary",
594
- onClick: handleCreate,
595
- disabled: disableButtons
596
- }, "Create")));
561
+ return /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(Paper, { square: true, elevation: 0 }, /* @__PURE__ */ React.createElement(Typography, { variant: "h6" }, "Review and create"), /* @__PURE__ */ React.createElement(
562
+ StructuredMetadataTable,
563
+ {
564
+ dense: true,
565
+ metadata: getReviewData(formData, getUiSchemasFromSteps(steps))
566
+ }
567
+ ), /* @__PURE__ */ React.createElement(Box, { mb: 4 }), /* @__PURE__ */ React.createElement(Button$1, { onClick: handleBack, disabled: disableButtons }, "Back"), /* @__PURE__ */ React.createElement(Button$1, { onClick: handleReset, disabled: disableButtons }, "Reset"), /* @__PURE__ */ React.createElement(
568
+ Button$1,
569
+ {
570
+ variant: "contained",
571
+ color: "primary",
572
+ onClick: handleCreate,
573
+ disabled: disableButtons
574
+ },
575
+ "Create"
576
+ )));
597
577
  };
598
578
 
599
579
  const Form$1 = withTheme(Theme);
@@ -675,51 +655,46 @@ const MultistepJsonForm = (props) => {
675
655
  }
676
656
  };
677
657
  const ReviewStepElement = ReviewStepComponent != null ? ReviewStepComponent : ReviewStep;
678
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Stepper, {
679
- activeStep,
680
- orientation: "vertical"
681
- }, steps.map(({ title, schema, ...formProps }, index) => {
682
- return /* @__PURE__ */ React.createElement(Step, {
683
- key: title
684
- }, /* @__PURE__ */ React.createElement(StepLabel, {
685
- "aria-label": `Step ${index + 1} ${title}`,
686
- "aria-disabled": "false",
687
- tabIndex: 0
688
- }, /* @__PURE__ */ React.createElement(Typography, {
689
- variant: "h6",
690
- component: "h3"
691
- }, title)), /* @__PURE__ */ React.createElement(StepContent, {
692
- key: title
693
- }, /* @__PURE__ */ React.createElement(Form$1, {
694
- showErrorList: false,
695
- fields: { ...fieldOverrides, ...fields },
696
- widgets,
697
- noHtml5Validate: true,
698
- formData,
699
- formContext: { formData },
700
- onChange,
701
- onSubmit: (e) => {
702
- if (e.errors.length === 0)
703
- handleNext();
658
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Stepper, { activeStep, orientation: "vertical" }, steps.map(({ title, schema, ...formProps }, index) => {
659
+ return /* @__PURE__ */ React.createElement(Step, { key: title }, /* @__PURE__ */ React.createElement(
660
+ StepLabel,
661
+ {
662
+ "aria-label": `Step ${index + 1} ${title}`,
663
+ "aria-disabled": "false",
664
+ tabIndex: 0
704
665
  },
705
- ...formProps,
706
- ...transformSchemaToProps(schema, layouts)
707
- }, /* @__PURE__ */ React.createElement(Button$1, {
708
- disabled: activeStep === 0,
709
- onClick: handleBack
710
- }, "Back"), /* @__PURE__ */ React.createElement(Button$1, {
711
- variant: "contained",
712
- color: "primary",
713
- type: "submit"
714
- }, "Next step"))));
715
- })), activeStep === steps.length && /* @__PURE__ */ React.createElement(ReviewStepElement, {
716
- disableButtons,
717
- handleBack,
718
- handleCreate,
719
- handleReset,
720
- formData,
721
- steps: getSchemasFromSteps(steps)
722
- }));
666
+ /* @__PURE__ */ React.createElement(Typography, { variant: "h6", component: "h3" }, title)
667
+ ), /* @__PURE__ */ React.createElement(StepContent, { key: title }, /* @__PURE__ */ React.createElement(
668
+ Form$1,
669
+ {
670
+ showErrorList: false,
671
+ fields: { ...fieldOverrides, ...fields },
672
+ widgets,
673
+ noHtml5Validate: true,
674
+ formData,
675
+ formContext: { formData },
676
+ onChange,
677
+ onSubmit: (e) => {
678
+ if (e.errors.length === 0)
679
+ handleNext();
680
+ },
681
+ ...formProps,
682
+ ...transformSchemaToProps(schema, layouts)
683
+ },
684
+ /* @__PURE__ */ React.createElement(Button$1, { disabled: activeStep === 0, onClick: handleBack }, "Back"),
685
+ /* @__PURE__ */ React.createElement(Button$1, { variant: "contained", color: "primary", type: "submit" }, "Next step")
686
+ )));
687
+ })), activeStep === steps.length && /* @__PURE__ */ React.createElement(
688
+ ReviewStepElement,
689
+ {
690
+ disableButtons,
691
+ handleBack,
692
+ handleCreate,
693
+ handleReset,
694
+ formData,
695
+ steps: getSchemasFromSteps(steps)
696
+ }
697
+ ));
723
698
  };
724
699
 
725
700
  function isObject(obj) {
@@ -832,15 +807,11 @@ const TemplatePage = ({
832
807
  };
833
808
  if (error) {
834
809
  errorApi.post(new Error(`Failed to load template, ${error}`));
835
- return /* @__PURE__ */ React.createElement(Navigate, {
836
- to: rootRoute()
837
- });
810
+ return /* @__PURE__ */ React.createElement(Navigate, { to: rootRoute() });
838
811
  }
839
812
  if (!loading && !schema) {
840
813
  errorApi.post(new Error("Template was not found."));
841
- return /* @__PURE__ */ React.createElement(Navigate, {
842
- to: rootRoute()
843
- });
814
+ return /* @__PURE__ */ React.createElement(Navigate, { to: rootRoute() });
844
815
  }
845
816
  const customFieldComponents = Object.fromEntries(
846
817
  customFieldExtensions.map(({ name, component }) => [name, component])
@@ -848,40 +819,44 @@ const TemplatePage = ({
848
819
  const customFieldValidators = Object.fromEntries(
849
820
  customFieldExtensions.map(({ name, validation }) => [name, validation])
850
821
  );
851
- return /* @__PURE__ */ React.createElement(AnalyticsContext, {
852
- attributes: { entityRef: templateRef }
853
- }, /* @__PURE__ */ React.createElement(Page, {
854
- themeId: "home"
855
- }, /* @__PURE__ */ React.createElement(Header, {
856
- pageTitleOverride: "Create a New Component",
857
- title: "Create a New Component",
858
- subtitle: "Create new software components using standard templates",
859
- ...headerOptions
860
- }), /* @__PURE__ */ React.createElement(Content, null, loading && /* @__PURE__ */ React.createElement(LinearProgress, {
861
- "data-testid": "loading-progress"
862
- }), schema && /* @__PURE__ */ React.createElement(InfoCard, {
863
- title: schema.title,
864
- noPadding: true,
865
- titleTypographyProps: { component: "h2" }
866
- }, /* @__PURE__ */ React.createElement(MultistepJsonForm, {
867
- ReviewStepComponent,
868
- formData: formState,
869
- fields: customFieldComponents,
870
- onChange: handleChange,
871
- onReset: handleFormReset,
872
- onFinish: handleCreate,
873
- layouts,
874
- steps: schema.steps.map((step) => {
875
- return {
876
- ...step,
877
- validate: createValidator(
878
- step.schema,
879
- customFieldValidators,
880
- { apiHolder }
881
- )
882
- };
883
- })
884
- })))));
822
+ return /* @__PURE__ */ React.createElement(AnalyticsContext, { attributes: { entityRef: templateRef } }, /* @__PURE__ */ React.createElement(Page, { themeId: "home" }, /* @__PURE__ */ React.createElement(
823
+ Header,
824
+ {
825
+ pageTitleOverride: "Create a New Component",
826
+ title: "Create a New Component",
827
+ subtitle: "Create new software components using standard templates",
828
+ ...headerOptions
829
+ }
830
+ ), /* @__PURE__ */ React.createElement(Content, null, loading && /* @__PURE__ */ React.createElement(LinearProgress, { "data-testid": "loading-progress" }), schema && /* @__PURE__ */ React.createElement(
831
+ InfoCard,
832
+ {
833
+ title: schema.title,
834
+ noPadding: true,
835
+ titleTypographyProps: { component: "h2" }
836
+ },
837
+ /* @__PURE__ */ React.createElement(
838
+ MultistepJsonForm,
839
+ {
840
+ ReviewStepComponent,
841
+ formData: formState,
842
+ fields: customFieldComponents,
843
+ onChange: handleChange,
844
+ onReset: handleFormReset,
845
+ onFinish: handleCreate,
846
+ layouts,
847
+ steps: schema.steps.map((step) => {
848
+ return {
849
+ ...step,
850
+ validate: createValidator(
851
+ step.schema,
852
+ customFieldValidators,
853
+ { apiHolder }
854
+ )
855
+ };
856
+ })
857
+ }
858
+ )
859
+ ))));
885
860
  };
886
861
 
887
862
  const useStyles$d = makeStyles((theme) => ({
@@ -915,10 +890,13 @@ const ActionsPage = () => {
915
890
  return /* @__PURE__ */ React.createElement(Progress, null);
916
891
  }
917
892
  if (error) {
918
- return /* @__PURE__ */ React.createElement(ErrorPage, {
919
- statusMessage: "Failed to load installed actions",
920
- status: "500"
921
- });
893
+ return /* @__PURE__ */ React.createElement(
894
+ ErrorPage,
895
+ {
896
+ statusMessage: "Failed to load installed actions",
897
+ status: "500"
898
+ }
899
+ );
922
900
  }
923
901
  const formatRows = (input) => {
924
902
  const properties = input.properties;
@@ -932,34 +910,20 @@ const ActionsPage = () => {
932
910
  const codeClassname = classNames(classes.code, {
933
911
  [classes.codeRequired]: (_a = input.required) == null ? void 0 : _a.includes(key)
934
912
  });
935
- return /* @__PURE__ */ React.createElement(TableRow, {
936
- key
937
- }, /* @__PURE__ */ React.createElement(TableCell, null, /* @__PURE__ */ React.createElement("div", {
938
- className: codeClassname
939
- }, key)), /* @__PURE__ */ React.createElement(TableCell, null, props.title), /* @__PURE__ */ React.createElement(TableCell, null, props.description), /* @__PURE__ */ React.createElement(TableCell, null, /* @__PURE__ */ React.createElement("span", {
940
- className: classes.code
941
- }, props.type)));
913
+ return /* @__PURE__ */ React.createElement(TableRow, { key }, /* @__PURE__ */ React.createElement(TableCell, null, /* @__PURE__ */ React.createElement("div", { className: codeClassname }, key)), /* @__PURE__ */ React.createElement(TableCell, null, props.title), /* @__PURE__ */ React.createElement(TableCell, null, props.description), /* @__PURE__ */ React.createElement(TableCell, null, /* @__PURE__ */ React.createElement("span", { className: classes.code }, props.type)));
942
914
  });
943
915
  };
944
916
  const renderTable = (input) => {
945
917
  if (!input.properties) {
946
918
  return void 0;
947
919
  }
948
- return /* @__PURE__ */ React.createElement(TableContainer, {
949
- component: Paper
950
- }, /* @__PURE__ */ React.createElement(Table, {
951
- size: "small"
952
- }, /* @__PURE__ */ React.createElement(TableHead, null, /* @__PURE__ */ React.createElement(TableRow, null, /* @__PURE__ */ React.createElement(TableCell, null, "Name"), /* @__PURE__ */ React.createElement(TableCell, null, "Title"), /* @__PURE__ */ React.createElement(TableCell, null, "Description"), /* @__PURE__ */ React.createElement(TableCell, null, "Type"))), /* @__PURE__ */ React.createElement(TableBody, null, formatRows(input))));
920
+ return /* @__PURE__ */ React.createElement(TableContainer, { component: Paper }, /* @__PURE__ */ React.createElement(Table, { size: "small" }, /* @__PURE__ */ React.createElement(TableHead, null, /* @__PURE__ */ React.createElement(TableRow, null, /* @__PURE__ */ React.createElement(TableCell, null, "Name"), /* @__PURE__ */ React.createElement(TableCell, null, "Title"), /* @__PURE__ */ React.createElement(TableCell, null, "Description"), /* @__PURE__ */ React.createElement(TableCell, null, "Type"))), /* @__PURE__ */ React.createElement(TableBody, null, formatRows(input))));
953
921
  };
954
922
  const renderTables = (name, input) => {
955
923
  if (!input) {
956
924
  return void 0;
957
925
  }
958
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Typography, {
959
- variant: "h6"
960
- }, name), input.map((i, index) => /* @__PURE__ */ React.createElement("div", {
961
- key: index
962
- }, renderTable(i))));
926
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Typography, { variant: "h6" }, name), input.map((i, index) => /* @__PURE__ */ React.createElement("div", { key: index }, renderTable(i))));
963
927
  };
964
928
  const items = value == null ? void 0 : value.map((action) => {
965
929
  var _a, _b, _c, _d;
@@ -967,29 +931,16 @@ const ActionsPage = () => {
967
931
  return void 0;
968
932
  }
969
933
  const oneOf = renderTables("oneOf", (_b = (_a = action.schema) == null ? void 0 : _a.input) == null ? void 0 : _b.oneOf);
970
- return /* @__PURE__ */ React.createElement(Box, {
971
- pb: 4,
972
- key: action.id
973
- }, /* @__PURE__ */ React.createElement(Typography, {
974
- variant: "h4",
975
- className: classes.code
976
- }, action.id), /* @__PURE__ */ React.createElement(Typography, null, action.description), ((_c = action.schema) == null ? void 0 : _c.input) && /* @__PURE__ */ React.createElement(Box, {
977
- pb: 2
978
- }, /* @__PURE__ */ React.createElement(Typography, {
979
- variant: "h5"
980
- }, "Input"), renderTable(action.schema.input), oneOf), ((_d = action.schema) == null ? void 0 : _d.output) && /* @__PURE__ */ React.createElement(Box, {
981
- pb: 2
982
- }, /* @__PURE__ */ React.createElement(Typography, {
983
- variant: "h5"
984
- }, "Output"), renderTable(action.schema.output)));
934
+ return /* @__PURE__ */ React.createElement(Box, { pb: 4, key: action.id }, /* @__PURE__ */ React.createElement(Typography, { variant: "h4", className: classes.code }, action.id), /* @__PURE__ */ React.createElement(Typography, null, action.description), ((_c = action.schema) == null ? void 0 : _c.input) && /* @__PURE__ */ React.createElement(Box, { pb: 2 }, /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, "Input"), renderTable(action.schema.input), oneOf), ((_d = action.schema) == null ? void 0 : _d.output) && /* @__PURE__ */ React.createElement(Box, { pb: 2 }, /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, "Output"), renderTable(action.schema.output)));
985
935
  });
986
- return /* @__PURE__ */ React.createElement(Page, {
987
- themeId: "home"
988
- }, /* @__PURE__ */ React.createElement(Header, {
989
- pageTitleOverride: "Create a New Component",
990
- title: "Installed actions",
991
- subtitle: "This is the collection of all installed actions"
992
- }), /* @__PURE__ */ React.createElement(Content, null, items));
936
+ return /* @__PURE__ */ React.createElement(Page, { themeId: "home" }, /* @__PURE__ */ React.createElement(
937
+ Header,
938
+ {
939
+ pageTitleOverride: "Create a New Component",
940
+ title: "Installed actions",
941
+ subtitle: "This is the collection of all installed actions"
942
+ }
943
+ ), /* @__PURE__ */ React.createElement(Content, null, items));
993
944
  };
994
945
 
995
946
  const showDirectoryPicker = window.showDirectoryPicker;
@@ -1213,15 +1164,11 @@ function DirectoryEditorProvider(props) {
1213
1164
  execute(directory);
1214
1165
  }, [execute, directory]);
1215
1166
  if (error) {
1216
- return /* @__PURE__ */ React.createElement(ErrorPanel, {
1217
- error
1218
- });
1167
+ return /* @__PURE__ */ React.createElement(ErrorPanel, { error });
1219
1168
  } else if (!result) {
1220
1169
  return /* @__PURE__ */ React.createElement(Progress, null);
1221
1170
  }
1222
- return /* @__PURE__ */ React.createElement(DirectoryEditorContext.Provider, {
1223
- value: result
1224
- }, props.children);
1171
+ return /* @__PURE__ */ React.createElement(DirectoryEditorContext.Provider, { value: result }, props.children);
1225
1172
  }
1226
1173
 
1227
1174
  const MAX_CONTENT_SIZE = 64 * 1024;
@@ -1229,10 +1176,10 @@ const CHUNK_SIZE = 32 * 1024;
1229
1176
  const DryRunContext = createContext(void 0);
1230
1177
  function base64EncodeContent(content) {
1231
1178
  if (content.length > MAX_CONTENT_SIZE) {
1232
- return btoa("<file too large>");
1179
+ return window.btoa("<file too large>");
1233
1180
  }
1234
1181
  try {
1235
- return btoa(content);
1182
+ return window.btoa(content);
1236
1183
  } catch {
1237
1184
  const decoder = new TextEncoder();
1238
1185
  const buffer = decoder.encode(content);
@@ -1242,7 +1189,7 @@ function base64EncodeContent(content) {
1242
1189
  String.fromCharCode(...buffer.slice(offset, offset + CHUNK_SIZE))
1243
1190
  );
1244
1191
  }
1245
- return btoa(chunks.join(""));
1192
+ return window.btoa(chunks.join(""));
1246
1193
  }
1247
1194
  }
1248
1195
  function DryRunProvider(props) {
@@ -1317,9 +1264,7 @@ function DryRunProvider(props) {
1317
1264
  }),
1318
1265
  [state, selectResult, deleteResult, execute]
1319
1266
  );
1320
- return /* @__PURE__ */ React.createElement(DryRunContext.Provider, {
1321
- value: dryRun
1322
- }, props.children);
1267
+ return /* @__PURE__ */ React.createElement(DryRunContext.Provider, { value: dryRun }, props.children);
1323
1268
  }
1324
1269
  function useDryRun() {
1325
1270
  const value = useContext(DryRunContext);
@@ -1440,23 +1385,19 @@ function TemplateEditorForm(props) {
1440
1385
  if (!steps) {
1441
1386
  return null;
1442
1387
  }
1443
- return /* @__PURE__ */ React.createElement("div", {
1444
- className: classes.containerWrapper
1445
- }, /* @__PURE__ */ React.createElement("div", {
1446
- className: classes.container
1447
- }, /* @__PURE__ */ React.createElement(ErrorBoundary, {
1448
- invalidator: steps,
1449
- setErrorText
1450
- }, /* @__PURE__ */ React.createElement(MultistepJsonForm, {
1451
- steps,
1452
- fields,
1453
- formData: data,
1454
- onChange: (e) => onUpdate(e.formData),
1455
- onReset: () => onUpdate({}),
1456
- finishButtonLabel: onDryRun && "Try It",
1457
- onFinish: onDryRun && (() => onDryRun(data)),
1458
- layouts
1459
- }))));
1388
+ return /* @__PURE__ */ React.createElement("div", { className: classes.containerWrapper }, /* @__PURE__ */ React.createElement("div", { className: classes.container }, /* @__PURE__ */ React.createElement(ErrorBoundary, { invalidator: steps, setErrorText }, /* @__PURE__ */ React.createElement(
1389
+ MultistepJsonForm,
1390
+ {
1391
+ steps,
1392
+ fields,
1393
+ formData: data,
1394
+ onChange: (e) => onUpdate(e.formData),
1395
+ onReset: () => onUpdate({}),
1396
+ finishButtonLabel: onDryRun && "Try It",
1397
+ onFinish: onDryRun && (() => onDryRun(data)),
1398
+ layouts
1399
+ }
1400
+ ))));
1460
1401
  }
1461
1402
  function TemplateEditorFormDirectoryEditorDryRun(props) {
1462
1403
  const { setErrorText, fieldExtensions = [], layouts } = props;
@@ -1481,15 +1422,18 @@ function TemplateEditorFormDirectoryEditorDryRun(props) {
1481
1422
  }
1482
1423
  };
1483
1424
  const content = selectedFile && selectedFile.path.match(/\.ya?ml$/) ? selectedFile.content : void 0;
1484
- return /* @__PURE__ */ React.createElement(TemplateEditorForm, {
1485
- onDryRun: handleDryRun,
1486
- fieldExtensions,
1487
- setErrorText,
1488
- content,
1489
- data,
1490
- onUpdate: setData,
1491
- layouts
1492
- });
1425
+ return /* @__PURE__ */ React.createElement(
1426
+ TemplateEditorForm,
1427
+ {
1428
+ onDryRun: handleDryRun,
1429
+ fieldExtensions,
1430
+ setErrorText,
1431
+ content,
1432
+ data,
1433
+ onUpdate: setData,
1434
+ layouts
1435
+ }
1436
+ );
1493
1437
  }
1494
1438
  TemplateEditorForm.DirectoryEditorDryRun = TemplateEditorFormDirectoryEditorDryRun;
1495
1439
 
@@ -1571,63 +1515,57 @@ const CustomFieldExplorer = ({
1571
1515
  },
1572
1516
  [setFieldFormState, setRefreshKey]
1573
1517
  );
1574
- return /* @__PURE__ */ React.createElement("main", {
1575
- className: classes.root
1576
- }, /* @__PURE__ */ React.createElement("div", {
1577
- className: classes.controls
1578
- }, /* @__PURE__ */ React.createElement(FormControl, {
1579
- variant: "outlined",
1580
- size: "small",
1581
- fullWidth: true
1582
- }, /* @__PURE__ */ React.createElement(InputLabel, {
1583
- id: "select-field-label"
1584
- }, "Choose Custom Field Extension"), /* @__PURE__ */ React.createElement(Select, {
1585
- value: selectedField,
1586
- label: "Choose Custom Field Extension",
1587
- labelId: "select-field-label",
1588
- onChange: (e) => handleSelectionChange(e.target.value)
1589
- }, fieldOptions.map((option, idx) => /* @__PURE__ */ React.createElement(MenuItem$1, {
1590
- key: idx,
1591
- value: option
1592
- }, option.name)))), /* @__PURE__ */ React.createElement(IconButton, {
1593
- size: "medium",
1594
- onClick: onClose
1595
- }, /* @__PURE__ */ React.createElement(CloseIcon, null))), /* @__PURE__ */ React.createElement("div", {
1596
- className: classes.fieldForm
1597
- }, /* @__PURE__ */ React.createElement(Card, null, /* @__PURE__ */ React.createElement(CardHeader, {
1598
- title: "Field Options"
1599
- }), /* @__PURE__ */ React.createElement(CardContent, null, /* @__PURE__ */ React.createElement(Form, {
1600
- showErrorList: false,
1601
- fields: { ...fieldOverrides, ...fieldComponents },
1602
- noHtml5Validate: true,
1603
- formData: fieldFormState,
1604
- formContext: { fieldFormState },
1605
- onSubmit: (e) => handleFieldConfigChange(e.formData),
1606
- schema: ((_a = selectedField.schema) == null ? void 0 : _a.uiOptions) || {}
1607
- }, /* @__PURE__ */ React.createElement(Button$1, {
1608
- variant: "contained",
1609
- color: "primary",
1610
- type: "submit",
1611
- disabled: !((_b = selectedField.schema) == null ? void 0 : _b.uiOptions)
1612
- }, "Apply"))))), /* @__PURE__ */ React.createElement("div", {
1613
- className: classes.preview
1614
- }, /* @__PURE__ */ React.createElement(Card, null, /* @__PURE__ */ React.createElement(CardHeader, {
1615
- title: "Example Template Spec"
1616
- }), /* @__PURE__ */ React.createElement(CardContent, null, /* @__PURE__ */ React.createElement(CodeMirror, {
1617
- readOnly: true,
1618
- theme: "dark",
1619
- height: "100%",
1620
- extensions: [StreamLanguage.define(yaml$1)],
1621
- value: sampleFieldTemplate
1622
- }))), /* @__PURE__ */ React.createElement(TemplateEditorForm, {
1623
- key: refreshKey,
1624
- content: sampleFieldTemplate,
1625
- contentIsSpec: true,
1626
- fieldExtensions: customFieldExtensions,
1627
- data: formState,
1628
- onUpdate: setFormState,
1629
- setErrorText: () => null
1630
- })));
1518
+ return /* @__PURE__ */ React.createElement("main", { className: classes.root }, /* @__PURE__ */ React.createElement("div", { className: classes.controls }, /* @__PURE__ */ React.createElement(FormControl, { variant: "outlined", size: "small", fullWidth: true }, /* @__PURE__ */ React.createElement(InputLabel, { id: "select-field-label" }, "Choose Custom Field Extension"), /* @__PURE__ */ React.createElement(
1519
+ Select,
1520
+ {
1521
+ value: selectedField,
1522
+ label: "Choose Custom Field Extension",
1523
+ labelId: "select-field-label",
1524
+ onChange: (e) => handleSelectionChange(e.target.value)
1525
+ },
1526
+ fieldOptions.map((option, idx) => /* @__PURE__ */ React.createElement(MenuItem$1, { key: idx, value: option }, option.name))
1527
+ )), /* @__PURE__ */ React.createElement(IconButton, { size: "medium", onClick: onClose }, /* @__PURE__ */ React.createElement(CloseIcon, null))), /* @__PURE__ */ React.createElement("div", { className: classes.fieldForm }, /* @__PURE__ */ React.createElement(Card, null, /* @__PURE__ */ React.createElement(CardHeader, { title: "Field Options" }), /* @__PURE__ */ React.createElement(CardContent, null, /* @__PURE__ */ React.createElement(
1528
+ Form,
1529
+ {
1530
+ showErrorList: false,
1531
+ fields: { ...fieldOverrides, ...fieldComponents },
1532
+ noHtml5Validate: true,
1533
+ formData: fieldFormState,
1534
+ formContext: { fieldFormState },
1535
+ onSubmit: (e) => handleFieldConfigChange(e.formData),
1536
+ schema: ((_a = selectedField.schema) == null ? void 0 : _a.uiOptions) || {}
1537
+ },
1538
+ /* @__PURE__ */ React.createElement(
1539
+ Button$1,
1540
+ {
1541
+ variant: "contained",
1542
+ color: "primary",
1543
+ type: "submit",
1544
+ disabled: !((_b = selectedField.schema) == null ? void 0 : _b.uiOptions)
1545
+ },
1546
+ "Apply"
1547
+ )
1548
+ )))), /* @__PURE__ */ React.createElement("div", { className: classes.preview }, /* @__PURE__ */ React.createElement(Card, null, /* @__PURE__ */ React.createElement(CardHeader, { title: "Example Template Spec" }), /* @__PURE__ */ React.createElement(CardContent, null, /* @__PURE__ */ React.createElement(
1549
+ CodeMirror,
1550
+ {
1551
+ readOnly: true,
1552
+ theme: "dark",
1553
+ height: "100%",
1554
+ extensions: [StreamLanguage.define(yaml$1)],
1555
+ value: sampleFieldTemplate
1556
+ }
1557
+ ))), /* @__PURE__ */ React.createElement(
1558
+ TemplateEditorForm,
1559
+ {
1560
+ key: refreshKey,
1561
+ content: sampleFieldTemplate,
1562
+ contentIsSpec: true,
1563
+ fieldExtensions: customFieldExtensions,
1564
+ data: formState,
1565
+ onUpdate: setFormState,
1566
+ setErrorText: () => null
1567
+ }
1568
+ )));
1631
1569
  };
1632
1570
 
1633
1571
  const useStyles$a = makeStyles$1((theme) => ({
@@ -1650,71 +1588,64 @@ const useStyles$a = makeStyles$1((theme) => ({
1650
1588
  function TemplateEditorIntro(props) {
1651
1589
  const classes = useStyles$a();
1652
1590
  const supportsLoad = WebFileSystemAccess.isSupported();
1653
- const cardLoadLocal = /* @__PURE__ */ React.createElement(Card$1, {
1654
- className: classes.card,
1655
- elevation: 4
1656
- }, /* @__PURE__ */ React.createElement(CardActionArea, {
1657
- disabled: !supportsLoad,
1658
- onClick: () => {
1659
- var _a;
1660
- return (_a = props.onSelect) == null ? void 0 : _a.call(props, "local");
1661
- }
1662
- }, /* @__PURE__ */ React.createElement(CardContent$1, null, /* @__PURE__ */ React.createElement(Typography$1, {
1663
- variant: "h5",
1664
- gutterBottom: true,
1665
- color: supportsLoad ? void 0 : "textSecondary",
1666
- style: { display: "flex", flexFlow: "row nowrap" }
1667
- }, "Load Template Directory"), /* @__PURE__ */ React.createElement(Typography$1, {
1668
- variant: "body1",
1669
- color: supportsLoad ? void 0 : "textSecondary"
1670
- }, "Load a local template directory, allowing you to both edit and try executing your own template."))), !supportsLoad && /* @__PURE__ */ React.createElement("div", {
1671
- className: classes.infoIcon
1672
- }, /* @__PURE__ */ React.createElement(Tooltip$1, {
1673
- placement: "top",
1674
- title: "Only supported in some Chromium-based browsers"
1675
- }, /* @__PURE__ */ React.createElement(InfoOutlinedIcon, null))));
1676
- const cardFormEditor = /* @__PURE__ */ React.createElement(Card$1, {
1677
- className: classes.card,
1678
- elevation: 4
1679
- }, /* @__PURE__ */ React.createElement(CardActionArea, {
1680
- onClick: () => {
1681
- var _a;
1682
- return (_a = props.onSelect) == null ? void 0 : _a.call(props, "form");
1683
- }
1684
- }, /* @__PURE__ */ React.createElement(CardContent$1, null, /* @__PURE__ */ React.createElement(Typography$1, {
1685
- variant: "h5",
1686
- gutterBottom: true
1687
- }, "Edit Template Form"), /* @__PURE__ */ React.createElement(Typography$1, {
1688
- variant: "body1"
1689
- }, "Preview and edit a template form, either using a sample template or by loading a template from the catalog."))));
1690
- const cardFieldExplorer = /* @__PURE__ */ React.createElement(Card$1, {
1691
- className: classes.card,
1692
- elevation: 4
1693
- }, /* @__PURE__ */ React.createElement(CardActionArea, {
1694
- onClick: () => {
1695
- var _a;
1696
- return (_a = props.onSelect) == null ? void 0 : _a.call(props, "field-explorer");
1697
- }
1698
- }, /* @__PURE__ */ React.createElement(CardContent$1, null, /* @__PURE__ */ React.createElement(Typography$1, {
1699
- variant: "h5",
1700
- gutterBottom: true
1701
- }, "Custom Field Explorer"), /* @__PURE__ */ React.createElement(Typography$1, {
1702
- variant: "body1"
1703
- }, "View and play around with available installed custom field extensions."))));
1704
- return /* @__PURE__ */ React.createElement("div", {
1705
- style: props.style
1706
- }, /* @__PURE__ */ React.createElement(Typography$1, {
1707
- variant: "h6",
1708
- className: classes.introText
1709
- }, "Get started by choosing one of the options below"), /* @__PURE__ */ React.createElement("div", {
1710
- style: {
1711
- display: "flex",
1712
- flexFlow: "row wrap",
1713
- alignItems: "flex-start",
1714
- justifyContent: "center",
1715
- alignContent: "flex-start"
1716
- }
1717
- }, supportsLoad && cardLoadLocal, cardFormEditor, !supportsLoad && cardLoadLocal, cardFieldExplorer));
1591
+ const cardLoadLocal = /* @__PURE__ */ React.createElement(Card$1, { className: classes.card, elevation: 4 }, /* @__PURE__ */ React.createElement(
1592
+ CardActionArea,
1593
+ {
1594
+ disabled: !supportsLoad,
1595
+ onClick: () => {
1596
+ var _a;
1597
+ return (_a = props.onSelect) == null ? void 0 : _a.call(props, "local");
1598
+ }
1599
+ },
1600
+ /* @__PURE__ */ React.createElement(CardContent$1, null, /* @__PURE__ */ React.createElement(
1601
+ Typography$1,
1602
+ {
1603
+ variant: "h5",
1604
+ gutterBottom: true,
1605
+ color: supportsLoad ? void 0 : "textSecondary",
1606
+ style: { display: "flex", flexFlow: "row nowrap" }
1607
+ },
1608
+ "Load Template Directory"
1609
+ ), /* @__PURE__ */ React.createElement(
1610
+ Typography$1,
1611
+ {
1612
+ variant: "body1",
1613
+ color: supportsLoad ? void 0 : "textSecondary"
1614
+ },
1615
+ "Load a local template directory, allowing you to both edit and try executing your own template."
1616
+ ))
1617
+ ), !supportsLoad && /* @__PURE__ */ React.createElement("div", { className: classes.infoIcon }, /* @__PURE__ */ React.createElement(
1618
+ Tooltip$1,
1619
+ {
1620
+ placement: "top",
1621
+ title: "Only supported in some Chromium-based browsers"
1622
+ },
1623
+ /* @__PURE__ */ React.createElement(InfoOutlinedIcon, null)
1624
+ )));
1625
+ const cardFormEditor = /* @__PURE__ */ React.createElement(Card$1, { className: classes.card, elevation: 4 }, /* @__PURE__ */ React.createElement(CardActionArea, { onClick: () => {
1626
+ var _a;
1627
+ return (_a = props.onSelect) == null ? void 0 : _a.call(props, "form");
1628
+ } }, /* @__PURE__ */ React.createElement(CardContent$1, null, /* @__PURE__ */ React.createElement(Typography$1, { variant: "h5", gutterBottom: true }, "Edit Template Form"), /* @__PURE__ */ React.createElement(Typography$1, { variant: "body1" }, "Preview and edit a template form, either using a sample template or by loading a template from the catalog."))));
1629
+ const cardFieldExplorer = /* @__PURE__ */ React.createElement(Card$1, { className: classes.card, elevation: 4 }, /* @__PURE__ */ React.createElement(CardActionArea, { onClick: () => {
1630
+ var _a;
1631
+ return (_a = props.onSelect) == null ? void 0 : _a.call(props, "field-explorer");
1632
+ } }, /* @__PURE__ */ React.createElement(CardContent$1, null, /* @__PURE__ */ React.createElement(Typography$1, { variant: "h5", gutterBottom: true }, "Custom Field Explorer"), /* @__PURE__ */ React.createElement(Typography$1, { variant: "body1" }, "View and play around with available installed custom field extensions."))));
1633
+ return /* @__PURE__ */ React.createElement("div", { style: props.style }, /* @__PURE__ */ React.createElement(Typography$1, { variant: "h6", className: classes.introText }, "Get started by choosing one of the options below"), /* @__PURE__ */ React.createElement(
1634
+ "div",
1635
+ {
1636
+ style: {
1637
+ display: "flex",
1638
+ flexFlow: "row wrap",
1639
+ alignItems: "flex-start",
1640
+ justifyContent: "center",
1641
+ alignContent: "flex-start"
1642
+ }
1643
+ },
1644
+ supportsLoad && cardLoadLocal,
1645
+ cardFormEditor,
1646
+ !supportsLoad && cardLoadLocal,
1647
+ cardFieldExplorer
1648
+ ));
1718
1649
  }
1719
1650
 
1720
1651
  const useStyles$9 = makeStyles$1((theme) => ({
@@ -1736,26 +1667,35 @@ const useStyles$9 = makeStyles$1((theme) => ({
1736
1667
  function DryRunResultsList() {
1737
1668
  const classes = useStyles$9();
1738
1669
  const dryRun = useDryRun();
1739
- return /* @__PURE__ */ React.createElement(List$1, {
1740
- className: classes.root,
1741
- dense: true
1742
- }, dryRun.results.map((result) => {
1670
+ return /* @__PURE__ */ React.createElement(List$1, { className: classes.root, dense: true }, dryRun.results.map((result) => {
1743
1671
  var _a;
1744
1672
  const failed = result.log.some((l) => l.body.status === "failed");
1745
- return /* @__PURE__ */ React.createElement(ListItem, {
1746
- button: true,
1747
- key: result.id,
1748
- selected: ((_a = dryRun.selectedResult) == null ? void 0 : _a.id) === result.id,
1749
- onClick: () => dryRun.selectResult(result.id)
1750
- }, /* @__PURE__ */ React.createElement(ListItemIcon, {
1751
- className: failed ? classes.iconFailure : classes.iconSuccess
1752
- }, failed ? /* @__PURE__ */ React.createElement(Cancel, null) : /* @__PURE__ */ React.createElement(Check, null)), /* @__PURE__ */ React.createElement(ListItemText, {
1753
- primary: `Result ${result.id}`
1754
- }), /* @__PURE__ */ React.createElement(ListItemSecondaryAction, null, /* @__PURE__ */ React.createElement(IconButton$1, {
1755
- edge: "end",
1756
- "aria-label": "delete",
1757
- onClick: () => dryRun.deleteResult(result.id)
1758
- }, /* @__PURE__ */ React.createElement(DeleteIcon, null))));
1673
+ return /* @__PURE__ */ React.createElement(
1674
+ ListItem,
1675
+ {
1676
+ button: true,
1677
+ key: result.id,
1678
+ selected: ((_a = dryRun.selectedResult) == null ? void 0 : _a.id) === result.id,
1679
+ onClick: () => dryRun.selectResult(result.id)
1680
+ },
1681
+ /* @__PURE__ */ React.createElement(
1682
+ ListItemIcon,
1683
+ {
1684
+ className: failed ? classes.iconFailure : classes.iconSuccess
1685
+ },
1686
+ failed ? /* @__PURE__ */ React.createElement(Cancel, null) : /* @__PURE__ */ React.createElement(Check, null)
1687
+ ),
1688
+ /* @__PURE__ */ React.createElement(ListItemText, { primary: `Result ${result.id}` }),
1689
+ /* @__PURE__ */ React.createElement(ListItemSecondaryAction, null, /* @__PURE__ */ React.createElement(
1690
+ IconButton$1,
1691
+ {
1692
+ edge: "end",
1693
+ "aria-label": "delete",
1694
+ onClick: () => dryRun.deleteResult(result.id)
1695
+ },
1696
+ /* @__PURE__ */ React.createElement(DeleteIcon, null)
1697
+ ))
1698
+ );
1759
1699
  }));
1760
1700
  }
1761
1701
 
@@ -1813,18 +1753,9 @@ function parseFileEntires(paths) {
1813
1753
  }
1814
1754
  function FileTreeItem({ entry }) {
1815
1755
  if (entry.type === "file") {
1816
- return /* @__PURE__ */ React.createElement(TreeItem, {
1817
- nodeId: entry.path,
1818
- label: entry.name
1819
- });
1756
+ return /* @__PURE__ */ React.createElement(TreeItem, { nodeId: entry.path, label: entry.name });
1820
1757
  }
1821
- return /* @__PURE__ */ React.createElement(TreeItem, {
1822
- nodeId: entry.path,
1823
- label: entry.name
1824
- }, entry.children.map((child) => /* @__PURE__ */ React.createElement(FileTreeItem, {
1825
- key: child.path,
1826
- entry: child
1827
- })));
1758
+ return /* @__PURE__ */ React.createElement(TreeItem, { nodeId: entry.path, label: entry.name }, entry.children.map((child) => /* @__PURE__ */ React.createElement(FileTreeItem, { key: child.path, entry: child })));
1828
1759
  }
1829
1760
  function FileBrowser(props) {
1830
1761
  const classes = useStyles$8();
@@ -1832,20 +1763,21 @@ function FileBrowser(props) {
1832
1763
  () => parseFileEntires(props.filePaths),
1833
1764
  [props.filePaths]
1834
1765
  );
1835
- return /* @__PURE__ */ React.createElement(TreeView, {
1836
- selected: props.selected,
1837
- className: classes.root,
1838
- defaultCollapseIcon: /* @__PURE__ */ React.createElement(ExpandMoreIcon, null),
1839
- defaultExpandIcon: /* @__PURE__ */ React.createElement(ChevronRightIcon, null),
1840
- onNodeSelect: (_e, nodeId) => {
1841
- if (props.onSelect && props.filePaths.includes(nodeId)) {
1842
- props.onSelect(nodeId);
1766
+ return /* @__PURE__ */ React.createElement(
1767
+ TreeView,
1768
+ {
1769
+ selected: props.selected,
1770
+ className: classes.root,
1771
+ defaultCollapseIcon: /* @__PURE__ */ React.createElement(ExpandMoreIcon, null),
1772
+ defaultExpandIcon: /* @__PURE__ */ React.createElement(ChevronRightIcon, null),
1773
+ onNodeSelect: (_e, nodeId) => {
1774
+ if (props.onSelect && props.filePaths.includes(nodeId)) {
1775
+ props.onSelect(nodeId);
1776
+ }
1843
1777
  }
1844
- }
1845
- }, fileTree.map((entry) => /* @__PURE__ */ React.createElement(FileTreeItem, {
1846
- key: entry.path,
1847
- entry
1848
- })));
1778
+ },
1779
+ fileTree.map((entry) => /* @__PURE__ */ React.createElement(FileTreeItem, { key: entry.path, entry }))
1780
+ );
1849
1781
  }
1850
1782
 
1851
1783
  const useStyles$7 = makeStyles$1((theme) => ({
@@ -1869,15 +1801,7 @@ function DryRunResultsSplitView(props) {
1869
1801
  if (childArray.length !== 2) {
1870
1802
  throw new Error("must have exactly 2 children");
1871
1803
  }
1872
- return /* @__PURE__ */ React.createElement("div", {
1873
- className: classes.root
1874
- }, /* @__PURE__ */ React.createElement("div", {
1875
- className: classNames(classes.child, classes.firstChild)
1876
- }, childArray[0]), /* @__PURE__ */ React.createElement(Divider, {
1877
- orientation: "horizontal"
1878
- }), /* @__PURE__ */ React.createElement("div", {
1879
- className: classes.child
1880
- }, childArray[1]));
1804
+ return /* @__PURE__ */ React.createElement("div", { className: classes.root }, /* @__PURE__ */ React.createElement("div", { className: classNames(classes.child, classes.firstChild) }, childArray[0]), /* @__PURE__ */ React.createElement(Divider, { orientation: "horizontal" }), /* @__PURE__ */ React.createElement("div", { className: classes.child }, childArray[1]));
1881
1805
  }
1882
1806
 
1883
1807
  const useStyles$6 = makeStyles$1({
@@ -1926,18 +1850,24 @@ function FilesContent() {
1926
1850
  if (!selectedResult) {
1927
1851
  return null;
1928
1852
  }
1929
- return /* @__PURE__ */ React.createElement(DryRunResultsSplitView, null, /* @__PURE__ */ React.createElement(FileBrowser, {
1930
- selected: selectedPath,
1931
- onSelect: setSelectedPath,
1932
- filePaths: selectedResult.directoryContents.map((file) => file.path)
1933
- }), /* @__PURE__ */ React.createElement(CodeMirror, {
1934
- className: classes.codeMirror,
1935
- theme: "dark",
1936
- height: "100%",
1937
- extensions: [StreamLanguage.define(yaml$1)],
1938
- readOnly: true,
1939
- value: (selectedFile == null ? void 0 : selectedFile.base64Content) ? atob(selectedFile.base64Content) : ""
1940
- }));
1853
+ return /* @__PURE__ */ React.createElement(DryRunResultsSplitView, null, /* @__PURE__ */ React.createElement(
1854
+ FileBrowser,
1855
+ {
1856
+ selected: selectedPath,
1857
+ onSelect: setSelectedPath,
1858
+ filePaths: selectedResult.directoryContents.map((file) => file.path)
1859
+ }
1860
+ ), /* @__PURE__ */ React.createElement(
1861
+ CodeMirror,
1862
+ {
1863
+ className: classes.codeMirror,
1864
+ theme: "dark",
1865
+ height: "100%",
1866
+ extensions: [StreamLanguage.define(yaml$1)],
1867
+ readOnly: true,
1868
+ value: (selectedFile == null ? void 0 : selectedFile.base64Content) ? atob(selectedFile.base64Content) : ""
1869
+ }
1870
+ ));
1941
1871
  }
1942
1872
  function LogContent() {
1943
1873
  var _a, _b;
@@ -1965,13 +1895,14 @@ function LogContent() {
1965
1895
  return null;
1966
1896
  }
1967
1897
  const selectedStep = (_a = steps.find((s) => s.id === currentStepId)) != null ? _a : steps[0];
1968
- return /* @__PURE__ */ React.createElement(DryRunResultsSplitView, null, /* @__PURE__ */ React.createElement(TaskStatusStepper, {
1969
- steps,
1970
- currentStepId: selectedStep.id,
1971
- onUserStepChange: setUserSelectedStepId
1972
- }), /* @__PURE__ */ React.createElement(LogViewer, {
1973
- text: (_b = selectedStep == null ? void 0 : selectedStep.logString) != null ? _b : ""
1974
- }));
1898
+ return /* @__PURE__ */ React.createElement(DryRunResultsSplitView, null, /* @__PURE__ */ React.createElement(
1899
+ TaskStatusStepper,
1900
+ {
1901
+ steps,
1902
+ currentStepId: selectedStep.id,
1903
+ onUserStepChange: setUserSelectedStepId
1904
+ }
1905
+ ), /* @__PURE__ */ React.createElement(LogViewer, { text: (_b = selectedStep == null ? void 0 : selectedStep.logString) != null ? _b : "" }));
1975
1906
  }
1976
1907
  function OutputContent() {
1977
1908
  var _a, _b;
@@ -1980,43 +1911,24 @@ function OutputContent() {
1980
1911
  if (!selectedResult) {
1981
1912
  return null;
1982
1913
  }
1983
- return /* @__PURE__ */ React.createElement(DryRunResultsSplitView, null, /* @__PURE__ */ React.createElement(Box$1, {
1984
- pt: 2
1985
- }, ((_b = (_a = selectedResult.output) == null ? void 0 : _a.links) == null ? void 0 : _b.length) && /* @__PURE__ */ React.createElement(TaskPageLinks, {
1986
- output: selectedResult.output
1987
- })), /* @__PURE__ */ React.createElement(CodeMirror, {
1988
- className: classes.codeMirror,
1989
- theme: "dark",
1990
- height: "100%",
1991
- extensions: [StreamLanguage.define(yaml$1)],
1992
- readOnly: true,
1993
- value: JSON.stringify(selectedResult.output, null, 2)
1994
- }));
1914
+ return /* @__PURE__ */ React.createElement(DryRunResultsSplitView, null, /* @__PURE__ */ React.createElement(Box$1, { pt: 2 }, ((_b = (_a = selectedResult.output) == null ? void 0 : _a.links) == null ? void 0 : _b.length) && /* @__PURE__ */ React.createElement(TaskPageLinks, { output: selectedResult.output })), /* @__PURE__ */ React.createElement(
1915
+ CodeMirror,
1916
+ {
1917
+ className: classes.codeMirror,
1918
+ theme: "dark",
1919
+ height: "100%",
1920
+ extensions: [StreamLanguage.define(yaml$1)],
1921
+ readOnly: true,
1922
+ value: JSON.stringify(selectedResult.output, null, 2)
1923
+ }
1924
+ ));
1995
1925
  }
1996
1926
  function DryRunResultsView() {
1997
1927
  const classes = useStyles$6();
1998
1928
  const [selectedTab, setSelectedTab] = useState(
1999
1929
  "files"
2000
1930
  );
2001
- return /* @__PURE__ */ React.createElement("div", {
2002
- className: classes.root
2003
- }, /* @__PURE__ */ React.createElement(Tabs, {
2004
- value: selectedTab,
2005
- onChange: (_, v) => setSelectedTab(v)
2006
- }, /* @__PURE__ */ React.createElement(Tab, {
2007
- value: "files",
2008
- label: "Files"
2009
- }), /* @__PURE__ */ React.createElement(Tab, {
2010
- value: "log",
2011
- label: "Log"
2012
- }), /* @__PURE__ */ React.createElement(Tab, {
2013
- value: "output",
2014
- label: "Output"
2015
- })), /* @__PURE__ */ React.createElement(Divider, null), /* @__PURE__ */ React.createElement("div", {
2016
- className: classes.contentWrapper
2017
- }, /* @__PURE__ */ React.createElement("div", {
2018
- className: classes.content
2019
- }, selectedTab === "files" && /* @__PURE__ */ React.createElement(FilesContent, null), selectedTab === "log" && /* @__PURE__ */ React.createElement(LogContent, null), selectedTab === "output" && /* @__PURE__ */ React.createElement(OutputContent, null))));
1931
+ return /* @__PURE__ */ React.createElement("div", { className: classes.root }, /* @__PURE__ */ React.createElement(Tabs, { value: selectedTab, onChange: (_, v) => setSelectedTab(v) }, /* @__PURE__ */ React.createElement(Tab, { value: "files", label: "Files" }), /* @__PURE__ */ React.createElement(Tab, { value: "log", label: "Log" }), /* @__PURE__ */ React.createElement(Tab, { value: "output", label: "Output" })), /* @__PURE__ */ React.createElement(Divider, null), /* @__PURE__ */ React.createElement("div", { className: classes.contentWrapper }, /* @__PURE__ */ React.createElement("div", { className: classes.content }, selectedTab === "files" && /* @__PURE__ */ React.createElement(FilesContent, null), selectedTab === "log" && /* @__PURE__ */ React.createElement(LogContent, null), selectedTab === "output" && /* @__PURE__ */ React.createElement(OutputContent, null))));
2020
1932
  }
2021
1933
 
2022
1934
  const useStyles$5 = makeStyles$1((theme) => ({
@@ -2052,22 +1964,26 @@ function DryRunResults() {
2052
1964
  setExpanded(false);
2053
1965
  }
2054
1966
  }, [prevResultsLength, resultsLength]);
2055
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Accordion, {
2056
- variant: "outlined",
2057
- expanded,
2058
- hidden: resultsLength === 0 && hidden,
2059
- onChange: (_, exp) => setExpanded(exp),
2060
- onTransitionEnd: () => resultsLength === 0 && setHidden(true)
2061
- }, /* @__PURE__ */ React.createElement(AccordionSummary, {
2062
- className: classes.header,
2063
- expandIcon: /* @__PURE__ */ React.createElement(ExpandMoreIcon$1, null)
2064
- }, /* @__PURE__ */ React.createElement(Typography$1, null, "Dry-run results")), /* @__PURE__ */ React.createElement(Divider, {
2065
- orientation: "horizontal"
2066
- }), /* @__PURE__ */ React.createElement(AccordionDetails, {
2067
- className: classes.content
2068
- }, /* @__PURE__ */ React.createElement(DryRunResultsList, null), /* @__PURE__ */ React.createElement(Divider, {
2069
- orientation: "horizontal"
2070
- }), /* @__PURE__ */ React.createElement(DryRunResultsView, null))));
1967
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
1968
+ Accordion,
1969
+ {
1970
+ variant: "outlined",
1971
+ expanded,
1972
+ hidden: resultsLength === 0 && hidden,
1973
+ onChange: (_, exp) => setExpanded(exp),
1974
+ onTransitionEnd: () => resultsLength === 0 && setHidden(true)
1975
+ },
1976
+ /* @__PURE__ */ React.createElement(
1977
+ AccordionSummary,
1978
+ {
1979
+ className: classes.header,
1980
+ expandIcon: /* @__PURE__ */ React.createElement(ExpandMoreIcon$1, null)
1981
+ },
1982
+ /* @__PURE__ */ React.createElement(Typography$1, null, "Dry-run results")
1983
+ ),
1984
+ /* @__PURE__ */ React.createElement(Divider, { orientation: "horizontal" }),
1985
+ /* @__PURE__ */ React.createElement(AccordionDetails, { className: classes.content }, /* @__PURE__ */ React.createElement(DryRunResultsList, null), /* @__PURE__ */ React.createElement(Divider, { orientation: "horizontal" }), /* @__PURE__ */ React.createElement(DryRunResultsView, null))
1986
+ ));
2071
1987
  }
2072
1988
 
2073
1989
  const useStyles$4 = makeStyles((theme) => ({
@@ -2106,33 +2022,29 @@ function TemplateEditorBrowser(props) {
2106
2022
  }
2107
2023
  props.onClose();
2108
2024
  };
2109
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
2110
- className: classes.buttons
2111
- }, /* @__PURE__ */ React.createElement(Tooltip, {
2112
- title: "Save all files"
2113
- }, /* @__PURE__ */ React.createElement(IconButton, {
2114
- className: classes.button,
2115
- disabled: directoryEditor.files.every((file) => !file.dirty),
2116
- onClick: () => directoryEditor.save()
2117
- }, /* @__PURE__ */ React.createElement(SaveIcon, null))), /* @__PURE__ */ React.createElement(Tooltip, {
2118
- title: "Reload directory"
2119
- }, /* @__PURE__ */ React.createElement(IconButton, {
2120
- className: classes.button,
2121
- onClick: () => directoryEditor.reload()
2122
- }, /* @__PURE__ */ React.createElement(RefreshIcon, null))), /* @__PURE__ */ React.createElement("div", {
2123
- className: classes.buttonsGap
2124
- }), /* @__PURE__ */ React.createElement(Tooltip, {
2125
- title: "Close directory"
2126
- }, /* @__PURE__ */ React.createElement(IconButton, {
2127
- className: classes.button,
2128
- onClick: handleClose
2129
- }, /* @__PURE__ */ React.createElement(CloseIcon, null)))), /* @__PURE__ */ React.createElement(Divider$1, {
2130
- className: classes.buttonsDivider
2131
- }), /* @__PURE__ */ React.createElement(FileBrowser, {
2132
- selected: (_b = (_a = directoryEditor.selectedFile) == null ? void 0 : _a.path) != null ? _b : "",
2133
- onSelect: directoryEditor.setSelectedFile,
2134
- filePaths: directoryEditor.files.map((file) => file.path)
2135
- }));
2025
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: classes.buttons }, /* @__PURE__ */ React.createElement(Tooltip, { title: "Save all files" }, /* @__PURE__ */ React.createElement(
2026
+ IconButton,
2027
+ {
2028
+ className: classes.button,
2029
+ disabled: directoryEditor.files.every((file) => !file.dirty),
2030
+ onClick: () => directoryEditor.save()
2031
+ },
2032
+ /* @__PURE__ */ React.createElement(SaveIcon, null)
2033
+ )), /* @__PURE__ */ React.createElement(Tooltip, { title: "Reload directory" }, /* @__PURE__ */ React.createElement(
2034
+ IconButton,
2035
+ {
2036
+ className: classes.button,
2037
+ onClick: () => directoryEditor.reload()
2038
+ },
2039
+ /* @__PURE__ */ React.createElement(RefreshIcon, null)
2040
+ )), /* @__PURE__ */ React.createElement("div", { className: classes.buttonsGap }), /* @__PURE__ */ React.createElement(Tooltip, { title: "Close directory" }, /* @__PURE__ */ React.createElement(IconButton, { className: classes.button, onClick: handleClose }, /* @__PURE__ */ React.createElement(CloseIcon, null)))), /* @__PURE__ */ React.createElement(Divider$1, { className: classes.buttonsDivider }), /* @__PURE__ */ React.createElement(
2041
+ FileBrowser,
2042
+ {
2043
+ selected: (_b = (_a = directoryEditor.selectedFile) == null ? void 0 : _a.path) != null ? _b : "",
2044
+ onSelect: directoryEditor.setSelectedFile,
2045
+ filePaths: directoryEditor.files.map((file) => file.path)
2046
+ }
2047
+ ));
2136
2048
  }
2137
2049
 
2138
2050
  const useStyles$3 = makeStyles((theme) => ({
@@ -2183,34 +2095,37 @@ function TemplateEditorTextArea(props) {
2183
2095
  }
2184
2096
  }
2185
2097
  );
2186
- return /* @__PURE__ */ React.createElement("div", {
2187
- className: classes.container
2188
- }, /* @__PURE__ */ React.createElement(CodeMirror, {
2189
- className: classes.codeMirror,
2190
- theme: "dark",
2191
- height: "100%",
2192
- extensions: [StreamLanguage.define(yaml$1), panelExtension],
2193
- value: props.content,
2194
- onChange: props.onUpdate
2195
- }), (props.onSave || props.onReload) && /* @__PURE__ */ React.createElement("div", {
2196
- className: classes.floatingButtons
2197
- }, /* @__PURE__ */ React.createElement(Paper, null, props.onSave && /* @__PURE__ */ React.createElement(Tooltip, {
2198
- title: "Save file"
2199
- }, /* @__PURE__ */ React.createElement(IconButton, {
2200
- className: classes.floatingButton,
2201
- onClick: () => {
2202
- var _a;
2203
- return (_a = props.onSave) == null ? void 0 : _a.call(props);
2204
- }
2205
- }, /* @__PURE__ */ React.createElement(SaveIcon, null))), props.onReload && /* @__PURE__ */ React.createElement(Tooltip, {
2206
- title: "Reload file"
2207
- }, /* @__PURE__ */ React.createElement(IconButton, {
2208
- className: classes.floatingButton,
2209
- onClick: () => {
2210
- var _a;
2211
- return (_a = props.onReload) == null ? void 0 : _a.call(props);
2098
+ return /* @__PURE__ */ React.createElement("div", { className: classes.container }, /* @__PURE__ */ React.createElement(
2099
+ CodeMirror,
2100
+ {
2101
+ className: classes.codeMirror,
2102
+ theme: "dark",
2103
+ height: "100%",
2104
+ extensions: [StreamLanguage.define(yaml$1), panelExtension],
2105
+ value: props.content,
2106
+ onChange: props.onUpdate
2212
2107
  }
2213
- }, /* @__PURE__ */ React.createElement(RefreshIcon, null))))));
2108
+ ), (props.onSave || props.onReload) && /* @__PURE__ */ React.createElement("div", { className: classes.floatingButtons }, /* @__PURE__ */ React.createElement(Paper, null, props.onSave && /* @__PURE__ */ React.createElement(Tooltip, { title: "Save file" }, /* @__PURE__ */ React.createElement(
2109
+ IconButton,
2110
+ {
2111
+ className: classes.floatingButton,
2112
+ onClick: () => {
2113
+ var _a;
2114
+ return (_a = props.onSave) == null ? void 0 : _a.call(props);
2115
+ }
2116
+ },
2117
+ /* @__PURE__ */ React.createElement(SaveIcon, null)
2118
+ )), props.onReload && /* @__PURE__ */ React.createElement(Tooltip, { title: "Reload file" }, /* @__PURE__ */ React.createElement(
2119
+ IconButton,
2120
+ {
2121
+ className: classes.floatingButton,
2122
+ onClick: () => {
2123
+ var _a;
2124
+ return (_a = props.onReload) == null ? void 0 : _a.call(props);
2125
+ }
2126
+ },
2127
+ /* @__PURE__ */ React.createElement(RefreshIcon, null)
2128
+ )))));
2214
2129
  }
2215
2130
  function TemplateEditorDirectoryEditorTextArea(props) {
2216
2131
  var _a, _b;
@@ -2221,15 +2136,18 @@ function TemplateEditorDirectoryEditorTextArea(props) {
2221
2136
  } : {
2222
2137
  onReload: () => directoryEditor.reload()
2223
2138
  };
2224
- return /* @__PURE__ */ React.createElement(TemplateEditorTextArea, {
2225
- errorText: props.errorText,
2226
- content: (_b = directoryEditor.selectedFile) == null ? void 0 : _b.content,
2227
- onUpdate: (content) => {
2228
- var _a2;
2229
- return (_a2 = directoryEditor.selectedFile) == null ? void 0 : _a2.updateContent(content);
2230
- },
2231
- ...actions
2232
- });
2139
+ return /* @__PURE__ */ React.createElement(
2140
+ TemplateEditorTextArea,
2141
+ {
2142
+ errorText: props.errorText,
2143
+ content: (_b = directoryEditor.selectedFile) == null ? void 0 : _b.content,
2144
+ onUpdate: (content) => {
2145
+ var _a2;
2146
+ return (_a2 = directoryEditor.selectedFile) == null ? void 0 : _a2.updateContent(content);
2147
+ },
2148
+ ...actions
2149
+ }
2150
+ );
2233
2151
  }
2234
2152
  TemplateEditorTextArea.DirectoryEditor = TemplateEditorDirectoryEditorTextArea;
2235
2153
 
@@ -2263,27 +2181,14 @@ const useStyles$2 = makeStyles({
2263
2181
  const TemplateEditor = (props) => {
2264
2182
  const classes = useStyles$2();
2265
2183
  const [errorText, setErrorText] = useState();
2266
- return /* @__PURE__ */ React.createElement(DirectoryEditorProvider, {
2267
- directory: props.directory
2268
- }, /* @__PURE__ */ React.createElement(DryRunProvider, null, /* @__PURE__ */ React.createElement("main", {
2269
- className: classes.root
2270
- }, /* @__PURE__ */ React.createElement("section", {
2271
- className: classes.browser
2272
- }, /* @__PURE__ */ React.createElement(TemplateEditorBrowser, {
2273
- onClose: props.onClose
2274
- })), /* @__PURE__ */ React.createElement("section", {
2275
- className: classes.editor
2276
- }, /* @__PURE__ */ React.createElement(TemplateEditorTextArea.DirectoryEditor, {
2277
- errorText
2278
- })), /* @__PURE__ */ React.createElement("section", {
2279
- className: classes.preview
2280
- }, /* @__PURE__ */ React.createElement(TemplateEditorForm.DirectoryEditorDryRun, {
2281
- setErrorText,
2282
- fieldExtensions: props.fieldExtensions,
2283
- layouts: props.layouts
2284
- })), /* @__PURE__ */ React.createElement("section", {
2285
- className: classes.results
2286
- }, /* @__PURE__ */ React.createElement(DryRunResults, null)))));
2184
+ return /* @__PURE__ */ React.createElement(DirectoryEditorProvider, { directory: props.directory }, /* @__PURE__ */ React.createElement(DryRunProvider, null, /* @__PURE__ */ React.createElement("main", { className: classes.root }, /* @__PURE__ */ React.createElement("section", { className: classes.browser }, /* @__PURE__ */ React.createElement(TemplateEditorBrowser, { onClose: props.onClose })), /* @__PURE__ */ React.createElement("section", { className: classes.editor }, /* @__PURE__ */ React.createElement(TemplateEditorTextArea.DirectoryEditor, { errorText })), /* @__PURE__ */ React.createElement("section", { className: classes.preview }, /* @__PURE__ */ React.createElement(
2185
+ TemplateEditorForm.DirectoryEditorDryRun,
2186
+ {
2187
+ setErrorText,
2188
+ fieldExtensions: props.fieldExtensions,
2189
+ layouts: props.layouts
2190
+ }
2191
+ )), /* @__PURE__ */ React.createElement("section", { className: classes.results }, /* @__PURE__ */ React.createElement(DryRunResults, null)))));
2287
2192
  };
2288
2193
 
2289
2194
  const EXAMPLE_TEMPLATE_PARAMS_YAML = `# Edit the template parameters below to see how they will render in the scaffolder form UI
@@ -2400,88 +2305,91 @@ const TemplateFormPreviewer = ({
2400
2305
  },
2401
2306
  [setTemplateYaml]
2402
2307
  );
2403
- return /* @__PURE__ */ React.createElement(React.Fragment, null, loading && /* @__PURE__ */ React.createElement(LinearProgress, null), /* @__PURE__ */ React.createElement("main", {
2404
- className: classes.root
2405
- }, /* @__PURE__ */ React.createElement("div", {
2406
- className: classes.controls
2407
- }, /* @__PURE__ */ React.createElement(FormControl, {
2408
- variant: "outlined",
2409
- size: "small",
2410
- fullWidth: true
2411
- }, /* @__PURE__ */ React.createElement(InputLabel, {
2412
- id: "select-template-label"
2413
- }, "Load Existing Template"), /* @__PURE__ */ React.createElement(Select, {
2414
- value: selectedTemplate,
2415
- label: "Load Existing Template",
2416
- labelId: "select-template-label",
2417
- onChange: (e) => handleSelectChange(e.target.value)
2418
- }, templateOptions.map((option, idx) => /* @__PURE__ */ React.createElement(MenuItem$1, {
2419
- key: idx,
2420
- value: option.value
2421
- }, option.label)))), /* @__PURE__ */ React.createElement(IconButton, {
2422
- size: "medium",
2423
- onClick: onClose
2424
- }, /* @__PURE__ */ React.createElement(CloseIcon, null))), /* @__PURE__ */ React.createElement("div", {
2425
- className: classes.textArea
2426
- }, /* @__PURE__ */ React.createElement(TemplateEditorTextArea, {
2427
- content: templateYaml,
2428
- onUpdate: setTemplateYaml,
2429
- errorText
2430
- })), /* @__PURE__ */ React.createElement("div", {
2431
- className: classes.preview
2432
- }, /* @__PURE__ */ React.createElement(TemplateEditorForm, {
2433
- content: templateYaml,
2434
- contentIsSpec: true,
2435
- fieldExtensions: customFieldExtensions,
2436
- data: formState,
2437
- onUpdate: setFormState,
2438
- setErrorText,
2439
- layouts
2440
- }))));
2308
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, loading && /* @__PURE__ */ React.createElement(LinearProgress, null), /* @__PURE__ */ React.createElement("main", { className: classes.root }, /* @__PURE__ */ React.createElement("div", { className: classes.controls }, /* @__PURE__ */ React.createElement(FormControl, { variant: "outlined", size: "small", fullWidth: true }, /* @__PURE__ */ React.createElement(InputLabel, { id: "select-template-label" }, "Load Existing Template"), /* @__PURE__ */ React.createElement(
2309
+ Select,
2310
+ {
2311
+ value: selectedTemplate,
2312
+ label: "Load Existing Template",
2313
+ labelId: "select-template-label",
2314
+ onChange: (e) => handleSelectChange(e.target.value)
2315
+ },
2316
+ templateOptions.map((option, idx) => /* @__PURE__ */ React.createElement(MenuItem$1, { key: idx, value: option.value }, option.label))
2317
+ )), /* @__PURE__ */ React.createElement(IconButton, { size: "medium", onClick: onClose }, /* @__PURE__ */ React.createElement(CloseIcon, null))), /* @__PURE__ */ React.createElement("div", { className: classes.textArea }, /* @__PURE__ */ React.createElement(
2318
+ TemplateEditorTextArea,
2319
+ {
2320
+ content: templateYaml,
2321
+ onUpdate: setTemplateYaml,
2322
+ errorText
2323
+ }
2324
+ )), /* @__PURE__ */ React.createElement("div", { className: classes.preview }, /* @__PURE__ */ React.createElement(
2325
+ TemplateEditorForm,
2326
+ {
2327
+ content: templateYaml,
2328
+ contentIsSpec: true,
2329
+ fieldExtensions: customFieldExtensions,
2330
+ data: formState,
2331
+ onUpdate: setFormState,
2332
+ setErrorText,
2333
+ layouts
2334
+ }
2335
+ ))));
2441
2336
  };
2442
2337
 
2443
2338
  function TemplateEditorPage(props) {
2444
2339
  const [selection, setSelection] = useState();
2445
2340
  let content = null;
2446
2341
  if ((selection == null ? void 0 : selection.type) === "local") {
2447
- content = /* @__PURE__ */ React.createElement(TemplateEditor, {
2448
- directory: selection.directory,
2449
- fieldExtensions: props.customFieldExtensions,
2450
- onClose: () => setSelection(void 0),
2451
- layouts: props.layouts
2452
- });
2342
+ content = /* @__PURE__ */ React.createElement(
2343
+ TemplateEditor,
2344
+ {
2345
+ directory: selection.directory,
2346
+ fieldExtensions: props.customFieldExtensions,
2347
+ onClose: () => setSelection(void 0),
2348
+ layouts: props.layouts
2349
+ }
2350
+ );
2453
2351
  } else if ((selection == null ? void 0 : selection.type) === "form") {
2454
- content = /* @__PURE__ */ React.createElement(TemplateFormPreviewer, {
2455
- defaultPreviewTemplate: props.defaultPreviewTemplate,
2456
- customFieldExtensions: props.customFieldExtensions,
2457
- onClose: () => setSelection(void 0),
2458
- layouts: props.layouts
2459
- });
2352
+ content = /* @__PURE__ */ React.createElement(
2353
+ TemplateFormPreviewer,
2354
+ {
2355
+ defaultPreviewTemplate: props.defaultPreviewTemplate,
2356
+ customFieldExtensions: props.customFieldExtensions,
2357
+ onClose: () => setSelection(void 0),
2358
+ layouts: props.layouts
2359
+ }
2360
+ );
2460
2361
  } else if ((selection == null ? void 0 : selection.type) === "field-explorer") {
2461
- content = /* @__PURE__ */ React.createElement(CustomFieldExplorer, {
2462
- customFieldExtensions: props.customFieldExtensions,
2463
- onClose: () => setSelection(void 0)
2464
- });
2362
+ content = /* @__PURE__ */ React.createElement(
2363
+ CustomFieldExplorer,
2364
+ {
2365
+ customFieldExtensions: props.customFieldExtensions,
2366
+ onClose: () => setSelection(void 0)
2367
+ }
2368
+ );
2465
2369
  } else {
2466
- content = /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(TemplateEditorIntro, {
2467
- onSelect: (option) => {
2468
- if (option === "local") {
2469
- WebFileSystemAccess.requestDirectoryAccess().then((directory) => setSelection({ type: "local", directory })).catch(() => {
2470
- });
2471
- } else if (option === "form") {
2472
- setSelection({ type: "form" });
2473
- } else if (option === "field-explorer") {
2474
- setSelection({ type: "field-explorer" });
2370
+ content = /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(
2371
+ TemplateEditorIntro,
2372
+ {
2373
+ onSelect: (option) => {
2374
+ if (option === "local") {
2375
+ WebFileSystemAccess.requestDirectoryAccess().then((directory) => setSelection({ type: "local", directory })).catch(() => {
2376
+ });
2377
+ } else if (option === "form") {
2378
+ setSelection({ type: "form" });
2379
+ } else if (option === "field-explorer") {
2380
+ setSelection({ type: "field-explorer" });
2381
+ }
2475
2382
  }
2476
2383
  }
2477
- }));
2478
- }
2479
- return /* @__PURE__ */ React.createElement(Page, {
2480
- themeId: "home"
2481
- }, /* @__PURE__ */ React.createElement(Header, {
2482
- title: "Template Editor",
2483
- subtitle: "Edit, preview, and try out templates and template forms"
2484
- }), content);
2384
+ ));
2385
+ }
2386
+ return /* @__PURE__ */ React.createElement(Page, { themeId: "home" }, /* @__PURE__ */ React.createElement(
2387
+ Header,
2388
+ {
2389
+ title: "Template Editor",
2390
+ subtitle: "Edit, preview, and try out templates and template forms"
2391
+ }
2392
+ ), content);
2485
2393
  }
2486
2394
 
2487
2395
  const useStyles = makeStyles(
@@ -2535,33 +2443,20 @@ const OwnerListPicker = (props) => {
2535
2443
  const { filter, onSelectOwner } = props;
2536
2444
  const classes = useStyles();
2537
2445
  const filterGroups = getFilterGroups();
2538
- return /* @__PURE__ */ React.createElement(Card, {
2539
- className: classes.root
2540
- }, filterGroups.map((group) => /* @__PURE__ */ React.createElement(Fragment, {
2541
- key: group.name
2542
- }, /* @__PURE__ */ React.createElement(Typography, {
2543
- variant: "subtitle2",
2544
- className: classes.title
2545
- }, group.name), /* @__PURE__ */ React.createElement(Card, {
2546
- className: classes.groupWrapper
2547
- }, /* @__PURE__ */ React.createElement(List$2, {
2548
- disablePadding: true,
2549
- dense: true
2550
- }, group.items.map((item) => /* @__PURE__ */ React.createElement(MenuItem$1, {
2551
- key: item.id,
2552
- button: true,
2553
- divider: true,
2554
- onClick: () => onSelectOwner(item.id),
2555
- selected: item.id === filter,
2556
- className: classes.menuItem,
2557
- "data-testid": `owner-picker-${item.id}`
2558
- }, item.icon && /* @__PURE__ */ React.createElement(ListItemIcon$1, {
2559
- className: classes.listIcon
2560
- }, /* @__PURE__ */ React.createElement(item.icon, {
2561
- fontSize: "small"
2562
- })), /* @__PURE__ */ React.createElement(ListItemText$1, null, /* @__PURE__ */ React.createElement(Typography, {
2563
- variant: "body1"
2564
- }, item.label)))))))));
2446
+ return /* @__PURE__ */ React.createElement(Card, { className: classes.root }, filterGroups.map((group) => /* @__PURE__ */ React.createElement(Fragment, { key: group.name }, /* @__PURE__ */ React.createElement(Typography, { variant: "subtitle2", className: classes.title }, group.name), /* @__PURE__ */ React.createElement(Card, { className: classes.groupWrapper }, /* @__PURE__ */ React.createElement(List$2, { disablePadding: true, dense: true }, group.items.map((item) => /* @__PURE__ */ React.createElement(
2447
+ MenuItem$1,
2448
+ {
2449
+ key: item.id,
2450
+ button: true,
2451
+ divider: true,
2452
+ onClick: () => onSelectOwner(item.id),
2453
+ selected: item.id === filter,
2454
+ className: classes.menuItem,
2455
+ "data-testid": `owner-picker-${item.id}`
2456
+ },
2457
+ item.icon && /* @__PURE__ */ React.createElement(ListItemIcon$1, { className: classes.listIcon }, /* @__PURE__ */ React.createElement(item.icon, { fontSize: "small" })),
2458
+ /* @__PURE__ */ React.createElement(ListItemText$1, null, /* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, item.label))
2459
+ )))))));
2565
2460
  };
2566
2461
 
2567
2462
  const CreatedAtColumn = ({ createdAt }) => {
@@ -2583,10 +2478,13 @@ const OwnerEntityColumn = ({ entityRef }) => {
2583
2478
  if (loading || error) {
2584
2479
  return null;
2585
2480
  }
2586
- return /* @__PURE__ */ React.createElement(EntityRefLink, {
2587
- entityRef: parseEntityRef(entityRef),
2588
- title: (_c = (_b = (_a = value == null ? void 0 : value.spec) == null ? void 0 : _a.profile) == null ? void 0 : _b.displayName) != null ? _c : value == null ? void 0 : value.metadata.name
2589
- });
2481
+ return /* @__PURE__ */ React.createElement(
2482
+ EntityRefLink,
2483
+ {
2484
+ entityRef: parseEntityRef(entityRef),
2485
+ title: (_c = (_b = (_a = value == null ? void 0 : value.spec) == null ? void 0 : _a.profile) == null ? void 0 : _b.displayName) != null ? _c : value == null ? void 0 : value.metadata.name
2486
+ }
2487
+ );
2590
2488
  };
2591
2489
 
2592
2490
  const TaskStatusColumn = ({ status }) => {
@@ -2610,10 +2508,7 @@ const TemplateTitleColumn = ({ entityRef }) => {
2610
2508
  if (loading || error || !entityRef) {
2611
2509
  return null;
2612
2510
  }
2613
- return /* @__PURE__ */ React.createElement(EntityRefLink, {
2614
- entityRef: parseEntityRef(entityRef),
2615
- title: value == null ? void 0 : value.title
2616
- });
2511
+ return /* @__PURE__ */ React.createElement(EntityRefLink, { entityRef: parseEntityRef(entityRef), title: value == null ? void 0 : value.title });
2617
2512
  };
2618
2513
 
2619
2514
  const ListTaskPageContent = (props) => {
@@ -2636,77 +2531,75 @@ const ListTaskPageContent = (props) => {
2636
2531
  return /* @__PURE__ */ React.createElement(Progress, null);
2637
2532
  }
2638
2533
  if (error) {
2639
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ErrorPanel, {
2640
- error
2641
- }), /* @__PURE__ */ React.createElement(EmptyState, {
2642
- missing: "info",
2643
- title: "No information to display",
2644
- description: "There is no Tasks or there was an issue communicating with backend."
2645
- }));
2646
- }
2647
- return /* @__PURE__ */ React.createElement(CatalogFilterLayout, null, /* @__PURE__ */ React.createElement(CatalogFilterLayout.Filters, null, /* @__PURE__ */ React.createElement(OwnerListPicker, {
2648
- filter: ownerFilter,
2649
- onSelectOwner: (id) => setOwnerFilter(id)
2650
- })), /* @__PURE__ */ React.createElement(CatalogFilterLayout.Content, null, /* @__PURE__ */ React.createElement(Table$1, {
2651
- data: (_a = value == null ? void 0 : value.tasks) != null ? _a : [],
2652
- title: "Tasks",
2653
- columns: [
2654
- {
2655
- title: "Task ID",
2656
- field: "id",
2657
- render: (row) => /* @__PURE__ */ React.createElement(Link, {
2658
- to: `${rootLink()}/tasks/${row.id}`
2659
- }, row.id)
2660
- },
2661
- {
2662
- title: "Template",
2663
- render: (row) => {
2664
- var _a2;
2665
- return /* @__PURE__ */ React.createElement(TemplateTitleColumn, {
2666
- entityRef: (_a2 = row.spec.templateInfo) == null ? void 0 : _a2.entityRef
2667
- });
2668
- }
2669
- },
2670
- {
2671
- title: "Created",
2672
- field: "createdAt",
2673
- render: (row) => /* @__PURE__ */ React.createElement(CreatedAtColumn, {
2674
- createdAt: row.createdAt
2675
- })
2676
- },
2677
- {
2678
- title: "Owner",
2679
- field: "createdBy",
2680
- render: (row) => {
2681
- var _a2, _b;
2682
- return /* @__PURE__ */ React.createElement(OwnerEntityColumn, {
2683
- entityRef: (_b = (_a2 = row.spec) == null ? void 0 : _a2.user) == null ? void 0 : _b.ref
2684
- });
2685
- }
2686
- },
2534
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ErrorPanel, { error }), /* @__PURE__ */ React.createElement(
2535
+ EmptyState,
2687
2536
  {
2688
- title: "Status",
2689
- field: "status",
2690
- render: (row) => /* @__PURE__ */ React.createElement(TaskStatusColumn, {
2691
- status: row.status
2692
- })
2537
+ missing: "info",
2538
+ title: "No information to display",
2539
+ description: "There is no Tasks or there was an issue communicating with backend."
2693
2540
  }
2694
- ]
2695
- })));
2541
+ ));
2542
+ }
2543
+ return /* @__PURE__ */ React.createElement(CatalogFilterLayout, null, /* @__PURE__ */ React.createElement(CatalogFilterLayout.Filters, null, /* @__PURE__ */ React.createElement(
2544
+ OwnerListPicker,
2545
+ {
2546
+ filter: ownerFilter,
2547
+ onSelectOwner: (id) => setOwnerFilter(id)
2548
+ }
2549
+ )), /* @__PURE__ */ React.createElement(CatalogFilterLayout.Content, null, /* @__PURE__ */ React.createElement(
2550
+ Table$1,
2551
+ {
2552
+ data: (_a = value == null ? void 0 : value.tasks) != null ? _a : [],
2553
+ title: "Tasks",
2554
+ columns: [
2555
+ {
2556
+ title: "Task ID",
2557
+ field: "id",
2558
+ render: (row) => /* @__PURE__ */ React.createElement(Link, { to: `${rootLink()}/tasks/${row.id}` }, row.id)
2559
+ },
2560
+ {
2561
+ title: "Template",
2562
+ render: (row) => {
2563
+ var _a2;
2564
+ return /* @__PURE__ */ React.createElement(
2565
+ TemplateTitleColumn,
2566
+ {
2567
+ entityRef: (_a2 = row.spec.templateInfo) == null ? void 0 : _a2.entityRef
2568
+ }
2569
+ );
2570
+ }
2571
+ },
2572
+ {
2573
+ title: "Created",
2574
+ field: "createdAt",
2575
+ render: (row) => /* @__PURE__ */ React.createElement(CreatedAtColumn, { createdAt: row.createdAt })
2576
+ },
2577
+ {
2578
+ title: "Owner",
2579
+ field: "createdBy",
2580
+ render: (row) => {
2581
+ var _a2, _b;
2582
+ return /* @__PURE__ */ React.createElement(OwnerEntityColumn, { entityRef: (_b = (_a2 = row.spec) == null ? void 0 : _a2.user) == null ? void 0 : _b.ref });
2583
+ }
2584
+ },
2585
+ {
2586
+ title: "Status",
2587
+ field: "status",
2588
+ render: (row) => /* @__PURE__ */ React.createElement(TaskStatusColumn, { status: row.status })
2589
+ }
2590
+ ]
2591
+ }
2592
+ )));
2696
2593
  };
2697
2594
  const ListTasksPage = (props) => {
2698
- return /* @__PURE__ */ React.createElement(Page, {
2699
- themeId: "home"
2700
- }, /* @__PURE__ */ React.createElement(Header, {
2701
- pageTitleOverride: "Templates Tasks",
2702
- title: /* @__PURE__ */ React.createElement(React.Fragment, null, "List template tasks ", /* @__PURE__ */ React.createElement(Lifecycle, {
2703
- shorthand: true,
2704
- alpha: true
2705
- })),
2706
- subtitle: "All tasks that have been started"
2707
- }), /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(ListTaskPageContent, {
2708
- ...props
2709
- })));
2595
+ return /* @__PURE__ */ React.createElement(Page, { themeId: "home" }, /* @__PURE__ */ React.createElement(
2596
+ Header,
2597
+ {
2598
+ pageTitleOverride: "Templates Tasks",
2599
+ title: /* @__PURE__ */ React.createElement(React.Fragment, null, "List template tasks ", /* @__PURE__ */ React.createElement(Lifecycle, { shorthand: true, alpha: true })),
2600
+ subtitle: "All tasks that have been started"
2601
+ }
2602
+ ), /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(ListTaskPageContent, { ...props })));
2710
2603
  };
2711
2604
 
2712
2605
  const Router = (props) => {
@@ -2747,52 +2640,63 @@ const Router = (props) => {
2747
2640
  ),
2748
2641
  []
2749
2642
  );
2750
- return /* @__PURE__ */ React.createElement(Navigate, {
2751
- to: newLink({ namespace: "default", templateName })
2752
- });
2643
+ return /* @__PURE__ */ React.createElement(Navigate, { to: newLink({ namespace: "default", templateName }) });
2753
2644
  };
2754
- return /* @__PURE__ */ React.createElement(Routes, null, /* @__PURE__ */ React.createElement(Route, {
2755
- path: "/",
2756
- element: /* @__PURE__ */ React.createElement(ScaffolderPage, {
2757
- groups,
2758
- TemplateCardComponent,
2759
- contextMenu: props.contextMenu,
2760
- headerOptions: props.headerOptions
2761
- })
2762
- }), /* @__PURE__ */ React.createElement(Route, {
2763
- path: legacySelectedTemplateRouteRef.path,
2764
- element: /* @__PURE__ */ React.createElement(RedirectingComponent, null)
2765
- }), /* @__PURE__ */ React.createElement(Route, {
2766
- path: selectedTemplateRouteRef.path,
2767
- element: /* @__PURE__ */ React.createElement(SecretsContextProvider, null, /* @__PURE__ */ React.createElement(TemplatePage, {
2768
- ReviewStepComponent,
2769
- customFieldExtensions: fieldExtensions,
2770
- layouts: customLayouts,
2771
- headerOptions: props.headerOptions
2772
- }))
2773
- }), /* @__PURE__ */ React.createElement(Route, {
2774
- path: scaffolderListTaskRouteRef.path,
2775
- element: /* @__PURE__ */ React.createElement(ListTasksPage, null)
2776
- }), /* @__PURE__ */ React.createElement(Route, {
2777
- path: scaffolderTaskRouteRef.path,
2778
- element: /* @__PURE__ */ React.createElement(TaskPageElement, null)
2779
- }), /* @__PURE__ */ React.createElement(Route, {
2780
- path: actionsRouteRef.path,
2781
- element: /* @__PURE__ */ React.createElement(ActionsPage, null)
2782
- }), /* @__PURE__ */ React.createElement(Route, {
2783
- path: editRouteRef.path,
2784
- element: /* @__PURE__ */ React.createElement(SecretsContextProvider, null, /* @__PURE__ */ React.createElement(TemplateEditorPage, {
2785
- defaultPreviewTemplate,
2786
- customFieldExtensions: fieldExtensions,
2787
- layouts: customLayouts
2788
- }))
2789
- }), /* @__PURE__ */ React.createElement(Route, {
2790
- path: "preview",
2791
- element: /* @__PURE__ */ React.createElement(Navigate, {
2792
- to: "../edit"
2793
- })
2794
- }));
2645
+ return /* @__PURE__ */ React.createElement(Routes, null, /* @__PURE__ */ React.createElement(
2646
+ Route,
2647
+ {
2648
+ path: "/",
2649
+ element: /* @__PURE__ */ React.createElement(
2650
+ ScaffolderPage,
2651
+ {
2652
+ groups,
2653
+ TemplateCardComponent,
2654
+ contextMenu: props.contextMenu,
2655
+ headerOptions: props.headerOptions
2656
+ }
2657
+ )
2658
+ }
2659
+ ), /* @__PURE__ */ React.createElement(
2660
+ Route,
2661
+ {
2662
+ path: legacySelectedTemplateRouteRef.path,
2663
+ element: /* @__PURE__ */ React.createElement(RedirectingComponent, null)
2664
+ }
2665
+ ), /* @__PURE__ */ React.createElement(
2666
+ Route,
2667
+ {
2668
+ path: selectedTemplateRouteRef.path,
2669
+ element: /* @__PURE__ */ React.createElement(SecretsContextProvider, null, /* @__PURE__ */ React.createElement(
2670
+ TemplatePage,
2671
+ {
2672
+ ReviewStepComponent,
2673
+ customFieldExtensions: fieldExtensions,
2674
+ layouts: customLayouts,
2675
+ headerOptions: props.headerOptions
2676
+ }
2677
+ ))
2678
+ }
2679
+ ), /* @__PURE__ */ React.createElement(
2680
+ Route,
2681
+ {
2682
+ path: scaffolderListTaskRouteRef.path,
2683
+ element: /* @__PURE__ */ React.createElement(ListTasksPage, null)
2684
+ }
2685
+ ), /* @__PURE__ */ React.createElement(Route, { path: scaffolderTaskRouteRef.path, element: /* @__PURE__ */ React.createElement(TaskPageElement, null) }), /* @__PURE__ */ React.createElement(Route, { path: actionsRouteRef.path, element: /* @__PURE__ */ React.createElement(ActionsPage, null) }), /* @__PURE__ */ React.createElement(
2686
+ Route,
2687
+ {
2688
+ path: editRouteRef.path,
2689
+ element: /* @__PURE__ */ React.createElement(SecretsContextProvider, null, /* @__PURE__ */ React.createElement(
2690
+ TemplateEditorPage,
2691
+ {
2692
+ defaultPreviewTemplate,
2693
+ customFieldExtensions: fieldExtensions,
2694
+ layouts: customLayouts
2695
+ }
2696
+ ))
2697
+ }
2698
+ ), /* @__PURE__ */ React.createElement(Route, { path: "preview", element: /* @__PURE__ */ React.createElement(Navigate, { to: "../edit" }) }));
2795
2699
  };
2796
2700
 
2797
2701
  export { Router };
2798
- //# sourceMappingURL=Router-c72ed8e0.esm.js.map
2702
+ //# sourceMappingURL=Router-95a01240.esm.js.map