Skip to content

Commit a7746a5

Browse files
committed
bring example into docs
1 parent d9a339a commit a7746a5

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

special-pages/pages/new-tab/app/new-tab.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ children:
1616
### `initialSetup`
1717
- {@link "NewTab Messages".InitialSetupRequest}
1818
- Returns {@link "NewTab Messages".InitialSetupResponse}
19-
- See the `initialSetupResponse` section of [example of initial data](../messages/examples/widgets.js)
2019
- See also
2120
- [Widget Config](./widget-list/widget-config.md) for the initial page widgets
2221
- [Update Notification](./update-notification/update-notification.md) for the optional data
2322
- [Customizer Drawer Feature Flags](./customizer/customizer.md) for optional feature flags like the customizer drawer
2423
about release notes (windows only).
2524

25+
{@includeCode ../messages/examples/widgets.js#initialSetupResponse}
26+
2627
## Notifications
2728

2829
### `contextMenu`

special-pages/pages/new-tab/messages/examples/widgets.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,20 @@ const widgetConfig = {
2424
visibility: 'visible',
2525
};
2626

27+
// #region initialSetupResponse
2728
/**
28-
* Widgets + WidgetConfigs when delivered in first payload...
29+
* Example of the `InitialSetupResponse`
2930
*
3031
* @type {import("../../types/new-tab.js").InitialSetupResponse}
3132
*/
33+
// prettier-ignore
3234
const initialSetupResponse = {
33-
widgets: [{ id: 'updateNotification' }, { id: 'rmf' }, { id: 'favorites' }, { id: 'privacyStats' }],
35+
widgets: [
36+
{ id: 'updateNotification' },
37+
{ id: 'rmf' },
38+
{ id: 'favorites' },
39+
{ id: 'privacyStats' }
40+
],
3441
widgetConfigs: [
3542
{ id: 'rmf', visibility: 'visible' },
3643
{ id: 'nextSteps', visibility: 'visible' },
@@ -42,6 +49,12 @@ const initialSetupResponse = {
4249
platform: { name: 'windows' },
4350
updateNotification: { content: null },
4451
customizer: { theme: 'system', userImages: [], userColor: null, background: { kind: 'default' } },
52+
defaultStyles: {
53+
lightBackgroundColor: '#E9EBEC',
54+
darkBackgroundColor: '#27282A',
55+
},
4556
};
4657

58+
// #endregion initialSetupResponse
59+
4760
export {};

0 commit comments

Comments
 (0)