11/**
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).
44 */
55
66/**
77 * Events that the host sends to the sidebar
88 */
99export type HostToSidebarEvent =
1010 /**
11- * The host is asking the sidebar to delete a frame.
11+ * The host informs the sidebar that a guest frame has been destroyed
1212 */
1313 | 'destroyFrame'
1414
1515 /**
16- * The host is asking the sidebar to set the annotation highlights on/off.
16+ * Highlights have been toggled on/off.
1717 */
1818 | 'setVisibleHighlights'
1919
@@ -32,7 +32,7 @@ export type GuestToSidebarEvent =
3232 | 'beforeCreateAnnotation'
3333
3434 /**
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.
3636 */
3737 | 'closeSidebar'
3838
@@ -42,7 +42,7 @@ export type GuestToSidebarEvent =
4242 | 'focusAnnotations'
4343
4444 /**
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.
4646 */
4747 | 'openSidebar'
4848
@@ -52,7 +52,7 @@ export type GuestToSidebarEvent =
5252 | 'showAnnotations'
5353
5454 /**
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
5656 */
5757 | 'sync'
5858
@@ -76,7 +76,7 @@ export type SidebarToGuestEvent =
7676 | 'focusAnnotations'
7777
7878 /**
79- * The sidebar is asking the guest(s) to get the document metadata.
79+ * The sidebar is asking the guest(s) for the URL and other metadata about the document .
8080 */
8181 | 'getDocumentInfo'
8282
@@ -100,31 +100,34 @@ export type SidebarToGuestEvent =
100100 */
101101export type SidebarToHostEvent =
102102 /**
103- * The sidebar relays to the host to open the sidebar.
103+ * The sidebar relays to the host to close the sidebar.
104104 */
105105 | 'closeSidebar'
106106
107107 /**
108- * The updated feature flags for the user
108+ * The sidebar informs the host to update the Hypothesis configuration to enable/disable additional features
109109 */
110110 | 'featureFlagsUpdated'
111111
112112 /**
113113 * 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
114115 */
115116 | 'helpRequested'
116117
117118 /**
118119 * The sidebar is asking the host to do a partner site log in
119120 * (for example pop up a log in window). This is used when the client is
120121 * 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
121123 */
122124 | 'loginRequested'
123125
124126 /**
125127 * The sidebar is asking the host to do a partner site log out.
126128 * This is used when the client is embedded in a partner site and a log out
127129 * button in the client is clicked.
130+ * https://h.readthedocs.io/projects/client/en/latest/publishers/config/#cmdoption-arg-onlogoutrequest
128131 */
129132 | 'logoutRequested'
130133
@@ -134,23 +137,26 @@ export type SidebarToHostEvent =
134137 | 'openNotebook'
135138
136139 /**
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).
139142 */
140143 | 'openSidebar'
141144
142145 /**
143146 * 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
144148 */
145149 | 'profileRequested'
146150
147151 /**
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
149154 */
150155 | 'publicAnnotationCountChanged'
151156
152157 /**
153158 * 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
154160 */
155161 | 'signupRequested' ;
156162
0 commit comments