1
1
/**
2
- * This module defines the set of global events that are dispatched across the
3
- * the bridge(s) between the sidebar-host and sidebar-guest(s ).
2
+ * This module defines the events that are sent between frames with different
3
+ * roles in the client (guest, host, sidebar).
4
4
*/
5
5
6
6
/**
7
7
* Events that the host sends to the sidebar
8
8
*/
9
9
export type HostToSidebarEvent =
10
10
/**
11
- * The host is asking the sidebar to delete a frame.
11
+ * The host informs the sidebar that a guest frame has been destroyed
12
12
*/
13
13
| 'destroyFrame'
14
14
15
15
/**
16
- * The host is asking the sidebar to set the annotation highlights on/off.
16
+ * Highlights have been toggled on/off.
17
17
*/
18
18
| 'setVisibleHighlights'
19
19
@@ -32,7 +32,7 @@ export type GuestToSidebarEvent =
32
32
| 'beforeCreateAnnotation'
33
33
34
34
/**
35
- * The guest is asking the sidebar to relay the message to open the sidebar.
35
+ * The guest is asking the sidebar to relay the message to the host to close the sidebar.
36
36
*/
37
37
| 'closeSidebar'
38
38
@@ -42,7 +42,7 @@ export type GuestToSidebarEvent =
42
42
| 'focusAnnotations'
43
43
44
44
/**
45
- * The guest is asking the sidebar to relay the message to open the sidebar.
45
+ * The guest is asking the sidebar to relay the message to the host to open the sidebar.
46
46
*/
47
47
| 'openSidebar'
48
48
@@ -52,7 +52,7 @@ export type GuestToSidebarEvent =
52
52
| 'showAnnotations'
53
53
54
54
/**
55
- * The guest notifies the sidebar to synchronize about the anchoring status of annotations.
55
+ * The guest informs the sidebar whether annotations were successfully anchored
56
56
*/
57
57
| 'sync'
58
58
@@ -76,7 +76,7 @@ export type SidebarToGuestEvent =
76
76
| 'focusAnnotations'
77
77
78
78
/**
79
- * The sidebar is asking the guest(s) to get the document metadata.
79
+ * The sidebar is asking the guest(s) the URL and other metadata about the document .
80
80
*/
81
81
| 'getDocumentInfo'
82
82
@@ -100,31 +100,34 @@ export type SidebarToGuestEvent =
100
100
*/
101
101
export type SidebarToHostEvent =
102
102
/**
103
- * The sidebar relays to the host to open the sidebar.
103
+ * The sidebar relays to the host to close the sidebar.
104
104
*/
105
105
| 'closeSidebar'
106
106
107
107
/**
108
- * The updated feature flags for the user
108
+ * The sidebar informs the host to update the Hypothesis configuration to enable/disable additional features
109
109
*/
110
110
| 'featureFlagsUpdated'
111
111
112
112
/**
113
113
* The sidebar is asking the host to open the partner site help page.
114
+ * https://h.readthedocs.io/projects/client/en/latest/publishers/config/#cmdoption-arg-onhelprequest
114
115
*/
115
116
| 'helpRequested'
116
117
117
118
/**
118
119
* The sidebar is asking the host to do a partner site log in
119
120
* (for example pop up a log in window). This is used when the client is
120
121
* embedded in a partner site and a log in button in the client is clicked.
122
+ * https://h.readthedocs.io/projects/client/en/latest/publishers/config/#cmdoption-arg-onloginrequest
121
123
*/
122
124
| 'loginRequested'
123
125
124
126
/**
125
127
* The sidebar is asking the host to do a partner site log out.
126
128
* This is used when the client is embedded in a partner site and a log out
127
129
* button in the client is clicked.
130
+ * https://h.readthedocs.io/projects/client/en/latest/publishers/config/#cmdoption-arg-onlogoutrequest
128
131
*/
129
132
| 'logoutRequested'
130
133
@@ -134,23 +137,26 @@ export type SidebarToHostEvent =
134
137
| 'openNotebook'
135
138
136
139
/**
137
- * The sidebar is asking the host to open the sidebar (side-effect of
138
- * creating an annotation).
140
+ * The sidebar is asking the host to open the sidebar (side-effect of creating
141
+ * an annotation).
139
142
*/
140
143
| 'openSidebar'
141
144
142
145
/**
143
146
* The sidebar is asking the host to open the partner site profile page.
147
+ * https://h.readthedocs.io/projects/client/en/latest/publishers/config/#cmdoption-arg-onprofilerequest
144
148
*/
145
149
| 'profileRequested'
146
150
147
151
/**
148
- * The sidebar inform the host to update the number of annotations in the partner site.
152
+ * The sidebar informs the host to update the annotation counter in the partner site.
153
+ * https://h.readthedocs.io/projects/client/en/latest/publishers/host-page-integration/#cmdoption-arg-data-hypothesis-annotation-count
149
154
*/
150
155
| 'publicAnnotationCountChanged'
151
156
152
157
/**
153
158
* The sidebar is asking the host to do a partner site sign-up.
159
+ * https://h.readthedocs.io/projects/client/en/latest/publishers/config/#cmdoption-arg-onsignuprequest
154
160
*/
155
161
| 'signupRequested' ;
156
162
0 commit comments