@backstage/core-components 0.18.11 → 0.18.12-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @backstage/core-components
2
2
 
3
+ ## 0.18.12-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 7ceeaad: Migrated CopyTextButton component from Material-UI to Backstage UI (BUI). Replaced MUI IconButton and Tooltip with BUI ButtonIcon and TooltipTrigger/Tooltip components. This is an internal refactoring that maintains backward compatibility - the component API remains unchanged.
8
+
9
+ ## 0.18.12-next.0
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+ - @backstage/core-plugin-api@1.12.8-next.0
15
+
3
16
  ## 0.18.11
4
17
 
5
18
  ### Patch Changes
@@ -0,0 +1,42 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "type": "object",
4
+ "properties": {
5
+ "auth": {
6
+ "type": "object",
7
+ "properties": {
8
+ "autologout": {
9
+ "type": "object",
10
+ "properties": {
11
+ "enabled": {
12
+ "type": "boolean",
13
+ "description": "Enable or disable the autologout feature",
14
+ "visibility": "frontend"
15
+ },
16
+ "idleTimeoutMinutes": {
17
+ "type": "number",
18
+ "description": "Number of minutes after which the inactive user is logged out automatically. Default is 60 minutes (1 hour)",
19
+ "visibility": "frontend"
20
+ },
21
+ "promptBeforeIdleSeconds": {
22
+ "type": "number",
23
+ "description": "Number of seconds before the idle timeout where the user will be asked if it's still active. A dialog will be shown. Default is 10 seconds. Set to 0 seconds to disable the prompt.",
24
+ "visibility": "frontend"
25
+ },
26
+ "useWorkerTimers": {
27
+ "type": "boolean",
28
+ "description": "Enable/disable the usage of worker thread timers instead of main thread timers. Default is true. If you experience some browser incompatibility, you may try to set this to false.",
29
+ "visibility": "frontend"
30
+ },
31
+ "logoutIfDisconnected": {
32
+ "type": "boolean",
33
+ "description": "Enable/disable the automatic logout also on users that are logged in but with no Backstage tabs open. Default is true.",
34
+ "visibility": "frontend"
35
+ }
36
+ },
37
+ "description": "Autologout feature configuration"
38
+ }
39
+ }
40
+ }
41
+ }
42
+ }
@@ -1,9 +1,8 @@
1
- import { jsx, Fragment } from 'react/jsx-runtime';
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { useApi, errorApiRef } from '@backstage/core-plugin-api';
3
- import IconButton from '@material-ui/core/IconButton';
4
- import Tooltip from '@material-ui/core/Tooltip';
3
+ import { TooltipTrigger, ButtonIcon, Tooltip } from '@backstage/ui';
5
4
  import CopyIcon from '@material-ui/icons/FileCopy';
6
- import { useState, useEffect } from 'react';
5
+ import { useState, useRef, useEffect } from 'react';
7
6
  import useCopyToClipboard from 'react-use/esm/useCopyToClipboard';
8
7
  import { coreComponentsTranslationRef } from '../../translation.esm.js';
9
8
  import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
@@ -19,28 +18,40 @@ function CopyTextButton(props) {
19
18
  const errorApi = useApi(errorApiRef);
20
19
  const [open, setOpen] = useState(false);
21
20
  const [{ error }, copyToClipboard] = useCopyToClipboard();
21
+ const timeoutRef = useRef(null);
22
22
  useEffect(() => {
23
23
  if (error) {
24
24
  errorApi.post(error);
25
25
  }
26
26
  }, [error, errorApi]);
27
- const handleCopyClick = (e) => {
28
- e.stopPropagation();
27
+ const handleCopyClick = () => {
28
+ if (timeoutRef.current) {
29
+ clearTimeout(timeoutRef.current);
30
+ }
29
31
  setOpen(true);
30
32
  copyToClipboard(text);
33
+ timeoutRef.current = setTimeout(() => {
34
+ setOpen(false);
35
+ }, tooltipDelay);
31
36
  };
32
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
33
- Tooltip,
34
- {
35
- id: "copy-test-tooltip",
36
- title: tooltipText,
37
- placement: "top",
38
- leaveDelay: tooltipDelay,
39
- onClose: () => setOpen(false),
40
- open,
41
- children: /* @__PURE__ */ jsx(IconButton, { onClick: handleCopyClick, "aria-label": ariaLabel, children: /* @__PURE__ */ jsx(CopyIcon, {}) })
42
- }
43
- ) });
37
+ useEffect(() => {
38
+ return () => {
39
+ if (timeoutRef.current) {
40
+ clearTimeout(timeoutRef.current);
41
+ }
42
+ };
43
+ }, []);
44
+ return /* @__PURE__ */ jsxs(TooltipTrigger, { isOpen: open, onOpenChange: setOpen, children: [
45
+ /* @__PURE__ */ jsx(
46
+ ButtonIcon,
47
+ {
48
+ icon: /* @__PURE__ */ jsx(CopyIcon, {}),
49
+ onPress: handleCopyClick,
50
+ "aria-label": ariaLabel
51
+ }
52
+ ),
53
+ /* @__PURE__ */ jsx(Tooltip, { children: tooltipText })
54
+ ] });
44
55
  }
45
56
 
46
57
  export { CopyTextButton };
@@ -1 +1 @@
1
- {"version":3,"file":"CopyTextButton.esm.js","sources":["../../../src/components/CopyTextButton/CopyTextButton.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 { errorApiRef, useApi } from '@backstage/core-plugin-api';\nimport IconButton from '@material-ui/core/IconButton';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport CopyIcon from '@material-ui/icons/FileCopy';\nimport { MouseEventHandler, useEffect, useState } from 'react';\nimport useCopyToClipboard from 'react-use/esm/useCopyToClipboard';\nimport { coreComponentsTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/**\n * Properties for {@link CopyTextButton}\n *\n * @public\n */\nexport interface CopyTextButtonProps {\n /**\n * The text to be copied\n */\n text: string;\n /**\n * Number of milliseconds that the tooltip is shown\n *\n * @remarks\n *\n * Default: 1000\n */\n tooltipDelay?: number;\n /**\n * Text to show in the tooltip when user has clicked the button\n *\n * @remarks\n *\n * Default: \"Text copied to clipboard\"\n */\n tooltipText?: string;\n\n /**\n * Text to use as aria-label prop on the button\n *\n * @remarks\n *\n * Default: \"Copy text\"\n */\n 'aria-label'?: string;\n}\n\n/**\n * Copy text button with visual feedback\n *\n * @public\n * @remarks\n *\n * Visual feedback takes form of:\n * - a hover color\n * - click ripple\n * - Tooltip shown when user has clicked\n *\n * @example\n *\n * ```\n * <CopyTextButton\n * text=\"My text that I want to be copied to the clipboard\"\n * arial-label=\"Accessible label for this button\" />\n * ```\n */\nexport function CopyTextButton(props: CopyTextButtonProps) {\n const { t } = useTranslationRef(coreComponentsTranslationRef);\n const {\n text,\n tooltipDelay = 1000,\n tooltipText = t('copyTextButton.tooltipText'),\n 'aria-label': ariaLabel = 'Copy text',\n } = props;\n const errorApi = useApi(errorApiRef);\n const [open, setOpen] = useState(false);\n const [{ error }, copyToClipboard] = useCopyToClipboard();\n\n useEffect(() => {\n if (error) {\n errorApi.post(error);\n }\n }, [error, errorApi]);\n\n const handleCopyClick: MouseEventHandler = e => {\n e.stopPropagation();\n setOpen(true);\n copyToClipboard(text);\n };\n\n return (\n <>\n <Tooltip\n id=\"copy-test-tooltip\"\n title={tooltipText}\n placement=\"top\"\n leaveDelay={tooltipDelay}\n onClose={() => setOpen(false)}\n open={open}\n >\n <IconButton onClick={handleCopyClick} aria-label={ariaLabel}>\n <CopyIcon />\n </IconButton>\n </Tooltip>\n </>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;AAiFO,SAAS,eAAe,KAAA,EAA4B;AACzD,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,4BAA4B,CAAA;AAC5D,EAAA,MAAM;AAAA,IACJ,IAAA;AAAA,IACA,YAAA,GAAe,GAAA;AAAA,IACf,WAAA,GAAc,EAAE,4BAA4B,CAAA;AAAA,IAC5C,cAAc,SAAA,GAAY;AAAA,GAC5B,GAAI,KAAA;AACJ,EAAA,MAAM,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAS,KAAK,CAAA;AACtC,EAAA,MAAM,CAAC,EAAE,KAAA,EAAM,EAAG,eAAe,IAAI,kBAAA,EAAmB;AAExD,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,KAAA,EAAO;AACT,MAAA,QAAA,CAAS,KAAK,KAAK,CAAA;AAAA,IACrB;AAAA,EACF,CAAA,EAAG,CAAC,KAAA,EAAO,QAAQ,CAAC,CAAA;AAEpB,EAAA,MAAM,kBAAqC,CAAA,CAAA,KAAK;AAC9C,IAAA,CAAA,CAAE,eAAA,EAAgB;AAClB,IAAA,OAAA,CAAQ,IAAI,CAAA;AACZ,IAAA,eAAA,CAAgB,IAAI,CAAA;AAAA,EACtB,CAAA;AAEA,EAAA,uBACE,GAAA,CAAA,QAAA,EAAA,EACE,QAAA,kBAAA,GAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACC,EAAA,EAAG,mBAAA;AAAA,MACH,KAAA,EAAO,WAAA;AAAA,MACP,SAAA,EAAU,KAAA;AAAA,MACV,UAAA,EAAY,YAAA;AAAA,MACZ,OAAA,EAAS,MAAM,OAAA,CAAQ,KAAK,CAAA;AAAA,MAC5B,IAAA;AAAA,MAEA,QAAA,kBAAA,GAAA,CAAC,cAAW,OAAA,EAAS,eAAA,EAAiB,cAAY,SAAA,EAChD,QAAA,kBAAA,GAAA,CAAC,YAAS,CAAA,EACZ;AAAA;AAAA,GACF,EACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"CopyTextButton.esm.js","sources":["../../../src/components/CopyTextButton/CopyTextButton.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 { errorApiRef, useApi } from '@backstage/core-plugin-api';\nimport { ButtonIcon, Tooltip, TooltipTrigger } from '@backstage/ui';\nimport CopyIcon from '@material-ui/icons/FileCopy';\nimport { useEffect, useRef, useState } from 'react';\nimport useCopyToClipboard from 'react-use/esm/useCopyToClipboard';\nimport { coreComponentsTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/**\n * Properties for {@link CopyTextButton}\n *\n * @public\n */\nexport interface CopyTextButtonProps {\n /**\n * The text to be copied\n */\n text: string;\n /**\n * Number of milliseconds that the tooltip is shown\n *\n * @remarks\n *\n * Default: 1000\n */\n tooltipDelay?: number;\n /**\n * Text to show in the tooltip when user has clicked the button\n *\n * @remarks\n *\n * Default: \"Text copied to clipboard\"\n */\n tooltipText?: string;\n\n /**\n * Text to use as aria-label prop on the button\n *\n * @remarks\n *\n * Default: \"Copy text\"\n */\n 'aria-label'?: string;\n}\n\n/**\n * Copy text button with visual feedback\n *\n * @public\n * @remarks\n *\n * Visual feedback takes form of:\n * - a hover color\n * - click ripple\n * - Tooltip shown when user has clicked\n *\n * @example\n *\n * ```\n * <CopyTextButton\n * text=\"My text that I want to be copied to the clipboard\"\n * arial-label=\"Accessible label for this button\" />\n * ```\n */\nexport function CopyTextButton(props: CopyTextButtonProps) {\n const { t } = useTranslationRef(coreComponentsTranslationRef);\n const {\n text,\n tooltipDelay = 1000,\n tooltipText = t('copyTextButton.tooltipText'),\n 'aria-label': ariaLabel = 'Copy text',\n } = props;\n const errorApi = useApi(errorApiRef);\n const [open, setOpen] = useState(false);\n const [{ error }, copyToClipboard] = useCopyToClipboard();\n const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n useEffect(() => {\n if (error) {\n errorApi.post(error);\n }\n }, [error, errorApi]);\n\n const handleCopyClick = () => {\n // Clear any existing timeout to reset the timer on repeated clicks\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n\n setOpen(true);\n copyToClipboard(text);\n\n // Set new timeout to close tooltip\n timeoutRef.current = setTimeout(() => {\n setOpen(false);\n }, tooltipDelay);\n };\n\n // Cleanup timeout on unmount\n useEffect(() => {\n return () => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n };\n }, []);\n\n return (\n <TooltipTrigger isOpen={open} onOpenChange={setOpen}>\n <ButtonIcon\n icon={<CopyIcon />}\n onPress={handleCopyClick}\n aria-label={ariaLabel}\n />\n <Tooltip>{tooltipText}</Tooltip>\n </TooltipTrigger>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;AAgFO,SAAS,eAAe,KAAA,EAA4B;AACzD,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,4BAA4B,CAAA;AAC5D,EAAA,MAAM;AAAA,IACJ,IAAA;AAAA,IACA,YAAA,GAAe,GAAA;AAAA,IACf,WAAA,GAAc,EAAE,4BAA4B,CAAA;AAAA,IAC5C,cAAc,SAAA,GAAY;AAAA,GAC5B,GAAI,KAAA;AACJ,EAAA,MAAM,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAS,KAAK,CAAA;AACtC,EAAA,MAAM,CAAC,EAAE,KAAA,EAAM,EAAG,eAAe,IAAI,kBAAA,EAAmB;AACxD,EAAA,MAAM,UAAA,GAAa,OAA6C,IAAI,CAAA;AAEpE,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,KAAA,EAAO;AACT,MAAA,QAAA,CAAS,KAAK,KAAK,CAAA;AAAA,IACrB;AAAA,EACF,CAAA,EAAG,CAAC,KAAA,EAAO,QAAQ,CAAC,CAAA;AAEpB,EAAA,MAAM,kBAAkB,MAAM;AAE5B,IAAA,IAAI,WAAW,OAAA,EAAS;AACtB,MAAA,YAAA,CAAa,WAAW,OAAO,CAAA;AAAA,IACjC;AAEA,IAAA,OAAA,CAAQ,IAAI,CAAA;AACZ,IAAA,eAAA,CAAgB,IAAI,CAAA;AAGpB,IAAA,UAAA,CAAW,OAAA,GAAU,WAAW,MAAM;AACpC,MAAA,OAAA,CAAQ,KAAK,CAAA;AAAA,IACf,GAAG,YAAY,CAAA;AAAA,EACjB,CAAA;AAGA,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,OAAO,MAAM;AACX,MAAA,IAAI,WAAW,OAAA,EAAS;AACtB,QAAA,YAAA,CAAa,WAAW,OAAO,CAAA;AAAA,MACjC;AAAA,IACF,CAAA;AAAA,EACF,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,uBACE,IAAA,CAAC,cAAA,EAAA,EAAe,MAAA,EAAQ,IAAA,EAAM,cAAc,OAAA,EAC1C,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,IAAA,sBAAO,QAAA,EAAA,EAAS,CAAA;AAAA,QAChB,OAAA,EAAS,eAAA;AAAA,QACT,YAAA,EAAY;AAAA;AAAA,KACd;AAAA,oBACA,GAAA,CAAC,WAAS,QAAA,EAAA,WAAA,EAAY;AAAA,GAAA,EACxB,CAAA;AAEJ;;;;"}
@@ -19,7 +19,7 @@ import '@material-ui/core/DialogTitle';
19
19
  import '../../components/Avatar/Avatar.esm.js';
20
20
  import '../../components/LinkButton/LinkButton.esm.js';
21
21
  import { CodeSnippet } from '../../components/CodeSnippet/CodeSnippet.esm.js';
22
- import '@material-ui/core/Tooltip';
22
+ import '@backstage/ui';
23
23
  import '@material-ui/icons/FileCopy';
24
24
  import 'react-use/esm/useCopyToClipboard';
25
25
  import '@material-ui/core/useMediaQuery';
@@ -47,6 +47,7 @@ import '@material-ui/core/LinearProgress';
47
47
  import { makeStyles } from '@material-ui/core/styles';
48
48
  import '../../components/ProgressBars/GaugeCard.esm.js';
49
49
  import '../../components/ProgressBars/Gauge.esm.js';
50
+ import '@material-ui/core/Tooltip';
50
51
  import 'rc-progress';
51
52
  import '../../components/Select/Select.esm.js';
52
53
  import '../../components/SimpleStepper/SimpleStepper.esm.js';
@@ -1 +1 @@
1
- {"version":3,"file":"StackDetails.esm.js","sources":["../../../src/layout/ErrorPage/StackDetails.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 Typography from '@material-ui/core/Typography';\nimport { useState } from 'react';\nimport { Link } from '../../components/Link';\nimport { CodeSnippet } from '../../components';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { coreComponentsTranslationRef } from '../../translation';\n\ninterface IStackDetailsProps {\n stack: string;\n}\n\n/** @public */\nexport type StackDetailsClassKey = 'title';\n\nconst useStyles = makeStyles(\n theme => ({\n title: {\n paddingBottom: theme.spacing(5),\n [theme.breakpoints.down('xs')]: {\n paddingBottom: theme.spacing(4),\n fontSize: theme.typography.h3.fontSize,\n },\n },\n }),\n { name: 'BackstageErrorPageStackDetails' },\n);\n\n/**\n * Error page details with stack trace\n *\n * @public\n *\n */\nexport function StackDetails(props: IStackDetailsProps) {\n const { stack } = props;\n const classes = useStyles();\n const { t } = useTranslationRef(coreComponentsTranslationRef);\n\n const [detailsOpen, setDetailsOpen] = useState<boolean>(false);\n\n if (!detailsOpen) {\n return (\n <Typography variant=\"h6\" className={classes.title}>\n <Link to=\"#\" onClick={() => setDetailsOpen(true)}>\n {t('errorPage.showMoreDetails')}\n </Link>\n </Typography>\n );\n }\n\n return (\n <>\n <Typography variant=\"h6\" className={classes.title}>\n <Link to=\"#\" onClick={() => setDetailsOpen(false)}>\n {t('errorPage.showLessDetails')}\n </Link>\n </Typography>\n <CodeSnippet\n text={stack}\n language=\"text\"\n showCopyCodeButton\n showLineNumbers\n />\n </>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAM,SAAA,GAAY,UAAA;AAAA,EAChB,CAAA,KAAA,MAAU;AAAA,IACR,KAAA,EAAO;AAAA,MACL,aAAA,EAAe,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA;AAAA,MAC9B,CAAC,KAAA,CAAM,WAAA,CAAY,IAAA,CAAK,IAAI,CAAC,GAAG;AAAA,QAC9B,aAAA,EAAe,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA;AAAA,QAC9B,QAAA,EAAU,KAAA,CAAM,UAAA,CAAW,EAAA,CAAG;AAAA;AAChC;AACF,GACF,CAAA;AAAA,EACA,EAAE,MAAM,gCAAA;AACV,CAAA;AAQO,SAAS,aAAa,KAAA,EAA2B;AACtD,EAAA,MAAM,EAAE,OAAM,GAAI,KAAA;AAClB,EAAA,MAAM,UAAU,SAAA,EAAU;AAC1B,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,4BAA4B,CAAA;AAE5D,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAI,SAAkB,KAAK,CAAA;AAE7D,EAAA,IAAI,CAAC,WAAA,EAAa;AAChB,IAAA,2BACG,UAAA,EAAA,EAAW,OAAA,EAAQ,MAAK,SAAA,EAAW,OAAA,CAAQ,OAC1C,QAAA,kBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAG,GAAA,EAAI,OAAA,EAAS,MAAM,cAAA,CAAe,IAAI,GAC5C,QAAA,EAAA,CAAA,CAAE,2BAA2B,GAChC,CAAA,EACF,CAAA;AAAA,EAEJ;AAEA,EAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,cAAW,OAAA,EAAQ,IAAA,EAAK,WAAW,OAAA,CAAQ,KAAA,EAC1C,8BAAC,IAAA,EAAA,EAAK,EAAA,EAAG,GAAA,EAAI,OAAA,EAAS,MAAM,cAAA,CAAe,KAAK,GAC7C,QAAA,EAAA,CAAA,CAAE,2BAA2B,GAChC,CAAA,EACF,CAAA;AAAA,oBACA,GAAA;AAAA,MAAC,WAAA;AAAA,MAAA;AAAA,QACC,IAAA,EAAM,KAAA;AAAA,QACN,QAAA,EAAS,MAAA;AAAA,QACT,kBAAA,EAAkB,IAAA;AAAA,QAClB,eAAA,EAAe;AAAA;AAAA;AACjB,GAAA,EACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"StackDetails.esm.js","sources":["../../../src/layout/ErrorPage/StackDetails.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 Typography from '@material-ui/core/Typography';\nimport { useState } from 'react';\nimport { Link } from '../../components/Link';\nimport { CodeSnippet } from '../../components';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { coreComponentsTranslationRef } from '../../translation';\n\ninterface IStackDetailsProps {\n stack: string;\n}\n\n/** @public */\nexport type StackDetailsClassKey = 'title';\n\nconst useStyles = makeStyles(\n theme => ({\n title: {\n paddingBottom: theme.spacing(5),\n [theme.breakpoints.down('xs')]: {\n paddingBottom: theme.spacing(4),\n fontSize: theme.typography.h3.fontSize,\n },\n },\n }),\n { name: 'BackstageErrorPageStackDetails' },\n);\n\n/**\n * Error page details with stack trace\n *\n * @public\n *\n */\nexport function StackDetails(props: IStackDetailsProps) {\n const { stack } = props;\n const classes = useStyles();\n const { t } = useTranslationRef(coreComponentsTranslationRef);\n\n const [detailsOpen, setDetailsOpen] = useState<boolean>(false);\n\n if (!detailsOpen) {\n return (\n <Typography variant=\"h6\" className={classes.title}>\n <Link to=\"#\" onClick={() => setDetailsOpen(true)}>\n {t('errorPage.showMoreDetails')}\n </Link>\n </Typography>\n );\n }\n\n return (\n <>\n <Typography variant=\"h6\" className={classes.title}>\n <Link to=\"#\" onClick={() => setDetailsOpen(false)}>\n {t('errorPage.showLessDetails')}\n </Link>\n </Typography>\n <CodeSnippet\n text={stack}\n language=\"text\"\n showCopyCodeButton\n showLineNumbers\n />\n </>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAM,SAAA,GAAY,UAAA;AAAA,EAChB,CAAA,KAAA,MAAU;AAAA,IACR,KAAA,EAAO;AAAA,MACL,aAAA,EAAe,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA;AAAA,MAC9B,CAAC,KAAA,CAAM,WAAA,CAAY,IAAA,CAAK,IAAI,CAAC,GAAG;AAAA,QAC9B,aAAA,EAAe,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA;AAAA,QAC9B,QAAA,EAAU,KAAA,CAAM,UAAA,CAAW,EAAA,CAAG;AAAA;AAChC;AACF,GACF,CAAA;AAAA,EACA,EAAE,MAAM,gCAAA;AACV,CAAA;AAQO,SAAS,aAAa,KAAA,EAA2B;AACtD,EAAA,MAAM,EAAE,OAAM,GAAI,KAAA;AAClB,EAAA,MAAM,UAAU,SAAA,EAAU;AAC1B,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,4BAA4B,CAAA;AAE5D,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAI,SAAkB,KAAK,CAAA;AAE7D,EAAA,IAAI,CAAC,WAAA,EAAa;AAChB,IAAA,2BACG,UAAA,EAAA,EAAW,OAAA,EAAQ,MAAK,SAAA,EAAW,OAAA,CAAQ,OAC1C,QAAA,kBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAG,GAAA,EAAI,OAAA,EAAS,MAAM,cAAA,CAAe,IAAI,GAC5C,QAAA,EAAA,CAAA,CAAE,2BAA2B,GAChC,CAAA,EACF,CAAA;AAAA,EAEJ;AAEA,EAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,cAAW,OAAA,EAAQ,IAAA,EAAK,WAAW,OAAA,CAAQ,KAAA,EAC1C,8BAAC,IAAA,EAAA,EAAK,EAAA,EAAG,GAAA,EAAI,OAAA,EAAS,MAAM,cAAA,CAAe,KAAK,GAC7C,QAAA,EAAA,CAAA,CAAE,2BAA2B,GAChC,CAAA,EACF,CAAA;AAAA,oBACA,GAAA;AAAA,MAAC,WAAA;AAAA,MAAA;AAAA,QACC,IAAA,EAAM,KAAA;AAAA,QACN,QAAA,EAAS,MAAA;AAAA,QACT,kBAAA,EAAkB,IAAA;AAAA,QAClB,eAAA,EAAe;AAAA;AAAA;AACjB,GAAA,EACF,CAAA;AAEJ;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/core-components",
3
- "version": "0.18.11",
3
+ "version": "0.18.12-next.1",
4
4
  "description": "Core components used by Backstage plugins and apps",
5
5
  "backstage": {
6
6
  "role": "web-library"
@@ -54,7 +54,7 @@
54
54
  },
55
55
  "files": [
56
56
  "dist",
57
- "config.d.ts"
57
+ "config.schema.json"
58
58
  ],
59
59
  "scripts": {
60
60
  "build": "backstage-cli package build",
@@ -66,11 +66,12 @@
66
66
  "test": "backstage-cli package test"
67
67
  },
68
68
  "dependencies": {
69
- "@backstage/config": "^1.3.8",
70
- "@backstage/core-plugin-api": "^1.12.7",
71
- "@backstage/errors": "^1.3.1",
72
- "@backstage/theme": "^0.7.3",
73
- "@backstage/version-bridge": "^1.0.12",
69
+ "@backstage/config": "1.3.8",
70
+ "@backstage/core-plugin-api": "1.12.8-next.0",
71
+ "@backstage/errors": "1.3.1",
72
+ "@backstage/theme": "0.7.3",
73
+ "@backstage/ui": "0.17.0-next.1",
74
+ "@backstage/version-bridge": "1.0.12",
74
75
  "@dagrejs/dagre": "^1.1.4",
75
76
  "@date-io/core": "^1.3.13",
76
77
  "@material-table/core": "^3.1.0",
@@ -110,10 +111,10 @@
110
111
  "zod": "^3.25.76 || ^4.0.0"
111
112
  },
112
113
  "devDependencies": {
113
- "@backstage/app-defaults": "^1.7.9",
114
- "@backstage/cli": "^0.36.3",
115
- "@backstage/core-app-api": "^1.20.2",
116
- "@backstage/test-utils": "^1.7.19",
114
+ "@backstage/app-defaults": "1.7.10-next.0",
115
+ "@backstage/cli": "0.36.4-next.2",
116
+ "@backstage/core-app-api": "1.20.3-next.0",
117
+ "@backstage/test-utils": "1.7.20-next.0",
117
118
  "@testing-library/dom": "^10.0.0",
118
119
  "@testing-library/jest-dom": "^6.0.0",
119
120
  "@testing-library/user-event": "^14.0.0",
@@ -149,6 +150,6 @@
149
150
  "optional": true
150
151
  }
151
152
  },
152
- "configSchema": "config.d.ts",
153
+ "configSchema": "config.schema.json",
153
154
  "module": "./dist/index.esm.js"
154
155
  }
package/config.d.ts DELETED
@@ -1,60 +0,0 @@
1
- /*
2
- * Copyright 2023 The Backstage Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- export interface Config {
17
- auth?: {
18
- /**
19
- * Autologout feature configuration
20
- */
21
- autologout?: {
22
- /**
23
- * Enable or disable the autologout feature
24
- * @visibility frontend
25
- */
26
- enabled?: boolean;
27
-
28
- /**
29
- * Number of minutes after which the inactive user is logged out automatically.
30
- * Default is 60 minutes (1 hour)
31
- * @visibility frontend
32
- */
33
- idleTimeoutMinutes?: number;
34
-
35
- /**
36
- * Number of seconds before the idle timeout where the user will be asked if it's still active.
37
- * A dialog will be shown.
38
- * Default is 10 seconds.
39
- * Set to 0 seconds to disable the prompt.
40
- * @visibility frontend
41
- */
42
- promptBeforeIdleSeconds?: number;
43
-
44
- /**
45
- * Enable/disable the usage of worker thread timers instead of main thread timers.
46
- * Default is true.
47
- * If you experience some browser incompatibility, you may try to set this to false.
48
- * @visibility frontend
49
- */
50
- useWorkerTimers?: boolean;
51
-
52
- /**
53
- * Enable/disable the automatic logout also on users that are logged in but with no Backstage tabs open.
54
- * Default is true.
55
- * @visibility frontend
56
- */
57
- logoutIfDisconnected?: boolean;
58
- };
59
- };
60
- }