@red-hat-developer-hub/backstage-plugin-theme 0.14.11 → 1.0.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +20 -3
  3. package/dist/assets/fonts/font.min.css.esm.js +0 -2
  4. package/dist/assets/fonts/font.min.css.esm.js.map +1 -1
  5. package/dist/backstage.esm.js.map +1 -1
  6. package/dist/components/LogoFull.esm.js.map +1 -1
  7. package/dist/components/LogoIcon.esm.js.map +1 -1
  8. package/dist/components/ThemeProvider.esm.js.map +1 -1
  9. package/dist/darkTheme.esm.js.map +1 -1
  10. package/dist/fonts.esm.js.map +1 -1
  11. package/dist/hooks/useBranding.esm.js +1 -1
  12. package/dist/hooks/useBranding.esm.js.map +1 -1
  13. package/dist/hooks/useTheme.esm.js.map +1 -1
  14. package/dist/hooks/useThemeConfig.esm.js +1 -1
  15. package/dist/hooks/useThemeConfig.esm.js.map +1 -1
  16. package/dist/hooks/useThemeOptions.esm.js.map +1 -1
  17. package/dist/index.d.ts +14 -130
  18. package/dist/index.esm.js +24 -6
  19. package/dist/index.esm.js.map +1 -1
  20. package/dist/legacy.d.ts +127 -0
  21. package/dist/legacy.esm.js +14 -0
  22. package/dist/legacy.esm.js.map +1 -0
  23. package/dist/lightTheme.esm.js.map +1 -1
  24. package/dist/node_modules_dist/style-inject/dist/style-inject.es.esm.js +1 -1
  25. package/dist/node_modules_dist/style-inject/dist/style-inject.es.esm.js.map +1 -1
  26. package/dist/rhdh.esm.js.map +1 -1
  27. package/dist/themes.esm.js.map +1 -1
  28. package/dist/types/LogoIcon.d-CTRMVGhF.d.ts +7 -0
  29. package/dist/typography.esm.js.map +1 -1
  30. package/dist/utils/createComponents.esm.js +13 -13
  31. package/dist/utils/createComponents.esm.js.map +1 -1
  32. package/dist/utils/createPageTheme.esm.js.map +1 -1
  33. package/dist/utils/createPageThemes.esm.js +1 -1
  34. package/dist/utils/createPageThemes.esm.js.map +1 -1
  35. package/dist/utils/mergeTheme.esm.js +2 -2
  36. package/dist/utils/mergeTheme.esm.js.map +1 -1
  37. package/dist/utils/migrateTheme.esm.js.map +1 -1
  38. package/dist/utils/navigationSidebarColors.esm.js +3 -3
  39. package/dist/utils/navigationSidebarColors.esm.js.map +1 -1
  40. package/package.json +26 -22
  41. package/dist/alpha.d.ts +0 -5
  42. package/dist/alpha.esm.js +0 -26
  43. package/dist/alpha.esm.js.map +0 -1
@@ -2,7 +2,7 @@ import { createPageTheme } from './createPageTheme.esm.js';
2
2
 
3
3
  const createPageThemes = (themeConfig) => {
4
4
  if (!themeConfig?.pageTheme || !Object.keys(themeConfig.pageTheme).length) {
5
- return undefined;
5
+ return void 0;
6
6
  }
7
7
  const pageThemes = {};
8
8
  for (const page in themeConfig.pageTheme) {
@@ -1 +1 @@
1
- {"version":3,"file":"createPageThemes.esm.js","sources":["../../src/utils/createPageThemes.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 { PageTheme } from '@backstage/theme';\nimport { ThemeConfig } from '../types';\nimport { createPageTheme } from './createPageTheme';\n\nexport const createPageThemes = (\n themeConfig: ThemeConfig | undefined,\n): Record<string, PageTheme> | undefined => {\n if (!themeConfig?.pageTheme || !Object.keys(themeConfig.pageTheme).length) {\n return undefined;\n }\n\n const pageThemes: Record<string, PageTheme> = {};\n\n for (const page in themeConfig.pageTheme) {\n if (Object.hasOwn(themeConfig.pageTheme, page)) {\n pageThemes[page] = createPageTheme(themeConfig.pageTheme[page]);\n }\n }\n\n return pageThemes;\n};\n"],"names":[],"mappings":";;AAoBa,MAAA,gBAAA,GAAmB,CAC9B,WAC0C,KAAA;AAC1C,EAAI,IAAA,CAAC,aAAa,SAAa,IAAA,CAAC,OAAO,IAAK,CAAA,WAAA,CAAY,SAAS,CAAA,CAAE,MAAQ,EAAA;AACzE,IAAO,OAAA,SAAA;AAAA;AAGT,EAAA,MAAM,aAAwC,EAAC;AAE/C,EAAW,KAAA,MAAA,IAAA,IAAQ,YAAY,SAAW,EAAA;AACxC,IAAA,IAAI,MAAO,CAAA,MAAA,CAAO,WAAY,CAAA,SAAA,EAAW,IAAI,CAAG,EAAA;AAC9C,MAAA,UAAA,CAAW,IAAI,CAAI,GAAA,eAAA,CAAgB,WAAY,CAAA,SAAA,CAAU,IAAI,CAAC,CAAA;AAAA;AAChE;AAGF,EAAO,OAAA,UAAA;AACT;;;;"}
1
+ {"version":3,"file":"createPageThemes.esm.js","sources":["../../src/utils/createPageThemes.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 { PageTheme } from '@backstage/theme';\nimport { ThemeConfig } from '../types';\nimport { createPageTheme } from './createPageTheme';\n\nexport const createPageThemes = (\n themeConfig: ThemeConfig | undefined,\n): Record<string, PageTheme> | undefined => {\n if (!themeConfig?.pageTheme || !Object.keys(themeConfig.pageTheme).length) {\n return undefined;\n }\n\n const pageThemes: Record<string, PageTheme> = {};\n\n for (const page in themeConfig.pageTheme) {\n if (Object.hasOwn(themeConfig.pageTheme, page)) {\n pageThemes[page] = createPageTheme(themeConfig.pageTheme[page]);\n }\n }\n\n return pageThemes;\n};\n"],"names":[],"mappings":";;AAoBO,MAAM,gBAAA,GAAmB,CAC9B,WAAA,KAC0C;AAC1C,EAAA,IAAI,CAAC,aAAa,SAAA,IAAa,CAAC,OAAO,IAAA,CAAK,WAAA,CAAY,SAAS,CAAA,CAAE,MAAA,EAAQ;AACzE,IAAA,OAAO,MAAA;AAAA,EACT;AAEA,EAAA,MAAM,aAAwC,EAAC;AAE/C,EAAA,KAAA,MAAW,IAAA,IAAQ,YAAY,SAAA,EAAW;AACxC,IAAA,IAAI,MAAA,CAAO,MAAA,CAAO,WAAA,CAAY,SAAA,EAAW,IAAI,CAAA,EAAG;AAC9C,MAAA,UAAA,CAAW,IAAI,CAAA,GAAI,eAAA,CAAgB,WAAA,CAAY,SAAA,CAAU,IAAI,CAAC,CAAA;AAAA,IAChE;AAAA,EACF;AAEA,EAAA,OAAO,UAAA;AACT;;;;"}
@@ -1,5 +1,5 @@
1
1
  function isObject(objectOrValue) {
2
- return objectOrValue !== undefined && objectOrValue !== null && typeof objectOrValue === "object" && !Array.isArray(objectOrValue);
2
+ return objectOrValue !== void 0 && objectOrValue !== null && typeof objectOrValue === "object" && !Array.isArray(objectOrValue);
3
3
  }
4
4
  const deepCopyObject = (objectOrValue) => {
5
5
  if (isObject(objectOrValue)) {
@@ -34,7 +34,7 @@ const deepMergeObjects = (defaultValue, customValue) => {
34
34
  }
35
35
  return result;
36
36
  }
37
- return customValue !== undefined ? customValue : defaultValue;
37
+ return customValue !== void 0 ? customValue : defaultValue;
38
38
  };
39
39
  const mergeUnifiedThemeOptions = (defaultThemeConfig, customizedThemeConfig) => {
40
40
  return deepMergeObjects(
@@ -1 +1 @@
1
- {"version":3,"file":"mergeTheme.esm.js","sources":["../../src/utils/mergeTheme.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 { ThemeConfig } from '../types';\n\nfunction isObject(\n objectOrValue: unknown,\n): objectOrValue is Record<string, unknown> {\n return (\n objectOrValue !== undefined &&\n objectOrValue !== null &&\n typeof objectOrValue === 'object' &&\n !Array.isArray(objectOrValue)\n );\n}\n\nconst deepCopyObject = (objectOrValue: unknown): unknown => {\n if (isObject(objectOrValue)) {\n const result: Record<string, unknown> = {};\n for (const key of Object.keys(objectOrValue)) {\n result[key] = deepCopyObject(objectOrValue[key]);\n }\n return result;\n }\n return objectOrValue;\n};\n\nexport const deepMergeObjects = (\n defaultValue: unknown,\n customValue: unknown,\n): unknown => {\n if (isObject(defaultValue) || isObject(customValue)) {\n const result: Record<string, unknown> = {};\n if (isObject(defaultValue) && isObject(customValue)) {\n for (const key of Object.keys(defaultValue)) {\n result[key] = deepMergeObjects(defaultValue[key], customValue[key]);\n }\n for (const key of Object.keys(customValue)) {\n result[key] = deepMergeObjects(defaultValue[key], customValue[key]);\n }\n } else if (customValue === null) {\n return null;\n } else if (isObject(customValue)) {\n for (const key of Object.keys(customValue)) {\n result[key] = deepCopyObject(customValue[key]);\n }\n } else if (isObject(defaultValue)) {\n for (const key of Object.keys(defaultValue)) {\n result[key] = deepCopyObject(defaultValue[key]);\n }\n }\n return result;\n }\n return customValue !== undefined ? customValue : defaultValue;\n};\n\n/**\n * Merges two theme configurations with this priority:\n *\n * 1. Values will be picked up first from the `defaultThemeConfig` and\n * then from the `customizedThemeConfig`.\n * This means that if a value is set in the customized theme, it will 'override' the default.\n * 2. Null values in `customizedThemeConfig` the will override the default with `null`,\n * while undefined values will be ignored.\n * 3. Objects will be merged recursively.\n * All other values, esp. Arrays, will not be merged.\n *\n * @param defaultThemeConfig\n * @param customizedThemeConfig\n * @returns\n */\nexport const mergeUnifiedThemeOptions = (\n defaultThemeConfig: ThemeConfig,\n customizedThemeConfig: ThemeConfig,\n): ThemeConfig => {\n return deepMergeObjects(\n defaultThemeConfig,\n customizedThemeConfig,\n ) as ThemeConfig;\n};\n"],"names":[],"mappings":"AAkBA,SAAS,SACP,aAC0C,EAAA;AAC1C,EACE,OAAA,aAAA,KAAkB,SAClB,IAAA,aAAA,KAAkB,IAClB,IAAA,OAAO,kBAAkB,QACzB,IAAA,CAAC,KAAM,CAAA,OAAA,CAAQ,aAAa,CAAA;AAEhC;AAEA,MAAM,cAAA,GAAiB,CAAC,aAAoC,KAAA;AAC1D,EAAI,IAAA,QAAA,CAAS,aAAa,CAAG,EAAA;AAC3B,IAAA,MAAM,SAAkC,EAAC;AACzC,IAAA,KAAA,MAAW,GAAO,IAAA,MAAA,CAAO,IAAK,CAAA,aAAa,CAAG,EAAA;AAC5C,MAAA,MAAA,CAAO,GAAG,CAAA,GAAI,cAAe,CAAA,aAAA,CAAc,GAAG,CAAC,CAAA;AAAA;AAEjD,IAAO,OAAA,MAAA;AAAA;AAET,EAAO,OAAA,aAAA;AACT,CAAA;AAEa,MAAA,gBAAA,GAAmB,CAC9B,YAAA,EACA,WACY,KAAA;AACZ,EAAA,IAAI,QAAS,CAAA,YAAY,CAAK,IAAA,QAAA,CAAS,WAAW,CAAG,EAAA;AACnD,IAAA,MAAM,SAAkC,EAAC;AACzC,IAAA,IAAI,QAAS,CAAA,YAAY,CAAK,IAAA,QAAA,CAAS,WAAW,CAAG,EAAA;AACnD,MAAA,KAAA,MAAW,GAAO,IAAA,MAAA,CAAO,IAAK,CAAA,YAAY,CAAG,EAAA;AAC3C,QAAO,MAAA,CAAA,GAAG,IAAI,gBAAiB,CAAA,YAAA,CAAa,GAAG,CAAG,EAAA,WAAA,CAAY,GAAG,CAAC,CAAA;AAAA;AAEpE,MAAA,KAAA,MAAW,GAAO,IAAA,MAAA,CAAO,IAAK,CAAA,WAAW,CAAG,EAAA;AAC1C,QAAO,MAAA,CAAA,GAAG,IAAI,gBAAiB,CAAA,YAAA,CAAa,GAAG,CAAG,EAAA,WAAA,CAAY,GAAG,CAAC,CAAA;AAAA;AACpE,KACF,MAAA,IAAW,gBAAgB,IAAM,EAAA;AAC/B,MAAO,OAAA,IAAA;AAAA,KACT,MAAA,IAAW,QAAS,CAAA,WAAW,CAAG,EAAA;AAChC,MAAA,KAAA,MAAW,GAAO,IAAA,MAAA,CAAO,IAAK,CAAA,WAAW,CAAG,EAAA;AAC1C,QAAA,MAAA,CAAO,GAAG,CAAA,GAAI,cAAe,CAAA,WAAA,CAAY,GAAG,CAAC,CAAA;AAAA;AAC/C,KACF,MAAA,IAAW,QAAS,CAAA,YAAY,CAAG,EAAA;AACjC,MAAA,KAAA,MAAW,GAAO,IAAA,MAAA,CAAO,IAAK,CAAA,YAAY,CAAG,EAAA;AAC3C,QAAA,MAAA,CAAO,GAAG,CAAA,GAAI,cAAe,CAAA,YAAA,CAAa,GAAG,CAAC,CAAA;AAAA;AAChD;AAEF,IAAO,OAAA,MAAA;AAAA;AAET,EAAO,OAAA,WAAA,KAAgB,YAAY,WAAc,GAAA,YAAA;AACnD;AAiBa,MAAA,wBAAA,GAA2B,CACtC,kBAAA,EACA,qBACgB,KAAA;AAChB,EAAO,OAAA,gBAAA;AAAA,IACL,kBAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
1
+ {"version":3,"file":"mergeTheme.esm.js","sources":["../../src/utils/mergeTheme.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 { ThemeConfig } from '../types';\n\nfunction isObject(\n objectOrValue: unknown,\n): objectOrValue is Record<string, unknown> {\n return (\n objectOrValue !== undefined &&\n objectOrValue !== null &&\n typeof objectOrValue === 'object' &&\n !Array.isArray(objectOrValue)\n );\n}\n\nconst deepCopyObject = (objectOrValue: unknown): unknown => {\n if (isObject(objectOrValue)) {\n const result: Record<string, unknown> = {};\n for (const key of Object.keys(objectOrValue)) {\n result[key] = deepCopyObject(objectOrValue[key]);\n }\n return result;\n }\n return objectOrValue;\n};\n\nexport const deepMergeObjects = (\n defaultValue: unknown,\n customValue: unknown,\n): unknown => {\n if (isObject(defaultValue) || isObject(customValue)) {\n const result: Record<string, unknown> = {};\n if (isObject(defaultValue) && isObject(customValue)) {\n for (const key of Object.keys(defaultValue)) {\n result[key] = deepMergeObjects(defaultValue[key], customValue[key]);\n }\n for (const key of Object.keys(customValue)) {\n result[key] = deepMergeObjects(defaultValue[key], customValue[key]);\n }\n } else if (customValue === null) {\n return null;\n } else if (isObject(customValue)) {\n for (const key of Object.keys(customValue)) {\n result[key] = deepCopyObject(customValue[key]);\n }\n } else if (isObject(defaultValue)) {\n for (const key of Object.keys(defaultValue)) {\n result[key] = deepCopyObject(defaultValue[key]);\n }\n }\n return result;\n }\n return customValue !== undefined ? customValue : defaultValue;\n};\n\n/**\n * Merges two theme configurations with this priority:\n *\n * 1. Values will be picked up first from the `defaultThemeConfig` and\n * then from the `customizedThemeConfig`.\n * This means that if a value is set in the customized theme, it will 'override' the default.\n * 2. Null values in `customizedThemeConfig` the will override the default with `null`,\n * while undefined values will be ignored.\n * 3. Objects will be merged recursively.\n * All other values, esp. Arrays, will not be merged.\n *\n * @param defaultThemeConfig\n * @param customizedThemeConfig\n * @returns\n */\nexport const mergeUnifiedThemeOptions = (\n defaultThemeConfig: ThemeConfig,\n customizedThemeConfig: ThemeConfig,\n): ThemeConfig => {\n return deepMergeObjects(\n defaultThemeConfig,\n customizedThemeConfig,\n ) as ThemeConfig;\n};\n"],"names":[],"mappings":"AAkBA,SAA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AC/B,MAAA,OAAO,IAAA;AAAA,IACT,CAAA,MAAA,IAAW,QAAA,CAAS,WAAW,CAAA,EAAG;AAChC,MAAA,KAAA,MAAW,GAAA,IAAO,MAAA,CAAO,IAAA,CAAK,WAAW,CAAA,EAAG;AAC1C,QAAA,MAAA,CAAO,GAAG,CAAA,GAAI,cAAA,CAAe,WAAA,CAAY,GAAG,CAAC,CAAA;AAAA,MAC/C;AAAA,IACF,CAAA,MAAA,IAAW,QAAA,CAAS,YAAY,CAAA,EAAG;AACjC,MAAA,KAAA,MAAW,GAAA,IAAO,MAAA,CAAO,IAAA,CAAK,YAAY,CAAA,EAAG;AAC3C,QAAA,MAAA,CAAO,GAAG,CAAA,GAAI,cAAA,CAAe,YAAA,CAAa,GAAG,CAAC,CAAA;AAAA,MAChD;AAAA,IACF;AACA,IAAA,OAAO,MAAA;AAAA,EACT;AACA,EAAA,OAAO,WAAA,KAAgB,SAAY,WAAA,GAAc,YAAA;AACnD;AAiBO,MAAM,wBAAA,GAA2B,CACtC,kBAAA,EACA,qBAAA,KACgB;AAChB,EAAA,OAAO,gBAAA;AAAA,IACL,kBAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"migrateTheme.esm.js","sources":["../../src/utils/migrateTheme.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 type { BackstagePaletteAdditions } from '@backstage/theme';\nimport type { SimplePaletteColorOptions } from '@mui/material/styles';\nimport type { ThemeConfig } from '../types';\n\nexport interface DeprecatedRHDH10to12ThemeColors {\n /**\n * primaryColor Configuration for the instance\n * The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n */\n primaryColor?: string;\n /**\n * Header Theme color Configuration for the instance\n * The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n */\n headerColor1?: string;\n /**\n * Header Theme color Configuration for the instance\n * The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n */\n headerColor2?: string;\n /**\n * Navigation Side Bar Indicator color Configuration for the instance\n * The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n */\n navigationIndicatorColor?: string;\n}\n\nfunction isObject(\n objectOrValue: unknown,\n): objectOrValue is Record<string, unknown> {\n return typeof objectOrValue === 'object' && !Array.isArray(objectOrValue);\n}\n\nexport const migrateThemeConfig = (\n themeConfig: ThemeConfig & DeprecatedRHDH10to12ThemeColors,\n): ThemeConfig => {\n if (!themeConfig) {\n return { palette: {} };\n }\n\n // Drop deprecated values from the root level!\n const migrated: ThemeConfig = {\n palette: themeConfig.palette ?? {},\n defaultPageTheme: themeConfig.defaultPageTheme,\n pageTheme: themeConfig.pageTheme,\n fontFamily: themeConfig.fontFamily,\n htmlFontSize: themeConfig.htmlFontSize,\n typography: themeConfig.typography,\n options: themeConfig.options,\n };\n\n if (themeConfig.primaryColor) {\n // eslint-disable-next-line no-console\n console.warn(\n '[deprecated] Automatically migrate theme configuration from `primaryColor` to `palette.primary.main`',\n );\n if (isObject(migrated.palette?.primary)) {\n if (!(migrated.palette.primary as SimplePaletteColorOptions).main) {\n (migrated.palette.primary as SimplePaletteColorOptions).main =\n themeConfig.primaryColor;\n }\n } else if (migrated.palette) {\n migrated.palette.primary = { main: themeConfig.primaryColor };\n }\n }\n\n if (themeConfig.navigationIndicatorColor) {\n // eslint-disable-next-line no-console\n console.warn(\n '[deprecated] Automatically migrate theme configuration from `navigationIndicatorColor` to `palette.navigation.indicator`',\n );\n if (isObject(migrated.palette?.navigation)) {\n if (!migrated.palette.navigation.indicator) {\n migrated.palette.navigation.indicator =\n themeConfig.navigationIndicatorColor;\n }\n } else if (migrated.palette) {\n migrated.palette.navigation = {\n indicator: themeConfig.navigationIndicatorColor,\n } as BackstagePaletteAdditions['navigation'];\n }\n }\n\n if (themeConfig.headerColor1) {\n if (themeConfig.pageTheme) {\n // eslint-disable-next-line no-console\n console.warn(\n '[deprecated] Ignore theme configuration `headerColor1` and `headerColor2` because `pageTheme` is defined!',\n );\n } else {\n // eslint-disable-next-line no-console\n console.warn(\n '[deprecated] Automatically migrate theme configuration from `headerColor1` and `headerColor2` to `pageTheme.home.backgroundColor`',\n );\n migrated.defaultPageTheme = 'home';\n migrated.pageTheme = {\n home: {\n backgroundColor: !themeConfig.headerColor2\n ? themeConfig.headerColor1\n : [themeConfig.headerColor1, themeConfig.headerColor2],\n },\n };\n }\n }\n\n return migrated;\n};\n"],"names":[],"mappings":"AA2CA,SAAS,SACP,aAC0C,EAAA;AAC1C,EAAA,OAAO,OAAO,aAAkB,KAAA,QAAA,IAAY,CAAC,KAAA,CAAM,QAAQ,aAAa,CAAA;AAC1E;AAEa,MAAA,kBAAA,GAAqB,CAChC,WACgB,KAAA;AAChB,EAAA,IAAI,CAAC,WAAa,EAAA;AAChB,IAAO,OAAA,EAAE,OAAS,EAAA,EAAG,EAAA;AAAA;AAIvB,EAAA,MAAM,QAAwB,GAAA;AAAA,IAC5B,OAAA,EAAS,WAAY,CAAA,OAAA,IAAW,EAAC;AAAA,IACjC,kBAAkB,WAAY,CAAA,gBAAA;AAAA,IAC9B,WAAW,WAAY,CAAA,SAAA;AAAA,IACvB,YAAY,WAAY,CAAA,UAAA;AAAA,IACxB,cAAc,WAAY,CAAA,YAAA;AAAA,IAC1B,YAAY,WAAY,CAAA,UAAA;AAAA,IACxB,SAAS,WAAY,CAAA;AAAA,GACvB;AAEA,EAAA,IAAI,YAAY,YAAc,EAAA;AAE5B,IAAQ,OAAA,CAAA,IAAA;AAAA,MACN;A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AAA,CAAY,YAAc,EAAA,WAAA,CAAY,YAAY;AAAA;AACzD,OACF;AAAA;AACF;AAGF,EAAO,OAAA,QAAA;AACT;;;;"}
1
+ {"version":3,"file":"migrateTheme.esm.js","sources":["../../src/utils/migrateTheme.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 type { BackstagePaletteAdditions } from '@backstage/theme';\nimport type { SimplePaletteColorOptions } from '@mui/material/styles';\nimport type { ThemeConfig } from '../types';\n\nexport interface DeprecatedRHDH10to12ThemeColors {\n /**\n * primaryColor Configuration for the instance\n * The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n */\n primaryColor?: string;\n /**\n * Header Theme color Configuration for the instance\n * The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n */\n headerColor1?: string;\n /**\n * Header Theme color Configuration for the instance\n * The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n */\n headerColor2?: string;\n /**\n * Navigation Side Bar Indicator color Configuration for the instance\n * The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n */\n navigationIndicatorColor?: string;\n}\n\nfunction isObject(\n objectOrValue: unknown,\n): objectOrValue is Record<string, unknown> {\n return typeof objectOrValue === 'object' && !Array.isArray(objectOrValue);\n}\n\nexport const migrateThemeConfig = (\n themeConfig: ThemeConfig & DeprecatedRHDH10to12ThemeColors,\n): ThemeConfig => {\n if (!themeConfig) {\n return { palette: {} };\n }\n\n // Drop deprecated values from the root level!\n const migrated: ThemeConfig = {\n palette: themeConfig.palette ?? {},\n defaultPageTheme: themeConfig.defaultPageTheme,\n pageTheme: themeConfig.pageTheme,\n fontFamily: themeConfig.fontFamily,\n htmlFontSize: themeConfig.htmlFontSize,\n typography: themeConfig.typography,\n options: themeConfig.options,\n };\n\n if (themeConfig.primaryColor) {\n // eslint-disable-next-line no-console\n console.warn(\n '[deprecated] Automatically migrate theme configuration from `primaryColor` to `palette.primary.main`',\n );\n if (isObject(migrated.palette?.primary)) {\n if (!(migrated.palette.primary as SimplePaletteColorOptions).main) {\n (migrated.palette.primary as SimplePaletteColorOptions).main =\n themeConfig.primaryColor;\n }\n } else if (migrated.palette) {\n migrated.palette.primary = { main: themeConfig.primaryColor };\n }\n }\n\n if (themeConfig.navigationIndicatorColor) {\n // eslint-disable-next-line no-console\n console.warn(\n '[deprecated] Automatically migrate theme configuration from `navigationIndicatorColor` to `palette.navigation.indicator`',\n );\n if (isObject(migrated.palette?.navigation)) {\n if (!migrated.palette.navigation.indicator) {\n migrated.palette.navigation.indicator =\n themeConfig.navigationIndicatorColor;\n }\n } else if (migrated.palette) {\n migrated.palette.navigation = {\n indicator: themeConfig.navigationIndicatorColor,\n } as BackstagePaletteAdditions['navigation'];\n }\n }\n\n if (themeConfig.headerColor1) {\n if (themeConfig.pageTheme) {\n // eslint-disable-next-line no-console\n console.warn(\n '[deprecated] Ignore theme configuration `headerColor1` and `headerColor2` because `pageTheme` is defined!',\n );\n } else {\n // eslint-disable-next-line no-console\n console.warn(\n '[deprecated] Automatically migrate theme configuration from `headerColor1` and `headerColor2` to `pageTheme.home.backgroundColor`',\n );\n migrated.defaultPageTheme = 'home';\n migrated.pageTheme = {\n home: {\n backgroundColor: !themeConfig.headerColor2\n ? themeConfig.headerColor1\n : [themeConfig.headerColor1, themeConfig.headerColor2],\n },\n };\n }\n }\n\n return migrated;\n};\n"],"names":[],"mappings":"AA2CA,SAAS,SACP,aAAA,EAC0C;AAC1C,EAAA,OAAO,OAAO,aAAA,KAAkB,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AW;AAC1C,QAAA,QAAA,CAAS,OAAA,CAAQ,UAAA,CAAW,SAAA,GAC1B,WAAA,CAAY,wBAAA;AAAA,MAChB;AAAA,IACF,CAAA,MAAA,IAAW,SAAS,OAAA,EAAS;AAC3B,MAAA,QAAA,CAAS,QAAQ,UAAA,GAAa;AAAA,QAC5B,WAAW,WAAA,CAAY;AAAA,OACzB;AAAA,IACF;AAAA,EACF;AAEA,EAAA,IAAI,YAAY,YAAA,EAAc;AAC5B,IAAA,IAAI,YAAY,SAAA,EAAW;AAEzB,MAAA,OAAA,CAAQ,IAAA;AAAA,QACN;AAAA,OACF;AAAA,IACF,CAAA,MAAO;AAEL,MAAA,OAAA,CAAQ,IAAA;AAAA,QACN;AAAA,OACF;AACA,MAAA,QAAA,CAAS,gBAAA,GAAmB,MAAA;AAC5B,MAAA,QAAA,CAAS,SAAA,GAAY;AAAA,QACnB,IAAA,EAAM;AAAA,UACJ,eAAA,EAAiB,CAAC,WAAA,CAAY,YAAA,GAC1B,WAAA,CAAY,eACZ,CAAC,WAAA,CAAY,YAAA,EAAc,WAAA,CAAY,YAAY;AAAA;AACzD,OACF;AAAA,IACF;AAAA,EACF;AAEA,EAAA,OAAO,QAAA;AACT;;;;"}
@@ -26,11 +26,11 @@ function pickNavigationOrRhdhGeneralColor(themeConfig, palette, pick) {
26
26
  }
27
27
  const defaultNav = defaultNavigationColor(baseline);
28
28
  const defaultRhdh = defaultRhdhGeneralColor(baseline);
29
- if (defaultNav === undefined && defaultRhdh === undefined) {
29
+ if (defaultNav === void 0 && defaultRhdh === void 0) {
30
30
  return fromRhdh || fromNavigation || "";
31
31
  }
32
- const navigationCustomized = fromNavigation !== undefined && fromNavigation !== defaultNav;
33
- const rhdhCustomized = fromRhdh !== undefined && fromRhdh !== defaultRhdh;
32
+ const navigationCustomized = fromNavigation !== void 0 && fromNavigation !== defaultNav;
33
+ const rhdhCustomized = fromRhdh !== void 0 && fromRhdh !== defaultRhdh;
34
34
  if (navigationCustomized && !rhdhCustomized) {
35
35
  return fromNavigation;
36
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"navigationSidebarColors.esm.js","sources":["../../src/utils/navigationSidebarColors.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 * as backstage from '../backstage';\nimport * as rhdh from '../rhdh';\nimport {\n type RHDHThemePalette,\n type ThemeConfig,\n type ThemeConfigPalette,\n} from '../types';\n\nfunction baselinePalette(\n themeConfig: ThemeConfig,\n): ThemeConfigPalette | undefined {\n const mode = themeConfig.mode ?? 'light';\n const variant = themeConfig.variant ?? 'rhdh';\n const baseline =\n variant === 'backstage'\n ? backstage.getDefaultThemeConfig(mode)\n : rhdh.getDefaultThemeConfig(mode);\n return baseline.palette as ThemeConfigPalette | undefined;\n}\n\nfunction hasRhdhGeneral(\n baseline: ThemeConfigPalette | undefined,\n palette: ThemeConfigPalette,\n): boolean {\n return !!baseline?.rhdh?.general || !!palette.rhdh?.general;\n}\n\n/**\n * One conceptual color can be set in two places in the merged theme:\n * - Backstage: `palette.navigation…`\n * - RHDH: `palette.rhdh.general…`\n *\n * We load the **default** palette for this mode/variant and compare:\n * - If only the Backstage value differs from its default → use Backstage (user\n * likely customized `navigation` in app config).\n * - If only the RHDH value differs from its default → use RHDH.\n * - If both differ and disagree → prefer **RHDH**.\n */\ntype NavigationVsRhdhGeneralPick = {\n /** Current merged `palette.navigation…` color. */\n navigationColor: string | undefined;\n /** Current merged `palette.rhdh.general…` color. */\n rhdhGeneralColor: string | undefined;\n /** That same navigation field on the **default** theme (for this mode). */\n defaultNavigationColor: (baseline: ThemeConfigPalette) => string | undefined;\n /** That same RHDH general field on the **default** theme. */\n defaultRhdhGeneralColor: (baseline: ThemeConfigPalette) => string | undefined;\n};\n\nfunction pickNavigationOrRhdhGeneralColor(\n themeConfig: ThemeConfig,\n palette: ThemeConfigPalette,\n pick: NavigationVsRhdhGeneralPick,\n): string {\n const {\n navigationColor: fromNavigation,\n rhdhGeneralColor: fromRhdh,\n defaultNavigationColor,\n defaultRhdhGeneralColor,\n } = pick;\n\n const baseline = baselinePalette(themeConfig);\n if (!baseline) {\n return fromRhdh || fromNavigation || '';\n }\n if (!hasRhdhGeneral(baseline, palette)) {\n return fromNavigation || fromRhdh || '';\n }\n\n const defaultNav = defaultNavigationColor(baseline);\n const defaultRhdh = defaultRhdhGeneralColor(baseline);\n\n if (defaultNav === undefined && defaultRhdh === undefined) {\n return fromRhdh || fromNavigation || '';\n }\n\n const navigationCustomized =\n fromNavigation !== undefined && fromNavigation !== defaultNav;\n const rhdhCustomized = fromRhdh !== undefined && fromRhdh !== defaultRhdh;\n\n if (navigationCustomized && !rhdhCustomized) {\n return fromNavigation!;\n }\n if (rhdhCustomized && !navigationCustomized) {\n return fromRhdh!;\n }\n if (navigationCustomized && rhdhCustomized && fromNavigation !== fromRhdh) {\n return fromRhdh ?? fromNavigation ?? '';\n }\n return fromRhdh || fromNavigation || '';\n}\n\nexport type NavigationSidebarChrome = {\n /** `navigation.background` and `rhdh.general.sidebarBackgroundColor` */\n sidebarBackgroundColor: string;\n /** `navigation.navItem.hoverBackground` and `sidebarItemSelectedBackgroundColor` */\n sidebarItemInteractionBackgroundColor: string;\n /** `navigation.color` (fallback: `text.primary`) */\n navigationItemColor: string;\n /** `navigation.selectedColor` (fallback: `navigation.color`, then `text.primary`) */\n navigationSelectedColor: string;\n};\n\n/**\n * Resolves all navigation/sidebar chrome colors for RHDH component overrides.\n */\nexport function resolveNavigationSidebarColors(\n themeConfig: ThemeConfig,\n): NavigationSidebarChrome {\n const palette = (themeConfig.palette ?? {}) as ThemeConfigPalette;\n const general = palette.rhdh?.general ?? ({} as RHDHThemePalette['general']);\n const textPrimary = palette.text?.primary ?? '';\n\n const navigationItemColor = palette.navigation?.color ?? textPrimary;\n const navigationSelectedColor =\n palette.navigation?.selectedColor ??\n palette.navigation?.color ??\n textPrimary;\n\n /** `themeConfig` + `palette` fixed; only pass which navigation vs RHDH fields to compare. */\n const pickNavigationColor = (fields: NavigationVsRhdhGeneralPick) =>\n pickNavigationOrRhdhGeneralColor(themeConfig, palette, fields);\n\n return {\n sidebarBackgroundColor: pickNavigationColor({\n navigationColor: palette.navigation?.background,\n rhdhGeneralColor: general.sidebarBackgroundColor,\n defaultNavigationColor: b => b.navigation?.background,\n defaultRhdhGeneralColor: b => b.rhdh?.general?.sidebarBackgroundColor,\n }),\n sidebarItemInteractionBackgroundColor: pickNavigationColor({\n navigationColor: palette.navigation?.navItem?.hoverBackground,\n rhdhGeneralColor: general.sidebarItemSelectedBackgroundColor,\n defaultNavigationColor: b => b.navigation?.navItem?.hoverBackground,\n defaultRhdhGeneralColor: b =>\n b.rhdh?.general?.sidebarItemSelectedBackgroundColor,\n }),\n navigationItemColor,\n navigationSelectedColor,\n };\n}\n"],"names":["backstage.getDefaultThemeConfig","rhdh.getDefaultThemeConfig"],"mappings":";;;AAwBA,SAAS,gBACP,WACgC,EAAA;AAChC,EAAM,MAAA,IAAA,GAAO,YAAY,IAAQ,IAAA,OAAA;AACjC,EAAM,MAAA,OAAA,GAAU,YAAY,OAAW,IAAA,MAAA;AACvC,EAAM,MAAA,QAAA,GACJ,YAAY,WACR,GAAAA,sBAAgC,IAAI,CAAA,GACpCC,uBAAK,CAAsB,IAAI,CAAA;AACrC,EAAA,OAAO,QAAS,CAAA,OAAA;AAClB;AAEA,SAAS,cAAA,CACP,UACA,OACS,EAAA;AACT,EAAO,OAAA,CAAC,CAAC,QAAU,EAAA,IAAA,EAAM,WAAW,CAAC,CAAC,QAAQ,IAAM,EAAA,OAAA;AACtD;AAwBA,SAAS,g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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 * as backstage from '../backstage';\nimport * as rhdh from '../rhdh';\nimport {\n type RHDHThemePalette,\n type ThemeConfig,\n type ThemeConfigPalette,\n} from '../types';\n\nfunction baselinePalette(\n themeConfig: ThemeConfig,\n): ThemeConfigPalette | undefined {\n const mode = themeConfig.mode ?? 'light';\n const variant = themeConfig.variant ?? 'rhdh';\n const baseline =\n variant === 'backstage'\n ? backstage.getDefaultThemeConfig(mode)\n : rhdh.getDefaultThemeConfig(mode);\n return baseline.palette as ThemeConfigPalette | undefined;\n}\n\nfunction hasRhdhGeneral(\n baseline: ThemeConfigPalette | undefined,\n palette: ThemeConfigPalette,\n): boolean {\n return !!baseline?.rhdh?.general || !!palette.rhdh?.general;\n}\n\n/**\n * One conceptual color can be set in two places in the merged theme:\n * - Backstage: `palette.navigation…`\n * - RHDH: `palette.rhdh.general…`\n *\n * We load the **default** palette for this mode/variant and compare:\n * - If only the Backstage value differs from its default → use Backstage (user\n * likely customized `navigation` in app config).\n * - If only the RHDH value differs from its default → use RHDH.\n * - If both differ and disagree → prefer **RHDH**.\n */\ntype NavigationVsRhdhGeneralPick = {\n /** Current merged `palette.navigation…` color. */\n navigationColor: string | undefined;\n /** Current merged `palette.rhdh.general…` color. */\n rhdhGeneralColor: string | undefined;\n /** That same navigation field on the **default** theme (for this mode). */\n defaultNavigationColor: (baseline: ThemeConfigPalette) => string | undefined;\n /** That same RHDH general field on the **default** theme. */\n defaultRhdhGeneralColor: (baseline: ThemeConfigPalette) => string | undefined;\n};\n\nfunction pickNavigationOrRhdhGeneralColor(\n themeConfig: ThemeConfig,\n palette: ThemeConfigPalette,\n pick: NavigationVsRhdhGeneralPick,\n): string {\n const {\n navigationColor: fromNavigation,\n rhdhGeneralColor: fromRhdh,\n defaultNavigationColor,\n defaultRhdhGeneralColor,\n } = pick;\n\n const baseline = baselinePalette(themeConfig);\n if (!baseline) {\n return fromRhdh || fromNavigation || '';\n }\n if (!hasRhdhGeneral(baseline, palette)) {\n return fromNavigation || fromRhdh || '';\n }\n\n const defaultNav = defaultNavigationColor(baseline);\n const defaultRhdh = defaultRhdhGeneralColor(baseline);\n\n if (defaultNav === undefined && defaultRhdh === undefined) {\n return fromRhdh || fromNavigation || '';\n }\n\n const navigationCustomized =\n fromNavigation !== undefined && fromNavigation !== defaultNav;\n const rhdhCustomized = fromRhdh !== undefined && fromRhdh !== defaultRhdh;\n\n if (navigationCustomized && !rhdhCustomized) {\n return fromNavigation!;\n }\n if (rhdhCustomized && !navigationCustomized) {\n return fromRhdh!;\n }\n if (navigationCustomized && rhdhCustomized && fromNavigation !== fromRhdh) {\n return fromRhdh ?? fromNavigation ?? '';\n }\n return fromRhdh || fromNavigation || '';\n}\n\nexport type NavigationSidebarChrome = {\n /** `navigation.background` and `rhdh.general.sidebarBackgroundColor` */\n sidebarBackgroundColor: string;\n /** `navigation.navItem.hoverBackground` and `sidebarItemSelectedBackgroundColor` */\n sidebarItemInteractionBackgroundColor: string;\n /** `navigation.color` (fallback: `text.primary`) */\n navigationItemColor: string;\n /** `navigation.selectedColor` (fallback: `navigation.color`, then `text.primary`) */\n navigationSelectedColor: string;\n};\n\n/**\n * Resolves all navigation/sidebar chrome colors for RHDH component overrides.\n */\nexport function resolveNavigationSidebarColors(\n themeConfig: ThemeConfig,\n): NavigationSidebarChrome {\n const palette = (themeConfig.palette ?? {}) as ThemeConfigPalette;\n const general = palette.rhdh?.general ?? ({} as RHDHThemePalette['general']);\n const textPrimary = palette.text?.primary ?? '';\n\n const navigationItemColor = palette.navigation?.color ?? textPrimary;\n const navigationSelectedColor =\n palette.navigation?.selectedColor ??\n palette.navigation?.color ??\n textPrimary;\n\n /** `themeConfig` + `palette` fixed; only pass which navigation vs RHDH fields to compare. */\n const pickNavigationColor = (fields: NavigationVsRhdhGeneralPick) =>\n pickNavigationOrRhdhGeneralColor(themeConfig, palette, fields);\n\n return {\n sidebarBackgroundColor: pickNavigationColor({\n navigationColor: palette.navigation?.background,\n rhdhGeneralColor: general.sidebarBackgroundColor,\n defaultNavigationColor: b => b.navigation?.background,\n defaultRhdhGeneralColor: b => b.rhdh?.general?.sidebarBackgroundColor,\n }),\n sidebarItemInteractionBackgroundColor: pickNavigationColor({\n navigationColor: palette.navigation?.navItem?.hoverBackground,\n rhdhGeneralColor: general.sidebarItemSelectedBackgroundColor,\n defaultNavigationColor: b => b.navigation?.navItem?.hoverBackground,\n defaultRhdhGeneralColor: b =>\n b.rhdh?.general?.sidebarItemSelectedBackgroundColor,\n }),\n navigationItemColor,\n navigationSelectedColor,\n };\n}\n"],"names":["backstage.getDefaultThemeConfig","rhdh.getDefaultThemeConfig"],"mappings":";;;AAwBA,SAAS,gBACP,WAAA,EACgC;AAChC,EAAA,MAAM,IAAA,GAAO,YAAY,IAAA,IAAQ,OAAA;AACjC,EAAA,MAAM,OAAA,GAAU,YAAY,OAAA,IAAW,MAAA;AACvC,EAAA,MAAM,QAAA,GACJ,YAAY,WAAA,GACRA,sBAAgC,IAAI,CAAA,GACpCC,uBAAK,CAAsB,IAAI,CAAA;AACrC,EAAA,OAAO,QAAA,CAAS,OAAA;AAClB;AAEA,SAAS,cAAA,CACP,UACA,OAAA,EACS;AACT,EAAA,OAAO,CAAC,CAAC,QAAA,EAAU,IAAA,EAAM,WAAW,CAAC,CAAC,QAAQ,IAAA,EAAM,OAAA;AACtD;AAwBA,SAAS,gCAAA,CACP,WAAA,EACA,OAAA,EACA,IAAA,EACQ;AACR,EAAA,MAAM;AAAA,IACJ,eAAA,EAAiB,cAAA;AAAA,IACjB,gBAAA,EAAkB,QAAA;AAAA,IAClB,sBAAA;AAAA,IACA;AAAA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AA,IAAW,EAAA;AAE7C,EAAA,MAAM,mBAAA,GAAsB,OAAA,CAAQ,UAAA,EAAY,KAAA,IAAS,WAAA;AACzD,EAAA,MAAM,0BACJ,OAAA,CAAQ,UAAA,EAAY,aAAA,IACpB,OAAA,CAAQ,YAAY,KAAA,IACpB,WAAA;AAGF,EAAA,MAAM,sBAAsB,CAAC,MAAA,KAC3B,gCAAA,CAAiC,WAAA,EAAa,SAAS,MAAM,CAAA;AAE/D,EAAA,OAAO;AAAA,IACL,wBAAwB,mBAAA,CAAoB;AAAA,MAC1C,eAAA,EAAiB,QAAQ,UAAA,EAAY,UAAA;AAAA,MACrC,kBAAkB,OAAA,CAAQ,sBAAA;AAAA,MAC1B,sBAAA,EAAwB,CAAA,CAAA,KAAK,CAAA,CAAE,UAAA,EAAY,UAAA;AAAA,MAC3C,uBAAA,EAAyB,CAAA,CAAA,KAAK,CAAA,CAAE,IAAA,EAAM,OAAA,EAAS;AAAA,KAChD,CAAA;AAAA,IACD,uCAAuC,mBAAA,CAAoB;AAAA,MACzD,eAAA,EAAiB,OAAA,CAAQ,UAAA,EAAY,OAAA,EAAS,eAAA;AAAA,MAC9C,kBAAkB,OAAA,CAAQ,kCAAA;AAAA,MAC1B,sBAAA,EAAwB,CAAA,CAAA,KAAK,CAAA,CAAE,UAAA,EAAY,OAAA,EAAS,eAAA;AAAA,MACpD,uBAAA,EAAyB,CAAA,CAAA,KACvB,CAAA,CAAE,IAAA,EAAM,OAAA,EAAS;AAAA,KACpB,CAAA;AAAA,IACD,mBAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@red-hat-developer-hub/backstage-plugin-theme",
3
- "version": "0.14.11",
3
+ "version": "1.0.0",
4
4
  "description": "Red Hat Developer Hub Theme",
5
5
  "main": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",
@@ -18,28 +18,32 @@
18
18
  "pluginId": "rhdh-theme",
19
19
  "pluginPackages": [
20
20
  "@red-hat-developer-hub/backstage-plugin-theme"
21
- ]
21
+ ],
22
+ "features": {
23
+ ".": "@backstage/FrontendModule"
24
+ }
22
25
  },
23
26
  "sideEffects": [
24
27
  "*.css"
25
28
  ],
26
29
  "exports": {
27
30
  ".": {
31
+ "backstage": "@backstage/FrontendModule",
28
32
  "import": "./dist/index.esm.js",
29
33
  "types": "./dist/index.d.ts",
30
34
  "default": "./dist/index.esm.js"
31
35
  },
32
- "./alpha": {
33
- "import": "./dist/alpha.esm.js",
34
- "types": "./dist/alpha.d.ts",
35
- "default": "./dist/alpha.esm.js"
36
+ "./legacy": {
37
+ "import": "./dist/legacy.esm.js",
38
+ "types": "./dist/legacy.d.ts",
39
+ "default": "./dist/legacy.esm.js"
36
40
  },
37
41
  "./package.json": "./package.json"
38
42
  },
39
43
  "typesVersions": {
40
44
  "*": {
41
- "alpha": [
42
- "dist/alpha.d.ts"
45
+ "legacy": [
46
+ "dist/legacy.d.ts"
43
47
  ],
44
48
  "package.json": [
45
49
  "package.json"
@@ -57,25 +61,25 @@
57
61
  "postpack": "backstage-cli package postpack"
58
62
  },
59
63
  "peerDependencies": {
60
- "@backstage/core-plugin-api": "^1.12.4",
61
- "@backstage/theme": "^0.7.2",
64
+ "@backstage/core-plugin-api": "^1.12.7",
65
+ "@backstage/theme": "^0.7.3",
62
66
  "@mui/icons-material": "^5.17.1",
63
67
  "@mui/material": "^5.0.0",
64
68
  "react": "^16.13.1 || ^17.0.0 || ^18.0.0",
65
69
  "react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0"
66
70
  },
67
71
  "devDependencies": {
68
- "@backstage/cli": "^0.36.0",
69
- "@backstage/core-app-api": "^1.19.6",
70
- "@backstage/core-components": "^0.18.8",
71
- "@backstage/core-plugin-api": "^1.12.4",
72
- "@backstage/dev-utils": "^1.1.21",
73
- "@backstage/frontend-defaults": "^0.5.0",
74
- "@backstage/plugin-user-settings": "^0.9.1",
75
- "@backstage/test-utils": "^1.7.16",
76
- "@backstage/theme": "^0.7.2",
72
+ "@backstage/cli": "^0.36.3",
73
+ "@backstage/core-app-api": "^1.20.2",
74
+ "@backstage/core-components": "^0.18.11",
75
+ "@backstage/core-plugin-api": "^1.12.7",
76
+ "@backstage/dev-utils": "^1.1.24",
77
+ "@backstage/frontend-defaults": "^0.5.3",
78
+ "@backstage/plugin-user-settings": "^0.9.4",
79
+ "@backstage/test-utils": "^1.7.19",
80
+ "@backstage/theme": "^0.7.3",
77
81
  "@backstage/types": "^1.2.2",
78
- "@backstage/ui": "^0.13.1",
82
+ "@backstage/ui": "^0.16.0",
79
83
  "@testing-library/jest-dom": "^6.0.0",
80
84
  "@testing-library/react": "^14.0.0",
81
85
  "@testing-library/user-event": "^14.0.0",
@@ -104,8 +108,8 @@
104
108
  "@divyanshiGupta"
105
109
  ],
106
110
  "dependencies": {
107
- "@backstage/frontend-plugin-api": "^0.15.1",
108
- "@backstage/plugin-app-react": "^0.2.1",
111
+ "@backstage/frontend-plugin-api": "^0.17.2",
112
+ "@backstage/plugin-app-react": "^0.2.4",
109
113
  "@mui/icons-material": "^5.17.1"
110
114
  },
111
115
  "module": "./dist/index.esm.js"
package/dist/alpha.d.ts DELETED
@@ -1,5 +0,0 @@
1
- import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
2
-
3
- declare const rhdhThemeModule: _backstage_frontend_plugin_api.FrontendModule;
4
-
5
- export { rhdhThemeModule };
package/dist/alpha.esm.js DELETED
@@ -1,26 +0,0 @@
1
- import { createFrontendModule } from '@backstage/frontend-plugin-api';
2
- import { ThemeBlueprint } from '@backstage/plugin-app-react';
3
- import './assets/fonts/font.min.css.esm.js';
4
- import { getAllThemes } from './themes.esm.js';
5
-
6
- const rhdhThemeExtensions = getAllThemes().map(
7
- (appTheme) => ThemeBlueprint.make({
8
- name: appTheme.id,
9
- params: {
10
- theme: {
11
- id: appTheme.id,
12
- title: appTheme.title,
13
- variant: appTheme.variant,
14
- icon: appTheme.icon,
15
- Provider: appTheme.Provider
16
- }
17
- }
18
- })
19
- );
20
- const rhdhThemeModule = createFrontendModule({
21
- pluginId: "app",
22
- extensions: rhdhThemeExtensions
23
- });
24
-
25
- export { rhdhThemeModule };
26
- //# sourceMappingURL=alpha.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"alpha.esm.js","sources":["../src/alpha/index.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\n/**\n * RHDH themes as NFS extensions (ThemeBlueprint).\n * Only the app can register ThemeBlueprint; we use the same theme definitions\n * from the theme plugin (getAllThemes()) so behavior matches the legacy app.\n *\n * @packageDocumentation\n */\n\nimport { createFrontendModule } from '@backstage/frontend-plugin-api';\nimport { ThemeBlueprint } from '@backstage/plugin-app-react';\n\nimport '../assets/fonts/font.min.css';\n\nimport { getAllThemes } from '../themes';\n\nconst rhdhThemeExtensions = getAllThemes().map(appTheme =>\n ThemeBlueprint.make({\n name: appTheme.id,\n params: {\n theme: {\n id: appTheme.id,\n title: appTheme.title,\n variant: appTheme.variant,\n icon: appTheme.icon,\n Provider: appTheme.Provider,\n },\n },\n }),\n);\n\n/*\n * @alpha\n */\nexport const rhdhThemeModule = createFrontendModule({\n pluginId: 'app',\n extensions: rhdhThemeExtensions,\n});\n"],"names":[],"mappings":";;;;;AA+BA,MAAM,mBAAA,GAAsB,cAAe,CAAA,GAAA;AAAA,EAAI,CAAA,QAAA,KAC7C,eAAe,IAAK,CAAA;AAAA,IAClB,MAAM,QAAS,CAAA,EAAA;AAAA,IACf,MAAQ,EAAA;AAAA,MACN,KAAO,EAAA;AAAA,QACL,IAAI,QAAS,CAAA,EAAA;AAAA,QACb,OAAO,QAAS,CAAA,KAAA;AAAA,QAChB,SAAS,QAAS,CAAA,OAAA;AAAA,QAClB,MAAM,QAAS,CAAA,IAAA;AAAA,QACf,UAAU,QAAS,CAAA;AAAA;AACrB;AACF,GACD;AACH,CAAA;AAKO,MAAM,kBAAkB,oBAAqB,CAAA;AAAA,EAClD,QAAU,EAAA,KAAA;AAAA,EACV,UAAY,EAAA;AACd,CAAC;;;;"}