@backstage/plugin-home 0.9.3-next.2 → 0.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 +18 -0
- package/README.md +43 -71
- package/dist/alpha.d.ts +33 -35
- package/dist/alpha.esm.js +3 -2
- package/dist/alpha.esm.js.map +1 -1
- package/dist/components/CustomHomepage/types.esm.js +1 -1
- package/dist/components/CustomHomepage/types.esm.js.map +1 -1
- package/dist/index.d.ts +36 -1
- package/dist/index.esm.js +1 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/package.json.esm.js +2 -2
- package/dist/translation.esm.js.map +1 -1
- package/package.json +18 -18
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @backstage/plugin-home
|
|
2
2
|
|
|
3
|
+
## 0.9.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 538c985: Updated installation documentation to use feature discovery as the default.
|
|
8
|
+
- 0be2541: Promoted the plugin's translation ref to the stable package entry point. It was previously only available through the alpha entry point.
|
|
9
|
+
- a49a40d: Updated dependency `zod` to `^3.25.76 || ^4.0.0` & migrated to `/v3` or `/v4` imports.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
- @backstage/plugin-catalog-react@2.1.0
|
|
12
|
+
- @backstage/core-compat-api@0.5.9
|
|
13
|
+
- @backstage/core-plugin-api@1.12.4
|
|
14
|
+
- @backstage/core-components@0.18.8
|
|
15
|
+
- @backstage/frontend-plugin-api@0.15.0
|
|
16
|
+
- @backstage/catalog-client@1.14.0
|
|
17
|
+
- @backstage/core-app-api@1.19.6
|
|
18
|
+
- @backstage/plugin-home-react@0.1.36
|
|
19
|
+
- @backstage/catalog-model@1.7.7
|
|
20
|
+
|
|
3
21
|
## 0.9.3-next.2
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -6,40 +6,19 @@ For App Integrators, the system is designed to be composable to give total freed
|
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
9
|
-
If you have a standalone app (you didn't clone this repo), then do
|
|
10
|
-
|
|
11
9
|
```bash
|
|
12
10
|
# From your Backstage root directory
|
|
13
11
|
yarn --cwd packages/app add @backstage/plugin-home
|
|
14
12
|
```
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
The home plugin supports both the new frontend system and the legacy system.
|
|
19
|
-
|
|
20
|
-
### New Frontend System
|
|
21
|
-
|
|
22
|
-
If you're using Backstage's new frontend system, add the plugin to your app:
|
|
23
|
-
|
|
24
|
-
```ts
|
|
25
|
-
// packages/app/src/App.tsx
|
|
26
|
-
import homePlugin from '@backstage/plugin-home/alpha';
|
|
27
|
-
|
|
28
|
-
const app = createApp({
|
|
29
|
-
features: [
|
|
30
|
-
// ... other plugins
|
|
31
|
-
homePlugin,
|
|
32
|
-
// ... other plugins
|
|
33
|
-
],
|
|
34
|
-
});
|
|
35
|
-
```
|
|
14
|
+
Once installed, the plugin is automatically available in your app through the default feature discovery. For more details and alternative installation methods, see [installing plugins](https://backstage.io/docs/frontend-system/building-apps/installing-plugins).
|
|
36
15
|
|
|
37
16
|
The plugin will automatically provide:
|
|
38
17
|
|
|
39
18
|
- A homepage at `/home` with customizable widget grid
|
|
40
19
|
- A "Home" navigation item in the sidebar
|
|
41
20
|
|
|
42
|
-
|
|
21
|
+
## Creating Custom Homepage Layouts
|
|
43
22
|
|
|
44
23
|
Use the `HomePageLayoutBlueprint` from `@backstage/plugin-home-react/alpha` to
|
|
45
24
|
create custom homepage layouts. A layout receives the installed widgets and is
|
|
@@ -86,7 +65,7 @@ const homeModule = createFrontendModule({
|
|
|
86
65
|
});
|
|
87
66
|
```
|
|
88
67
|
|
|
89
|
-
|
|
68
|
+
## Visit Tracking (Optional)
|
|
90
69
|
|
|
91
70
|
Visit tracking is an **optional feature** that must be explicitly enabled. When enabled, it provides intelligent storage fallbacks:
|
|
92
71
|
|
|
@@ -112,12 +91,7 @@ app:
|
|
|
112
91
|
|
|
113
92
|
## Creating Homepage Widgets
|
|
114
93
|
|
|
115
|
-
Homepage widgets are React components that can be added to customizable home pages.
|
|
116
|
-
|
|
117
|
-
- **New Frontend System**: Use `HomePageWidgetBlueprint` to register widgets as extensions
|
|
118
|
-
- **Legacy System**: Use `createCardExtension` to export widgets as card components
|
|
119
|
-
|
|
120
|
-
### New Frontend System
|
|
94
|
+
Homepage widgets are React components that can be added to customizable home pages.
|
|
121
95
|
|
|
122
96
|
Create widgets using the `HomePageWidgetBlueprint`:
|
|
123
97
|
|
|
@@ -156,26 +130,24 @@ const myWidget = HomePageWidgetBlueprint.make({
|
|
|
156
130
|
});
|
|
157
131
|
```
|
|
158
132
|
|
|
159
|
-
> **Example**: See [dev/index.tsx](dev/index.tsx) for a comprehensive example of creating multiple homepage widgets and layouts
|
|
133
|
+
> **Example**: See [dev/index.tsx](dev/index.tsx) for a comprehensive example of creating multiple homepage widgets and layouts.
|
|
160
134
|
|
|
161
|
-
|
|
135
|
+
## Contributing
|
|
162
136
|
|
|
163
|
-
|
|
137
|
+
### Homepage Components
|
|
164
138
|
|
|
165
|
-
|
|
166
|
-
import { createCardExtension } from '@backstage/plugin-home-react';
|
|
139
|
+
We believe that people have great ideas for what makes a useful Home Page, and we want to make it easy for everyone to benefit from the effort you put in to create something cool for the Home Page. Therefore, a great way of contributing is by simply creating more Home Page Components that can then be used by everyone when composing their own Home Page. If they are tightly coupled to an existing plugin, it is recommended to allow them to live within that plugin, for convenience and to limit complex dependencies. On the other hand, if there's no clear plugin that the component is based on, it's also fine to contribute them into the [home plugin](/plugins/home/src/homePageComponents)
|
|
167
140
|
|
|
168
|
-
|
|
169
|
-
createCardExtension<{ defaultCategory?: 'programming' | 'any' }>({
|
|
170
|
-
title: 'My Custom Widget',
|
|
171
|
-
components: () => import('./homePageComponents/MyWidget'),
|
|
172
|
-
}),
|
|
173
|
-
);
|
|
174
|
-
```
|
|
141
|
+
Additionally, the API is at a very early state, so contributing additional use cases may expose weaknesses in the current solution that we may iterate on to provide more flexibility and ease of use for those who wish to develop components for the Home Page.
|
|
175
142
|
|
|
176
|
-
|
|
143
|
+
### Homepage Templates
|
|
144
|
+
|
|
145
|
+
We are hoping that we together can build up a collection of Homepage templates. We therefore put together a place where we can collect all the templates for the Home Plugin in the [storybook](https://backstage.io/storybook/?path=/story/plugins-home-templates).
|
|
146
|
+
If you would like to contribute with a template, start by taking a look at the [DefaultTemplate storybook example](/packages/app-legacy/src/components/home/templates/DefaultTemplate.stories.tsx) or [CustomizableTemplate storybook example](/packages/app-legacy/src/components/home/templates/CustomizableTemplate.stories.tsx) to create your own, and then open a PR with your suggestion.
|
|
147
|
+
|
|
148
|
+
## Old Frontend System
|
|
177
149
|
|
|
178
|
-
|
|
150
|
+
This section covers the home plugin setup and usage for apps that still use the old frontend system.
|
|
179
151
|
|
|
180
152
|
### Setting up the Home Page
|
|
181
153
|
|
|
@@ -204,13 +176,26 @@ import { homePage } from './components/home/HomePage';
|
|
|
204
176
|
// ...
|
|
205
177
|
```
|
|
206
178
|
|
|
207
|
-
### Creating
|
|
179
|
+
### Creating Widgets (Old Frontend System)
|
|
180
|
+
|
|
181
|
+
In the old frontend system, use the `createCardExtension` helper to create homepage widgets:
|
|
182
|
+
|
|
183
|
+
```tsx
|
|
184
|
+
import { createCardExtension } from '@backstage/plugin-home-react';
|
|
185
|
+
|
|
186
|
+
export const MyWidget = homePlugin.provide(
|
|
187
|
+
createCardExtension<{ defaultCategory?: 'programming' | 'any' }>({
|
|
188
|
+
title: 'My Custom Widget',
|
|
189
|
+
components: () => import('./homePageComponents/MyWidget'),
|
|
190
|
+
}),
|
|
191
|
+
);
|
|
192
|
+
```
|
|
208
193
|
|
|
209
|
-
|
|
194
|
+
The `createCardExtension` provides error boundary and lazy loading, and accepts generics for custom props that App Integrators can configure.
|
|
210
195
|
|
|
211
|
-
### Composing a Home Page (
|
|
196
|
+
### Composing a Home Page (Old Frontend System)
|
|
212
197
|
|
|
213
|
-
|
|
198
|
+
Composing a Home Page is done by creating regular React components. Components created with `createCardExtension` are rendered like so:
|
|
214
199
|
|
|
215
200
|
```tsx
|
|
216
201
|
import Grid from '@material-ui/core/Grid';
|
|
@@ -227,7 +212,7 @@ export const homePage = (
|
|
|
227
212
|
|
|
228
213
|
Additionally, the App Integrator is provided an escape hatch in case the way the card is rendered does not fit their requirements. They may optionally pass the `Renderer`-prop, which will receive the `title`, `content` and optionally `actions`, `settings` and `contextProvider`, if they exist for the component. This allows the App Integrator to render the content in any way they want.
|
|
229
214
|
|
|
230
|
-
|
|
215
|
+
### Customizable Home Page (Old Frontend System)
|
|
231
216
|
|
|
232
217
|
If you want to allow users to customize the components that are shown in the home page, you can use CustomHomePageGrid component.
|
|
233
218
|
By adding the allowed components inside the grid, the user can add, configure, remove and move the components around in their
|
|
@@ -259,7 +244,7 @@ export const homePage = (
|
|
|
259
244
|
> [!NOTE]
|
|
260
245
|
> You can provide a title to the grid by passing it as a prop: `<CustomHomepageGrid title="Your Dashboard" />`. This will be displayed as a header above the grid layout.
|
|
261
246
|
|
|
262
|
-
|
|
247
|
+
#### Creating Customizable Components (Old Frontend System)
|
|
263
248
|
|
|
264
249
|
The custom home page can use the default components created by using the default `createCardExtension` method but if you
|
|
265
250
|
want to add additional configuration like component size or settings, you can define those in the `layout`
|
|
@@ -317,7 +302,7 @@ Available home page properties that are used for homepage widgets are:
|
|
|
317
302
|
| `layout.height.maxRows` | integer | Maximum height of the widget (1-12) |
|
|
318
303
|
| `settings.schema` | object | Customization settings of the widget, see below |
|
|
319
304
|
|
|
320
|
-
#### Widget Specific Settings
|
|
305
|
+
#### Widget Specific Settings (Old Frontend System)
|
|
321
306
|
|
|
322
307
|
To define settings that the users can change for your component, you should define the `layout` and `settings`
|
|
323
308
|
properties. The `settings.schema` object should follow
|
|
@@ -369,7 +354,7 @@ Each widget has its own settings and the setting values are passed to the underl
|
|
|
369
354
|
In case your `CardExtension` had `Settings` component defined, it will automatically disappear when you add the
|
|
370
355
|
`settingsSchema` to the component data structure.
|
|
371
356
|
|
|
372
|
-
|
|
357
|
+
#### Adding Default Layout (Old Frontend System)
|
|
373
358
|
|
|
374
359
|
You can set the default layout of the customizable home page by passing configuration to the `CustomHomepageGrid`
|
|
375
360
|
component:
|
|
@@ -391,7 +376,7 @@ const defaultConfig = [
|
|
|
391
376
|
<CustomHomepageGrid config={defaultConfig}>
|
|
392
377
|
```
|
|
393
378
|
|
|
394
|
-
|
|
379
|
+
### Page Visit Homepage Component (Old Frontend System)
|
|
395
380
|
|
|
396
381
|
This component shows the homepage user a view for "Recently visited" or "Top visited".
|
|
397
382
|
Being provided by the `<HomePageTopVisited/>` and `<HomePageRecentlyVisited/>` component, see it in use on a homepage example below:
|
|
@@ -505,11 +490,11 @@ home:
|
|
|
505
490
|
|
|
506
491
|
In order to validate the config you can use `backstage/cli config:check`
|
|
507
492
|
|
|
508
|
-
|
|
493
|
+
#### Customizing the VisitList (Old Frontend System)
|
|
509
494
|
|
|
510
495
|
If you want more control over the recent and top visited lists, you can write your own functions to transform the path names and determine which visits to save. You can also enrich each visit with other fields and customize the chip colors/labels in the visit lists.
|
|
511
496
|
|
|
512
|
-
|
|
497
|
+
##### Transform Pathname Function
|
|
513
498
|
|
|
514
499
|
Provide a `transformPathname` function to transform the pathname before it's processed for visit tracking. This can be used for transforming the pathname for the visit (before any other consideration). As an example, you can treat multiple sub-path visits to be counted as a singular path, e.g. `/entity-path/sub1` , `/entity-path/sub-2`, `/entity-path/sub-2/sub-sub-2` can all be mapped to `/entity-path` so visits to any of those routes are all counted as the same.
|
|
515
500
|
|
|
@@ -548,7 +533,7 @@ export const apis: AnyApiFactory[] = [
|
|
|
548
533
|
];
|
|
549
534
|
```
|
|
550
535
|
|
|
551
|
-
|
|
536
|
+
##### Can Save Function
|
|
552
537
|
|
|
553
538
|
Provide a `canSave` function to determine which visits should be tracked and saved. This allows you to conditionally save visits to the list:
|
|
554
539
|
|
|
@@ -586,7 +571,7 @@ export const apis: AnyApiFactory[] = [
|
|
|
586
571
|
];
|
|
587
572
|
```
|
|
588
573
|
|
|
589
|
-
|
|
574
|
+
##### Enrich Visit Function
|
|
590
575
|
|
|
591
576
|
You can also add the `enrichVisit` function to put additional values on each `Visit`. The values could later be used to customize the chips in the `VisitList`. For example, you could add the entity `type` on the `Visit` so that `type` is used for labels instead of `kind`.
|
|
592
577
|
|
|
@@ -637,7 +622,7 @@ export const apis: AnyApiFactory[] = [
|
|
|
637
622
|
];
|
|
638
623
|
```
|
|
639
624
|
|
|
640
|
-
|
|
625
|
+
##### Custom Chip Colors and Labels
|
|
641
626
|
|
|
642
627
|
To provide your own chip colors and/or labels for the recent and top visited lists, wrap the components in `VisitDisplayProvider` with `getChipColor` and `getChipLabel` functions. The colors provided will be used instead of the hard coded [`colorVariants`](https://github.com/backstage/backstage/blob/2da352043425bcab4c4422e4d2820c26c0a83382/packages/theme/src/base/pageTheme.ts#L46) provided via `@backstage/theme`.
|
|
643
628
|
|
|
@@ -680,16 +665,3 @@ export default function HomePage() {
|
|
|
680
665
|
);
|
|
681
666
|
}
|
|
682
667
|
```
|
|
683
|
-
|
|
684
|
-
## Contributing
|
|
685
|
-
|
|
686
|
-
### Homepage Components
|
|
687
|
-
|
|
688
|
-
We believe that people have great ideas for what makes a useful Home Page, and we want to make it easy for everyone to benefit from the effort you put in to create something cool for the Home Page. Therefore, a great way of contributing is by simply creating more Home Page Components that can then be used by everyone when composing their own Home Page. If they are tightly coupled to an existing plugin, it is recommended to allow them to live within that plugin, for convenience and to limit complex dependencies. On the other hand, if there's no clear plugin that the component is based on, it's also fine to contribute them into the [home plugin](/plugins/home/src/homePageComponents)
|
|
689
|
-
|
|
690
|
-
Additionally, the API is at a very early state, so contributing additional use cases may expose weaknesses in the current solution that we may iterate on to provide more flexibility and ease of use for those who wish to develop components for the Home Page.
|
|
691
|
-
|
|
692
|
-
### Homepage Templates
|
|
693
|
-
|
|
694
|
-
We are hoping that we together can build up a collection of Homepage templates. We therefore put together a place where we can collect all the templates for the Home Plugin in the [storybook](https://backstage.io/storybook/?path=/story/plugins-home-templates).
|
|
695
|
-
If you would like to contribute with a template, start by taking a look at the [DefaultTemplate storybook example](/packages/app-legacy/src/components/home/templates/DefaultTemplate.stories.tsx) or [CustomizableTemplate storybook example](/packages/app-legacy/src/components/home/templates/CustomizableTemplate.stories.tsx) to create your own, and then open a PR with your suggestion.
|
package/dist/alpha.d.ts
CHANGED
|
@@ -3,41 +3,6 @@ import { HomePageLayoutProps } from '@backstage/plugin-home-react/alpha';
|
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
* Translation reference for the home plugin.
|
|
8
|
-
* Contains localized text strings for home page components and widgets.
|
|
9
|
-
*
|
|
10
|
-
* @alpha
|
|
11
|
-
*/
|
|
12
|
-
declare const homeTranslationRef: _backstage_frontend_plugin_api.TranslationRef<"home", {
|
|
13
|
-
readonly "starredEntities.noStarredEntitiesMessage": "Click the star beside an entity name to add it to this list!";
|
|
14
|
-
readonly "addWidgetDialog.title": "Add new widget to dashboard";
|
|
15
|
-
readonly "customHomepageButtons.cancel": "Cancel";
|
|
16
|
-
readonly "customHomepageButtons.clearAll": "Clear all";
|
|
17
|
-
readonly "customHomepageButtons.edit": "Edit";
|
|
18
|
-
readonly "customHomepageButtons.restoreDefaults": "Restore defaults";
|
|
19
|
-
readonly "customHomepageButtons.addWidget": "Add widget";
|
|
20
|
-
readonly "customHomepageButtons.save": "Save";
|
|
21
|
-
readonly "customHomepage.noWidgets": "No widgets added. Start by clicking the 'Add widget' button.";
|
|
22
|
-
readonly "widgetSettingsOverlay.cancelButtonTitle": "Cancel";
|
|
23
|
-
readonly "widgetSettingsOverlay.editSettingsTooptip": "Edit settings";
|
|
24
|
-
readonly "widgetSettingsOverlay.deleteWidgetTooltip": "Delete widget";
|
|
25
|
-
readonly "widgetSettingsOverlay.submitButtonTitle": "Submit";
|
|
26
|
-
readonly "starredEntityListItem.removeFavoriteEntityTitle": "Remove entity from favorites";
|
|
27
|
-
readonly "visitList.empty.title": "There are no visits to show yet.";
|
|
28
|
-
readonly "visitList.empty.description": "Once you start using Backstage, your visits will appear here as a quick link to carry on where you left off.";
|
|
29
|
-
readonly "visitList.few.title": "The more pages you visit, the more pages will appear here.";
|
|
30
|
-
readonly "quickStart.title": "Onboarding";
|
|
31
|
-
readonly "quickStart.description": "Get started with Backstage";
|
|
32
|
-
readonly "quickStart.learnMoreLinkTitle": "Learn more";
|
|
33
|
-
readonly "visitedByType.action.viewMore": "View more";
|
|
34
|
-
readonly "visitedByType.action.viewLess": "View less";
|
|
35
|
-
readonly "featuredDocsCard.empty.title": "No documents to show";
|
|
36
|
-
readonly "featuredDocsCard.empty.description": "Create your own document. Check out our Getting Started Information";
|
|
37
|
-
readonly "featuredDocsCard.empty.learnMoreLinkTitle": "DOCS";
|
|
38
|
-
readonly "featuredDocsCard.learnMoreTitle": "LEARN MORE";
|
|
39
|
-
}>;
|
|
40
|
-
|
|
41
6
|
/**
|
|
42
7
|
* Home plugin for the new frontend system.
|
|
43
8
|
*
|
|
@@ -165,4 +130,37 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
|
|
|
165
130
|
}>;
|
|
166
131
|
}>;
|
|
167
132
|
|
|
133
|
+
/**
|
|
134
|
+
* @alpha
|
|
135
|
+
* @deprecated Import from `@backstage/plugin-home` instead.
|
|
136
|
+
*/
|
|
137
|
+
declare const homeTranslationRef: _backstage_frontend_plugin_api.TranslationRef<"home", {
|
|
138
|
+
readonly "starredEntities.noStarredEntitiesMessage": "Click the star beside an entity name to add it to this list!";
|
|
139
|
+
readonly "addWidgetDialog.title": "Add new widget to dashboard";
|
|
140
|
+
readonly "customHomepageButtons.cancel": "Cancel";
|
|
141
|
+
readonly "customHomepageButtons.clearAll": "Clear all";
|
|
142
|
+
readonly "customHomepageButtons.edit": "Edit";
|
|
143
|
+
readonly "customHomepageButtons.restoreDefaults": "Restore defaults";
|
|
144
|
+
readonly "customHomepageButtons.addWidget": "Add widget";
|
|
145
|
+
readonly "customHomepageButtons.save": "Save";
|
|
146
|
+
readonly "customHomepage.noWidgets": "No widgets added. Start by clicking the 'Add widget' button.";
|
|
147
|
+
readonly "widgetSettingsOverlay.cancelButtonTitle": "Cancel";
|
|
148
|
+
readonly "widgetSettingsOverlay.editSettingsTooptip": "Edit settings";
|
|
149
|
+
readonly "widgetSettingsOverlay.deleteWidgetTooltip": "Delete widget";
|
|
150
|
+
readonly "widgetSettingsOverlay.submitButtonTitle": "Submit";
|
|
151
|
+
readonly "starredEntityListItem.removeFavoriteEntityTitle": "Remove entity from favorites";
|
|
152
|
+
readonly "visitList.empty.title": "There are no visits to show yet.";
|
|
153
|
+
readonly "visitList.empty.description": "Once you start using Backstage, your visits will appear here as a quick link to carry on where you left off.";
|
|
154
|
+
readonly "visitList.few.title": "The more pages you visit, the more pages will appear here.";
|
|
155
|
+
readonly "quickStart.title": "Onboarding";
|
|
156
|
+
readonly "quickStart.description": "Get started with Backstage";
|
|
157
|
+
readonly "quickStart.learnMoreLinkTitle": "Learn more";
|
|
158
|
+
readonly "visitedByType.action.viewMore": "View more";
|
|
159
|
+
readonly "visitedByType.action.viewLess": "View less";
|
|
160
|
+
readonly "featuredDocsCard.empty.title": "No documents to show";
|
|
161
|
+
readonly "featuredDocsCard.empty.description": "Create your own document. Check out our Getting Started Information";
|
|
162
|
+
readonly "featuredDocsCard.empty.learnMoreLinkTitle": "DOCS";
|
|
163
|
+
readonly "featuredDocsCard.learnMoreTitle": "LEARN MORE";
|
|
164
|
+
}>;
|
|
165
|
+
|
|
168
166
|
export { _default as default, homeTranslationRef };
|
package/dist/alpha.esm.js
CHANGED
|
@@ -10,7 +10,7 @@ import { VisitsWebStorageApi } from './api/VisitsWebStorageApi.esm.js';
|
|
|
10
10
|
import { visitsApiRef } from './api/VisitsApi.esm.js';
|
|
11
11
|
import HomeIcon from '@material-ui/icons/Home';
|
|
12
12
|
import { homePageLayoutComponentDataRef, homePageWidgetDataRef, HomePageLayoutBlueprint, HomePageWidgetBlueprint } from '@backstage/plugin-home-react/alpha';
|
|
13
|
-
|
|
13
|
+
import { homeTranslationRef as homeTranslationRef$1 } from './translation.esm.js';
|
|
14
14
|
|
|
15
15
|
const rootRouteRef = createRouteRef();
|
|
16
16
|
const homePage = PageBlueprint.makeWithOverrides({
|
|
@@ -156,6 +156,7 @@ var alpha = createFrontendPlugin({
|
|
|
156
156
|
root: rootRouteRef
|
|
157
157
|
}
|
|
158
158
|
});
|
|
159
|
+
const homeTranslationRef = homeTranslationRef$1;
|
|
159
160
|
|
|
160
|
-
export { alpha as default };
|
|
161
|
+
export { alpha as default, homeTranslationRef };
|
|
161
162
|
//# sourceMappingURL=alpha.esm.js.map
|
package/dist/alpha.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * The home plugin for Backstage's new frontend system.\n *\n * @remarks\n * This package provides the new frontend system implementation of the home plugin,\n * which offers customizable home pages with widget support and optional visit tracking.\n *\n * @packageDocumentation\n */\n\nimport { lazy as reactLazy } from 'react';\nimport {\n createExtensionInput,\n PageBlueprint,\n NavItemBlueprint,\n createFrontendPlugin,\n createRouteRef,\n AppRootElementBlueprint,\n identityApiRef,\n storageApiRef,\n errorApiRef,\n ApiBlueprint,\n ExtensionBoundary,\n} from '@backstage/frontend-plugin-api';\nimport { VisitListener } from './components/';\nimport { visitsApiRef, VisitsStorageApi, VisitsWebStorageApi } from './api';\nimport HomeIcon from '@material-ui/icons/Home';\nimport {\n homePageWidgetDataRef,\n homePageLayoutComponentDataRef,\n HomePageLayoutBlueprint,\n HomePageWidgetBlueprint,\n type HomePageLayoutProps,\n} from '@backstage/plugin-home-react/alpha';\n\nconst rootRouteRef = createRouteRef();\n\nconst homePage = PageBlueprint.makeWithOverrides({\n inputs: {\n widgets: createExtensionInput([homePageWidgetDataRef]),\n layout: createExtensionInput([HomePageLayoutBlueprint.dataRefs.component], {\n singleton: true,\n optional: true,\n internal: true,\n }),\n },\n factory(originalFactory, { node, inputs }) {\n return originalFactory({\n path: '/home',\n noHeader: true,\n routeRef: rootRouteRef,\n loader: async () => {\n const LazyDefaultLayout = reactLazy(() =>\n import('./alpha/DefaultHomePageLayout').then(m => ({\n default: m.DefaultHomePageLayout,\n })),\n );\n\n const DefaultLayoutComponent = (props: HomePageLayoutProps) => (\n <ExtensionBoundary node={node}>\n <LazyDefaultLayout {...props} />\n </ExtensionBoundary>\n );\n\n const Layout =\n inputs.layout?.get(homePageLayoutComponentDataRef) ??\n DefaultLayoutComponent;\n\n const widgets = inputs.widgets.map(widget => ({\n ...widget.get(homePageWidgetDataRef),\n node: widget.node,\n }));\n\n return <Layout widgets={widgets} />;\n },\n });\n },\n});\n\nconst visitListenerAppRootElement = AppRootElementBlueprint.make({\n name: 'visit-listener',\n disabled: true,\n params: {\n element: <VisitListener />,\n },\n});\n\nconst visitsApi = ApiBlueprint.make({\n name: 'visits',\n disabled: true,\n params: defineParams =>\n defineParams({\n api: visitsApiRef,\n deps: {\n storageApi: storageApiRef,\n identityApi: identityApiRef,\n errorApi: errorApiRef,\n },\n factory: ({ storageApi, identityApi, errorApi }) => {\n // Smart fallback: use custom storage API if available, otherwise localStorage\n if (storageApi) {\n return VisitsStorageApi.create({ storageApi, identityApi });\n }\n return VisitsWebStorageApi.create({ identityApi, errorApi });\n },\n }),\n});\n\nconst homeNavItem = NavItemBlueprint.make({\n params: {\n title: 'Home',\n routeRef: rootRouteRef,\n icon: HomeIcon,\n },\n});\n\nconst homePageToolkitWidget = HomePageWidgetBlueprint.make({\n name: 'toolkit',\n params: {\n name: 'HomePageToolkit',\n title: 'Toolkit',\n components: () =>\n import('./homePageComponents/Toolkit').then(m => ({\n Content: m.Content,\n ContextProvider: m.ContextProvider,\n })),\n componentProps: {\n tools: [\n {\n url: 'https://backstage.io',\n label: 'Backstage Docs',\n icon: <HomeIcon />,\n },\n ],\n },\n },\n});\n\nconst homePageStarredEntitiesWidget = HomePageWidgetBlueprint.make({\n name: 'starred-entities',\n params: {\n name: 'HomePageStarredEntities',\n title: 'Your Starred Entities',\n components: () =>\n import('./homePageComponents/StarredEntities').then(m => ({\n Content: m.Content,\n })),\n },\n});\n\nconst homePageRandomJokeWidget = HomePageWidgetBlueprint.make({\n name: 'random-joke',\n params: {\n name: 'HomePageRandomJoke',\n title: 'Random Joke',\n description: 'Shows a random programming joke',\n components: () =>\n import('./homePageComponents/RandomJoke').then(m => ({\n Content: m.Content,\n Settings: m.Settings,\n Actions: m.Actions,\n ContextProvider: m.ContextProvider,\n })),\n layout: {\n height: { minRows: 4 },\n width: { minColumns: 3 },\n },\n settings: {\n schema: {\n title: 'Random Joke settings',\n type: 'object',\n properties: {\n defaultCategory: {\n title: 'Category',\n type: 'string',\n enum: ['any', 'programming', 'dad'],\n default: 'any',\n },\n },\n },\n },\n },\n});\n\n/**\n * Home plugin for the new frontend system.\n *\n * Provides core homepage functionality with optional visit tracking extensions.\n * Visit tracking extensions are disabled by default and can be enabled via app-config.yaml.\n *\n * @alpha\n */\nexport default createFrontendPlugin({\n pluginId: 'home',\n title: 'Home',\n icon: <HomeIcon />,\n info: { packageJson: () => import('../package.json') },\n extensions: [\n homePage,\n homeNavItem,\n visitsApi,\n visitListenerAppRootElement,\n homePageToolkitWidget,\n homePageStarredEntitiesWidget,\n homePageRandomJokeWidget,\n ],\n routes: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rB,KAAA,EAAO,EAAE,UAAA,EAAY,CAAA;AAAE,KACzB;AAAA,IACA,QAAA,EAAU;AAAA,MACR,MAAA,EAAQ;AAAA,QACN,KAAA,EAAO,sBAAA;AAAA,QACP,IAAA,EAAM,QAAA;AAAA,QACN,UAAA,EAAY;AAAA,UACV,eAAA,EAAiB;AAAA,YACf,KAAA,EAAO,UAAA;AAAA,YACP,IAAA,EAAM,QAAA;AAAA,YACN,IAAA,EAAM,CAAC,KAAA,EAAO,aAAA,EAAe,KAAK,CAAA;AAAA,YAClC,OAAA,EAAS;AAAA;AACX;AACF;AACF;AACF;AAEJ,CAAC,CAAA;AAUD,YAAe,oBAAA,CAAqB;AAAA,EAClC,QAAA,EAAU,MAAA;AAAA,EACV,KAAA,EAAO,MAAA;AAAA,EACP,IAAA,sBAAO,QAAA,EAAA,EAAS,CAAA;AAAA,EAChB,MAAM,EAAE,WAAA,EAAa,MAAM,OAAO,uBAAiB,CAAA,EAAE;AAAA,EACrD,UAAA,EAAY;AAAA,IACV,QAAA;AAAA,IACA,WAAA;AAAA,IACA,SAAA;AAAA,IACA,2BAAA;AAAA,IACA,qBAAA;AAAA,IACA,6BAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM;AAAA;AAEV,CAAC,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * The home plugin for Backstage's new frontend system.\n *\n * @remarks\n * This package provides the new frontend system implementation of the home plugin,\n * which offers customizable home pages with widget support and optional visit tracking.\n *\n * @packageDocumentation\n */\n\nimport { lazy as reactLazy } from 'react';\nimport {\n createExtensionInput,\n PageBlueprint,\n NavItemBlueprint,\n createFrontendPlugin,\n createRouteRef,\n AppRootElementBlueprint,\n identityApiRef,\n storageApiRef,\n errorApiRef,\n ApiBlueprint,\n ExtensionBoundary,\n} from '@backstage/frontend-plugin-api';\nimport { VisitListener } from './components/';\nimport { visitsApiRef, VisitsStorageApi, VisitsWebStorageApi } from './api';\nimport HomeIcon from '@material-ui/icons/Home';\nimport {\n homePageWidgetDataRef,\n homePageLayoutComponentDataRef,\n HomePageLayoutBlueprint,\n HomePageWidgetBlueprint,\n type HomePageLayoutProps,\n} from '@backstage/plugin-home-react/alpha';\n\nconst rootRouteRef = createRouteRef();\n\nconst homePage = PageBlueprint.makeWithOverrides({\n inputs: {\n widgets: createExtensionInput([homePageWidgetDataRef]),\n layout: createExtensionInput([HomePageLayoutBlueprint.dataRefs.component], {\n singleton: true,\n optional: true,\n internal: true,\n }),\n },\n factory(originalFactory, { node, inputs }) {\n return originalFactory({\n path: '/home',\n noHeader: true,\n routeRef: rootRouteRef,\n loader: async () => {\n const LazyDefaultLayout = reactLazy(() =>\n import('./alpha/DefaultHomePageLayout').then(m => ({\n default: m.DefaultHomePageLayout,\n })),\n );\n\n const DefaultLayoutComponent = (props: HomePageLayoutProps) => (\n <ExtensionBoundary node={node}>\n <LazyDefaultLayout {...props} />\n </ExtensionBoundary>\n );\n\n const Layout =\n inputs.layout?.get(homePageLayoutComponentDataRef) ??\n DefaultLayoutComponent;\n\n const widgets = inputs.widgets.map(widget => ({\n ...widget.get(homePageWidgetDataRef),\n node: widget.node,\n }));\n\n return <Layout widgets={widgets} />;\n },\n });\n },\n});\n\nconst visitListenerAppRootElement = AppRootElementBlueprint.make({\n name: 'visit-listener',\n disabled: true,\n params: {\n element: <VisitListener />,\n },\n});\n\nconst visitsApi = ApiBlueprint.make({\n name: 'visits',\n disabled: true,\n params: defineParams =>\n defineParams({\n api: visitsApiRef,\n deps: {\n storageApi: storageApiRef,\n identityApi: identityApiRef,\n errorApi: errorApiRef,\n },\n factory: ({ storageApi, identityApi, errorApi }) => {\n // Smart fallback: use custom storage API if available, otherwise localStorage\n if (storageApi) {\n return VisitsStorageApi.create({ storageApi, identityApi });\n }\n return VisitsWebStorageApi.create({ identityApi, errorApi });\n },\n }),\n});\n\nconst homeNavItem = NavItemBlueprint.make({\n params: {\n title: 'Home',\n routeRef: rootRouteRef,\n icon: HomeIcon,\n },\n});\n\nconst homePageToolkitWidget = HomePageWidgetBlueprint.make({\n name: 'toolkit',\n params: {\n name: 'HomePageToolkit',\n title: 'Toolkit',\n components: () =>\n import('./homePageComponents/Toolkit').then(m => ({\n Content: m.Content,\n ContextProvider: m.ContextProvider,\n })),\n componentProps: {\n tools: [\n {\n url: 'https://backstage.io',\n label: 'Backstage Docs',\n icon: <HomeIcon />,\n },\n ],\n },\n },\n});\n\nconst homePageStarredEntitiesWidget = HomePageWidgetBlueprint.make({\n name: 'starred-entities',\n params: {\n name: 'HomePageStarredEntities',\n title: 'Your Starred Entities',\n components: () =>\n import('./homePageComponents/StarredEntities').then(m => ({\n Content: m.Content,\n })),\n },\n});\n\nconst homePageRandomJokeWidget = HomePageWidgetBlueprint.make({\n name: 'random-joke',\n params: {\n name: 'HomePageRandomJoke',\n title: 'Random Joke',\n description: 'Shows a random programming joke',\n components: () =>\n import('./homePageComponents/RandomJoke').then(m => ({\n Content: m.Content,\n Settings: m.Settings,\n Actions: m.Actions,\n ContextProvider: m.ContextProvider,\n })),\n layout: {\n height: { minRows: 4 },\n width: { minColumns: 3 },\n },\n settings: {\n schema: {\n title: 'Random Joke settings',\n type: 'object',\n properties: {\n defaultCategory: {\n title: 'Category',\n type: 'string',\n enum: ['any', 'programming', 'dad'],\n default: 'any',\n },\n },\n },\n },\n },\n});\n\n/**\n * Home plugin for the new frontend system.\n *\n * Provides core homepage functionality with optional visit tracking extensions.\n * Visit tracking extensions are disabled by default and can be enabled via app-config.yaml.\n *\n * @alpha\n */\nexport default createFrontendPlugin({\n pluginId: 'home',\n title: 'Home',\n icon: <HomeIcon />,\n info: { packageJson: () => import('../package.json') },\n extensions: [\n homePage,\n homeNavItem,\n visitsApi,\n visitListenerAppRootElement,\n homePageToolkitWidget,\n homePageStarredEntitiesWidget,\n homePageRandomJokeWidget,\n ],\n routes: {\n root: rootRouteRef,\n },\n});\n\nimport { homeTranslationRef as _homeTranslationRef } from './translation';\n\n/**\n * @alpha\n * @deprecated Import from `@backstage/plugin-home` instead.\n */\nexport const homeTranslationRef = _homeTranslationRef;\n"],"names":["reactLazy","_homeTranslationRef"],"mappings":";;;;;;;;;;;;;;AAmDA,MAAM,eAAe,cAAA,EAAe;AAEpC,MAAM,QAAA,GAAW,cAAc,iBAAA,CAAkB;AAAA,EAC/C,MAAA,EAAQ;AAAA,IACN,OAAA,EAAS,oBAAA,CAAqB,CAAC,qBAAqB,CAAC,CAAA;AAAA,IACrD,QAAQ,oBAAA,CAAqB,CAAC,uBAAA,CAAwB,QAAA,CAAS,SAAS,CAAA,EAAG;AAAA,MACzE,SAAA,EAAW,IAAA;AAAA,MACX,QAAA,EAAU,IAAA;AAAA,MACV,QAAA,EAAU;AAAA,KACX;AAAA,GACH;AAAA,EACA,OAAA,CAAQ,eAAA,EAAiB,EAAE,IAAA,EAAM,QAAO,EAAG;AACzC,IAAA,OAAO,eAAA,CAAgB;AAAA,MACrB,IAAA,EAAM,OAAA;AAAA,MACN,QAAA,EAAU,IAAA;AAAA,MACV,QAAA,EAAU,YAAA;AAAA,MACV,QAAQ,YAAY;AAClB,QAAA,MAAM,iBAAA,GAAoBA,IAAA;AAAA,UAAU,MAClC,OAAO,sCAA+B,CAAA,CAAE,KAAK,CAAA,CAAA,MAAM;AAAA,YACjD,SAAS,CAAA,CAAE;AAAA,WACb,CAAE;AAAA,SACJ;AAEA,QAAA,MAAM,sBAAA,GAAyB,CAAC,KAAA,qBA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@@
|
|
|
1
|
-
{"version":3,"file":"types.esm.js","sources":["../../../src/components/CustomHomepage/types.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CSSProperties, ReactElement, ReactNode } from 'react';\nimport { Layout } from 'react-grid-layout';\nimport { z } from 'zod';\nimport { RJSFSchema, UiSchema } from '@rjsf/utils';\n\nconst RSJFTypeSchema: z.ZodType<RJSFSchema> = z.any();\nconst RSJFTypeUiSchema: z.ZodType<UiSchema> = z.any();\nconst ReactElementSchema: z.ZodType<ReactElement> = z.any();\nconst LayoutSchema: z.ZodType<Layout> = z.any();\n\n/**\n * Breakpoint options for <CustomHomepageGridProps/>\n *\n * @public\n */\nexport type Breakpoint = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\n/**\n * Props customizing the <CustomHomepageGrid/> component.\n *\n * @public\n */\nexport type CustomHomepageGridProps = {\n /**\n * Children contain all widgets user can configure on their own homepage.\n */\n children?: ReactNode;\n /**\n * Default layout for the homepage before users have modified it.\n */\n config?: LayoutConfiguration[];\n /**\n * Title displayed in the header of the grid. If not provided, no title will be shown.\n */\n title?: string;\n /**\n * Height of grid row in pixels.\n * @defaultValue 60\n */\n rowHeight?: number;\n /**\n * Screen width in pixels for different breakpoints.\n * @defaultValue theme breakpoints\n */\n breakpoints?: Record<Breakpoint, number>;\n /**\n * Number of grid columns for different breakpoints.\n * @defaultValue \\{ lg: 12, md: 10, sm: 6, xs: 4, xxs: 2 \\}\n */\n cols?: Record<Breakpoint, number>;\n /**\n * Grid container padding (x, y) in pixels for all or specific breakpoints.\n * @defaultValue [0, 0]\n * @example [10, 10]\n * @example \\{ lg: [10, 10] \\}\n */\n containerPadding?: [number, number] | Record<Breakpoint, [number, number]>;\n /**\n * Grid container margin (x, y) in pixels for all or specific breakpoints.\n * @defaultValue [0, 0]\n * @example [10, 10]\n * @example \\{ lg: [10, 10] \\}\n */\n containerMargin?: [number, number] | Record<Breakpoint, [number, number]>;\n /**\n * Maximum number of rows user can have in the grid.\n * @defaultValue unlimited\n */\n maxRows?: number;\n /**\n * Custom style for grid.\n */\n style?: CSSProperties;\n /**\n * Compaction type of widgets in the grid. This controls where widgets are moved in case\n * they are overlapping in the grid.\n */\n compactType?: 'vertical' | 'horizontal' | null;\n /**\n * Controls if widgets can overlap in the grid. If true, grid can be placed one over the other.\n * @defaultValue false\n */\n allowOverlap?: boolean;\n /**\n * Controls if widgets can collide with each other. If true, grid items won't change position when being dragged over.\n * @defaultValue true\n */\n preventCollision?: boolean;\n};\n\nexport const LayoutConfigurationSchema = z.object({\n component: ReactElementSchema,\n x: z.number().nonnegative('x must be positive number'),\n y: z.number().nonnegative('y must be positive number'),\n width: z.number().positive('width must be positive number'),\n height: z.number().positive('height must be positive number'),\n movable: z.boolean().optional(),\n deletable: z.boolean().optional(),\n resizable: z.boolean().optional(),\n});\n\n/**\n * Layout configuration that can be passed to the custom home page.\n *\n * @public\n */\nexport type LayoutConfiguration = {\n component: ReactElement | string;\n x: number;\n y: number;\n width: number;\n height: number;\n movable?: boolean;\n deletable?: boolean;\n resizable?: boolean;\n};\n\nexport const WidgetSchema = z.object({\n name: z.string(),\n title: z.string().optional(),\n description: z.string().optional(),\n component: ReactElementSchema,\n width: z.number().positive('width must be positive number').optional(),\n height: z.number().positive('height must be positive number').optional(),\n minWidth: z.number().positive('minWidth must be positive number').optional(),\n maxWidth: z.number().positive('maxWidth must be positive number').optional(),\n minHeight: z\n .number()\n .positive('minHeight must be positive number')\n .optional(),\n maxHeight: z\n .number()\n .positive('maxHeight must be positive number')\n .optional(),\n settingsSchema: RSJFTypeSchema.optional(),\n uiSchema: RSJFTypeUiSchema.optional(),\n movable: z.boolean().optional(),\n deletable: z.boolean().optional(),\n resizable: z.boolean().optional(),\n});\n\nexport type Widget = z.infer<typeof WidgetSchema>;\n\nconst GridWidgetSchema = z.object({\n id: z.string(),\n layout: LayoutSchema,\n settings: z.record(z.string(), z.any()),\n movable: z.boolean().optional(),\n deletable: z.boolean().optional(),\n resizable: z.boolean().optional(),\n});\n\nexport type GridWidget = z.infer<typeof GridWidgetSchema>;\n\nexport const CustomHomepageGridStateV1Schema = z.object({\n version: z.literal(1),\n pages: z.record(z.string(), z.array(GridWidgetSchema)),\n});\n\nexport type CustomHomepageGridStateV1 = z.infer<\n typeof CustomHomepageGridStateV1Schema\n>;\n"],"names":[],"mappings":";;AAqBA,MAAM,cAAA,GAAwC,EAAE,GAAA,EAAI;AACpD,MAAM,gBAAA,GAAwC,EAAE,GAAA,EAAI;AACpD,MAAM,kBAAA,GAA8C,EAAE,GAAA,EAAI;AAC1D,MAAM,YAAA,GAAkC,EAAE,GAAA,EAAI;AAkFvC,MAAM,yBAAA,GAA4B,EAAE,MAAA,CAAO;AAAA,EAChD,SAAA,EAAW,kBAAA;AAAA,EACX,CAAA,EAAG,CAAA,CAAE,MAAA,EAAO,CAAE,YAAY,2BAA2B,CAAA;AAAA,EACrD,CAAA,EAAG,CAAA,CAAE,MAAA,EAAO,CAAE,YAAY,2BAA2B,CAAA;AAAA,EACrD,KAAA,EAAO,CAAA,CAAE,MAAA,EAAO,CAAE,SAAS,+BAA+B,CAAA;AAAA,EAC1D,MAAA,EAAQ,CAAA,CAAE,MAAA,EAAO,CAAE,SAAS,gCAAgC,CAAA;AAAA,EAC5D,OAAA,EAAS,CAAA,CAAE,OAAA,EAAQ,CAAE,QAAA,EAAS;AAAA,EAC9B,SAAA,EAAW,CAAA,CAAE,OAAA,EAAQ,CAAE,QAAA,EAAS;AAAA,EAChC,SAAA,EAAW,CAAA,CAAE,OAAA,EAAQ,C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,CAAA,CAAE,KAAK,CAAA;AAAA,EACtC,OAAA,EAAS,CAAA,CAAE,OAAA,EAAQ,CAAE,QAAA,EAAS;AAAA,EAC9B,SAAA,EAAW,CAAA,CAAE,OAAA,EAAQ,CAAE,QAAA,EAAS;AAAA,EAChC,SAAA,EAAW,CAAA,CAAE,OAAA,EAAQ,CAAE,QAAA;AACzB,CAAC,CAAA;AAIM,MAAM,+BAAA,GAAkC,EAAE,MAAA,CAAO;AAAA,EACtD,OAAA,EAAS,CAAA,CAAE,OAAA,CAAQ,CAAC,CAAA;AAAA,EACpB,KAAA,EAAO,EAAE,MAAA,CAAO,CAAA,CAAE,QAAO,EAAG,CAAA,CAAE,KAAA,CAAM,gBAAgB,CAAC;AACvD,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"types.esm.js","sources":["../../../src/components/CustomHomepage/types.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CSSProperties, ReactElement, ReactNode } from 'react';\nimport { Layout } from 'react-grid-layout';\nimport { z } from 'zod/v3';\nimport { RJSFSchema, UiSchema } from '@rjsf/utils';\n\nconst RSJFTypeSchema: z.ZodType<RJSFSchema> = z.any();\nconst RSJFTypeUiSchema: z.ZodType<UiSchema> = z.any();\nconst ReactElementSchema: z.ZodType<ReactElement> = z.any();\nconst LayoutSchema: z.ZodType<Layout> = z.any();\n\n/**\n * Breakpoint options for <CustomHomepageGridProps/>\n *\n * @public\n */\nexport type Breakpoint = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\n/**\n * Props customizing the <CustomHomepageGrid/> component.\n *\n * @public\n */\nexport type CustomHomepageGridProps = {\n /**\n * Children contain all widgets user can configure on their own homepage.\n */\n children?: ReactNode;\n /**\n * Default layout for the homepage before users have modified it.\n */\n config?: LayoutConfiguration[];\n /**\n * Title displayed in the header of the grid. If not provided, no title will be shown.\n */\n title?: string;\n /**\n * Height of grid row in pixels.\n * @defaultValue 60\n */\n rowHeight?: number;\n /**\n * Screen width in pixels for different breakpoints.\n * @defaultValue theme breakpoints\n */\n breakpoints?: Record<Breakpoint, number>;\n /**\n * Number of grid columns for different breakpoints.\n * @defaultValue \\{ lg: 12, md: 10, sm: 6, xs: 4, xxs: 2 \\}\n */\n cols?: Record<Breakpoint, number>;\n /**\n * Grid container padding (x, y) in pixels for all or specific breakpoints.\n * @defaultValue [0, 0]\n * @example [10, 10]\n * @example \\{ lg: [10, 10] \\}\n */\n containerPadding?: [number, number] | Record<Breakpoint, [number, number]>;\n /**\n * Grid container margin (x, y) in pixels for all or specific breakpoints.\n * @defaultValue [0, 0]\n * @example [10, 10]\n * @example \\{ lg: [10, 10] \\}\n */\n containerMargin?: [number, number] | Record<Breakpoint, [number, number]>;\n /**\n * Maximum number of rows user can have in the grid.\n * @defaultValue unlimited\n */\n maxRows?: number;\n /**\n * Custom style for grid.\n */\n style?: CSSProperties;\n /**\n * Compaction type of widgets in the grid. This controls where widgets are moved in case\n * they are overlapping in the grid.\n */\n compactType?: 'vertical' | 'horizontal' | null;\n /**\n * Controls if widgets can overlap in the grid. If true, grid can be placed one over the other.\n * @defaultValue false\n */\n allowOverlap?: boolean;\n /**\n * Controls if widgets can collide with each other. If true, grid items won't change position when being dragged over.\n * @defaultValue true\n */\n preventCollision?: boolean;\n};\n\nexport const LayoutConfigurationSchema = z.object({\n component: ReactElementSchema,\n x: z.number().nonnegative('x must be positive number'),\n y: z.number().nonnegative('y must be positive number'),\n width: z.number().positive('width must be positive number'),\n height: z.number().positive('height must be positive number'),\n movable: z.boolean().optional(),\n deletable: z.boolean().optional(),\n resizable: z.boolean().optional(),\n});\n\n/**\n * Layout configuration that can be passed to the custom home page.\n *\n * @public\n */\nexport type LayoutConfiguration = {\n component: ReactElement | string;\n x: number;\n y: number;\n width: number;\n height: number;\n movable?: boolean;\n deletable?: boolean;\n resizable?: boolean;\n};\n\nexport const WidgetSchema = z.object({\n name: z.string(),\n title: z.string().optional(),\n description: z.string().optional(),\n component: ReactElementSchema,\n width: z.number().positive('width must be positive number').optional(),\n height: z.number().positive('height must be positive number').optional(),\n minWidth: z.number().positive('minWidth must be positive number').optional(),\n maxWidth: z.number().positive('maxWidth must be positive number').optional(),\n minHeight: z\n .number()\n .positive('minHeight must be positive number')\n .optional(),\n maxHeight: z\n .number()\n .positive('maxHeight must be positive number')\n .optional(),\n settingsSchema: RSJFTypeSchema.optional(),\n uiSchema: RSJFTypeUiSchema.optional(),\n movable: z.boolean().optional(),\n deletable: z.boolean().optional(),\n resizable: z.boolean().optional(),\n});\n\nexport type Widget = z.infer<typeof WidgetSchema>;\n\nconst GridWidgetSchema = z.object({\n id: z.string(),\n layout: LayoutSchema,\n settings: z.record(z.string(), z.any()),\n movable: z.boolean().optional(),\n deletable: z.boolean().optional(),\n resizable: z.boolean().optional(),\n});\n\nexport type GridWidget = z.infer<typeof GridWidgetSchema>;\n\nexport const CustomHomepageGridStateV1Schema = z.object({\n version: z.literal(1),\n pages: z.record(z.string(), z.array(GridWidgetSchema)),\n});\n\nexport type CustomHomepageGridStateV1 = z.infer<\n typeof CustomHomepageGridStateV1Schema\n>;\n"],"names":[],"mappings":";;AAqBA,MAAM,cAAA,GAAwC,EAAE,GAAA,EAAI;AACpD,MAAM,gBAAA,GAAwC,EAAE,GAAA,EAAI;AACpD,MAAM,kBAAA,GAA8C,EAAE,GAAA,EAAI;AAC1D,MAAM,YAAA,GAAkC,EAAE,GAAA,EAAI;AAkFvC,MAAM,yBAAA,GAA4B,EAAE,MAAA,CAAO;AAAA,EAChD,SAAA,EAAW,kBAAA;AAAA,EACX,CAAA,EA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Z,cAAA,EAAgB,eAAe,QAAA,EAAS;AAAA,EACxC,QAAA,EAAU,iBAAiB,QAAA,EAAS;AAAA,EACpC,OAAA,EAAS,CAAA,CAAE,OAAA,EAAQ,CAAE,QAAA,EAAS;AAAA,EAC9B,SAAA,EAAW,CAAA,CAAE,OAAA,EAAQ,CAAE,QAAA,EAAS;AAAA,EAChC,SAAA,EAAW,CAAA,CAAE,OAAA,EAAQ,CAAE,QAAA;AACzB,CAAC;AAID,MAAM,gBAAA,GAAmB,EAAE,MAAA,CAAO;AAAA,EAChC,EAAA,EAAI,EAAE,MAAA,EAAO;AAAA,EACb,MAAA,EAAQ,YAAA;AAAA,EACR,QAAA,EAAU,EAAE,MAAA,CAAO,CAAA,CAAE,QAAO,EAAG,CAAA,CAAE,KAAK,CAAA;AAAA,EACtC,OAAA,EAAS,CAAA,CAAE,OAAA,EAAQ,CAAE,QAAA,EAAS;AAAA,EAC9B,SAAA,EAAW,CAAA,CAAE,OAAA,EAAQ,CAAE,QAAA,EAAS;AAAA,EAChC,SAAA,EAAW,CAAA,CAAE,OAAA,EAAQ,CAAE,QAAA;AACzB,CAAC,CAAA;AAIM,MAAM,+BAAA,GAAkC,EAAE,MAAA,CAAO;AAAA,EACtD,OAAA,EAAS,CAAA,CAAE,OAAA,CAAQ,CAAC,CAAA;AAAA,EACpB,KAAA,EAAO,EAAE,MAAA,CAAO,CAAA,CAAE,QAAO,EAAG,CAAA,CAAE,KAAA,CAAM,gBAAgB,CAAC;AACvD,CAAC;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -618,5 +618,40 @@ declare const SettingsModal: (props: {
|
|
|
618
618
|
children: JSX.Element;
|
|
619
619
|
}) => react_jsx_runtime.JSX.Element;
|
|
620
620
|
|
|
621
|
-
|
|
621
|
+
/**
|
|
622
|
+
* Translation reference for the home plugin.
|
|
623
|
+
* Contains localized text strings for home page components and widgets.
|
|
624
|
+
*
|
|
625
|
+
* @public
|
|
626
|
+
*/
|
|
627
|
+
declare const homeTranslationRef: _backstage_frontend_plugin_api.TranslationRef<"home", {
|
|
628
|
+
readonly "starredEntities.noStarredEntitiesMessage": "Click the star beside an entity name to add it to this list!";
|
|
629
|
+
readonly "addWidgetDialog.title": "Add new widget to dashboard";
|
|
630
|
+
readonly "customHomepageButtons.cancel": "Cancel";
|
|
631
|
+
readonly "customHomepageButtons.clearAll": "Clear all";
|
|
632
|
+
readonly "customHomepageButtons.edit": "Edit";
|
|
633
|
+
readonly "customHomepageButtons.restoreDefaults": "Restore defaults";
|
|
634
|
+
readonly "customHomepageButtons.addWidget": "Add widget";
|
|
635
|
+
readonly "customHomepageButtons.save": "Save";
|
|
636
|
+
readonly "customHomepage.noWidgets": "No widgets added. Start by clicking the 'Add widget' button.";
|
|
637
|
+
readonly "widgetSettingsOverlay.cancelButtonTitle": "Cancel";
|
|
638
|
+
readonly "widgetSettingsOverlay.editSettingsTooptip": "Edit settings";
|
|
639
|
+
readonly "widgetSettingsOverlay.deleteWidgetTooltip": "Delete widget";
|
|
640
|
+
readonly "widgetSettingsOverlay.submitButtonTitle": "Submit";
|
|
641
|
+
readonly "starredEntityListItem.removeFavoriteEntityTitle": "Remove entity from favorites";
|
|
642
|
+
readonly "visitList.empty.title": "There are no visits to show yet.";
|
|
643
|
+
readonly "visitList.empty.description": "Once you start using Backstage, your visits will appear here as a quick link to carry on where you left off.";
|
|
644
|
+
readonly "visitList.few.title": "The more pages you visit, the more pages will appear here.";
|
|
645
|
+
readonly "quickStart.title": "Onboarding";
|
|
646
|
+
readonly "quickStart.description": "Get started with Backstage";
|
|
647
|
+
readonly "quickStart.learnMoreLinkTitle": "Learn more";
|
|
648
|
+
readonly "visitedByType.action.viewMore": "View more";
|
|
649
|
+
readonly "visitedByType.action.viewLess": "View less";
|
|
650
|
+
readonly "featuredDocsCard.empty.title": "No documents to show";
|
|
651
|
+
readonly "featuredDocsCard.empty.description": "Create your own document. Check out our Getting Started Information";
|
|
652
|
+
readonly "featuredDocsCard.empty.learnMoreLinkTitle": "DOCS";
|
|
653
|
+
readonly "featuredDocsCard.learnMoreTitle": "LEARN MORE";
|
|
654
|
+
}>;
|
|
655
|
+
|
|
656
|
+
export { ComponentAccordion, ComponentTab, ComponentTabs, CustomHomepageGrid, FeaturedDocsCard, HeaderWorldClock, HomePageCompanyLogo, HomePageRandomJoke, HomePageRecentlyVisited, HomePageStarredEntities, HomePageToolkit, HomePageTopVisited, HomepageCompositionRoot, QuickStartCard, SettingsModal, TemplateBackstageLogo, TemplateBackstageLogoIcon, VisitDisplayProvider, VisitListener, VisitsStorageApi, VisitsWebStorageApi, WelcomeTitle, createCardExtension, homePlugin, homeTranslationRef, isOperator, useVisitDisplay, visitsApiRef };
|
|
622
657
|
export type { Breakpoint, CardConfig, CardExtensionProps, CardLayout, CardSettings, ClockConfig, ComponentParts, ComponentRenderer, CustomHomepageGridProps, FeaturedDocsCardProps, GetChipColorFunction, GetLabelFunction, LayoutConfiguration, Operators, QuickStartCardProps, RendererProps, StarredEntitiesProps, Tool, ToolkitContentProps, Visit, VisitDisplayContextValue, VisitDisplayProviderProps, VisitInput, VisitedByTypeKind, VisitedByTypeProps, VisitsApi, VisitsApiQueryParams, VisitsApiSaveParams, VisitsStorageApiOptions, VisitsWebStorageApiOptions, WelcomeTitleLanguageProps };
|
package/dist/index.esm.js
CHANGED
|
@@ -10,4 +10,5 @@ export { SettingsModal, createCardExtension } from './deprecated.esm.js';
|
|
|
10
10
|
export { VisitsStorageApi } from './api/VisitsStorageApi.esm.js';
|
|
11
11
|
export { VisitsWebStorageApi } from './api/VisitsWebStorageApi.esm.js';
|
|
12
12
|
export { isOperator, visitsApiRef } from './api/VisitsApi.esm.js';
|
|
13
|
+
export { homeTranslationRef } from './translation.esm.js';
|
|
13
14
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
package/dist/package.json.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var name = "@backstage/plugin-home";
|
|
2
|
-
var version = "0.9.3
|
|
2
|
+
var version = "0.9.3";
|
|
3
3
|
var description = "A Backstage plugin that helps you build a home page";
|
|
4
4
|
var backstage = {
|
|
5
5
|
role: "frontend-plugin",
|
|
@@ -78,7 +78,7 @@ var dependencies = {
|
|
|
78
78
|
"react-grid-layout": "1.3.4",
|
|
79
79
|
"react-resizable": "^3.0.4",
|
|
80
80
|
"react-use": "^17.2.4",
|
|
81
|
-
zod: "^3.25.76"
|
|
81
|
+
zod: "^3.25.76 || ^4.0.0"
|
|
82
82
|
};
|
|
83
83
|
var devDependencies = {
|
|
84
84
|
"@backstage/cli": "workspace:^",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation.esm.js","sources":["../src/translation.ts"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createTranslationRef } from '@backstage/frontend-plugin-api';\n\n/**\n * Translation reference for the home plugin.\n * Contains localized text strings for home page components and widgets.\n *\n * @
|
|
1
|
+
{"version":3,"file":"translation.esm.js","sources":["../src/translation.ts"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createTranslationRef } from '@backstage/frontend-plugin-api';\n\n/**\n * Translation reference for the home plugin.\n * Contains localized text strings for home page components and widgets.\n *\n * @public\n */\nexport const homeTranslationRef = createTranslationRef({\n id: 'home',\n messages: {\n addWidgetDialog: {\n title: 'Add new widget to dashboard',\n },\n customHomepageButtons: {\n edit: 'Edit',\n restoreDefaults: 'Restore defaults',\n clearAll: 'Clear all',\n addWidget: 'Add widget',\n save: 'Save',\n cancel: 'Cancel',\n },\n customHomepage: {\n noWidgets: \"No widgets added. Start by clicking the 'Add widget' button.\",\n },\n widgetSettingsOverlay: {\n editSettingsTooptip: 'Edit settings',\n deleteWidgetTooltip: 'Delete widget',\n submitButtonTitle: 'Submit',\n cancelButtonTitle: 'Cancel',\n },\n starredEntityListItem: {\n removeFavoriteEntityTitle: 'Remove entity from favorites',\n },\n visitList: {\n empty: {\n title: 'There are no visits to show yet.',\n description:\n 'Once you start using Backstage, your visits will appear here as a quick link to carry on where you left off.',\n },\n few: {\n title: 'The more pages you visit, the more pages will appear here.',\n },\n },\n quickStart: {\n title: 'Onboarding',\n description: 'Get started with Backstage',\n learnMoreLinkTitle: 'Learn more',\n },\n starredEntities: {\n noStarredEntitiesMessage:\n 'Click the star beside an entity name to add it to this list!',\n },\n visitedByType: {\n action: {\n viewMore: 'View more',\n viewLess: 'View less',\n },\n },\n featuredDocsCard: {\n learnMoreTitle: 'LEARN MORE',\n empty: {\n title: 'No documents to show',\n description:\n 'Create your own document. Check out our Getting Started Information',\n learnMoreLinkTitle: 'DOCS',\n },\n },\n },\n});\n"],"names":[],"mappings":";;AAuBO,MAAM,qBAAqB,oBAAA,CAAqB;AAAA,EACrD,EAAA,EAAI,MAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,eAAA,EAAiB;AAAA,MACf,KAAA,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|
|
2
2
|
"name": "@backstage/plugin-home",
|
|
3
|
-
"version": "0.9.3
|
|
3
|
+
"version": "0.9.3",
|
|
4
4
|
"description": "A Backstage plugin that helps you build a home page",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "frontend-plugin",
|
|
@@ -68,17 +68,17 @@
|
|
|
68
68
|
"test": "backstage-cli package test"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@backstage/catalog-client": "1.14.0
|
|
72
|
-
"@backstage/catalog-model": "1.7.
|
|
73
|
-
"@backstage/config": "1.3.6",
|
|
74
|
-
"@backstage/core-app-api": "1.19.6
|
|
75
|
-
"@backstage/core-compat-api": "0.5.9
|
|
76
|
-
"@backstage/core-components": "0.18.8
|
|
77
|
-
"@backstage/core-plugin-api": "1.12.4
|
|
78
|
-
"@backstage/frontend-plugin-api": "0.15.0
|
|
79
|
-
"@backstage/plugin-catalog-react": "2.1.0
|
|
80
|
-
"@backstage/plugin-home-react": "0.1.36
|
|
81
|
-
"@backstage/theme": "0.7.2",
|
|
71
|
+
"@backstage/catalog-client": "^1.14.0",
|
|
72
|
+
"@backstage/catalog-model": "^1.7.7",
|
|
73
|
+
"@backstage/config": "^1.3.6",
|
|
74
|
+
"@backstage/core-app-api": "^1.19.6",
|
|
75
|
+
"@backstage/core-compat-api": "^0.5.9",
|
|
76
|
+
"@backstage/core-components": "^0.18.8",
|
|
77
|
+
"@backstage/core-plugin-api": "^1.12.4",
|
|
78
|
+
"@backstage/frontend-plugin-api": "^0.15.0",
|
|
79
|
+
"@backstage/plugin-catalog-react": "^2.1.0",
|
|
80
|
+
"@backstage/plugin-home-react": "^0.1.36",
|
|
81
|
+
"@backstage/theme": "^0.7.2",
|
|
82
82
|
"@material-ui/core": "^4.12.2",
|
|
83
83
|
"@material-ui/icons": "^4.9.1",
|
|
84
84
|
"@material-ui/lab": "4.0.0-alpha.61",
|
|
@@ -91,14 +91,14 @@
|
|
|
91
91
|
"react-grid-layout": "1.3.4",
|
|
92
92
|
"react-resizable": "^3.0.4",
|
|
93
93
|
"react-use": "^17.2.4",
|
|
94
|
-
"zod": "^3.25.76"
|
|
94
|
+
"zod": "^3.25.76 || ^4.0.0"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
|
-
"@backstage/cli": "0.36.0
|
|
98
|
-
"@backstage/dev-utils": "1.1.21
|
|
99
|
-
"@backstage/frontend-defaults": "0.5.0
|
|
100
|
-
"@backstage/plugin-catalog": "2.0.0
|
|
101
|
-
"@backstage/test-utils": "1.7.16
|
|
97
|
+
"@backstage/cli": "^0.36.0",
|
|
98
|
+
"@backstage/dev-utils": "^1.1.21",
|
|
99
|
+
"@backstage/frontend-defaults": "^0.5.0",
|
|
100
|
+
"@backstage/plugin-catalog": "^2.0.0",
|
|
101
|
+
"@backstage/test-utils": "^1.7.16",
|
|
102
102
|
"@testing-library/dom": "^10.0.0",
|
|
103
103
|
"@testing-library/jest-dom": "^6.0.0",
|
|
104
104
|
"@testing-library/react": "^16.0.0",
|