@backstage/core-components 0.16.5-next.1 → 0.17.1-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/dist/alpha.d.ts +2 -2
- package/dist/components/DismissableBanner/DismissableBanner.esm.js +9 -13
- package/dist/components/DismissableBanner/DismissableBanner.esm.js.map +1 -1
- package/dist/components/Select/Select.esm.js +9 -0
- package/dist/components/Select/Select.esm.js.map +1 -1
- package/dist/components/SimpleStepper/SimpleStepper.esm.js +7 -1
- package/dist/components/SimpleStepper/SimpleStepper.esm.js.map +1 -1
- package/dist/translation.esm.js +2 -2
- package/dist/translation.esm.js.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# @backstage/core-components
|
|
2
2
|
|
|
3
|
+
## 0.17.1-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5d7bad4: Fixed the messaging in the `AlertDisplay` where it was claiming that there were older messages available rather than newer.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/config@1.3.2
|
|
10
|
+
- @backstage/core-plugin-api@1.10.5
|
|
11
|
+
- @backstage/errors@1.2.7
|
|
12
|
+
- @backstage/theme@0.6.4
|
|
13
|
+
- @backstage/version-bridge@1.0.11
|
|
14
|
+
|
|
15
|
+
## 0.17.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- 25300cb: `SimpleStepper` back button now works with `activeStep` property set higher than 0
|
|
20
|
+
- 9545af2: Declared CancelIcon explicitly on Chip component inside Select.tsx to disable onMouseDown event by default that creates the flaw of re-opening select component when user tries to remove a selected filter.
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- fffe3c0: Added `classNames` prop to the `Page` component
|
|
25
|
+
- df3b9f0: Fixed a bug in the SidebarSubmenuItem within the core-components package that caused the dropdown button to be misaligned in the sidebar and the button text to appear in uppercase due to the default <Button> behavior. Also added an example dropdown menu to the app for reference.
|
|
26
|
+
- 48aab13: Add i18n support for scaffolder-react plugin
|
|
27
|
+
- 0a0ced6: Avoid Layout Shift for `DismissableBanner` when using a `storageApi` with latency (e.g. `user-settings-backend`)
|
|
28
|
+
|
|
29
|
+
Properly handle the `unknown` state of the `storageApi`. There's a trade-off: this may lead to some Layout Shift if the banner has not been dismissed, but once it has been dismissed, you won't have any.
|
|
30
|
+
|
|
31
|
+
- Updated dependencies
|
|
32
|
+
- @backstage/core-plugin-api@1.10.5
|
|
33
|
+
- @backstage/config@1.3.2
|
|
34
|
+
- @backstage/errors@1.2.7
|
|
35
|
+
- @backstage/theme@0.6.4
|
|
36
|
+
- @backstage/version-bridge@1.0.11
|
|
37
|
+
|
|
3
38
|
## 0.16.5-next.1
|
|
4
39
|
|
|
5
40
|
### Patch Changes
|
package/dist/alpha.d.ts
CHANGED
|
@@ -48,8 +48,8 @@ declare const coreComponentsTranslationRef: _backstage_core_plugin_api_alpha.Tra
|
|
|
48
48
|
readonly "oauthRequestDialog.rejectAll": "Reject All";
|
|
49
49
|
readonly "supportButton.title": "Support";
|
|
50
50
|
readonly "supportButton.close": "Close";
|
|
51
|
-
readonly "alertDisplay.message_one": "({{ count }}
|
|
52
|
-
readonly "alertDisplay.message_other": "({{ count }}
|
|
51
|
+
readonly "alertDisplay.message_one": "({{ count }} newer message)";
|
|
52
|
+
readonly "alertDisplay.message_other": "({{ count }} newer messages)";
|
|
53
53
|
readonly "autoLogout.stillTherePrompt.title": "Logging out due to inactivity";
|
|
54
54
|
readonly "autoLogout.stillTherePrompt.buttonText": "Yes! Don't log me out";
|
|
55
55
|
readonly "proxiedSignInPage.title": "You do not appear to be signed in. Please try reloading the browser page.";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React__default, {
|
|
1
|
+
import React__default, { useMemo } from 'react';
|
|
2
2
|
import { useApi, storageApiRef } from '@backstage/core-plugin-api';
|
|
3
3
|
import useObservable from 'react-use/esm/useObservable';
|
|
4
4
|
import classNames from 'classnames';
|
|
@@ -60,19 +60,15 @@ const DismissableBanner = (props) => {
|
|
|
60
60
|
const classes = useStyles();
|
|
61
61
|
const storageApi = useApi(storageApiRef);
|
|
62
62
|
const notificationsStore = storageApi.forBucket("notifications");
|
|
63
|
-
const rawDismissedBanners = notificationsStore.snapshot("dismissedBanners").value ?? [];
|
|
64
|
-
const [dismissedBanners, setDismissedBanners] = useState(
|
|
65
|
-
new Set(rawDismissedBanners)
|
|
66
|
-
);
|
|
67
63
|
const observedItems = useObservable(
|
|
68
|
-
notificationsStore.observe$("dismissedBanners")
|
|
64
|
+
notificationsStore.observe$("dismissedBanners"),
|
|
65
|
+
notificationsStore.snapshot("dismissedBanners")
|
|
69
66
|
);
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}, [observedItems?.value]);
|
|
67
|
+
const dismissedBanners = useMemo(
|
|
68
|
+
() => new Set(observedItems.value ?? []),
|
|
69
|
+
[observedItems.value]
|
|
70
|
+
);
|
|
71
|
+
const loadingSettings = observedItems.presence === "unknown";
|
|
76
72
|
const handleClick = () => {
|
|
77
73
|
notificationsStore.set("dismissedBanners", [...dismissedBanners, id]);
|
|
78
74
|
};
|
|
@@ -80,7 +76,7 @@ const DismissableBanner = (props) => {
|
|
|
80
76
|
Snackbar,
|
|
81
77
|
{
|
|
82
78
|
anchorOrigin: fixed ? { vertical: "bottom", horizontal: "center" } : { vertical: "top", horizontal: "center" },
|
|
83
|
-
open: !dismissedBanners.has(id),
|
|
79
|
+
open: !loadingSettings && !dismissedBanners.has(id),
|
|
84
80
|
classes: {
|
|
85
81
|
root: classNames(classes.root, !fixed && classes.topPosition)
|
|
86
82
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DismissableBanner.esm.js","sources":["../../../src/components/DismissableBanner/DismissableBanner.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ReactNode,
|
|
1
|
+
{"version":3,"file":"DismissableBanner.esm.js","sources":["../../../src/components/DismissableBanner/DismissableBanner.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ReactNode, useMemo } from 'react';\nimport { useApi, storageApiRef } from '@backstage/core-plugin-api';\nimport useObservable from 'react-use/esm/useObservable';\nimport classNames from 'classnames';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Snackbar from '@material-ui/core/Snackbar';\nimport SnackbarContent from '@material-ui/core/SnackbarContent';\nimport IconButton from '@material-ui/core/IconButton';\nimport Close from '@material-ui/icons/Close';\n\n/** @public */\nexport type DismissableBannerClassKey =\n | 'root'\n | 'topPosition'\n | 'icon'\n | 'content'\n | 'message'\n | 'info'\n | 'error';\n\n/**\n * @public\n * @deprecated This type contained a typo, please use DismissableBannerClassKey instead\n */\nexport type DismissbleBannerClassKey = DismissableBannerClassKey;\n\nconst useStyles = makeStyles(\n theme => ({\n root: {\n padding: theme.spacing(0),\n marginBottom: theme.spacing(0),\n marginTop: theme.spacing(0),\n display: 'flex',\n flexFlow: 'row nowrap',\n },\n // showing on top\n topPosition: {\n position: 'relative',\n marginBottom: theme.spacing(6),\n marginTop: -theme.spacing(3),\n zIndex: 'unset',\n },\n icon: {\n fontSize: theme.typography.h6.fontSize,\n },\n content: {\n width: '100%',\n maxWidth: 'inherit',\n flexWrap: 'nowrap',\n color: theme.palette.banner.text,\n },\n message: {\n display: 'flex',\n alignItems: 'center',\n '& a': {\n color: theme.palette.banner.link,\n },\n },\n button: {\n color: theme.palette.banner.closeButtonColor ?? 'inherit',\n },\n info: {\n backgroundColor: theme.palette.banner.info,\n },\n error: {\n backgroundColor: theme.palette.banner.error,\n },\n warning: {\n backgroundColor:\n theme.palette.banner.warning ?? theme.palette.banner.error,\n },\n }),\n { name: 'BackstageDismissableBanner' },\n);\n\nexport type Props = {\n variant: 'info' | 'error' | 'warning';\n message: ReactNode;\n id: string;\n fixed?: boolean;\n};\n\n/** @public */\nexport const DismissableBanner = (props: Props) => {\n const { variant, message, id, fixed = false } = props;\n const classes = useStyles();\n const storageApi = useApi(storageApiRef);\n const notificationsStore = storageApi.forBucket('notifications');\n const observedItems = useObservable(\n notificationsStore.observe$<string[]>('dismissedBanners'),\n notificationsStore.snapshot<string[]>('dismissedBanners'),\n );\n\n const dismissedBanners = useMemo(\n () => new Set(observedItems.value ?? []),\n [observedItems.value],\n );\n\n const loadingSettings = observedItems.presence === 'unknown';\n\n const handleClick = () => {\n notificationsStore.set('dismissedBanners', [...dismissedBanners, id]);\n };\n\n return (\n <Snackbar\n anchorOrigin={\n fixed\n ? { vertical: 'bottom', horizontal: 'center' }\n : { vertical: 'top', horizontal: 'center' }\n }\n open={!loadingSettings && !dismissedBanners.has(id)}\n classes={{\n root: classNames(classes.root, !fixed && classes.topPosition),\n }}\n >\n <SnackbarContent\n classes={{\n root: classNames(classes.content, classes[variant]),\n message: classes.message,\n }}\n message={message}\n action={[\n <IconButton\n key=\"dismiss\"\n title=\"Permanently dismiss this message\"\n className={classes.button}\n onClick={handleClick}\n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AAA,GACI,EAAE,QAAA,EAAU,QAAU,EAAA,UAAA,EAAY,QAAS,EAAA,GAC3C,EAAE,QAAA,EAAU,KAAO,EAAA,UAAA,EAAY,QAAS,EAAA;AAAA,MAE9C,MAAM,CAAC,eAAA,IAAmB,CAAC,gBAAA,CAAiB,IAAI,EAAE,CAAA;AAAA,MAClD,OAAS,EAAA;AAAA,QACP,MAAM,UAAW,CAAA,OAAA,CAAQ,MAAM,CAAC,KAAA,IAAS,QAAQ,WAAW;AAAA;AAC9D,KAAA;AAAA,oBAEAA,cAAA,CAAA,aAAA;AAAA,MAAC,eAAA;AAAA,MAAA;AAAA,QACC,OAAS,EAAA;AAAA,UACP,MAAM,UAAW,CAAA,OAAA,CAAQ,OAAS,EAAA,OAAA,CAAQ,OAAO,CAAC,CAAA;AAAA,UAClD,SAAS,OAAQ,CAAA;AAAA,SACnB;AAAA,QACA,OAAA;AAAA,QACA,MAAQ,EAAA;AAAA,0BACNA,cAAA,CAAA,aAAA;AAAA,YAAC,UAAA;AAAA,YAAA;AAAA,cACC,GAAI,EAAA,SAAA;AAAA,cACJ,KAAM,EAAA,kCAAA;AAAA,cACN,WAAW,OAAQ,CAAA,MAAA;AAAA,cACnB,OAAS,EAAA;AAAA,aAAA;AAAA,4BAERA,cAAA,CAAA,aAAA,CAAAC,SAAA,EAAA,EAAM,SAAW,EAAA,OAAA,CAAQ,IAAM,EAAA;AAAA;AAClC;AACF;AAAA;AACF,GACF;AAEJ;;;;"}
|
|
@@ -8,6 +8,7 @@ import MenuItem from '@material-ui/core/MenuItem';
|
|
|
8
8
|
import Select from '@material-ui/core/Select';
|
|
9
9
|
import { withStyles, createStyles, makeStyles } from '@material-ui/core/styles';
|
|
10
10
|
import Typography from '@material-ui/core/Typography';
|
|
11
|
+
import CancelIcon from '@material-ui/icons/Cancel';
|
|
11
12
|
import React__default, { useState, useEffect } from 'react';
|
|
12
13
|
import ClosedDropdown from './static/ClosedDropdown.esm.js';
|
|
13
14
|
import OpenedDropdown from './static/OpenedDropdown.esm.js';
|
|
@@ -149,9 +150,17 @@ function SelectComponent(props) {
|
|
|
149
150
|
return item ? /* @__PURE__ */ React__default.createElement(
|
|
150
151
|
Chip,
|
|
151
152
|
{
|
|
153
|
+
"data-testid": "chip",
|
|
152
154
|
key: item?.value,
|
|
153
155
|
label: item?.label,
|
|
154
156
|
clickable: true,
|
|
157
|
+
deleteIcon: /* @__PURE__ */ React__default.createElement(
|
|
158
|
+
CancelIcon,
|
|
159
|
+
{
|
|
160
|
+
"data-testid": "cancel-icon",
|
|
161
|
+
onMouseDown: (event) => event.stopPropagation()
|
|
162
|
+
}
|
|
163
|
+
),
|
|
155
164
|
onDelete: handleDelete(selectedValue),
|
|
156
165
|
className: classes.chip
|
|
157
166
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.esm.js","sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport Box from '@material-ui/core/Box';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport Chip from '@material-ui/core/Chip';\nimport FormControl from '@material-ui/core/FormControl';\nimport InputBase from '@material-ui/core/InputBase';\nimport InputLabel from '@material-ui/core/InputLabel';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport Select from '@material-ui/core/Select';\nimport {\n createStyles,\n makeStyles,\n Theme,\n withStyles,\n} from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport React, { useEffect, useState } from 'react';\n\nimport ClosedDropdown from './static/ClosedDropdown';\nimport OpenedDropdown from './static/OpenedDropdown';\n\n/** @public */\nexport type SelectInputBaseClassKey = 'root' | 'input';\n\nconst BootstrapInput = withStyles(\n (theme: Theme) =>\n createStyles({\n root: {\n 'label + &': {\n marginTop: theme.spacing(3),\n },\n '&.Mui-focused > div[role=button]': {\n borderColor: theme.palette.primary.main,\n },\n },\n input: {\n borderRadius: theme.shape.borderRadius,\n position: 'relative',\n backgroundColor: theme.palette.background.paper,\n border: '1px solid #ced4da',\n fontSize: theme.typography.body1.fontSize,\n padding: theme.spacing(1.25, 3.25, 1.25, 1.5),\n transition: theme.transitions.create(['border-color', 'box-shadow']),\n '&:focus': {\n background: theme.palette.background.paper,\n borderRadius: theme.shape.borderRadius,\n },\n },\n }),\n { name: 'BackstageSelectInputBase' },\n)(InputBase);\n\n/** @public */\nexport type SelectClassKey =\n | 'formControl'\n | 'label'\n | 'chips'\n | 'chip'\n | 'checkbox'\n | 'root';\n\nconst useStyles = makeStyles(\n (theme: Theme) =>\n createStyles({\n formControl: {\n margin: theme.spacing(1, 0),\n },\n label: {\n transform: 'initial',\n fontWeight: 'bold',\n fontSize: theme.typography.body2.fontSize,\n fontFamily: theme.typography.fontFamily,\n color: theme.palette.text.primary,\n '&.Mui-focused': {\n color: theme.palette.text.primary,\n },\n },\n formLabel: {\n transform: 'initial',\n fontWeight: 'bold',\n fontSize: theme.typography.body2.fontSize,\n fontFamily: theme.typography.fontFamily,\n color: theme.palette.text.primary,\n '&.Mui-focused': {\n color: theme.palette.text.primary,\n },\n },\n chips: {\n display: 'flex',\n flexWrap: 'wrap',\n },\n chip: {\n margin: 2,\n },\n checkbox: {},\n\n root: {\n display: 'flex',\n flexDirection: 'column',\n },\n }),\n { name: 'BackstageSelect' },\n);\n\n/** @public */\nexport type SelectItem = {\n label: string;\n value: string | number;\n};\n\n/** @public */\nexport type SelectedItems = string | string[] | number | number[];\n\nexport type SelectProps = {\n multiple?: boolean;\n items: SelectItem[];\n label: string;\n placeholder?: string;\n selected?: SelectedItems;\n onChange: (arg: SelectedItems) => void;\n triggerReset?: boolean;\n native?: boolean;\n disabled?: boolean;\n margin?: 'dense' | 'none';\n 'data-testid'?: string;\n};\n\n/** @public */\nexport function SelectComponent(props: SelectProps) {\n const {\n multiple,\n items,\n label,\n placeholder,\n selected,\n onChange,\n triggerReset,\n native = false,\n disabled = false,\n margin,\n 'data-testid': dataTestId = 'select',\n } = props;\n const classes = useStyles();\n const [value, setValue] = useState<SelectedItems>(\n selected || (multiple ? [] : ''),\n );\n const [isOpen, setOpen] = useState(false);\n\n useEffect(() => {\n setValue(multiple ? [] : '');\n }, [triggerReset, multiple]);\n\n useEffect(() => {\n setValue(selected || (multiple ? [] : ''));\n }, [selected, multiple]);\n\n const handleChange = (event: React.ChangeEvent<{ value: unknown }>) => {\n setValue(event.target.value as SelectedItems);\n onChange(event.target.value as SelectedItems);\n };\n\n const handleOpen = (event: React.ChangeEvent<any>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n setOpen(previous => {\n if (multiple && !(event.target instanceof HTMLElement)) {\n return true;\n }\n return !previous;\n });\n };\n\n const handleClose = () => {\n setOpen(false);\n };\n\n const handleDelete = (selectedValue: string | number) => () => {\n const newValue = (value as any[]).filter(chip => chip !== selectedValue);\n setValue(newValue);\n onChange(newValue);\n };\n\n return (\n <Box className={classes.root}>\n <FormControl className={classes.formControl}>\n <InputLabel className={classes.formLabel}>{label}</InputLabel>\n <Select\n aria-label={label}\n value={value}\n native={native}\n disabled={disabled}\n data-testid={dataTestId}\n displayEmpty\n multiple={multiple}\n margin={margin}\n onChange={handleChange}\n open={isOpen}\n onOpen={handleOpen}\n onClose={handleClose}\n input={<BootstrapInput />}\n label={label}\n renderValue={s =>\n multiple && (value as any[]).length !== 0 ? (\n <Box className={classes.chips}>\n {(s as string[]).map(selectedValue => {\n const item = items.find(el => el.value === selectedValue);\n return item ? (\n <Chip\n key={item?.value}\n label={item?.label}\n clickable\n onDelete={handleDelete(selectedValue)}\n className={classes.chip}\n />\n ) : (\n false\n );\n })}\n </Box>\n ) : (\n <Typography>\n {(value as any[]).length === 0\n ? placeholder || ''\n : items.find(el => el.value === s)?.label}\n </Typography>\n )\n }\n IconComponent={() =>\n !isOpen ? <ClosedDropdown /> : <OpenedDropdown />\n }\n MenuProps={{\n anchorOrigin: {\n vertical: 'bottom',\n horizontal: 'left',\n },\n transformOrigin: {\n vertical: 'top',\n horizontal: 'left',\n },\n getContentAnchorEl: null,\n }}\n >\n {!!placeholder && !multiple && (\n <MenuItem value={[]}>{placeholder}</MenuItem>\n )}\n {native\n ? items &&\n items.map(item => (\n <option value={item.value} key={item.value}>\n {item.label}\n </option>\n ))\n : items &&\n items.map(item => (\n <MenuItem key={item.value} value={item.value}>\n {multiple && (\n <Checkbox\n color=\"primary\"\n checked={(value as any[]).includes(item.value) || false}\n className={classes.checkbox}\n />\n )}\n {item.label}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n </Box>\n );\n}\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;AAsCA,MAAM,cAAiB,GAAA,UAAA;AAAA,EACrB,CAAC,UACC,YAAa,CAAA;AAAA,IACX,IAAM,EAAA;AAAA,MACJ,WAAa,EAAA;AAAA,QACX,SAAA,EAAW,KAAM,CAAA,OAAA,CAAQ,CAAC;AAAA,OAC5B;AAAA,MACA,kCAAoC,EAAA;AAAA,QAClC,WAAA,EAAa,KAAM,CAAA,OAAA,CAAQ,OAAQ,CAAA;AAAA;AACrC,KACF;AAAA,IACA,KAAO,EAAA;AAAA,MACL,YAAA,EAAc,MAAM,KAAM,CAAA,YAAA;AAAA,MAC1B,QAAU,EAAA,UAAA;AAAA,MACV,eAAA,EAAiB,KAAM,CAAA,OAAA,CAAQ,UAAW,CAAA,KAAA;AAAA,MAC1C,MAAQ,EAAA,mBAAA;AAAA,MACR,QAAA,EAAU,KAAM,CAAA,UAAA,CAAW,KAAM,CAAA,QAAA;AAAA,MACjC,SAAS,KAAM,CAAA,OAAA,CAAQ,IAAM,EAAA,IAAA,EAAM,MAAM,GAAG,CAA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,EAAA;AAAA,SACd;AAAA,QACA,kBAAoB,EAAA;AAAA;AACtB,KAAA;AAAA,IAEC,CAAC,CAAC,WAAA,IAAe,CAAC,QAAA,iDAChB,QAAS,EAAA,EAAA,KAAA,EAAO,EAAC,EAAA,EAAI,WAAY,CAAA;AAAA,IAEnC,MACG,GAAA,KAAA,IACA,KAAM,CAAA,GAAA,CAAI,CACR,IAAA,qBAAAA,cAAA,CAAA,aAAA,CAAC,QAAO,EAAA,EAAA,KAAA,EAAO,IAAK,CAAA,KAAA,EAAO,GAAK,EAAA,IAAA,CAAK,KAClC,EAAA,EAAA,IAAA,CAAK,KACR,CACD,CACD,GAAA,KAAA,IACA,KAAM,CAAA,GAAA,CAAI,CACR,IAAA,qBAAAA,cAAA,CAAA,aAAA,CAAC,QAAS,EAAA,EAAA,GAAA,EAAK,IAAK,CAAA,KAAA,EAAO,KAAO,EAAA,IAAA,CAAK,SACpC,QACC,oBAAAA,cAAA,CAAA,aAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACC,KAAM,EAAA,SAAA;AAAA,QACN,OAAU,EAAA,KAAA,CAAgB,QAAS,CAAA,IAAA,CAAK,KAAK,CAAK,IAAA,KAAA;AAAA,QAClD,WAAW,OAAQ,CAAA;AAAA;AAAA,KACrB,EAED,IAAK,CAAA,KACR,CACD;AAAA,GAET,CACF,CAAA;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"Select.esm.js","sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport Box from '@material-ui/core/Box';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport Chip from '@material-ui/core/Chip';\nimport FormControl from '@material-ui/core/FormControl';\nimport InputBase from '@material-ui/core/InputBase';\nimport InputLabel from '@material-ui/core/InputLabel';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport Select from '@material-ui/core/Select';\nimport {\n createStyles,\n makeStyles,\n Theme,\n withStyles,\n} from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport CancelIcon from '@material-ui/icons/Cancel';\nimport React, { useEffect, useState } from 'react';\n\nimport ClosedDropdown from './static/ClosedDropdown';\nimport OpenedDropdown from './static/OpenedDropdown';\n\n/** @public */\nexport type SelectInputBaseClassKey = 'root' | 'input';\n\nconst BootstrapInput = withStyles(\n (theme: Theme) =>\n createStyles({\n root: {\n 'label + &': {\n marginTop: theme.spacing(3),\n },\n '&.Mui-focused > div[role=button]': {\n borderColor: theme.palette.primary.main,\n },\n },\n input: {\n borderRadius: theme.shape.borderRadius,\n position: 'relative',\n backgroundColor: theme.palette.background.paper,\n border: '1px solid #ced4da',\n fontSize: theme.typography.body1.fontSize,\n padding: theme.spacing(1.25, 3.25, 1.25, 1.5),\n transition: theme.transitions.create(['border-color', 'box-shadow']),\n '&:focus': {\n background: theme.palette.background.paper,\n borderRadius: theme.shape.borderRadius,\n },\n },\n }),\n { name: 'BackstageSelectInputBase' },\n)(InputBase);\n\n/** @public */\nexport type SelectClassKey =\n | 'formControl'\n | 'label'\n | 'chips'\n | 'chip'\n | 'checkbox'\n | 'root';\n\nconst useStyles = makeStyles(\n (theme: Theme) =>\n createStyles({\n formControl: {\n margin: theme.spacing(1, 0),\n },\n label: {\n transform: 'initial',\n fontWeight: 'bold',\n fontSize: theme.typography.body2.fontSize,\n fontFamily: theme.typography.fontFamily,\n color: theme.palette.text.primary,\n '&.Mui-focused': {\n color: theme.palette.text.primary,\n },\n },\n formLabel: {\n transform: 'initial',\n fontWeight: 'bold',\n fontSize: theme.typography.body2.fontSize,\n fontFamily: theme.typography.fontFamily,\n color: theme.palette.text.primary,\n '&.Mui-focused': {\n color: theme.palette.text.primary,\n },\n },\n chips: {\n display: 'flex',\n flexWrap: 'wrap',\n },\n chip: {\n margin: 2,\n },\n checkbox: {},\n\n root: {\n display: 'flex',\n flexDirection: 'column',\n },\n }),\n { name: 'BackstageSelect' },\n);\n\n/** @public */\nexport type SelectItem = {\n label: string;\n value: string | number;\n};\n\n/** @public */\nexport type SelectedItems = string | string[] | number | number[];\n\nexport type SelectProps = {\n multiple?: boolean;\n items: SelectItem[];\n label: string;\n placeholder?: string;\n selected?: SelectedItems;\n onChange: (arg: SelectedItems) => void;\n triggerReset?: boolean;\n native?: boolean;\n disabled?: boolean;\n margin?: 'dense' | 'none';\n 'data-testid'?: string;\n};\n\n/** @public */\nexport function SelectComponent(props: SelectProps) {\n const {\n multiple,\n items,\n label,\n placeholder,\n selected,\n onChange,\n triggerReset,\n native = false,\n disabled = false,\n margin,\n 'data-testid': dataTestId = 'select',\n } = props;\n const classes = useStyles();\n const [value, setValue] = useState<SelectedItems>(\n selected || (multiple ? [] : ''),\n );\n const [isOpen, setOpen] = useState(false);\n\n useEffect(() => {\n setValue(multiple ? [] : '');\n }, [triggerReset, multiple]);\n\n useEffect(() => {\n setValue(selected || (multiple ? [] : ''));\n }, [selected, multiple]);\n\n const handleChange = (event: React.ChangeEvent<{ value: unknown }>) => {\n setValue(event.target.value as SelectedItems);\n onChange(event.target.value as SelectedItems);\n };\n\n const handleOpen = (event: React.ChangeEvent<any>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n setOpen(previous => {\n if (multiple && !(event.target instanceof HTMLElement)) {\n return true;\n }\n return !previous;\n });\n };\n\n const handleClose = () => {\n setOpen(false);\n };\n\n const handleDelete = (selectedValue: string | number) => () => {\n const newValue = (value as any[]).filter(chip => chip !== selectedValue);\n setValue(newValue);\n onChange(newValue);\n };\n\n return (\n <Box className={classes.root}>\n <FormControl className={classes.formControl}>\n <InputLabel className={classes.formLabel}>{label}</InputLabel>\n <Select\n aria-label={label}\n value={value}\n native={native}\n disabled={disabled}\n data-testid={dataTestId}\n displayEmpty\n multiple={multiple}\n margin={margin}\n onChange={handleChange}\n open={isOpen}\n onOpen={handleOpen}\n onClose={handleClose}\n input={<BootstrapInput />}\n label={label}\n renderValue={s =>\n multiple && (value as any[]).length !== 0 ? (\n <Box className={classes.chips}>\n {(s as string[]).map(selectedValue => {\n const item = items.find(el => el.value === selectedValue);\n return item ? (\n <Chip\n data-testid=\"chip\"\n key={item?.value}\n label={item?.label}\n clickable\n deleteIcon={\n <CancelIcon\n data-testid=\"cancel-icon\"\n onMouseDown={event => event.stopPropagation()}\n />\n }\n onDelete={handleDelete(selectedValue)}\n className={classes.chip}\n />\n ) : (\n false\n );\n })}\n </Box>\n ) : (\n <Typography>\n {(value as any[]).length === 0\n ? placeholder || ''\n : items.find(el => el.value === s)?.label}\n </Typography>\n )\n }\n IconComponent={() =>\n !isOpen ? <ClosedDropdown /> : <OpenedDropdown />\n }\n MenuProps={{\n anchorOrigin: {\n vertical: 'bottom',\n horizontal: 'left',\n },\n transformOrigin: {\n vertical: 'top',\n horizontal: 'left',\n },\n getContentAnchorEl: null,\n }}\n >\n {!!placeholder && !multiple && (\n <MenuItem value={[]}>{placeholder}</MenuItem>\n )}\n {native\n ? items &&\n items.map(item => (\n <option value={item.value} key={item.value}>\n {item.label}\n </option>\n ))\n : items &&\n items.map(item => (\n <MenuItem key={item.value} value={item.value}>\n {multiple && (\n <Checkbox\n color=\"primary\"\n checked={(value as any[]).includes(item.value) || false}\n className={classes.checkbox}\n />\n )}\n {item.label}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n </Box>\n );\n}\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;AAuCA,MAAM,cAAiB,GAAA,UAAA;AAAA,EACrB,CAAC,UACC,YAAa,CAAA;AAAA,IACX,IAAM,EAAA;AAAA,MACJ,WAAa,EAAA;AAAA,QACX,SAAA,EAAW,KAAM,CAAA,OA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A,EAAO,KAAO,EAAA,IAAA,CAAK,SACpC,QACC,oBAAAA,cAAA,CAAA,aAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACC,KAAM,EAAA,SAAA;AAAA,QACN,OAAU,EAAA,KAAA,CAAgB,QAAS,CAAA,IAAA,CAAK,KAAK,CAAK,IAAA,KAAA;AAAA,QAClD,WAAW,OAAQ,CAAA;AAAA;AAAA,KACrB,EAED,IAAK,CAAA,KACR,CACD;AAAA,GAET,CACF,CAAA;AAEJ;;;;"}
|
|
@@ -14,7 +14,13 @@ const VerticalStepperContext = React__default.createContext({
|
|
|
14
14
|
function SimpleStepper(props) {
|
|
15
15
|
const { children, elevated, onStepChange, activeStep = 0 } = props;
|
|
16
16
|
const [stepIndex, setStepIndex] = useState(activeStep);
|
|
17
|
-
const
|
|
17
|
+
const inOrderRecreatedStepHistory = Array.from(
|
|
18
|
+
{ length: activeStep + 1 },
|
|
19
|
+
(_, i) => i
|
|
20
|
+
);
|
|
21
|
+
const [stepHistory, setStepHistory] = useState(
|
|
22
|
+
inOrderRecreatedStepHistory
|
|
23
|
+
);
|
|
18
24
|
useEffect(() => {
|
|
19
25
|
setStepIndex(activeStep);
|
|
20
26
|
}, [activeStep]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleStepper.esm.js","sources":["../../../src/components/SimpleStepper/SimpleStepper.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React, {\n Children,\n isValidElement,\n useState,\n useEffect,\n PropsWithChildren,\n} from 'react';\nimport MuiStepper from '@material-ui/core/Stepper';\n\ntype InternalState = {\n stepperLength: number;\n stepIndex: number;\n setStepIndex: any;\n stepHistory: number[];\n setStepHistory: any;\n onStepChange?: (prevIndex: number, nextIndex: number) => void;\n};\n\nconst noop = () => {};\nexport const VerticalStepperContext = React.createContext<InternalState>({\n stepperLength: 0,\n stepIndex: 0,\n setStepIndex: noop,\n stepHistory: [],\n setStepHistory: noop,\n onStepChange: noop,\n});\n\nexport interface StepperProps {\n elevated?: boolean;\n onStepChange?: (prevIndex: number, nextIndex: number) => void;\n activeStep?: number;\n}\n\nexport function SimpleStepper(props: PropsWithChildren<StepperProps>) {\n const { children, elevated, onStepChange, activeStep = 0 } = props;\n const [stepIndex, setStepIndex] = useState<number>(activeStep);\n const [stepHistory, setStepHistory] = useState<number[]>(
|
|
1
|
+
{"version":3,"file":"SimpleStepper.esm.js","sources":["../../../src/components/SimpleStepper/SimpleStepper.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React, {\n Children,\n isValidElement,\n useState,\n useEffect,\n PropsWithChildren,\n} from 'react';\nimport MuiStepper from '@material-ui/core/Stepper';\n\ntype InternalState = {\n stepperLength: number;\n stepIndex: number;\n setStepIndex: any;\n stepHistory: number[];\n setStepHistory: any;\n onStepChange?: (prevIndex: number, nextIndex: number) => void;\n};\n\nconst noop = () => {};\n\nexport const VerticalStepperContext = React.createContext<InternalState>({\n stepperLength: 0,\n stepIndex: 0,\n setStepIndex: noop,\n stepHistory: [],\n setStepHistory: noop,\n onStepChange: noop,\n});\n\nexport interface StepperProps {\n elevated?: boolean;\n onStepChange?: (prevIndex: number, nextIndex: number) => void;\n activeStep?: number;\n}\n\nexport function SimpleStepper(props: PropsWithChildren<StepperProps>) {\n const { children, elevated, onStepChange, activeStep = 0 } = props;\n const [stepIndex, setStepIndex] = useState<number>(activeStep);\n /*\n Recreates the stepHistory array based on the activeStep\n to make sure the handleBack function of the Footer works when activeStep is higher than 0\n */\n const inOrderRecreatedStepHistory = Array.from(\n { length: activeStep + 1 },\n (_, i) => i,\n );\n const [stepHistory, setStepHistory] = useState<number[]>(\n inOrderRecreatedStepHistory,\n );\n\n useEffect(() => {\n setStepIndex(activeStep);\n }, [activeStep]);\n\n const steps: React.ReactNode[] = [];\n let endStep;\n Children.forEach(children, child => {\n if (isValidElement(child)) {\n if (child.props.end) {\n endStep = child;\n } else {\n steps.push(child);\n }\n }\n });\n\n return (\n <>\n <VerticalStepperContext.Provider\n value={{\n stepIndex,\n setStepIndex,\n stepHistory,\n setStepHistory,\n onStepChange,\n stepperLength: Children.count(children),\n }}\n >\n <MuiStepper\n activeStep={stepIndex}\n orientation=\"vertical\"\n elevation={elevated ? 2 : 0}\n >\n {steps}\n </MuiStepper>\n </VerticalStepperContext.Provider>\n {stepIndex >= Children.count(children) - 1 && endStep}\n </>\n );\n}\n"],"names":["React"],"mappings":";;;AAiCA,MAAM,OAAO,MAAM;AAAC,CAAA;AAEP,MAAA,sBAAA,GAAyBA,eAAM,aAA6B,CAAA;AAAA,EACvE,aAAe,EAAA,CAAA;AAAA,EACf,SAAW,EAAA,CAAA;AAAA,EACX,YAAc,EAAA,IAAA;AAAA,EACd,aAAa,EAAC;AAAA,EACd,cAAgB,EAAA,IAAA;AAAA,EAChB,YAAc,EAAA;AAChB,CAAC;AAQM,SAAS,cAAc,KAAwC,EAAA;AACpE,EAAA,MAAM,EAAE,QAAU,EAAA,QAAA,EAAU,YAAc,EAAA,UAAA,GAAa,GAAM,GAAA,KAAA;AAC7D,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAI,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A,CAAS,MAAM,QAAQ,CAAA,GAAI,KAAK,OAChD,CAAA;AAEJ;;;;"}
|
package/dist/translation.esm.js
CHANGED
|
@@ -86,8 +86,8 @@ const coreComponentsTranslationRef = createTranslationRef({
|
|
|
86
86
|
}
|
|
87
87
|
},
|
|
88
88
|
alertDisplay: {
|
|
89
|
-
message_one: "({{ count }}
|
|
90
|
-
message_other: "({{ count }}
|
|
89
|
+
message_one: "({{ count }} newer message)",
|
|
90
|
+
message_other: "({{ count }} newer messages)"
|
|
91
91
|
},
|
|
92
92
|
autoLogout: {
|
|
93
93
|
stillTherePrompt: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation.esm.js","sources":["../src/translation.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @alpha */\nexport const coreComponentsTranslationRef = createTranslationRef({\n id: 'core-components',\n messages: {\n signIn: {\n title: 'Sign In',\n loginFailed: 'Login failed',\n customProvider: {\n title: 'Custom User',\n subtitle:\n 'Enter your own User ID and credentials.\\n This selection will not be stored.',\n userId: 'User ID',\n tokenInvalid: 'Token is not a valid OpenID Connect JWT Token',\n continue: 'Continue',\n idToken: 'ID Token (optional)',\n },\n guestProvider: {\n title: 'Guest',\n subtitle:\n 'Enter as a Guest User.\\n You will not have a verified identity, meaning some features might be unavailable.',\n enter: 'Enter',\n },\n },\n skipToContent: 'Skip to content',\n copyTextButton: {\n tooltipText: 'Text copied to clipboard',\n },\n simpleStepper: {\n reset: 'Reset',\n finish: 'Finish',\n next: 'Next',\n skip: 'Skip',\n back: 'Back',\n },\n errorPage: {\n subtitle: 'ERROR {{status}}: {{statusMessage}}',\n title: 'Looks like someone dropped the mic!',\n goBack: 'Go back',\n showMoreDetails: 'Show more details',\n showLessDetails: 'Show less details',\n },\n emptyState: {\n missingAnnotation: {\n title: 'Missing Annotation',\n actionTitle:\n 'Add the annotation to your component YAML as shown in the highlighted example below:',\n readMore: 'Read more',\n },\n },\n supportConfig: {\n default: {\n title: 'Support Not Configured',\n linkTitle: 'Add `app.support` config key',\n },\n },\n errorBoundary: {\n title: 'Please contact {{slackChannel}} for help.',\n },\n oauthRequestDialog: {\n title: 'Login Required',\n authRedirectTitle: 'This will trigger a http redirect to OAuth Login.',\n login: 'Log in',\n rejectAll: 'Reject All',\n },\n supportButton: {\n title: 'Support',\n close: 'Close',\n },\n table: {\n filter: {\n title: 'Filters',\n clearAll: 'Clear all',\n placeholder: 'All results',\n },\n body: {\n emptyDataSourceMessage: 'No records to display',\n },\n pagination: {\n firstTooltip: 'First Page',\n labelDisplayedRows: '{from}-{to} of {count}',\n labelRowsSelect: 'rows',\n lastTooltip: 'Last Page',\n nextTooltip: 'Next Page',\n previousTooltip: 'Previous Page',\n },\n toolbar: {\n search: 'Filter',\n },\n },\n alertDisplay: {\n message_one: '({{ count }}
|
|
1
|
+
{"version":3,"file":"translation.esm.js","sources":["../src/translation.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @alpha */\nexport const coreComponentsTranslationRef = createTranslationRef({\n id: 'core-components',\n messages: {\n signIn: {\n title: 'Sign In',\n loginFailed: 'Login failed',\n customProvider: {\n title: 'Custom User',\n subtitle:\n 'Enter your own User ID and credentials.\\n This selection will not be stored.',\n userId: 'User ID',\n tokenInvalid: 'Token is not a valid OpenID Connect JWT Token',\n continue: 'Continue',\n idToken: 'ID Token (optional)',\n },\n guestProvider: {\n title: 'Guest',\n subtitle:\n 'Enter as a Guest User.\\n You will not have a verified identity, meaning some features might be unavailable.',\n enter: 'Enter',\n },\n },\n skipToContent: 'Skip to content',\n copyTextButton: {\n tooltipText: 'Text copied to clipboard',\n },\n simpleStepper: {\n reset: 'Reset',\n finish: 'Finish',\n next: 'Next',\n skip: 'Skip',\n back: 'Back',\n },\n errorPage: {\n subtitle: 'ERROR {{status}}: {{statusMessage}}',\n title: 'Looks like someone dropped the mic!',\n goBack: 'Go back',\n showMoreDetails: 'Show more details',\n showLessDetails: 'Show less details',\n },\n emptyState: {\n missingAnnotation: {\n title: 'Missing Annotation',\n actionTitle:\n 'Add the annotation to your component YAML as shown in the highlighted example below:',\n readMore: 'Read more',\n },\n },\n supportConfig: {\n default: {\n title: 'Support Not Configured',\n linkTitle: 'Add `app.support` config key',\n },\n },\n errorBoundary: {\n title: 'Please contact {{slackChannel}} for help.',\n },\n oauthRequestDialog: {\n title: 'Login Required',\n authRedirectTitle: 'This will trigger a http redirect to OAuth Login.',\n login: 'Log in',\n rejectAll: 'Reject All',\n },\n supportButton: {\n title: 'Support',\n close: 'Close',\n },\n table: {\n filter: {\n title: 'Filters',\n clearAll: 'Clear all',\n placeholder: 'All results',\n },\n body: {\n emptyDataSourceMessage: 'No records to display',\n },\n pagination: {\n firstTooltip: 'First Page',\n labelDisplayedRows: '{from}-{to} of {count}',\n labelRowsSelect: 'rows',\n lastTooltip: 'Last Page',\n nextTooltip: 'Next Page',\n previousTooltip: 'Previous Page',\n },\n toolbar: {\n search: 'Filter',\n },\n },\n alertDisplay: {\n message_one: '({{ count }} newer message)',\n message_other: '({{ count }} newer messages)',\n },\n autoLogout: {\n stillTherePrompt: {\n title: 'Logging out due to inactivity',\n buttonText: \"Yes! Don't log me out\",\n },\n },\n proxiedSignInPage: {\n title:\n 'You do not appear to be signed in. Please try reloading the browser page.',\n },\n },\n});\n"],"names":[],"mappings":";;AAmBO,MAAM,+BAA+B,oBAAqB,CAAA;AAAA,EAC/D,EAAI,EAAA,iBAAA;AAAA,EACJ,QAAU,EAAA;AAAA,IACR,MAAQ,EAAA;AAAA,MACN,KAAO,EAAA,SAAA;AAAA,MACP,WAAa,EAAA,cAAA;AAAA,MACb,cAAgB,EAAA;AAAA,QACd,KAAO,EAAA,aAAA;AAAA,QACP,QACE,EAAA,8EAAA;AAAA,QACF,MAAQ,EAAA,SAAA;AAAA,QACR,YAAc,EAAA,+CAAA;AAAA,QACd,QAAU,EAAA,UAAA;AAAA,QACV,OAAS,EAAA;AAAA,OACX;AAAA,MACA,aAAe,EAAA;AAAA,QACb,KAAO,EAAA,OAAA;AAAA,QACP,QACE,EAAA,6GAAA;AAAA,QACF,KAAO,EAAA;AAAA;AACT,KACF;AAAA,IACA,aAAe,EAAA,iBAAA;AAAA,IACf,cAAgB,EAAA;AAAA,MACd,WAAa,EAAA;AAAA,KACf;AAAA,IACA,aAAe,EAAA;AAAA,MACb,KAAO,EAAA,OAAA;AAAA,MACP,MAAQ,EAAA,QAAA;AAAA,MACR,IAAM,EAAA,MAAA;AAAA,MACN,IAAM,EAAA,MAAA;AAAA,MACN,IAAM,EAAA;AAAA,KACR;AAAA,IACA,SAAW,EAAA;AAAA,MACT,QAAU,EAAA,qCAAA;AAAA,MACV,KAAO,EAAA,qCAAA;AAAA,MACP,MAAQ,EAAA,SAAA;AAAA,MACR,eAAiB,EAAA,mBAAA;AAAA,MACjB,eAAiB,EAAA;AAAA,KACnB;AAAA,IACA,UAAY,EAAA;AAAA,MACV,iBAAmB,EAAA;AAAA,QACjB,KAAO,EAAA,oBAAA;AAAA,QACP,WACE,EAA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ANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/core-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.1-next.0",
|
|
4
4
|
"description": "Core components used by Backstage plugins and apps",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "web-library"
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@backstage/config": "1.3.2",
|
|
70
|
-
"@backstage/core-plugin-api": "1.10.
|
|
70
|
+
"@backstage/core-plugin-api": "1.10.5",
|
|
71
71
|
"@backstage/errors": "1.2.7",
|
|
72
72
|
"@backstage/theme": "0.6.4",
|
|
73
73
|
"@backstage/version-bridge": "1.0.11",
|
|
@@ -106,10 +106,10 @@
|
|
|
106
106
|
"zod": "^3.22.4"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
|
-
"@backstage/app-defaults": "1.6.
|
|
110
|
-
"@backstage/cli": "0.
|
|
111
|
-
"@backstage/core-app-api": "1.16.0
|
|
112
|
-
"@backstage/test-utils": "1.7.6
|
|
109
|
+
"@backstage/app-defaults": "1.6.1-next.0",
|
|
110
|
+
"@backstage/cli": "0.32.0-next.1",
|
|
111
|
+
"@backstage/core-app-api": "1.16.0",
|
|
112
|
+
"@backstage/test-utils": "1.7.6",
|
|
113
113
|
"@testing-library/dom": "^10.0.0",
|
|
114
114
|
"@testing-library/jest-dom": "^6.0.0",
|
|
115
115
|
"@testing-library/user-event": "^14.0.0",
|