@red-hat-developer-hub/backstage-plugin-global-floating-action-button 1.9.2 → 1.9.3
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 +7 -0
- package/dist/components/CustomFab.esm.js +8 -9
- package/dist/components/CustomFab.esm.js.map +1 -1
- package/dist/components/FABWithSubmenu.esm.js +17 -27
- package/dist/components/FABWithSubmenu.esm.js.map +1 -1
- package/dist/components/FloatingButton.esm.js +19 -18
- package/dist/components/FloatingButton.esm.js.map +1 -1
- package/dist/translations/de.esm.js +2 -2
- package/dist/translations/de.esm.js.map +1 -1
- package/dist/translations/fr.esm.js +5 -5
- package/dist/translations/fr.esm.js.map +1 -1
- package/dist/translations/it.esm.js +2 -2
- package/dist/translations/it.esm.js.map +1 -1
- package/package.json +1 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @red-hat-developer-hub/backstage-plugin-global-floating-action-button
|
|
2
2
|
|
|
3
|
+
## 1.9.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 4b07772: Translations updated for de/es/fr/it/ja
|
|
8
|
+
- 6e7d784: Replace JSS `makeStyles` with MUI `sx` props to prevent CSS class name collisions with other dynamically loaded plugins in RHDH.
|
|
9
|
+
|
|
3
10
|
## 1.9.2
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { useNavigate } from 'react-router-dom';
|
|
3
|
-
import { makeStyles } from '@mui/styles';
|
|
4
3
|
import Fab from '@mui/material/Fab';
|
|
5
4
|
import Tooltip from '@mui/material/Tooltip';
|
|
6
5
|
import Typography from '@mui/material/Typography';
|
|
@@ -10,9 +9,6 @@ import { Slot } from '../types.esm.js';
|
|
|
10
9
|
import { getSlotOptions } from '../utils.esm.js';
|
|
11
10
|
import { getTranslatedTextWithFallback } from '../utils/translationUtils.esm.js';
|
|
12
11
|
|
|
13
|
-
const useStyles = makeStyles(() => ({
|
|
14
|
-
openInNew: { paddingBottom: "5px", paddingTop: "3px" }
|
|
15
|
-
}));
|
|
16
12
|
const FABLabel = ({
|
|
17
13
|
label,
|
|
18
14
|
slot,
|
|
@@ -20,14 +16,17 @@ const FABLabel = ({
|
|
|
20
16
|
icon,
|
|
21
17
|
order
|
|
22
18
|
}) => {
|
|
23
|
-
const styles = useStyles();
|
|
24
19
|
const marginStyle = getSlotOptions(slot).margin;
|
|
25
20
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
26
21
|
showExternalIcon && /* @__PURE__ */ jsx(
|
|
27
22
|
OpenInNewIcon,
|
|
28
23
|
{
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
sx: {
|
|
25
|
+
pb: "5px",
|
|
26
|
+
pt: "3px",
|
|
27
|
+
...marginStyle,
|
|
28
|
+
order: order.externalIcon
|
|
29
|
+
}
|
|
31
30
|
}
|
|
32
31
|
),
|
|
33
32
|
label && /* @__PURE__ */ jsx(
|
|
@@ -48,7 +47,7 @@ const FABLabel = ({
|
|
|
48
47
|
const CustomFab = ({
|
|
49
48
|
actionButton,
|
|
50
49
|
size,
|
|
51
|
-
|
|
50
|
+
sx,
|
|
52
51
|
t
|
|
53
52
|
}) => {
|
|
54
53
|
const navigate = useNavigate();
|
|
@@ -90,7 +89,7 @@ const CustomFab = ({
|
|
|
90
89
|
Fab,
|
|
91
90
|
{
|
|
92
91
|
...newWindow ? { target: "_blank", rel: "noopener" } : {},
|
|
93
|
-
|
|
92
|
+
sx,
|
|
94
93
|
style: {
|
|
95
94
|
color: actionButton?.iconColor || "#1f1f1f",
|
|
96
95
|
backgroundColor: actionButton.color ? "" : "white"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomFab.esm.js","sources":["../../src/components/CustomFab.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 type { ReactElement } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport
|
|
1
|
+
{"version":3,"file":"CustomFab.esm.js","sources":["../../src/components/CustomFab.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 type { ReactElement } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport Fab from '@mui/material/Fab';\nimport Tooltip from '@mui/material/Tooltip';\nimport Typography from '@mui/material/Typography';\nimport OpenInNewIcon from '@mui/icons-material/OpenInNew';\nimport { FabIcon } from './FabIcon';\nimport { FloatingActionButton, Slot } from '../types';\nimport { getSlotOptions } from '../utils';\nimport { getTranslatedTextWithFallback } from '../utils/translationUtils';\nimport { TranslationFunction } from '@backstage/core-plugin-api/alpha';\nimport { globalFloatingActionButtonTranslationRef } from '../translations';\nimport type { SxProps, Theme } from '@mui/material/styles';\n\nconst FABLabel = ({\n label,\n slot,\n showExternalIcon,\n icon,\n order,\n}: {\n label: string;\n slot: Slot;\n showExternalIcon: boolean;\n icon?: string | ReactElement;\n order: { externalIcon?: number; icon?: number };\n}) => {\n const marginStyle = getSlotOptions(slot).margin;\n return (\n <>\n {showExternalIcon && (\n <OpenInNewIcon\n sx={{\n pb: '5px',\n pt: '3px',\n ...marginStyle,\n order: order.externalIcon,\n }}\n />\n )}\n {label && (\n <Typography\n sx={{\n ...marginStyle,\n color: '#151515',\n order: 2,\n textTransform: 'none',\n }}\n >\n {label}\n </Typography>\n )}\n {icon && (\n <Typography sx={{ mb: -1, order: order.icon }}>\n <FabIcon icon={icon} />\n </Typography>\n )}\n </>\n );\n};\n\nexport const CustomFab = ({\n actionButton,\n size,\n sx,\n t,\n}: {\n actionButton: FloatingActionButton;\n size?: 'small' | 'medium' | 'large';\n sx?: SxProps<Theme>;\n t: TranslationFunction<typeof globalFloatingActionButtonTranslationRef.T>;\n}) => {\n const navigate = useNavigate();\n const isExternalUri = (uri: string) => /^([a-z+.-]+):/.test(uri);\n const isExternal = isExternalUri(actionButton.to!);\n const newWindow = isExternal && !!/^https?:/.exec(actionButton.to!);\n const navigateTo = () =>\n actionButton.to && !isExternal ? navigate(actionButton.to) : '';\n\n const resolvedLabel = getTranslatedTextWithFallback(\n t,\n actionButton.labelKey,\n actionButton.label,\n );\n const resolvedTooltip = actionButton.toolTip\n ? getTranslatedTextWithFallback(\n t,\n actionButton.toolTipKey,\n actionButton.toolTip,\n )\n : undefined;\n\n if (!resolvedLabel) {\n // eslint-disable-next-line no-console\n console.warn(\n 'Label is missing from your FAB component. A label is required for the aria-label attribute.',\n actionButton,\n );\n return null;\n }\n\n const labelText =\n (resolvedLabel || '').length > 20\n ? `${resolvedLabel.slice(0, resolvedLabel.length)}...`\n : resolvedLabel;\n\n const getColor = () => {\n if (actionButton.color) {\n return actionButton.color;\n }\n return undefined;\n };\n\n const displayOnRight =\n actionButton.slot === Slot.PAGE_END || !actionButton.slot;\n\n return (\n <Tooltip\n title={resolvedTooltip}\n placement={getSlotOptions(actionButton.slot).tooltipDirection}\n >\n <Fab\n {...(newWindow ? { target: '_blank', rel: 'noopener' } : {})}\n sx={sx}\n style={{\n color: actionButton?.iconColor || '#1f1f1f',\n backgroundColor: actionButton.color ? '' : 'white',\n }}\n variant={\n actionButton.showLabel || isExternal || !actionButton.icon\n ? 'extended'\n : 'circular'\n }\n size={size || actionButton.size || 'medium'}\n color={getColor()}\n aria-label={resolvedLabel}\n data-testid={(resolvedLabel || '')\n .replace(' ', '-')\n .toLocaleLowerCase('en-US')}\n onClick={actionButton.onClick || navigateTo}\n {...(isExternal ? { href: actionButton.to } : {})}\n >\n <FABLabel\n showExternalIcon={isExternal}\n icon={actionButton.icon}\n label={actionButton.showLabel || !actionButton.icon ? labelText : ''}\n order={\n displayOnRight\n ? { externalIcon: isExternal ? 1 : -1, icon: 3 }\n : { externalIcon: isExternal ? 3 : -1, icon: 1 }\n }\n slot={actionButton.slot || Slot.PAGE_END}\n />\n </Fab>\n </Tooltip>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AA8BA,MAAM,WAAW,CAAC;AAAA,EAChB,KAAA;AAAA,EACA,IAAA;AAAA,EACA,gBAAA;AAAA,EACA,IAAA;AAAA,EACA;AACF,CAMM,KAAA;AACJ,EAAM,MAAA,WAAA,GAAc,cAAe,CAAA,IAAI,CAAE,CAAA,MAAA;AACzC,EAAA,uBAEK,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,IACC,gBAAA,oBAAA,GAAA;AAAA,MAAC,aAAA;AAAA,MAAA;AAAA,QACC,EAAI,EAAA;AAAA,UACF,EAAI,EAAA,KAAA;AAAA,UACJ,EAAI,EAAA,KAAA;AAAA,UACJ,GAAG,WAAA;AAAA,UACH,OAAO,KAAM,CAAA;AAAA;AACf;AAAA,KACF;AAAA,IAED,KACC,oBAAA,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,EAAI,EAAA;AAAA,UACF,GAAG,WAAA;AAAA,UACH,KAAO,EAAA,SAAA;AAAA,UACP,KAAO,EAAA,CAAA;AAAA,UACP,aAAe,EAAA;AAAA,SACjB;AAAA,QAEC,QAAA,EAAA;AAAA;AAAA,KACH;AAAA,IAED,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AA,KAAO,EAAC;AAAA,UAE/C,QAAA,kBAAA,GAAA;AAAA,YAAC,QAAA;AAAA,YAAA;AAAA,cACC,gBAAkB,EAAA,UAAA;AAAA,cAClB,MAAM,YAAa,CAAA,IAAA;AAAA,cACnB,OAAO,YAAa,CAAA,SAAA,IAAa,CAAC,YAAA,CAAa,OAAO,SAAY,GAAA,EAAA;AAAA,cAClE,OACE,cACI,GAAA,EAAE,YAAc,EAAA,UAAA,GAAa,IAAI,EAAI,EAAA,IAAA,EAAM,CAAE,EAAA,GAC7C,EAAE,YAAc,EAAA,UAAA,GAAa,CAAI,GAAA,EAAA,EAAI,MAAM,CAAE,EAAA;AAAA,cAEnD,IAAA,EAAM,YAAa,CAAA,IAAA,IAAQ,IAAK,CAAA;AAAA;AAAA;AAClC;AAAA;AACF;AAAA,GACF;AAEJ;;;;"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useRef, useState, useEffect } from 'react';
|
|
3
|
-
import classnames from 'classnames';
|
|
4
3
|
import { useLocation } from 'react-router-dom';
|
|
5
|
-
import { makeStyles } from '@mui/styles';
|
|
6
4
|
import Fab from '@mui/material/Fab';
|
|
7
5
|
import Tooltip from '@mui/material/Tooltip';
|
|
8
6
|
import Box from '@mui/material/Box';
|
|
@@ -15,30 +13,12 @@ import Typography from '@mui/material/Typography';
|
|
|
15
13
|
import { useTranslation } from '../hooks/useTranslation.esm.js';
|
|
16
14
|
import { getTranslatedTextWithFallback } from '../utils/translationUtils.esm.js';
|
|
17
15
|
|
|
18
|
-
const useStyles = makeStyles((theme) => ({
|
|
19
|
-
fabContainer: {
|
|
20
|
-
zIndex: 200,
|
|
21
|
-
display: "flex",
|
|
22
|
-
position: "fixed",
|
|
23
|
-
alignItems: "center",
|
|
24
|
-
gap: "10px"
|
|
25
|
-
},
|
|
26
|
-
button: {
|
|
27
|
-
zIndex: 205,
|
|
28
|
-
color: theme && Object.keys(theme).length > 0 ? theme.palette.grey[500] : "#9e9e9e"
|
|
29
|
-
},
|
|
30
|
-
menuButtonStyle: {
|
|
31
|
-
color: "white"
|
|
32
|
-
}
|
|
33
|
-
}));
|
|
34
16
|
const FABWithSubmenu = ({
|
|
35
|
-
|
|
17
|
+
sx: sxProp,
|
|
36
18
|
fabs,
|
|
37
19
|
slot
|
|
38
20
|
}) => {
|
|
39
21
|
const containerRef = useRef(null);
|
|
40
|
-
const styles = useStyles();
|
|
41
|
-
const fab = useStyles();
|
|
42
22
|
const { pathname } = useLocation();
|
|
43
23
|
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
|
44
24
|
useEffect(() => {
|
|
@@ -59,10 +39,17 @@ const FABWithSubmenu = ({
|
|
|
59
39
|
return /* @__PURE__ */ jsxs(
|
|
60
40
|
Box,
|
|
61
41
|
{
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
42
|
+
sx: [
|
|
43
|
+
{
|
|
44
|
+
zIndex: 200,
|
|
45
|
+
display: "flex",
|
|
46
|
+
position: "fixed",
|
|
47
|
+
alignItems: "center",
|
|
48
|
+
gap: "10px",
|
|
49
|
+
flexDirection: "column-reverse"
|
|
50
|
+
},
|
|
51
|
+
...Array.isArray(sxProp) ? sxProp : [sxProp]
|
|
52
|
+
],
|
|
66
53
|
id: "floating-button-with-submenu",
|
|
67
54
|
"data-testid": "floating-button-with-submenu",
|
|
68
55
|
children: [
|
|
@@ -82,7 +69,7 @@ const FABWithSubmenu = ({
|
|
|
82
69
|
"aria-label": "Menu",
|
|
83
70
|
variant: "circular",
|
|
84
71
|
sx: { zIndex: 1e3 },
|
|
85
|
-
children: isMenuOpen ? /* @__PURE__ */ jsx(CloseIcon, {
|
|
72
|
+
children: isMenuOpen ? /* @__PURE__ */ jsx(CloseIcon, { sx: { color: "white" } }) : /* @__PURE__ */ jsx(MenuIcon, { sx: { color: "white" } })
|
|
86
73
|
}
|
|
87
74
|
)
|
|
88
75
|
] })
|
|
@@ -104,7 +91,10 @@ const FABWithSubmenu = ({
|
|
|
104
91
|
actionButton: fb,
|
|
105
92
|
t,
|
|
106
93
|
size: "medium",
|
|
107
|
-
|
|
94
|
+
sx: (theme) => ({
|
|
95
|
+
zIndex: 205,
|
|
96
|
+
color: theme && Object.keys(theme).length > 0 ? theme.palette.grey[500] : "#9e9e9e"
|
|
97
|
+
})
|
|
108
98
|
},
|
|
109
99
|
fb.label
|
|
110
100
|
) })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FABWithSubmenu.esm.js","sources":["../../src/components/FABWithSubmenu.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 { useRef, useState, useEffect } from 'react';\
|
|
1
|
+
{"version":3,"file":"FABWithSubmenu.esm.js","sources":["../../src/components/FABWithSubmenu.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 { useRef, useState, useEffect } from 'react';\n\nimport { useLocation } from 'react-router-dom';\nimport Fab from '@mui/material/Fab';\nimport Tooltip from '@mui/material/Tooltip';\nimport Box from '@mui/material/Box';\n\nimport CloseIcon from '@mui/icons-material/Close';\nimport MenuIcon from '@mui/icons-material/Menu';\nimport Slide from '@mui/material/Slide';\nimport { CustomFab } from './CustomFab';\nimport { getSlotOptions } from '../utils';\nimport { FloatingActionButton, Slot } from '../types';\nimport Typography from '@mui/material/Typography';\nimport { useTranslation } from '../hooks/useTranslation';\nimport { getTranslatedTextWithFallback } from '../utils/translationUtils';\nimport type { SxProps, Theme } from '@mui/material/styles';\n\nexport const FABWithSubmenu = ({\n sx: sxProp,\n fabs,\n slot,\n}: {\n fabs: FloatingActionButton[];\n slot: Slot;\n sx?: SxProps<Theme>;\n}) => {\n const containerRef = useRef<HTMLElement>(null);\n const { pathname } = useLocation();\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n\n useEffect(() => {\n return () => {\n setIsMenuOpen(false);\n };\n }, [pathname]);\n\n const handleClick = () => {\n if (isMenuOpen) {\n setTimeout(() => {\n setIsMenuOpen(false);\n }, 300);\n } else {\n setIsMenuOpen(true);\n }\n };\n // This hook call is necessary to prevent infinite re-render loops\n // The translation context provides stability to the component's render cycle\n const { t } = useTranslation();\n return (\n <Box\n sx={[\n {\n zIndex: 200,\n display: 'flex',\n position: 'fixed',\n alignItems: 'center',\n gap: '10px',\n flexDirection: 'column-reverse',\n },\n ...(Array.isArray(sxProp) ? sxProp : [sxProp]),\n ]}\n id=\"floating-button-with-submenu\"\n data-testid=\"floating-button-with-submenu\"\n >\n <Tooltip\n title={getTranslatedTextWithFallback(t, 'fab.menu.tooltip', 'Menu')}\n placement={getSlotOptions(slot).tooltipDirection}\n >\n <Typography>\n <Box ref={containerRef} sx={{ overflow: 'hidden' }} />\n <Fab\n size=\"medium\"\n color=\"info\"\n onClick={handleClick}\n aria-label=\"Menu\"\n variant=\"circular\"\n sx={{ zIndex: 1000 }}\n >\n {isMenuOpen ? (\n <CloseIcon sx={{ color: 'white' }} />\n ) : (\n <MenuIcon sx={{ color: 'white' }} />\n )}\n </Fab>\n </Typography>\n </Tooltip>\n {fabs?.map(fb => {\n return (\n <Slide\n key={fb.label}\n direction=\"up\"\n container={containerRef?.current}\n in={isMenuOpen}\n mountOnEnter\n unmountOnExit\n timeout={500}\n >\n <Box>\n <CustomFab\n actionButton={fb}\n t={t}\n size=\"medium\"\n key={fb.label}\n sx={theme => ({\n zIndex: 205,\n color:\n theme && Object.keys(theme).length > 0\n ? theme.palette.grey[500]\n : '#9e9e9e',\n })}\n />\n </Box>\n </Slide>\n );\n })}\n </Box>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAkCO,MAAM,iBAAiB,CAAC;AAAA,EAC7B,EAAI,EAAA,MAAA;AAAA,EACJ,IAAA;AAAA,EACA;AACF,CAIM,KAAA;AACJ,EAAM,MAAA,YAAA,GAAe,OAAoB,IAAI,CAAA;AAC7C,EAAM,MAAA,EAAE,QAAS,EAAA,GAAI,WAAY,EAAA;AACjC,EAAA,MAAM,CAAC,UAAA,EAAY,aAAa,CAAA,GAAI,SAAS,KAAK,CAAA;AAElD,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,OAAO,MAAM;AACX,MAAA,aAAA,CAAc,KAAK,CAAA;AAAA,KACrB;AAAA,GACF,EAAG,CAAC,QAAQ,CAAC,CAAA;AAEb,EAAA,MAAM,cAAc,MAAM;AACxB,IAAA,IAAI,UAAY,EAAA;AACd,MAAA,UAAA,CAAW,MAAM;AACf,QAAA,aAAA,CAAc,KAAK,CAAA;AAAA,SAClB,GAAG,CAAA;AAAA,KACD,MAAA;AACL,MAAA,aAAA,CAAc,IAAI,CAAA;AAAA;AACpB,GACF;AAGA,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,cAAe,EAAA;AAC7B,EACE,uBAAA,IAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,EAAI,EAAA;AAAA,QACF;AAAA,UACE,MAAQ,EAAA,GAAA;AAAA,UACR,OAAS,EAAA,MAAA;AAAA,UACT,QAAU,EAAA,OAAA;AAAA,UACV,UAAY,EAAA,QAAA;AAAA,UACZ,GAAK,EAAA,MAAA;AAAA,UACL,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AA,cACJ,YAAY,EAAA,IAAA;AAAA,cACZ,aAAa,EAAA,IAAA;AAAA,cACb,OAAS,EAAA,GAAA;AAAA,cAET,8BAAC,GACC,EAAA,EAAA,QAAA,kBAAA,GAAA;AAAA,gBAAC,SAAA;AAAA,gBAAA;AAAA,kBACC,YAAc,EAAA,EAAA;AAAA,kBACd,CAAA;AAAA,kBACA,IAAK,EAAA,QAAA;AAAA,kBAEL,IAAI,CAAU,KAAA,MAAA;AAAA,oBACZ,MAAQ,EAAA,GAAA;AAAA,oBACR,KACE,EAAA,KAAA,IAAS,MAAO,CAAA,IAAA,CAAK,KAAK,CAAA,CAAE,MAAS,GAAA,CAAA,GACjC,KAAM,CAAA,OAAA,CAAQ,IAAK,CAAA,GAAG,CACtB,GAAA;AAAA,mBACR;AAAA,iBAAA;AAAA,gBAPK,EAAG,CAAA;AAAA,eASZ,EAAA;AAAA,aAAA;AAAA,YAtBK,EAAG,CAAA;AAAA,WAuBV;AAAA,SAEH;AAAA;AAAA;AAAA,GACH;AAEJ;;;;"}
|
|
@@ -2,36 +2,35 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { useRef, useState, useEffect, useMemo } from 'react';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
4
|
import { useLocation } from 'react-router-dom';
|
|
5
|
-
import
|
|
5
|
+
import Box from '@mui/material/Box';
|
|
6
6
|
import { FABWithSubmenu } from './FABWithSubmenu.esm.js';
|
|
7
7
|
import { CustomFab } from './CustomFab.esm.js';
|
|
8
|
+
import { Slot } from '../types.esm.js';
|
|
8
9
|
import { filterAndSortButtons } from '../utils.esm.js';
|
|
9
10
|
import { useTranslation } from '../hooks/useTranslation.esm.js';
|
|
10
11
|
|
|
11
|
-
const
|
|
12
|
-
|
|
12
|
+
const slotSx = {
|
|
13
|
+
[Slot.PAGE_END]: (theme) => ({
|
|
13
14
|
bottom: `calc(${theme?.spacing?.(2) ?? "16px"} + 1.5em)`,
|
|
14
15
|
right: `calc(${theme?.spacing?.(2) ?? "16px"} + 1.5em)`,
|
|
15
16
|
alignItems: "end",
|
|
16
|
-
// When drawer is docked, adjust margin
|
|
17
17
|
".docked-drawer-open &": {
|
|
18
18
|
transition: "margin-right 0.3s ease",
|
|
19
|
-
marginRight: "var(--docked-drawer-width, 500px)
|
|
19
|
+
marginRight: "var(--docked-drawer-width, 500px)"
|
|
20
20
|
}
|
|
21
|
-
},
|
|
22
|
-
|
|
21
|
+
}),
|
|
22
|
+
[Slot.BOTTOM_LEFT]: (theme) => ({
|
|
23
23
|
bottom: `calc(${theme?.spacing?.(2) ?? "16px"} + 1.5em)`,
|
|
24
24
|
paddingLeft: theme?.spacing?.(2) ?? "16px",
|
|
25
25
|
alignItems: "start"
|
|
26
|
-
}
|
|
27
|
-
}
|
|
26
|
+
})
|
|
27
|
+
};
|
|
28
28
|
const FloatingButton = ({
|
|
29
29
|
floatingButtons,
|
|
30
30
|
slot
|
|
31
31
|
}) => {
|
|
32
32
|
const timeoutRef = useRef();
|
|
33
33
|
const { pathname } = useLocation();
|
|
34
|
-
const fabButton = useStyles();
|
|
35
34
|
const [targetElement, setTargetElement] = useState(null);
|
|
36
35
|
const { t } = useTranslation();
|
|
37
36
|
useEffect(() => {
|
|
@@ -57,17 +56,19 @@ const FloatingButton = ({
|
|
|
57
56
|
}
|
|
58
57
|
let fabDiv;
|
|
59
58
|
if (fabs.length > 1) {
|
|
60
|
-
fabDiv = /* @__PURE__ */ jsx(FABWithSubmenu, {
|
|
59
|
+
fabDiv = /* @__PURE__ */ jsx(FABWithSubmenu, { sx: slotSx[slot], fabs, slot });
|
|
61
60
|
} else {
|
|
62
61
|
fabDiv = /* @__PURE__ */ jsx(
|
|
63
|
-
|
|
62
|
+
Box,
|
|
64
63
|
{
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
64
|
+
sx: [
|
|
65
|
+
{
|
|
66
|
+
zIndex: 200,
|
|
67
|
+
display: "flex",
|
|
68
|
+
position: "fixed"
|
|
69
|
+
},
|
|
70
|
+
...Array.isArray(slotSx[slot]) ? slotSx[slot] : [slotSx[slot]]
|
|
71
|
+
],
|
|
71
72
|
id: "floating-button",
|
|
72
73
|
"data-testid": "floating-button",
|
|
73
74
|
children: /* @__PURE__ */ jsx(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingButton.esm.js","sources":["../../src/components/FloatingButton.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 { useRef, useState, useEffect, useMemo } from 'react';\nimport { createPortal } from 'react-dom';\nimport { useLocation } from 'react-router-dom';\n\nimport
|
|
1
|
+
{"version":3,"file":"FloatingButton.esm.js","sources":["../../src/components/FloatingButton.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 { useRef, useState, useEffect, useMemo } from 'react';\nimport { createPortal } from 'react-dom';\nimport { useLocation } from 'react-router-dom';\n\nimport Box from '@mui/material/Box';\nimport { FABWithSubmenu } from './FABWithSubmenu';\nimport { CustomFab } from './CustomFab';\nimport { FloatingActionButton, Slot } from '../types';\nimport { filterAndSortButtons } from '../utils';\nimport { useTranslation } from '../hooks/useTranslation';\nimport type { SxProps, Theme } from '@mui/material/styles';\n\nconst slotSx: Record<Slot, SxProps<Theme>> = {\n [Slot.PAGE_END]: theme => ({\n bottom: `calc(${theme?.spacing?.(2) ?? '16px'} + 1.5em)`,\n right: `calc(${theme?.spacing?.(2) ?? '16px'} + 1.5em)`,\n alignItems: 'end',\n '.docked-drawer-open &': {\n transition: 'margin-right 0.3s ease',\n marginRight: 'var(--docked-drawer-width, 500px)',\n },\n }),\n [Slot.BOTTOM_LEFT]: theme => ({\n bottom: `calc(${theme?.spacing?.(2) ?? '16px'} + 1.5em)`,\n paddingLeft: theme?.spacing?.(2) ?? '16px',\n alignItems: 'start',\n }),\n};\n\nexport const FloatingButton = ({\n floatingButtons,\n slot,\n}: {\n floatingButtons: FloatingActionButton[];\n slot: Slot;\n}) => {\n const timeoutRef = useRef<NodeJS.Timeout>();\n const { pathname } = useLocation();\n const [targetElement, setTargetElement] = useState<Element | null>(null);\n const { t } = useTranslation();\n\n useEffect(() => {\n const checkTargetElement = () => {\n const element =\n document.querySelector('[class^=\"BackstagePage-root\"]') ??\n document.querySelector('main');\n if (element) {\n setTargetElement(element);\n } else {\n timeoutRef.current = setTimeout(checkTargetElement, 300);\n }\n };\n checkTargetElement();\n return () => {\n clearTimeout(timeoutRef.current);\n };\n }, [pathname, targetElement]);\n\n const fabs = useMemo(\n () => filterAndSortButtons(floatingButtons, pathname),\n [floatingButtons, pathname],\n );\n\n if (fabs?.length === 0) {\n return null;\n }\n\n let fabDiv;\n if (fabs.length > 1) {\n fabDiv = <FABWithSubmenu sx={slotSx[slot]} fabs={fabs} slot={slot} />;\n } else {\n fabDiv = (\n <Box\n sx={[\n {\n zIndex: 200,\n display: 'flex',\n position: 'fixed',\n },\n ...(Array.isArray(slotSx[slot]) ? slotSx[slot] : [slotSx[slot]]),\n ]}\n id=\"floating-button\"\n data-testid=\"floating-button\"\n >\n <CustomFab\n actionButton={{ color: 'info', iconColor: 'white', ...f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AC,SAAA;AAAA,UAAA;AAAA,YACC,YAAA,EAAc,EAAE,KAAO,EAAA,MAAA,EAAQ,WAAW,OAAS,EAAA,GAAG,IAAK,CAAA,CAAC,CAAE,EAAA;AAAA,YAC9D;AAAA;AAAA;AACF;AAAA,KACF;AAAA;AAGJ,EAAO,OAAA,aAAA,GACH,aAAa,MAAQ,EAAA,aAAa,IAClC,YAAa,CAAA,MAAA,EAAQ,SAAS,IAAI,CAAA;AACxC;;;;"}
|
|
@@ -5,7 +5,7 @@ const globalFloatingActionButtonTranslationDe = createTranslationMessages({
|
|
|
5
5
|
ref: globalFloatingActionButtonTranslationRef,
|
|
6
6
|
messages: {
|
|
7
7
|
"fab.create.label": "Erstellen",
|
|
8
|
-
"fab.create.tooltip": "
|
|
8
|
+
"fab.create.tooltip": "Entity erstellen",
|
|
9
9
|
"fab.docs.label": "Dokumente",
|
|
10
10
|
"fab.docs.tooltip": "Dokumentation",
|
|
11
11
|
"fab.apis.label": "APIs",
|
|
@@ -15,7 +15,7 @@ const globalFloatingActionButtonTranslationDe = createTranslationMessages({
|
|
|
15
15
|
"fab.bulkImport.label": "Massenimport",
|
|
16
16
|
"fab.bulkImport.tooltip": "Mehrere Repositorys gleichzeitig registrieren",
|
|
17
17
|
"fab.quay.label": "Quay",
|
|
18
|
-
"fab.quay.tooltip": "Quay
|
|
18
|
+
"fab.quay.tooltip": "Quay-Containerregistrierung",
|
|
19
19
|
"fab.menu.tooltip": "Men\xFC"
|
|
20
20
|
}
|
|
21
21
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"de.esm.js","sources":["../../src/translations/de.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 { createTranslationMessages } from '@backstage/core-plugin-api/alpha';\nimport { globalFloatingActionButtonTranslationRef } from './ref';\n\n/**\n * de translation for plugin.global-floating-action-button.\n * @public\n */\nconst globalFloatingActionButtonTranslationDe = createTranslationMessages({\n ref: globalFloatingActionButtonTranslationRef,\n messages: {\n 'fab.create.label': 'Erstellen',\n 'fab.create.tooltip': '
|
|
1
|
+
{"version":3,"file":"de.esm.js","sources":["../../src/translations/de.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 { createTranslationMessages } from '@backstage/core-plugin-api/alpha';\nimport { globalFloatingActionButtonTranslationRef } from './ref';\n\n/**\n * de translation for plugin.global-floating-action-button.\n * @public\n */\nconst globalFloatingActionButtonTranslationDe = createTranslationMessages({\n ref: globalFloatingActionButtonTranslationRef,\n messages: {\n 'fab.create.label': 'Erstellen',\n 'fab.create.tooltip': 'Entity erstellen',\n 'fab.docs.label': 'Dokumente',\n 'fab.docs.tooltip': 'Dokumentation',\n 'fab.apis.label': 'APIs',\n 'fab.apis.tooltip': 'API-Dokumentation',\n 'fab.github.label': 'GitHub',\n 'fab.github.tooltip': 'GitHub-Repository',\n 'fab.bulkImport.label': 'Massenimport',\n 'fab.bulkImport.tooltip': 'Mehrere Repositorys gleichzeitig registrieren',\n 'fab.quay.label': 'Quay',\n 'fab.quay.tooltip': 'Quay-Containerregistrierung',\n 'fab.menu.tooltip': 'Menü',\n },\n});\n\nexport default globalFloatingActionButtonTranslationDe;\n"],"names":[],"mappings":";;;AAuBA,MAAM,0CAA0C,yBAA0B,CAAA;AAAA,EACxE,GAAK,EAAA,wCAAA;AAAA,EACL,QAAU,EAAA;AAAA,IACR,kBAAoB,EAAA,WAAA;AAAA,IACpB,oBAAsB,EAAA,kBAAA;AAAA,IACtB,gBAAkB,EAAA,WAAA;AAAA,IAClB,kBAAoB,EAAA,eAAA;AAAA,IACpB,gBAAkB,EAAA,MAAA;AAAA,IAClB,kBAAoB,EAAA,mBAAA;AAAA,IACpB,kBAAoB,EAAA,QAAA;AAAA,IACpB,oBAAsB,EAAA,mBAAA;AAAA,IACtB,sBAAwB,EAAA,cAAA;AAAA,IACxB,wBAA0B,EAAA,+CAAA;AAAA,IAC1B,gBAAkB,EAAA,MAAA;AAAA,IAClB,kBAAoB,EAAA,6BAAA;AAAA,IACpB,kBAAoB,EAAA;AAAA;AAExB,CAAC;;;;"}
|
|
@@ -5,17 +5,17 @@ const globalFloatingActionButtonTranslationFr = createTranslationMessages({
|
|
|
5
5
|
ref: globalFloatingActionButtonTranslationRef,
|
|
6
6
|
messages: {
|
|
7
7
|
"fab.create.label": "Cr\xE9er",
|
|
8
|
-
"fab.create.tooltip": "Cr\xE9er
|
|
8
|
+
"fab.create.tooltip": "Cr\xE9er une entit\xE9",
|
|
9
9
|
"fab.docs.label": "Docs",
|
|
10
10
|
"fab.docs.tooltip": "Documentation",
|
|
11
11
|
"fab.apis.label": "APIs",
|
|
12
|
-
"fab.apis.tooltip": "Documentation API",
|
|
12
|
+
"fab.apis.tooltip": "Documentation de l'API",
|
|
13
13
|
"fab.github.label": "GitHub",
|
|
14
14
|
"fab.github.tooltip": "R\xE9f\xE9rentiel GitHub",
|
|
15
|
-
"fab.bulkImport.label": "Importation en
|
|
16
|
-
"fab.bulkImport.tooltip": "
|
|
15
|
+
"fab.bulkImport.label": "Importation en vrac",
|
|
16
|
+
"fab.bulkImport.tooltip": "Enregistrez plusieurs r\xE9f\xE9rentiels en masse",
|
|
17
17
|
"fab.quay.label": "Quay",
|
|
18
|
-
"fab.quay.tooltip": "
|
|
18
|
+
"fab.quay.tooltip": "Registre des conteneurs de Quay",
|
|
19
19
|
"fab.menu.tooltip": "Menu"
|
|
20
20
|
}
|
|
21
21
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fr.esm.js","sources":["../../src/translations/fr.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 { createTranslationMessages } from '@backstage/core-plugin-api/alpha';\nimport { globalFloatingActionButtonTranslationRef } from './ref';\n\n/**\n * fr translation for plugin.global-floating-action-button.\n * @public\n */\nconst globalFloatingActionButtonTranslationFr = createTranslationMessages({\n ref: globalFloatingActionButtonTranslationRef,\n messages: {\n 'fab.create.label': 'Créer',\n 'fab.create.tooltip':
|
|
1
|
+
{"version":3,"file":"fr.esm.js","sources":["../../src/translations/fr.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 { createTranslationMessages } from '@backstage/core-plugin-api/alpha';\nimport { globalFloatingActionButtonTranslationRef } from './ref';\n\n/**\n * fr translation for plugin.global-floating-action-button.\n * @public\n */\nconst globalFloatingActionButtonTranslationFr = createTranslationMessages({\n ref: globalFloatingActionButtonTranslationRef,\n messages: {\n 'fab.create.label': 'Créer',\n 'fab.create.tooltip': 'Créer une entité',\n 'fab.docs.label': 'Docs',\n 'fab.docs.tooltip': 'Documentation',\n 'fab.apis.label': 'APIs',\n 'fab.apis.tooltip': \"Documentation de l'API\",\n 'fab.github.label': 'GitHub',\n 'fab.github.tooltip': 'Référentiel GitHub',\n 'fab.bulkImport.label': 'Importation en vrac',\n 'fab.bulkImport.tooltip': 'Enregistrez plusieurs référentiels en masse',\n 'fab.quay.label': 'Quay',\n 'fab.quay.tooltip': 'Registre des conteneurs de Quay',\n 'fab.menu.tooltip': 'Menu',\n },\n});\n\nexport default globalFloatingActionButtonTranslationFr;\n"],"names":[],"mappings":";;;AAuBA,MAAM,0CAA0C,yBAA0B,CAAA;AAAA,EACxE,GAAK,EAAA,wCAAA;AAAA,EACL,QAAU,EAAA;AAAA,IACR,kBAAoB,EAAA,UAAA;AAAA,IACpB,oBAAsB,EAAA,wBAAA;AAAA,IACtB,gBAAkB,EAAA,MAAA;AAAA,IAClB,kBAAoB,EAAA,eAAA;AAAA,IACpB,gBAAkB,EAAA,MAAA;AAAA,IAClB,kBAAoB,EAAA,wBAAA;AAAA,IACpB,kBAAoB,EAAA,QAAA;AAAA,IACpB,oBAAsB,EAAA,0BAAA;AAAA,IACtB,sBAAwB,EAAA,qBAAA;AAAA,IACxB,wBAA0B,EAAA,mDAAA;AAAA,IAC1B,gBAAkB,EAAA,MAAA;AAAA,IAClB,kBAAoB,EAAA,iCAAA;AAAA,IACpB,kBAAoB,EAAA;AAAA;AAExB,CAAC;;;;"}
|
|
@@ -11,11 +11,11 @@ const globalFloatingActionButtonTranslationIt = createTranslationMessages({
|
|
|
11
11
|
"fab.apis.label": "API",
|
|
12
12
|
"fab.apis.tooltip": "Documentazione API",
|
|
13
13
|
"fab.github.label": "GitHub",
|
|
14
|
-
"fab.github.tooltip": "Repository GitHub",
|
|
14
|
+
"fab.github.tooltip": "Repository di GitHub",
|
|
15
15
|
"fab.bulkImport.label": "Importazione in blocco",
|
|
16
16
|
"fab.bulkImport.tooltip": "Registra pi\xF9 repository in blocco",
|
|
17
17
|
"fab.quay.label": "Quay",
|
|
18
|
-
"fab.quay.tooltip": "Registro
|
|
18
|
+
"fab.quay.tooltip": "Registro container Quay",
|
|
19
19
|
"fab.menu.tooltip": "Menu"
|
|
20
20
|
}
|
|
21
21
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"it.esm.js","sources":["../../src/translations/it.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 { createTranslationMessages } from '@backstage/core-plugin-api/alpha';\nimport { globalFloatingActionButtonTranslationRef } from './ref';\n\n/**\n * Italian translation for plugin.global-floating-action-button.\n * @public\n */\nconst globalFloatingActionButtonTranslationIt = createTranslationMessages({\n ref: globalFloatingActionButtonTranslationRef,\n messages: {\n 'fab.create.label': 'Crea',\n 'fab.create.tooltip': 'Crea entità',\n 'fab.docs.label': 'Documenti',\n 'fab.docs.tooltip': 'Documentazione',\n 'fab.apis.label': 'API',\n 'fab.apis.tooltip': 'Documentazione API',\n 'fab.github.label': 'GitHub',\n 'fab.github.tooltip': 'Repository GitHub',\n 'fab.bulkImport.label': 'Importazione in blocco',\n 'fab.bulkImport.tooltip': 'Registra più repository in blocco',\n 'fab.quay.label': 'Quay',\n 'fab.quay.tooltip': 'Registro
|
|
1
|
+
{"version":3,"file":"it.esm.js","sources":["../../src/translations/it.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 { createTranslationMessages } from '@backstage/core-plugin-api/alpha';\nimport { globalFloatingActionButtonTranslationRef } from './ref';\n\n/**\n * Italian translation for plugin.global-floating-action-button.\n * @public\n */\nconst globalFloatingActionButtonTranslationIt = createTranslationMessages({\n ref: globalFloatingActionButtonTranslationRef,\n messages: {\n 'fab.create.label': 'Crea',\n 'fab.create.tooltip': 'Crea entità',\n 'fab.docs.label': 'Documenti',\n 'fab.docs.tooltip': 'Documentazione',\n 'fab.apis.label': 'API',\n 'fab.apis.tooltip': 'Documentazione API',\n 'fab.github.label': 'GitHub',\n 'fab.github.tooltip': 'Repository di GitHub',\n 'fab.bulkImport.label': 'Importazione in blocco',\n 'fab.bulkImport.tooltip': 'Registra più repository in blocco',\n 'fab.quay.label': 'Quay',\n 'fab.quay.tooltip': 'Registro container Quay',\n 'fab.menu.tooltip': 'Menu',\n },\n});\n\nexport default globalFloatingActionButtonTranslationIt;\n"],"names":[],"mappings":";;;AAuBA,MAAM,0CAA0C,yBAA0B,CAAA;AAAA,EACxE,GAAK,EAAA,wCAAA;AAAA,EACL,QAAU,EAAA;AAAA,IACR,kBAAoB,EAAA,MAAA;AAAA,IACpB,oBAAsB,EAAA,gBAAA;AAAA,IACtB,gBAAkB,EAAA,WAAA;AAAA,IAClB,kBAAoB,EAAA,gBAAA;AAAA,IACpB,gBAAkB,EAAA,KAAA;AAAA,IAClB,kBAAoB,EAAA,oBAAA;AAAA,IACpB,kBAAoB,EAAA,QAAA;AAAA,IACpB,oBAAsB,EAAA,sBAAA;AAAA,IACtB,sBAAwB,EAAA,wBAAA;AAAA,IACxB,wBAA0B,EAAA,sCAAA;AAAA,IAC1B,gBAAkB,EAAA,MAAA;AAAA,IAClB,kBAAoB,EAAA,yBAAA;AAAA,IACpB,kBAAoB,EAAA;AAAA;AAExB,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@red-hat-developer-hub/backstage-plugin-global-floating-action-button",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.3",
|
|
4
4
|
"main": "dist/index.esm.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -37,9 +37,7 @@
|
|
|
37
37
|
"@backstage/theme": "^0.7.2",
|
|
38
38
|
"@mui/icons-material": "^5.15.17",
|
|
39
39
|
"@mui/material": "^5.15.17",
|
|
40
|
-
"@mui/styles": "5.18.0",
|
|
41
40
|
"@scalprum/react-core": "0.11.1",
|
|
42
|
-
"classnames": "^2.5.1",
|
|
43
41
|
"react-use": "^17.2.4"
|
|
44
42
|
},
|
|
45
43
|
"peerDependencies": {
|