Skip to content

Commit 464da2c

Browse files
authored
ntp: updated docs to support deeplinks (#1420)
1 parent d7104df commit 464da2c

File tree

8 files changed

+336
-289
lines changed

8 files changed

+336
-289
lines changed

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

+112-102
Original file line numberDiff line numberDiff line change
@@ -59,115 +59,125 @@ title: Customizer
5959

6060
## Subscriptions
6161

62-
- {@link "NewTab Messages".CustomizerOnBackgroundUpdateSubscription `customizer_onBackgroundUpdate`}.
63-
- Sends {@link "NewTab Messages".BackgroundData} whenever needed.
64-
- For example:
65-
- ```json
66-
{
67-
"background": { "kind": "color", "value": "color01" }
68-
}
69-
```
70-
- ```json
71-
{
72-
"background": { "kind": "gradient", "value": "gradient01" }
73-
}
74-
```
75-
- ```json
76-
{
77-
"background": { "kind": "hex", "value": "#cacaca" }
78-
}
79-
```
80-
- ```json
81-
{
82-
"background": { "kind": "default" }
83-
}
84-
```
85-
- ```json
86-
{
87-
"background": {
88-
"kind": "userImage",
89-
"value": { "id": "abc", "src": "...", "thumb": "...", "colorScheme": "light" }
90-
}
91-
}
92-
```
62+
### `customizer_onBackgroundUpdate`
63+
- {@link "NewTab Messages".CustomizerOnBackgroundUpdateSubscription}
64+
- Sends {@link "NewTab Messages".BackgroundData} whenever needed.
65+
- For example:
66+
```json
67+
{
68+
"background": { "kind": "color", "value": "color01" }
69+
}
70+
```
71+
```json
72+
{
73+
"background": { "kind": "gradient", "value": "gradient01" }
74+
}
75+
```
76+
```json
77+
{
78+
"background": { "kind": "hex", "value": "#cacaca" }
79+
}
80+
```
81+
```json
82+
{
83+
"background": { "kind": "default" }
84+
}
85+
```
86+
```json
87+
{
88+
"background": {
89+
"kind": "userImage",
90+
"value": { "id": "abc", "src": "...", "thumb": "...", "colorScheme": "light" }
91+
}
92+
}
93+
```
9394
94-
- {@link "NewTab Messages".CustomizerOnImagesUpdateSubscription `customizer_onImagesUpdate`}.
95-
- Sends {@link "NewTab Messages".UserImageData} whenever needed.
96-
- For example, this would be pushed into the page following a successful upload
97-
- Note: In that situation, you'd send this followed by `customizer_onBackgroundUpdate` above
98-
- For example:
99-
- ```json
100-
{
101-
"userImages": [{"id": "abc", "src": "...", "thumb": "...", "colorScheme": "light" }]
102-
}
103-
```
95+
### `customizer_onImagesUpdate`
96+
- {@link "NewTab Messages".CustomizerOnImagesUpdateSubscription}.
97+
- Sends {@link "NewTab Messages".UserImageData} whenever needed.
98+
- For example, this would be pushed into the page following a successful upload
99+
- Note: In that situation, you'd send this followed by `customizer_onBackgroundUpdate` above
100+
- For example:
101+
```json
102+
{
103+
"userImages": [{"id": "abc", "src": "...", "thumb": "...", "colorScheme": "light" }]
104+
}
105+
```
104106
105-
- {@link "NewTab Messages".CustomizerOnColorUpdateSubscription `customizer_onColorUpdate`}.
106-
- Sends {@link "NewTab Messages".UserColorData} whenever needed.
107-
- For example:
108-
- ```json
109-
{
110-
"userColor": { "kind": "hex", "value": "#cacaca" }
111-
}
112-
```
113-
or:
114-
- ```json
115-
{
116-
"userColor": null
117-
}
118-
```
107+
### `customizer_onColorUpdate`
108+
- {@link "NewTab Messages".CustomizerOnColorUpdateSubscription}.
109+
- Sends {@link "NewTab Messages".UserColorData} whenever needed.
110+
- For example:
111+
```json
112+
{
113+
"userColor": { "kind": "hex", "value": "#cacaca" }
114+
}
115+
```
116+
or:
117+
```json
118+
{
119+
"userColor": null
120+
}
121+
```
119122
120-
- {@link "NewTab Messages".CustomizerOnThemeUpdateSubscription `customizer_onThemeUpdate`}.
121-
- Sends {@link "NewTab Messages".ThemeData} whenever needed.
122-
- For example:
123-
- ```json
124-
{
125-
"theme": "system"
126-
}
127-
```
123+
### `customizer_onThemeUpdate`
124+
- {@link "NewTab Messages".CustomizerOnThemeUpdateSubscription}.
125+
- Sends {@link "NewTab Messages".ThemeData} whenever needed.
126+
- For example:
127+
```json
128+
{
129+
"theme": "system"
130+
}
131+
```
128132

129-
- {@link "NewTab Messages".CustomizerAutoOpenSubscription `customizer_autoOpen`}.
130-
- Send this into the page to trigger the customizer to be opened.
133+
### `customizer_autoOpen`
134+
- {@link "NewTab Messages".CustomizerAutoOpenSubscription}.
135+
- Send this into the page to trigger the customizer to be opened.
131136

132137
## Notifications
133138

134-
- {@link "NewTab Messages".CustomizerSetBackgroundNotification `customizer_setBackground`}.
135-
- Sends {@link "NewTab Messages".CustomizerSetBackgroundNotify} whenever needed.
136-
- For example:
137-
- ```json
138-
{
139-
"background": { "kind": "color", "value": "color01" }
140-
}
141-
```
142-
143-
- {@link "NewTab Messages".CustomizerSetThemeNotification `customizer_setTheme`}.
144-
- Sends {@link "NewTab Messages".CustomizerSetBackgroundNotify} whenever needed.
145-
- For example:
146-
- ```json
147-
{
148-
"theme": "light"
149-
}
150-
```
139+
### `customizer_setBackground`
140+
- {@link "NewTab Messages".CustomizerSetBackgroundNotification}.
141+
- Sends {@link "NewTab Messages".CustomizerSetBackgroundNotify} whenever needed.
142+
- For example:
143+
```json
144+
{
145+
"background": { "kind": "color", "value": "color01" }
146+
}
147+
```
151148

152-
- {@link "NewTab Messages".CustomizerUploadNotification `customizer_upload`}.
153-
- Sent to trigger a file upload
149+
### `customizer_setTheme`
150+
- {@link "NewTab Messages".CustomizerSetThemeNotification}.
151+
- Sends {@link "NewTab Messages".CustomizerSetBackgroundNotify} whenever needed.
152+
- For example:
153+
```json
154+
{
155+
"theme": "light"
156+
}
157+
```
158+
159+
### `customizer_upload`
160+
- {@link "NewTab Messages".CustomizerUploadNotification}.
161+
- Sent to trigger a file upload
154162

155-
- {@link "NewTab Messages".CustomizerDeleteImageNotification `customizer_deleteImage`}.
156-
- Sends {@link "NewTab Messages".CustomizerDeleteImageNotify} whenever needed.
157-
- For example:
158-
- ```json
159-
{
160-
"id": "abc"
161-
}
162-
```
163+
### `customizer_deleteImage`
164+
- {@link "NewTab Messages".CustomizerDeleteImageNotification}.
165+
- Sends {@link "NewTab Messages".CustomizerDeleteImageNotify} whenever needed.
166+
- For example:
167+
```json
168+
{
169+
"id": "abc"
170+
}
171+
```
163172

164-
- {@link "NewTab Messages".CustomizerContextMenuNotification `customizer_contextMenu`}.
165-
- Sends {@link "NewTab Messages".UserImageContextMenu}
166-
- Note: only sent for right-clicks on user images in the selection screen.
167-
- For example:
168-
- ```json
169-
{
170-
"target": "userImage",
171-
"id": "01"
172-
}
173-
```
173+
### `customizer_contextMenu`
174+
- {@link "NewTab Messages".CustomizerContextMenuNotification}.
175+
- Sends {@link "NewTab Messages".UserImageContextMenu}
176+
- Note: only sent for right-clicks on user images in the selection screen.
177+
- For example:
178+
```json
179+
{
180+
"target": "userImage",
181+
"id": "01"
182+
}
183+
```

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

+64-56
Original file line numberDiff line numberDiff line change
@@ -19,70 +19,78 @@ There are three representations of a favicon: image source, letters, or fallback
1919
- if the favicon image source is absent, or it fails to load (404), we'll then try to use 'letters'
2020
- if the `etldPlusOne` field is `null` though, we won't use any letters, and we'll load a default globe icon instead
2121

22-
# Messages
23-
2422
## Requests:
2523

26-
- {@link "NewTab Messages".FavoritesGetDataRequest `favorites_getData`}
27-
- Used to fetch the initial data (during the first render)
28-
- returns {@link "NewTab Messages".FavoritesData}
29-
- {@link "NewTab Messages".FavoritesGetDataRequest `favorites_getConfig`}
30-
- Used to fetch the initial data (during the first render)
31-
- returns {@link "NewTab Messages".FavoritesConfig}
24+
### `favorites_getData`
25+
- {@link "NewTab Messages".FavoritesGetDataRequest}
26+
- Used to fetch the initial data (during the first render)
27+
- returns {@link "NewTab Messages".FavoritesData}
3228

29+
### `favorites_getConfig`
30+
- {@link "NewTab Messages".FavoritesGetDataRequest}
31+
- Used to fetch the initial data (during the first render)
32+
- returns {@link "NewTab Messages".FavoritesConfig}
3333

3434
## Subscriptions:
3535

36-
- {@link "NewTab Messages".FavoritesOnDataUpdateSubscription `favorites_onDataUpdate`}.
37-
- The tracker/company data used in the feed.
38-
- returns {@link "NewTab Messages".FavoritesData}
39-
- {@link "NewTab Messages".FavoritesOnConfigUpdateSubscription `favorites_onConfigUpdate`}.
40-
- The widget config
41-
- returns {@link "NewTab Messages".FavoritesConfig}
36+
### `favorites_onDataUpdate`
37+
- {@link "NewTab Messages".FavoritesOnDataUpdateSubscription}.
38+
- The tracker/company data used in the feed.
39+
- returns {@link "NewTab Messages".FavoritesData}
40+
41+
### `favorites_onConfigUpdate`
42+
- {@link "NewTab Messages".FavoritesOnConfigUpdateSubscription}.
43+
- The widget config
44+
- returns {@link "NewTab Messages".FavoritesConfig}
4245

4346

4447
## Notifications:
4548

46-
- {@link "NewTab Messages".FavoritesSetConfigNotification `favorites_setConfig`}
47-
- Sent when the user toggles the expansion of the favorites
48-
- Sends {@link "NewTab Messages".FavoritesConfig}
49-
- Example payload:
50-
```json
51-
{
52-
"expansion": "collapsed"
53-
}
54-
```
55-
- {@link "NewTab Messages".FavoritesMoveNotification `favorites_move`}
56-
- Sends {@link "NewTab Messages".FavoritesMoveAction}
57-
- When you receive this message, apply the following
58-
- Search your collection to find the object with the given `id`.
59-
- Remove that object from its current position.
60-
- Insert it into the new position specified by `targetIndex`.
61-
- Example payload:
62-
```json
63-
{
64-
"id": "abc",
65-
"targetIndex": 1
66-
}
67-
```
49+
### `favorites_setConfig`
50+
- {@link "NewTab Messages".FavoritesSetConfigNotification}
51+
- Sent when the user toggles the expansion of the favorites
52+
- Sends {@link "NewTab Messages".FavoritesConfig}
53+
- Example payload:
54+
```json
55+
{
56+
"expansion": "collapsed"
57+
}
58+
```
59+
60+
### `favorites_move`
61+
- {@link "NewTab Messages".FavoritesMoveNotification}
62+
- Sends {@link "NewTab Messages".FavoritesMoveAction}
63+
- When you receive this message, apply the following
64+
- Search your collection to find the object with the given `id`.
65+
- Remove that object from its current position.
66+
- Insert it into the new position specified by `targetIndex`.
67+
- Example payload:
68+
```json
69+
{
70+
"id": "abc",
71+
"targetIndex": 1
72+
}
73+
```
6874
69-
- {@link "NewTab Messages".FavoritesOpenContextMenuNotification `favorites_openContextMenu`}
70-
- Sends {@link "NewTab Messages".FavoritesOpenContextMenuAction}
71-
- When you receive this message, show the context menu for the entity
72-
- Example payload:
73-
```json
74-
{
75-
"id": "abc"
76-
}
77-
```
78-
79-
- {@link "NewTab Messages".FavoritesOpenNotification `favorites_open`}
80-
- Sends {@link "NewTab Messages".FavoritesOpenNotification}
81-
- When you receive this message, open the favorite in the given target
82-
- Example payload:
83-
```json
84-
{
85-
"id": "abc",
86-
"target": "same-tab"
87-
}
88-
```
75+
### `favorites_openContextMenu`
76+
- {@link "NewTab Messages".FavoritesOpenContextMenuNotification}
77+
- Sends {@link "NewTab Messages".FavoritesOpenContextMenuAction}
78+
- When you receive this message, show the context menu for the entity
79+
- Example payload:
80+
```json
81+
{
82+
"id": "abc"
83+
}
84+
```
85+
86+
### `favorites_open`
87+
- {@link "NewTab Messages".FavoritesOpenNotification}
88+
- Sends {@link "NewTab Messages".FavoritesOpenNotification}
89+
- When you receive this message, open the favorite in the given target
90+
- Example payload:
91+
```json
92+
{
93+
"id": "abc",
94+
"target": "same-tab"
95+
}
96+
```

0 commit comments

Comments
 (0)