@red-hat-developer-hub/backstage-plugin-global-floating-action-button 1.7.1 → 1.7.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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @red-hat-developer-hub/backstage-plugin-global-floating-action-button
2
2
 
3
+ ## 1.7.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 0f684d9: Updated documentation examples to use the new `/bulk-import` route instead of `/bulk-import/repositories`
8
+
9
+ ## 1.7.2
10
+
11
+ ### Patch Changes
12
+
13
+ - bb8ef80: updated drawer classname
14
+
3
15
  ## 1.7.1
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -34,13 +34,13 @@ The sections below are relevant for static plugins. If the plugin is expected to
34
34
  icon: <svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#e8eaed"><g><rect fill="none" height="24" width="24"/></g><g><path d="M11,7L9.6,8.4l2.6,2.6H2v2h10.2l-2.6,2.6L11,17l5-5L11,7z M20,19h-8v2h8c1.1,0,2-0.9,2-2V5c0-1.1-0.9-2-2-2h-8v2h8V19z"/></g></svg>
35
35
  label: 'Bulk import'
36
36
  toolTip: 'Register multiple repositories in bulk'
37
- to: /bulk-import/repositories
37
+ to: /bulk-import
38
38
  # end of fab config
39
39
  appIcons:
40
40
  - name: bulkImportIcon
41
41
  importName: BulkImportIcon
42
42
  dynamicRoutes:
43
- - path: /bulk-import/repositories
43
+ - path: /bulk-import
44
44
  importName: BulkImportPage
45
45
  menuItem:
46
46
  icon: bulkImportIcon
@@ -94,13 +94,13 @@ The sections below are relevant for static plugins. If the plugin is expected to
94
94
  icon: <svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#e8eaed"><g><rect fill="none" height="24" width="24"/></g><g><path d="M11,7L9.6,8.4l2.6,2.6H2v2h10.2l-2.6,2.6L11,17l5-5L11,7z M20,19h-8v2h8c1.1,0,2-0.9,2-2V5c0-1.1-0.9-2-2-2h-8v2h8V19z"/></g></svg>
95
95
  label: 'Bulk import'
96
96
  toolTip: 'Register multiple repositories in bulk'
97
- to: /bulk-import/repositories
97
+ to: /bulk-import
98
98
  # end of fab config
99
99
  appIcons:
100
100
  - name: bulkImportIcon
101
101
  importName: BulkImportIcon
102
102
  dynamicRoutes:
103
- - path: /bulk-import/repositories
103
+ - path: /bulk-import
104
104
  importName: BulkImportPage
105
105
  menuItem:
106
106
  icon: bulkImportIcon
@@ -150,14 +150,14 @@ The sections below are relevant for static plugins. If the plugin is expected to
150
150
  icon: <svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#e8eaed"><g><rect fill="none" height="24" width="24"/></g><g><path d="M11,7L9.6,8.4l2.6,2.6H2v2h10.2l-2.6,2.6L11,17l5-5L11,7z M20,19h-8v2h8c1.1,0,2-0.9,2-2V5c0-1.1-0.9-2-2-2h-8v2h8V19z"/></g></svg>
151
151
  label: 'Bulk import'
152
152
  toolTip: 'Register multiple repositories in bulk'
153
- to: /bulk-import/repositories
153
+ to: /bulk-import
154
154
  visibleOnPaths: ['/catalog', '/settings']
155
155
  # end of fab config
156
156
  appIcons:
157
157
  - name: bulkImportIcon
158
158
  importName: BulkImportIcon
159
159
  dynamicRoutes:
160
- - path: /bulk-import/repositories
160
+ - path: /bulk-import
161
161
  importName: BulkImportPage
162
162
  menuItem:
163
163
  icon: bulkImportIcon
@@ -184,14 +184,14 @@ The sections below are relevant for static plugins. If the plugin is expected to
184
184
  icon: <svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#e8eaed"><g><rect fill="none" height="24" width="24"/></g><g><path d="M11,7L9.6,8.4l2.6,2.6H2v2h10.2l-2.6,2.6L11,17l5-5L11,7z M20,19h-8v2h8c1.1,0,2-0.9,2-2V5c0-1.1-0.9-2-2-2h-8v2h8V19z"/></g></svg>
185
185
  label: 'Bulk import'
186
186
  toolTip: 'Register multiple repositories in bulk'
187
- to: /bulk-import/repositories
187
+ to: /bulk-import
188
188
  excludeOnPaths: ['/bulk-import']
189
189
  # end of fab config
190
190
  appIcons:
191
191
  - name: bulkImportIcon
192
192
  importName: BulkImportIcon
193
193
  dynamicRoutes:
194
- - path: /bulk-import/repositories
194
+ - path: /bulk-import
195
195
  importName: BulkImportPage
196
196
  menuItem:
197
197
  icon: bulkImportIcon
@@ -13,10 +13,10 @@ const useStyles = makeStyles((theme) => ({
13
13
  bottom: `calc(${theme?.spacing?.(2) ?? "16px"} + 1.5em)`,
14
14
  right: `calc(${theme?.spacing?.(2) ?? "16px"} + 1.5em)`,
15
15
  alignItems: "end",
16
- // When quickstart drawer is open, adjust margin
17
- ".quickstart-drawer-open &": {
16
+ // When drawer is docked, adjust margin
17
+ ".docked-drawer-open &": {
18
18
  transition: "margin-right 0.3s ease",
19
- marginRight: "var(--quickstart-drawer-width, 500px) "
19
+ marginRight: "var(--docked-drawer-width, 500px) "
20
20
  }
21
21
  },
22
22
  "bottom-left": {
@@ -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 { makeStyles } from '@mui/styles';\nimport { FABWithSubmenu } from './FABWithSubmenu';\nimport { CustomFab } from './CustomFab';\nimport { FloatingActionButton, Slot } from '../types';\nimport { filterAndSortButtons } from '../utils';\nimport { useTranslation } from '../hooks/useTranslation';\n\nconst useStyles = makeStyles(theme => ({\n 'page-end': {\n bottom: `calc(${theme?.spacing?.(2) ?? '16px'} + 1.5em)`,\n right: `calc(${theme?.spacing?.(2) ?? '16px'} + 1.5em)`,\n alignItems: 'end',\n\n // When quickstart drawer is open, adjust margin\n '.quickstart-drawer-open &': {\n transition: 'margin-right 0.3s ease',\n marginRight: 'var(--quickstart-drawer-width, 500px) ',\n },\n },\n 'bottom-left': {\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 fabButton = useStyles();\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 = (\n <FABWithSubmenu className={fabButton[slot]} fabs={fabs} slot={slot} />\n );\n } else {\n fabDiv = (\n <div\n style={{\n zIndex: 200,\n display: 'flex',\n position: 'fixed',\n }}\n className={fabButton[slot]}\n id=\"floating-button\"\n data-testid=\"floating-button\"\n >\n <CustomFab\n actionButton={{ color: 'info', iconCol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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;;;;"}
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 { makeStyles } from '@mui/styles';\nimport { FABWithSubmenu } from './FABWithSubmenu';\nimport { CustomFab } from './CustomFab';\nimport { FloatingActionButton, Slot } from '../types';\nimport { filterAndSortButtons } from '../utils';\nimport { useTranslation } from '../hooks/useTranslation';\n\nconst useStyles = makeStyles(theme => ({\n 'page-end': {\n bottom: `calc(${theme?.spacing?.(2) ?? '16px'} + 1.5em)`,\n right: `calc(${theme?.spacing?.(2) ?? '16px'} + 1.5em)`,\n alignItems: 'end',\n\n // When drawer is docked, adjust margin\n '.docked-drawer-open &': {\n transition: 'margin-right 0.3s ease',\n marginRight: 'var(--docked-drawer-width, 500px) ',\n },\n },\n 'bottom-left': {\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 fabButton = useStyles();\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 = (\n <FABWithSubmenu className={fabButton[slot]} fabs={fabs} slot={slot} />\n );\n } else {\n fabDiv = (\n <div\n style={{\n zIndex: 200,\n display: 'flex',\n position: 'fixed',\n }}\n className={fabButton[slot]}\n id=\"floating-button\"\n data-testid=\"floating-button\"\n >\n <CustomFab\n actionButton={{ color: 'info', iconColor: 'white', ...fabs[0] }}\n t={t}\n />\n </div>\n );\n }\n return targetElement\n ? createPortal(fabDiv, targetElement)\n : createPortal(fabDiv, document.body);\n};\n"],"names":[],"mappings":";;;;;;;;;;AA2BA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,UAAY,EAAA;AAAA,IACV,QAAQ,CAAQ,KAAA,EAAA,KAAA,EAAO,OAAU,GAAA,CAAC,KAAK,MAAM,CAAA,SAAA,CAAA;AAAA,IAC7C,OAAO,CAAQ,KAAA,EAAA,KAAA,EAAO,OAAU,GAAA,CAAC,KAAK,MAAM,CAAA,SAAA,CAAA;AAAA,IAC5C,UAAY,EAAA,KAAA;AAAA;AAAA,IAGZ,uBAAyB,EAAA;AAAA,MACvB,UAAY,EAAA,wBAAA;AAAA,MACZ,WAAa,EAAA;AAAA;AACf,GACF;AAAA,EACA,aAAe,EAAA;AAAA,IACb,QAAQ,CA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AO,OAAA,IAAA;AAAA;AAGT,EAAI,IAAA,MAAA;AACJ,EAAI,IAAA,IAAA,CAAK,SAAS,CAAG,EAAA;AACnB,IAAA,MAAA,uBACG,cAAe,EAAA,EAAA,SAAA,EAAW,UAAU,IAAI,CAAA,EAAG,MAAY,IAAY,EAAA,CAAA;AAAA,GAEjE,MAAA;AACL,IACE,MAAA,mBAAA,GAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,KAAO,EAAA;AAAA,UACL,MAAQ,EAAA,GAAA;AAAA,UACR,OAAS,EAAA,MAAA;AAAA,UACT,QAAU,EAAA;AAAA,SACZ;AAAA,QACA,SAAA,EAAW,UAAU,IAAI,CAAA;AAAA,QACzB,EAAG,EAAA,iBAAA;AAAA,QACH,aAAY,EAAA,iBAAA;AAAA,QAEZ,QAAA,kBAAA,GAAA;AAAA,UAAC,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;;;;"}
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.7.1",
3
+ "version": "1.7.3",
4
4
  "main": "dist/index.esm.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "license": "Apache-2.0",