@inboxsdk/core 2.1.25 → 2.1.27

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/inboxsdk.js CHANGED
@@ -814,7 +814,7 @@ function isElementVisible(el) {
814
814
 
815
815
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- SDK_VERSION is injected by webpack
816
816
  ///@ts-ignore
817
- const BUILD_VERSION = "2.1.25-1701718305489-e07cd3aabee5e39f";
817
+ const BUILD_VERSION = "2.1.27-1706185810630-874edc85a14e17b3";
818
818
  if (false) {}
819
819
 
820
820
  /***/ }),
@@ -10529,7 +10529,7 @@ options.insert = htmlElement => {
10529
10529
  htmlElement.setAttribute('data-inboxsdk-version',
10530
10530
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
10531
10531
  ///@ts-ignore
10532
- "2.1.25-1701718305489-e07cd3aabee5e39f");
10532
+ "2.1.27-1706185810630-874edc85a14e17b3");
10533
10533
  document.head.append(htmlElement);
10534
10534
  };
10535
10535
  options.domAPI = (styleDomAPI_default());
@@ -11999,27 +11999,34 @@ var kefir_cast_default = /*#__PURE__*/__webpack_require__.n(kefir_cast);
11999
11999
  var safe_event_emitter = __webpack_require__(6666);
12000
12000
  ;// CONCATENATED MODULE: ./src/platform-implementation-js/views/collapsible-section-view.ts
12001
12001
 
12002
+ /**
12003
+ * {@link CollapsibleSectionView}s allow you to display additional content on ListRouteViews. They are typically rendered as additional content above the list of threads below. The visual style is similar to that of multiple inbox sections used in native Gmail. Note that the rendering may vary slightly depending on the actual ListRouteView that the {@link CollapsibleSectionView} is rendered in. For example, {@link CollapsibleSectionViews} rendered on search results pages use different header styles to match Gmail's style more accurately.
12002
12004
 
12003
- const membersMap = new WeakMap();
12005
+ * You can either render rows (that are visually similar to Gmail rows) or custom content in your {@link CollapsibleSectionView}. Until content is provided, the SectionView will simply display a "Loading..." indicator.
12006
+ *
12007
+ * @see ListRouteView.addCollapsibleSection for more information.
12008
+ * @todo the docs mention this class extending SectionView. That doesn't seem to be the case.
12009
+ */
12004
12010
  class CollapsibleSectionView extends safe_event_emitter/* default */.Z {
12011
+ /** This property is set to true once the view is destroyed. */
12012
+
12013
+ #collapsibleSectionViewDriver;
12005
12014
  constructor(collapsibleSectionViewDriver, driver) {
12006
12015
  super();
12007
- const members = {
12008
- collapsibleSectionViewDriver
12009
- };
12010
- membersMap.set(this, members);
12016
+ this.#collapsibleSectionViewDriver = collapsibleSectionViewDriver;
12011
12017
  this.destroyed = false;
12012
12018
  _bindToEventStream(this, collapsibleSectionViewDriver, driver);
12013
12019
  }
12014
12020
  setCollapsed(value) {
12015
- (0,get_or_fail/* default */.Z)(membersMap, this).collapsibleSectionViewDriver.setCollapsed(value);
12021
+ this.#collapsibleSectionViewDriver.setCollapsed(value);
12016
12022
  }
12023
+
12024
+ /** Removes this section from the current Route */
12017
12025
  remove() {
12018
12026
  this.destroy();
12019
12027
  }
12020
12028
  destroy() {
12021
- const members = (0,get_or_fail/* default */.Z)(membersMap, this);
12022
- members.collapsibleSectionViewDriver.destroy();
12029
+ this.#collapsibleSectionViewDriver.destroy();
12023
12030
  this.removeAllListeners();
12024
12031
  }
12025
12032
  }
@@ -12080,15 +12087,11 @@ function _bindToEventStream(collapsibleSectionView, collapsibleSectionViewDriver
12080
12087
  /* harmony default export */ const collapsible_section_view = (CollapsibleSectionView);
12081
12088
  ;// CONCATENATED MODULE: ./src/platform-implementation-js/views/section-view.ts
12082
12089
 
12083
-
12084
- const section_view_membersMap = new WeakMap();
12085
12090
  class SectionView extends safe_event_emitter/* default */.Z {
12091
+ #sectionViewDriver;
12086
12092
  constructor(sectionViewDriver, driver) {
12087
12093
  super();
12088
- const members = {
12089
- sectionViewDriver
12090
- };
12091
- section_view_membersMap.set(this, members);
12094
+ this.#sectionViewDriver = sectionViewDriver;
12092
12095
  this.destroyed = false;
12093
12096
  section_view_bindToEventStream(this, sectionViewDriver, driver);
12094
12097
  }
@@ -12096,8 +12099,7 @@ class SectionView extends safe_event_emitter/* default */.Z {
12096
12099
  this.destroy();
12097
12100
  }
12098
12101
  destroy() {
12099
- const members = (0,get_or_fail/* default */.Z)(section_view_membersMap, this);
12100
- members.sectionViewDriver.destroy();
12102
+ this.#sectionViewDriver.destroy();
12101
12103
  this.removeAllListeners();
12102
12104
  }
12103
12105
  }
@@ -12159,45 +12161,51 @@ function section_view_bindToEventStream(sectionView, sectionViewDriver, driver)
12159
12161
 
12160
12162
 
12161
12163
 
12162
-
12164
+ /**
12165
+ * Extends {@link RouteView}. {@link ListRouteView}s represent pages within Gmail that show a list of emails. Typical examples are the Inbox, Sent Mail, Drafts, etc. However, views like the Conversation view or Settings would not be a ListRouteView.
12166
+ */
12163
12167
  class ListRouteView extends route_view/* default */.Z {
12168
+ #routeViewDriver;
12169
+ #driver;
12170
+ #appId;
12171
+ #sectionViews = [];
12164
12172
  constructor(routeViewDriver, driver, appId) {
12165
12173
  super(routeViewDriver);
12166
- const members = {
12167
- routeViewDriver,
12168
- driver,
12169
- appId,
12170
- sectionViews: []
12171
- };
12172
- list_route_view_membersMap.set(this, members);
12173
- list_route_view_bindToEventStream(routeViewDriver, this);
12174
+ this.#routeViewDriver = routeViewDriver;
12175
+ this.#driver = driver;
12176
+ this.#appId = appId;
12177
+ this.#bindToEventStream();
12174
12178
  }
12179
+
12180
+ /**
12181
+ * Adds a collapsible section to the top of the page.
12182
+ */
12175
12183
  addCollapsibleSection(collapsibleSectionDescriptor) {
12176
- const members = (0,get_or_fail/* default */.Z)(list_route_view_membersMap, this);
12177
- const collapsibleSectionViewDriver = members.routeViewDriver.addCollapsibleSection(kefir_cast_default()(kefir_esm["default"], collapsibleSectionDescriptor).toProperty(), members.appId);
12178
- const collapsibleSectionView = new collapsible_section_view(collapsibleSectionViewDriver, members.driver);
12179
- members.sectionViews.push(collapsibleSectionView);
12184
+ const collapsibleSectionViewDriver = this.#routeViewDriver.addCollapsibleSection(kefir_cast_default()(kefir_esm["default"], collapsibleSectionDescriptor).toProperty(), this.#appId);
12185
+ const collapsibleSectionView = new collapsible_section_view(collapsibleSectionViewDriver, this.#driver);
12186
+ this.#sectionViews.push(collapsibleSectionView);
12180
12187
  return collapsibleSectionView;
12181
12188
  }
12189
+
12190
+ /** Adds a non-collapsible section to the top of the page. */
12182
12191
  addSection(sectionDescriptor) {
12183
- const members = (0,get_or_fail/* default */.Z)(list_route_view_membersMap, this);
12184
- const sectionViewDriver = members.routeViewDriver.addSection(kefir_cast_default()(kefir_esm["default"], sectionDescriptor).toProperty(), members.appId);
12185
- const sectionView = new section_view(sectionViewDriver, members.driver);
12186
- members.sectionViews.push(sectionView);
12192
+ const sectionViewDriver = this.#routeViewDriver.addSection(kefir_cast_default()(kefir_esm["default"], sectionDescriptor).toProperty(), this.#appId);
12193
+ const sectionView = new section_view(sectionViewDriver, this.#driver);
12194
+ this.#sectionViews.push(sectionView);
12187
12195
  return sectionView;
12188
12196
  }
12197
+
12198
+ /** Simulates a click on the Gmail thread list refresh button. */
12189
12199
  refresh() {
12190
- (0,get_or_fail/* default */.Z)(list_route_view_membersMap, this).routeViewDriver.refresh();
12200
+ this.#routeViewDriver.refresh();
12191
12201
  }
12192
- }
12193
- const list_route_view_membersMap = new WeakMap();
12194
- function list_route_view_bindToEventStream(routeViewDriver, routeView) {
12195
- routeViewDriver.getEventStream().onEnd(() => {
12196
- const members = (0,get_or_fail/* default */.Z)(list_route_view_membersMap, routeView);
12197
- members.sectionViews.forEach(sectionView => {
12198
- sectionView.destroy();
12202
+ #bindToEventStream() {
12203
+ this.#routeViewDriver.getEventStream().onEnd(() => {
12204
+ this.#sectionViews.forEach(sectionView => {
12205
+ sectionView.destroy();
12206
+ });
12199
12207
  });
12200
- });
12208
+ }
12201
12209
  }
12202
12210
  /* harmony default export */ const list_route_view = (ListRouteView);
12203
12211
  // EXTERNAL MODULE: ./src/platform-implementation-js/views/route-view/custom-route-view.ts
@@ -15216,63 +15224,69 @@ class InboxDropdownButtonView extends GenericButtonView {
15216
15224
 
15217
15225
 
15218
15226
  class GmailCollapsibleSectionView {
15219
- _collapsibleSectionDescriptor = {};
15220
- _element = null;
15221
- _headerElement = null;
15222
- _titleElement = null;
15223
- _bodyElement = null;
15224
- _contentElement = null;
15225
- _tableBodyElement = null;
15226
- _collapsedContainer = null;
15227
- _messageElement = null;
15228
- _footerElement = null;
15229
- _isCollapsed = false;
15230
- _inboxDropdownButtonView = null;
15231
- _dropdownViewController = null;
15227
+ #driver;
15228
+ #groupOrderHint;
15229
+ #isReadyDeferred;
15230
+ #isCollapsible;
15231
+ #collapsibleSectionDescriptor = {};
15232
+ #isSearch;
15233
+ #element = null;
15234
+ #headerElement = null;
15235
+ #titleElement = null;
15236
+ #bodyElement = null;
15237
+ #contentElement = null;
15238
+ #tableBodyElement = null;
15239
+ #collapsedContainer = null;
15240
+ #messageElement = null;
15241
+ #footerElement = null;
15242
+ #eventStream;
15243
+ #isCollapsed = false;
15244
+ #inboxDropdownButtonView = null;
15245
+ #dropdownViewController = null;
15232
15246
  constructor(driver, groupOrderHint, isSearch, isCollapsible) {
15233
- this._driver = driver;
15234
- this._isSearch = isSearch;
15235
- this._groupOrderHint = groupOrderHint;
15236
- this._isCollapsible = isCollapsible;
15237
- this._eventStream = kefir_bus_default()();
15238
- this._isReadyDeferred = new defer();
15247
+ this.#driver = driver;
15248
+ this.#isSearch = isSearch;
15249
+ this.#groupOrderHint = groupOrderHint;
15250
+ this.#isCollapsible = isCollapsible;
15251
+ this.#eventStream = kefir_bus_default()();
15252
+ this.#isReadyDeferred = defer();
15239
15253
  }
15240
15254
  destroy() {
15241
- if (this._element) this._element.remove();
15242
- if (this._eventStream) this._eventStream.end();
15243
- if (this._headerElement) this._headerElement.remove();
15244
- if (this._titleElement) this._titleElement.remove();
15245
- if (this._bodyElement) this._bodyElement.remove();
15246
- if (this._contentElement) this._contentElement.remove();
15247
- if (this._tableBodyElement) this._tableBodyElement.remove();
15248
- if (this._collapsedContainer) this._collapsedContainer.remove();
15249
- if (this._messageElement) this._messageElement.remove();
15250
- if (this._inboxDropdownButtonView) this._inboxDropdownButtonView.destroy();
15251
- if (this._dropdownViewController) this._dropdownViewController.destroy();
15255
+ if (this.#element) this.#element.remove();
15256
+ if (this.#eventStream) this.#eventStream.end();
15257
+ if (this.#headerElement) this.#headerElement.remove();
15258
+ if (this.#titleElement) this.#titleElement.remove();
15259
+ if (this.#bodyElement) this.#bodyElement.remove();
15260
+ if (this.#contentElement) this.#contentElement.remove();
15261
+ if (this.#tableBodyElement) this.#tableBodyElement.remove();
15262
+ if (this.#collapsedContainer) this.#collapsedContainer.remove();
15263
+ if (this.#messageElement) this.#messageElement.remove();
15264
+ if (this.#inboxDropdownButtonView) this.#inboxDropdownButtonView.destroy();
15265
+ if (this.#dropdownViewController) this.#dropdownViewController.destroy();
15252
15266
  }
15253
15267
  getElement() {
15254
- const element = this._element;
15268
+ const element = this.#element;
15255
15269
  if (!element) throw new Error('tried to access element that does not exist');
15256
15270
  return element;
15257
15271
  }
15258
15272
  getEventStream() {
15259
- return this._eventStream;
15273
+ return this.#eventStream;
15260
15274
  }
15261
15275
  setCollapsibleSectionDescriptorProperty(collapsibleSectionDescriptorProperty) {
15262
- const stoppedProperty = collapsibleSectionDescriptorProperty.takeUntilBy(this._eventStream.filter(() => false).beforeEnd(() => null));
15263
- stoppedProperty.onValue(x => this._updateValues(x));
15264
- stoppedProperty.take(1).onValue(() => this._isReadyDeferred.resolve(this));
15276
+ const stoppedProperty = collapsibleSectionDescriptorProperty.takeUntilBy(this.#eventStream.filter(() => false).beforeEnd(() => null));
15277
+ stoppedProperty.onValue(x => this.#updateValues(x));
15278
+ stoppedProperty.take(1).onValue(() => this.#isReadyDeferred.resolve(this));
15265
15279
  }
15266
15280
  setCollapsed(value) {
15267
- if (!this._isCollapsible) {
15281
+ if (!this.#isCollapsible) {
15268
15282
  return;
15269
15283
  }
15270
- this._isReadyDeferred.promise.then(() => {
15271
- if (value) this._collapse();else this._expand();
15284
+ this.#isReadyDeferred.promise.then(() => {
15285
+ if (value) this.#collapse();else this.#expand();
15272
15286
  });
15273
15287
  }
15274
- _updateValues(collapsibleSectionDescriptor) {
15275
- const element = this._element;
15288
+ #updateValues(collapsibleSectionDescriptor) {
15289
+ const element = this.#element;
15276
15290
  if (!collapsibleSectionDescriptor) {
15277
15291
  if (element) {
15278
15292
  element.style.display = 'none';
@@ -15282,107 +15296,107 @@ class GmailCollapsibleSectionView {
15282
15296
  element.style.display = '';
15283
15297
  }
15284
15298
  if (!element) {
15285
- this._setupElement(collapsibleSectionDescriptor);
15286
- this._showLoadingMessage();
15299
+ this.#setupElement(collapsibleSectionDescriptor);
15300
+ this.#showLoadingMessage();
15287
15301
  } else {
15288
- this._updateElement(collapsibleSectionDescriptor);
15289
- }
15290
- this._updateHeader(collapsibleSectionDescriptor);
15291
- this._updateTitle(collapsibleSectionDescriptor);
15292
- this._updateSubtitle(collapsibleSectionDescriptor);
15293
- this._updateSummaryText(collapsibleSectionDescriptor);
15294
- this._updateDropdown(collapsibleSectionDescriptor);
15295
- this._updateContentElement(collapsibleSectionDescriptor);
15296
- this._updateTableRows(collapsibleSectionDescriptor);
15297
- this._updateMessageElement(collapsibleSectionDescriptor);
15298
- this._updateFooter(collapsibleSectionDescriptor);
15299
- this._collapsibleSectionDescriptor = collapsibleSectionDescriptor;
15300
- }
15301
- _setupElement(collapsibleSectionDescriptor) {
15302
- const element = this._element = document.createElement('div');
15302
+ this.#updateElement(collapsibleSectionDescriptor);
15303
+ }
15304
+ this.#updateHeader(collapsibleSectionDescriptor);
15305
+ this.#updateTitle(collapsibleSectionDescriptor);
15306
+ this.#updateSubtitle(collapsibleSectionDescriptor);
15307
+ this.#updateSummaryText(collapsibleSectionDescriptor);
15308
+ this.#updateDropdown(collapsibleSectionDescriptor);
15309
+ this.#updateContentElement(collapsibleSectionDescriptor);
15310
+ this.#updateTableRows(collapsibleSectionDescriptor);
15311
+ this.#updateMessageElement(collapsibleSectionDescriptor);
15312
+ this.#updateFooter(collapsibleSectionDescriptor);
15313
+ this.#collapsibleSectionDescriptor = collapsibleSectionDescriptor;
15314
+ }
15315
+ #setupElement(collapsibleSectionDescriptor) {
15316
+ const element = this.#element = document.createElement('div');
15303
15317
  element.setAttribute('class', 'inboxsdk__resultsSection');
15304
- element.setAttribute('data-group-order-hint', String(this._groupOrderHint));
15318
+ element.setAttribute('data-group-order-hint', String(this.#groupOrderHint));
15305
15319
  element.setAttribute('data-order-hint', String(typeof collapsibleSectionDescriptor.orderHint === 'number' ? collapsibleSectionDescriptor.orderHint : 0));
15306
- if (!this._isCollapsible) element.classList.add('inboxsdk__resultsSection_nonCollapsible');
15307
- this._setupHeader(collapsibleSectionDescriptor);
15308
- const bodyElement = this._bodyElement = document.createElement('div');
15320
+ if (!this.#isCollapsible) element.classList.add('inboxsdk__resultsSection_nonCollapsible');
15321
+ this.#setupHeader(collapsibleSectionDescriptor);
15322
+ const bodyElement = this.#bodyElement = document.createElement('div');
15309
15323
  const bodyContentsElement = document.createElement('div');
15310
15324
  bodyContentsElement.classList.add('zE');
15311
15325
  bodyElement.appendChild(bodyContentsElement);
15312
15326
  element.appendChild(bodyElement);
15313
- const contentElement = this._contentElement = document.createElement('div');
15327
+ const contentElement = this.#contentElement = document.createElement('div');
15314
15328
  bodyContentsElement.appendChild(contentElement);
15315
- const messageElement = this._messageElement = document.createElement('div');
15329
+ const messageElement = this.#messageElement = document.createElement('div');
15316
15330
  bodyContentsElement.appendChild(messageElement);
15317
- const tableBodyElement = this._tableBodyElement = document.createElement('div');
15331
+ const tableBodyElement = this.#tableBodyElement = document.createElement('div');
15318
15332
  bodyContentsElement.appendChild(tableBodyElement);
15319
- this._setupFooter();
15320
- if (this._isCollapsible && this._titleElement) {
15321
- kefir_esm.fromEvents(this._titleElement, 'click').onValue(() => this._toggleCollapseState());
15333
+ this.#setupFooter();
15334
+ if (this.#isCollapsible && this.#titleElement) {
15335
+ kefir_esm.fromEvents(this.#titleElement, 'click').onValue(() => this.#toggleCollapseState());
15322
15336
  }
15323
- kefir_esm.fromEvents(element, 'removeCollapsedContainer').onValue(() => this._destroyCollapsedContainer());
15324
- kefir_esm.fromEvents(element, 'readdToCollapsedContainer').onValue(() => this._addToCollapsedContainer());
15325
- this._eventStream.emit({
15337
+ kefir_esm.fromEvents(element, 'removeCollapsedContainer').onValue(() => this.#destroyCollapsedContainer());
15338
+ kefir_esm.fromEvents(element, 'readdToCollapsedContainer').onValue(() => this.#addToCollapsedContainer());
15339
+ this.#eventStream.emit({
15326
15340
  type: 'update',
15327
15341
  property: 'orderHint',
15328
15342
  sectionDescriptor: collapsibleSectionDescriptor
15329
15343
  });
15330
15344
  }
15331
- _setupHeader(collapsibleSectionDescriptor) {
15332
- const headerElement = this._headerElement = document.createElement('div');
15345
+ #setupHeader(collapsibleSectionDescriptor) {
15346
+ const headerElement = this.#headerElement = document.createElement('div');
15333
15347
  headerElement.classList.add('inboxsdk__resultsSection_header', 'Wg');
15334
- this._setupGmailv2Header(headerElement, collapsibleSectionDescriptor);
15335
- if (this._element) this._element.appendChild(headerElement);
15348
+ this.#setupGmailv2Header(headerElement, collapsibleSectionDescriptor);
15349
+ if (this.#element) this.#element.appendChild(headerElement);
15336
15350
  }
15337
- _setupGmailv2Header(headerElement, collapsibleSectionDescriptor) {
15338
- const titleElement = this._titleElement = document.createElement('div');
15351
+ #setupGmailv2Header(headerElement, collapsibleSectionDescriptor) {
15352
+ const titleElement = this.#titleElement = document.createElement('div');
15339
15353
  titleElement.setAttribute('class', 'inboxsdk__resultsSection_title');
15340
15354
  titleElement.innerHTML = ['<h3 class="Wr iR">', '<img alt="" src="//ssl.gstatic.com/ui/v1/icons/mail/images/cleardot.gif" class="qi Wp Wq">', '<div class="Wn">', escape_default()(collapsibleSectionDescriptor.title), '</div>', '</h3>'].join('');
15341
15355
  const floatRightElement = document.createElement('div');
15342
15356
  floatRightElement.classList.add('Cr');
15343
- if (this._isSearch) floatRightElement.classList.add('Wg');
15357
+ if (this.#isSearch) floatRightElement.classList.add('Wg');
15344
15358
  headerElement.appendChild(titleElement);
15345
15359
  headerElement.appendChild(floatRightElement);
15346
15360
  }
15347
- _setupFooter() {
15348
- const footerElement = this._footerElement = document.createElement('div');
15361
+ #setupFooter() {
15362
+ const footerElement = this.#footerElement = document.createElement('div');
15349
15363
  footerElement.classList.add('inboxsdk__resultsSection_footer');
15350
- if (this._bodyElement) this._bodyElement.appendChild(footerElement);
15364
+ if (this.#bodyElement) this.#bodyElement.appendChild(footerElement);
15351
15365
  }
15352
- _updateElement(collapsibleSectionDescriptor) {
15353
- if (this._collapsibleSectionDescriptor.orderHint !== collapsibleSectionDescriptor.orderHint) {
15354
- const element = this._element;
15366
+ #updateElement(collapsibleSectionDescriptor) {
15367
+ if (this.#collapsibleSectionDescriptor.orderHint !== collapsibleSectionDescriptor.orderHint) {
15368
+ const element = this.#element;
15355
15369
  if (element) element.setAttribute('data-order-hint', '' + (typeof collapsibleSectionDescriptor.orderHint === 'number' ? collapsibleSectionDescriptor.orderHint : 0));
15356
- this._eventStream.emit({
15370
+ this.#eventStream.emit({
15357
15371
  type: 'update',
15358
15372
  property: 'orderHint'
15359
15373
  });
15360
15374
  }
15361
15375
  }
15362
- _updateHeader(collapsibleSectionDescriptor) {
15363
- if (this._isCollapsible || collapsibleSectionDescriptor.title || collapsibleSectionDescriptor.subtitle || collapsibleSectionDescriptor.titleLinkText || collapsibleSectionDescriptor.hasDropdown) {
15364
- if (this._headerElement) this._headerElement.style.display = '';
15376
+ #updateHeader(collapsibleSectionDescriptor) {
15377
+ if (this.#isCollapsible || collapsibleSectionDescriptor.title || collapsibleSectionDescriptor.subtitle || collapsibleSectionDescriptor.titleLinkText || collapsibleSectionDescriptor.hasDropdown) {
15378
+ if (this.#headerElement) this.#headerElement.style.display = '';
15365
15379
  } else {
15366
- if (this._headerElement) this._headerElement.style.display = 'none';
15380
+ if (this.#headerElement) this.#headerElement.style.display = 'none';
15367
15381
  }
15368
15382
  }
15369
- _updateTitle(collapsibleSectionDescriptor) {
15370
- if (this._collapsibleSectionDescriptor.title !== collapsibleSectionDescriptor.title) {
15383
+ #updateTitle(collapsibleSectionDescriptor) {
15384
+ if (this.#collapsibleSectionDescriptor.title !== collapsibleSectionDescriptor.title) {
15371
15385
  const selector = 'h3 > .Wn';
15372
- if (this._titleElement) {
15373
- (0,querySelectorOrFail/* default */.Z)(this._titleElement, selector).textContent = collapsibleSectionDescriptor.title;
15386
+ if (this.#titleElement) {
15387
+ (0,querySelectorOrFail/* default */.Z)(this.#titleElement, selector).textContent = collapsibleSectionDescriptor.title;
15374
15388
  }
15375
15389
  }
15376
15390
  }
15377
- _updateSubtitle(collapsibleSectionDescriptor) {
15378
- const titleElement = this._titleElement;
15391
+ #updateSubtitle(collapsibleSectionDescriptor) {
15392
+ const titleElement = this.#titleElement;
15379
15393
  if (!titleElement) return;
15380
15394
  let subtitleElement = titleElement.querySelector('.inboxsdk__resultsSection_title_subtitle');
15381
15395
  if (!collapsibleSectionDescriptor.subtitle) {
15382
15396
  if (subtitleElement) {
15383
15397
  subtitleElement.remove();
15384
15398
  }
15385
- } else if (this._collapsibleSectionDescriptor.subtitle !== collapsibleSectionDescriptor.subtitle) {
15399
+ } else if (this.#collapsibleSectionDescriptor.subtitle !== collapsibleSectionDescriptor.subtitle) {
15386
15400
  if (!subtitleElement) {
15387
15401
  subtitleElement = document.createElement('span');
15388
15402
  if (subtitleElement && titleElement) {
@@ -15397,22 +15411,22 @@ class GmailCollapsibleSectionView {
15397
15411
  subtitleElement.textContent = '(' + collapsibleSectionDescriptor.subtitle + ')';
15398
15412
  }
15399
15413
  }
15400
- _updateSummaryText(collapsibleSectionDescriptor) {
15401
- const headerElement = this._headerElement;
15414
+ #updateSummaryText(collapsibleSectionDescriptor) {
15415
+ const headerElement = this.#headerElement;
15402
15416
  if (!headerElement) return;
15403
15417
  let summaryTextElement = headerElement.querySelector('.inboxsdk__resultsSection_header_summaryText');
15404
15418
  if (!collapsibleSectionDescriptor.titleLinkText) {
15405
15419
  if (summaryTextElement) {
15406
15420
  summaryTextElement.remove();
15407
15421
  }
15408
- } else if (collapsibleSectionDescriptor.titleLinkText !== this._collapsibleSectionDescriptor.titleLinkText) {
15422
+ } else if (collapsibleSectionDescriptor.titleLinkText !== this.#collapsibleSectionDescriptor.titleLinkText) {
15409
15423
  if (!summaryTextElement) {
15410
15424
  summaryTextElement = document.createElement('div');
15411
15425
  summaryTextElement.setAttribute('class', 'inboxsdk__resultsSection_header_summaryText Wm');
15412
15426
  summaryTextElement.innerHTML = ['<span class="Di">&nbsp;', '<div class="J-J5-Ji amH">', '<span class="Dj">', '<span></span>', '</span>', '&nbsp;', '</div>', '</span>'].join('');
15413
- this._eventStream.plug(kefir_esm.fromEvents(summaryTextElement, 'click').map(() => ({
15427
+ this.#eventStream.plug(kefir_esm.fromEvents(summaryTextElement, 'click').map(() => ({
15414
15428
  eventName: 'titleLinkClicked',
15415
- sectionDescriptor: this._collapsibleSectionDescriptor
15429
+ sectionDescriptor: this.#collapsibleSectionDescriptor
15416
15430
  })));
15417
15431
  const _summaryTextElement = summaryTextElement;
15418
15432
  summaryTextElement.addEventListener('mouseenter', function () {
@@ -15427,30 +15441,30 @@ class GmailCollapsibleSectionView {
15427
15441
  (0,querySelectorOrFail/* default */.Z)(summaryTextElement, '.Dj > *').textContent = collapsibleSectionDescriptor.titleLinkText;
15428
15442
  }
15429
15443
  }
15430
- _updateDropdown(collapsibleSectionDescriptor) {
15444
+ #updateDropdown(collapsibleSectionDescriptor) {
15431
15445
  if (!collapsibleSectionDescriptor.hasDropdown || !collapsibleSectionDescriptor.onDropdownClick) {
15432
- if (this._inboxDropdownButtonView) this._inboxDropdownButtonView.destroy();
15433
- if (this._dropdownViewController) this._dropdownViewController.destroy();
15446
+ if (this.#inboxDropdownButtonView) this.#inboxDropdownButtonView.destroy();
15447
+ if (this.#dropdownViewController) this.#dropdownViewController.destroy();
15434
15448
  } else if (collapsibleSectionDescriptor.hasDropdown && collapsibleSectionDescriptor.onDropdownClick) {
15435
- if (!this._inboxDropdownButtonView || !this._dropdownViewController) {
15436
- const inboxDropdownButtonView = this._inboxDropdownButtonView = new InboxDropdownButtonView();
15437
- this._dropdownViewController = new dropdown_button_view_controller/* default */.Z({
15449
+ if (!this.#inboxDropdownButtonView || !this.#dropdownViewController) {
15450
+ const inboxDropdownButtonView = this.#inboxDropdownButtonView = new InboxDropdownButtonView();
15451
+ this.#dropdownViewController = new dropdown_button_view_controller/* default */.Z({
15438
15452
  buttonView: inboxDropdownButtonView,
15439
15453
  dropdownViewDriverClass: gmail_dropdown_view/* default */.Z,
15440
15454
  dropdownShowFunction: collapsibleSectionDescriptor.onDropdownClick
15441
15455
  });
15442
- const headerElement = this._headerElement;
15456
+ const headerElement = this.#headerElement;
15443
15457
  if (headerElement) {
15444
15458
  const childElement = headerElement.querySelector('.Cr');
15445
15459
  if (childElement) childElement.appendChild(inboxDropdownButtonView.getElement());
15446
15460
  }
15447
- } else if (collapsibleSectionDescriptor.onDropdownClick !== this._collapsibleSectionDescriptor.onDropdownClick) {
15448
- if (this._dropdownViewController) this._dropdownViewController.setDropdownShowFunction(collapsibleSectionDescriptor.onDropdownClick);
15461
+ } else if (collapsibleSectionDescriptor.onDropdownClick !== this.#collapsibleSectionDescriptor.onDropdownClick) {
15462
+ if (this.#dropdownViewController) this.#dropdownViewController.setDropdownShowFunction(collapsibleSectionDescriptor.onDropdownClick);
15449
15463
  }
15450
15464
  }
15451
15465
  }
15452
- _updateContentElement(collapsibleSectionDescriptor) {
15453
- const contentElement = this._contentElement;
15466
+ #updateContentElement(collapsibleSectionDescriptor) {
15467
+ const contentElement = this.#contentElement;
15454
15468
  if (!contentElement) return;
15455
15469
  contentElement.innerHTML = '';
15456
15470
  if (collapsibleSectionDescriptor.contentElement) {
@@ -15460,27 +15474,27 @@ class GmailCollapsibleSectionView {
15460
15474
  contentElement.style.display = 'none';
15461
15475
  }
15462
15476
  }
15463
- _updateTableRows(collapsibleSectionDescriptor) {
15477
+ #updateTableRows(collapsibleSectionDescriptor) {
15464
15478
  const {
15465
15479
  tableRows
15466
15480
  } = collapsibleSectionDescriptor;
15467
- const tableBodyElement = this._tableBodyElement;
15481
+ const tableBodyElement = this.#tableBodyElement;
15468
15482
  if (!tableBodyElement) return;
15469
15483
  tableBodyElement.innerHTML = '';
15470
15484
  if (!tableRows || tableRows.length === 0) {
15471
15485
  tableBodyElement.style.display = 'none';
15472
15486
  } else {
15473
15487
  tableBodyElement.style.display = '';
15474
- this._renderTable(tableRows);
15488
+ this.#renderTable(tableRows);
15475
15489
  }
15476
15490
  }
15477
- _renderTable(tableRows) {
15491
+ #renderTable(tableRows) {
15478
15492
  const tableElement = document.createElement('table');
15479
15493
  tableElement.setAttribute('class', 'F cf zt');
15480
15494
  tableElement.innerHTML = _getTableHTML();
15481
- if (this._tableBodyElement) this._tableBodyElement.appendChild(tableElement);
15495
+ if (this.#tableBodyElement) this.#tableBodyElement.appendChild(tableElement);
15482
15496
  const tbody = tableElement.querySelector('tbody');
15483
- const eventStream = this._eventStream;
15497
+ const eventStream = this.#eventStream;
15484
15498
  tableRows.forEach(result => {
15485
15499
  const rowElement = document.createElement('tr');
15486
15500
  rowElement.setAttribute('class', 'inboxsdk__resultsSection_tableRow zA ' + (result.isRead ? 'yO' : 'zE'));
@@ -15493,19 +15507,19 @@ class GmailCollapsibleSectionView {
15493
15507
  })));
15494
15508
  });
15495
15509
  }
15496
- _updateMessageElement(collapsibleSectionDescriptor) {
15497
- const messageElement = this._messageElement;
15510
+ #updateMessageElement(collapsibleSectionDescriptor) {
15511
+ const messageElement = this.#messageElement;
15498
15512
  if (collapsibleSectionDescriptor.tableRows && collapsibleSectionDescriptor.tableRows.length > 0 || collapsibleSectionDescriptor.contentElement) {
15499
15513
  if (messageElement) {
15500
15514
  messageElement.innerHTML = '';
15501
15515
  messageElement.style.display = 'none';
15502
15516
  }
15503
15517
  } else if (collapsibleSectionDescriptor.tableRows && collapsibleSectionDescriptor.tableRows.length === 0 && !collapsibleSectionDescriptor.contentElement) {
15504
- this._showEmptyMessage();
15518
+ this.#showEmptyMessage();
15505
15519
  }
15506
15520
  }
15507
- _showLoadingMessage() {
15508
- const messageElement = this._messageElement;
15521
+ #showLoadingMessage() {
15522
+ const messageElement = this.#messageElement;
15509
15523
  if (messageElement) {
15510
15524
  messageElement.setAttribute('class', 'TB TC inboxsdk__resultsSection_loading');
15511
15525
  messageElement.innerHTML = 'loading...'; //TODO: localize
@@ -15513,8 +15527,8 @@ class GmailCollapsibleSectionView {
15513
15527
  messageElement.style.display = '';
15514
15528
  }
15515
15529
  }
15516
- _showEmptyMessage() {
15517
- const messageElement = this._messageElement;
15530
+ #showEmptyMessage() {
15531
+ const messageElement = this.#messageElement;
15518
15532
  if (messageElement) {
15519
15533
  messageElement.setAttribute('class', 'TB TC');
15520
15534
  messageElement.innerHTML = 'No results found'; //TODO: localize
@@ -15522,8 +15536,8 @@ class GmailCollapsibleSectionView {
15522
15536
  messageElement.style.display = '';
15523
15537
  }
15524
15538
  }
15525
- _updateFooter(collapsibleSectionDescriptor) {
15526
- const footerElement = this._footerElement;
15539
+ #updateFooter(collapsibleSectionDescriptor) {
15540
+ const footerElement = this.#footerElement;
15527
15541
  if (!footerElement) return;
15528
15542
  footerElement.innerHTML = '';
15529
15543
  if (!collapsibleSectionDescriptor.footerLinkText && !collapsibleSectionDescriptor.footerLinkIconUrl && !collapsibleSectionDescriptor.footerLinkIconClass) {
@@ -15533,74 +15547,74 @@ class GmailCollapsibleSectionView {
15533
15547
  const footerLinkElement = document.createElement('span');
15534
15548
  footerLinkElement.setAttribute('class', 'e Wb');
15535
15549
  footerLinkElement.textContent = collapsibleSectionDescriptor.footerLinkText;
15536
- this._eventStream.plug(kefir_esm.fromEvents(footerLinkElement, 'click').map(() => {
15550
+ this.#eventStream.plug(kefir_esm.fromEvents(footerLinkElement, 'click').map(() => {
15537
15551
  return {
15538
15552
  eventName: 'footerClicked',
15539
- sectionDescriptor: this._collapsibleSectionDescriptor
15553
+ sectionDescriptor: this.#collapsibleSectionDescriptor
15540
15554
  };
15541
15555
  }));
15542
15556
  footerElement.appendChild(footerLinkElement);
15543
15557
  footerElement.insertAdjacentHTML('beforeend', '<br style="clear:both;">');
15544
15558
  }
15545
15559
  }
15546
- _toggleCollapseState() {
15547
- if (this._isCollapsed) {
15548
- this._expand();
15560
+ #toggleCollapseState() {
15561
+ if (this.#isCollapsed) {
15562
+ this.#expand();
15549
15563
  } else {
15550
- this._collapse();
15564
+ this.#collapse();
15551
15565
  }
15552
15566
  }
15553
- _collapse() {
15554
- const element = this._element;
15567
+ #collapse() {
15568
+ const element = this.#element;
15555
15569
  if (!element) {
15556
15570
  return;
15557
15571
  }
15558
15572
  element.classList.add('inboxsdk__resultsSection_collapsed');
15559
- if (!this._isSearch) {
15560
- this._addToCollapsedContainer();
15573
+ if (!this.#isSearch) {
15574
+ this.#addToCollapsedContainer();
15561
15575
  }
15562
15576
  const selector = 'h3 > img.Wp';
15563
- if (this._titleElement) {
15564
- const arrowSpan = (0,querySelectorOrFail/* default */.Z)(this._titleElement, selector);
15577
+ if (this.#titleElement) {
15578
+ const arrowSpan = (0,querySelectorOrFail/* default */.Z)(this.#titleElement, selector);
15565
15579
  if (arrowSpan) {
15566
15580
  arrowSpan.classList.remove('Wq');
15567
15581
  arrowSpan.classList.add('Wo');
15568
15582
  }
15569
15583
  }
15570
- if (this._bodyElement) this._bodyElement.style.display = 'none';
15571
- this._isCollapsed = true;
15572
- this._eventStream.emit({
15584
+ if (this.#bodyElement) this.#bodyElement.style.display = 'none';
15585
+ this.#isCollapsed = true;
15586
+ this.#eventStream.emit({
15573
15587
  eventName: 'collapsed'
15574
15588
  });
15575
15589
  }
15576
- _expand() {
15577
- const element = this._element;
15590
+ #expand() {
15591
+ const element = this.#element;
15578
15592
  if (!element) {
15579
15593
  return;
15580
15594
  }
15581
15595
  element.classList.remove('inboxsdk__resultsSection_collapsed');
15582
- if (!this._isSearch) {
15583
- this._removeFromCollapsedContainer();
15596
+ if (!this.#isSearch) {
15597
+ this.#removeFromCollapsedContainer();
15584
15598
  }
15585
15599
  const selector = 'h3 > img.Wp';
15586
- if (this._titleElement) {
15587
- const arrowSpan = (0,querySelectorOrFail/* default */.Z)(this._titleElement, selector);
15600
+ if (this.#titleElement) {
15601
+ const arrowSpan = (0,querySelectorOrFail/* default */.Z)(this.#titleElement, selector);
15588
15602
  if (arrowSpan) {
15589
15603
  arrowSpan.classList.remove('Wo');
15590
15604
  arrowSpan.classList.add('Wq');
15591
15605
  }
15592
15606
  }
15593
- if (this._bodyElement) this._bodyElement.style.display = '';
15594
- this._isCollapsed = false;
15595
- this._eventStream.emit({
15607
+ if (this.#bodyElement) this.#bodyElement.style.display = '';
15608
+ this.#isCollapsed = false;
15609
+ this.#eventStream.emit({
15596
15610
  eventName: 'expanded'
15597
15611
  });
15598
15612
  }
15599
- _addToCollapsedContainer() {
15600
- const element = this._element;
15613
+ #addToCollapsedContainer() {
15614
+ const element = this.#element;
15601
15615
  if (!element) return;
15602
- if (this._headerElement) this._headerElement.classList.remove('Wg');
15603
- if (this._isCollapsedContainer(element.previousElementSibling) && this._isCollapsedContainer(element.nextElementSibling)) {
15616
+ if (this.#headerElement) this.#headerElement.classList.remove('Wg');
15617
+ if (this.#isCollapsedContainer(element.previousElementSibling) && this.#isCollapsedContainer(element.nextElementSibling)) {
15604
15618
  //we are surrounded by collapse containers, let's favor our previous sibling
15605
15619
  const otherCollapseContainer = element.nextElementSibling;
15606
15620
  const previousSibling = element.previousElementSibling;
@@ -15610,15 +15624,15 @@ class GmailCollapsibleSectionView {
15610
15624
  //now we need to "merge" the two collapse containers. This can be done by taking all the result sections out of the collapsed container
15611
15625
  //and calling our "recollapse" helper function on them
15612
15626
  const elementsToRecollapse = Array.from(otherCollapseContainer.children[0].children).concat(Array.from(otherCollapseContainer.children[1].children));
15613
- if (otherCollapseContainer) this._pulloutSectionsFromCollapsedContainer(otherCollapseContainer);
15614
- this._recollapse(elementsToRecollapse);
15627
+ if (otherCollapseContainer) this.#pulloutSectionsFromCollapsedContainer(otherCollapseContainer);
15628
+ this.#recollapse(elementsToRecollapse);
15615
15629
  } else {
15616
- this._readdToCollapsedContainer();
15630
+ this.#readdToCollapsedContainer();
15617
15631
  }
15618
15632
  }
15619
- _removeFromCollapsedContainer() {
15620
- if (this._headerElement) this._headerElement.classList.add('Wg');
15621
- const element = this._element;
15633
+ #removeFromCollapsedContainer() {
15634
+ if (this.#headerElement) this.#headerElement.classList.add('Wg');
15635
+ const element = this.#element;
15622
15636
  if (!element) return;
15623
15637
  const parentElement = element.parentElement;
15624
15638
  if (!parentElement) return;
@@ -15627,35 +15641,35 @@ class GmailCollapsibleSectionView {
15627
15641
  return;
15628
15642
  }
15629
15643
  const elementsToRecollapse = Array.from(container.children[0].children).concat(Array.from(container.children[1].children));
15630
- this._pulloutSectionsFromCollapsedContainer(container);
15631
- this._destroyCollapsedContainer();
15632
- this._recollapse(elementsToRecollapse.filter(child => child !== element));
15644
+ this.#pulloutSectionsFromCollapsedContainer(container);
15645
+ this.#destroyCollapsedContainer();
15646
+ this.#recollapse(elementsToRecollapse.filter(child => child !== element));
15633
15647
  }
15634
- _pulloutSectionsFromCollapsedContainer(container) {
15648
+ #pulloutSectionsFromCollapsedContainer(container) {
15635
15649
  const prependedChildren = Array.from(container.children[0].children);
15636
15650
  prependedChildren.forEach(child => container.insertAdjacentElement('beforebegin', child));
15637
15651
  const appendedChildren = Array.from(container.children[1].children).reverse();
15638
15652
  appendedChildren.forEach(child => container.insertAdjacentElement('afterend', child));
15639
15653
  }
15640
- _readdToCollapsedContainer() {
15641
- const element = this._element;
15654
+ #readdToCollapsedContainer() {
15655
+ const element = this.#element;
15642
15656
  if (!element) return;
15643
- if (this._collapsedContainer) {
15644
- this._collapsedContainer.children[0].insertBefore(element, this._collapsedContainer.children[1].firstElementChild);
15657
+ if (this.#collapsedContainer) {
15658
+ this.#collapsedContainer.children[0].insertBefore(element, this.#collapsedContainer.children[1].firstElementChild);
15645
15659
  return;
15646
15660
  }
15647
15661
  let collapsedContainer;
15648
15662
  let isPrepend;
15649
- if (this._isCollapsedContainer(element.previousElementSibling)) {
15663
+ if (this.#isCollapsedContainer(element.previousElementSibling)) {
15650
15664
  isPrepend = false;
15651
15665
  collapsedContainer = element.previousElementSibling;
15652
- } else if (this._isCollapsedContainer(element.nextElementSibling)) {
15666
+ } else if (this.#isCollapsedContainer(element.nextElementSibling)) {
15653
15667
  isPrepend = true;
15654
15668
  collapsedContainer = element.nextElementSibling;
15655
15669
  } else {
15656
15670
  isPrepend = true;
15657
- this._createCollapsedContainer();
15658
- collapsedContainer = this._collapsedContainer;
15671
+ this.#createCollapsedContainer();
15672
+ collapsedContainer = this.#collapsedContainer;
15659
15673
  }
15660
15674
  if (isPrepend && collapsedContainer) {
15661
15675
  collapsedContainer.children[0].insertBefore(element, collapsedContainer.children[0].firstElementChild);
@@ -15663,10 +15677,10 @@ class GmailCollapsibleSectionView {
15663
15677
  collapsedContainer.children[0].appendChild(element);
15664
15678
  }
15665
15679
  }
15666
- _isCollapsedContainer(element) {
15680
+ #isCollapsedContainer(element) {
15667
15681
  return element && element.classList.contains('inboxsdk__results_collapsedContainer');
15668
15682
  }
15669
- _recollapse(children) {
15683
+ #recollapse(children) {
15670
15684
  children.forEach(child => {
15671
15685
  const removeEvent = document.createEvent('CustomEvent');
15672
15686
  removeEvent.initCustomEvent('removeCollapsedContainer', false, false, null);
@@ -15676,17 +15690,17 @@ class GmailCollapsibleSectionView {
15676
15690
  child.dispatchEvent(readdEvent);
15677
15691
  });
15678
15692
  }
15679
- _createCollapsedContainer() {
15680
- const collapsedContainer = this._collapsedContainer = document.createElement('div');
15693
+ #createCollapsedContainer() {
15694
+ const collapsedContainer = this.#collapsedContainer = document.createElement('div');
15681
15695
  collapsedContainer.setAttribute('class', 'inboxsdk__results_collapsedContainer Wg');
15682
15696
  collapsedContainer.innerHTML = '<div class="inboxsdk__results_collapsedContainer_prepend"></div><div class="inboxsdk__results_collapsedContainer_append"></div>';
15683
- const element = this._element;
15697
+ const element = this.#element;
15684
15698
  if (element) element.insertAdjacentElement('afterend', collapsedContainer);
15685
15699
  }
15686
- _destroyCollapsedContainer() {
15687
- if (this._collapsedContainer) {
15688
- this._collapsedContainer.remove();
15689
- this._collapsedContainer = null;
15700
+ #destroyCollapsedContainer() {
15701
+ if (this.#collapsedContainer) {
15702
+ this.#collapsedContainer.remove();
15703
+ this.#collapsedContainer = null;
15690
15704
  }
15691
15705
  }
15692
15706
  }
@@ -16169,26 +16183,7 @@ class GmailRouteView {
16169
16183
  if (threadContainerElement === 'destroyed') {
16170
16184
  return;
16171
16185
  }
16172
- const elementStream = (0,make_element_child_stream/* default */.Z)(threadContainerElement).filter(event => !!event.el.querySelector('.if') || !!event.el.querySelector('.PeIF1d') || !!event.el.querySelector('.a98.iY') || event.el.matches('.a98.iY')).onValue(_ref4 => {
16173
- let {
16174
- el
16175
- } = _ref4;
16176
- const versions = [];
16177
-
16178
- // TODO: remove this once we're sure that all users are on the latest version
16179
- if (el.matches(":has(.if)")) {
16180
- versions.push('2014-11-06');
16181
- } else if (el.matches(":has(.PeIF1d)")) {
16182
- versions.push('2022-10-12');
16183
- } else if (el.matches(":has(.a98.iY)")) {
16184
- return versions.push('2022-11-21');
16185
- } else if (el.matches(".a98.iY")) {
16186
- versions.push('2023-11-22');
16187
- }
16188
- this.#driver.logger.eventSdkPassive('routeView#startMonitoringPreviewPaneForThread', {
16189
- versions
16190
- });
16191
- });
16186
+ const elementStream = (0,make_element_child_stream/* default */.Z)(threadContainerElement).filter(event => event.el.matches('.a98.iY'));
16192
16187
  this._eventStream.plug(elementStream.flatMap(makeElementViewStream(element => new gmail_thread_view(element, this, this.#driver, true))).map(view => {
16193
16188
  this._threadView = view;
16194
16189
  return {
@@ -16198,10 +16193,10 @@ class GmailRouteView {
16198
16193
  }));
16199
16194
  }
16200
16195
  #getSectionsContainer() {
16201
- return (0,toItemWithLifetimeStream/* default */.Z)(this.#page.tree.getAllByTag('rowListElementContainer')).takeUntilBy(this._stopper).take(1).map(_ref5 => {
16196
+ return (0,toItemWithLifetimeStream/* default */.Z)(this.#page.tree.getAllByTag('rowListElementContainer')).takeUntilBy(this._stopper).take(1).map(_ref4 => {
16202
16197
  let {
16203
16198
  el
16204
- } = _ref5;
16199
+ } = _ref4;
16205
16200
  const main = el.getValue();
16206
16201
  let sectionsContainer = main.querySelector('.inboxsdk__custom_sections');
16207
16202
  if (!sectionsContainer) {
@@ -19240,7 +19235,7 @@ options.insert = htmlElement => {
19240
19235
  htmlElement.setAttribute('data-inboxsdk-version',
19241
19236
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
19242
19237
  ///@ts-ignore
19243
- "2.1.25-1701718305489-e07cd3aabee5e39f");
19238
+ "2.1.27-1706185810630-874edc85a14e17b3");
19244
19239
  document.head.append(htmlElement);
19245
19240
  };
19246
19241
  options.domAPI = (styleDomAPI_default());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inboxsdk/core",
3
- "version": "2.1.25",
3
+ "version": "2.1.27",
4
4
  "description": "Library for building browser extensions for Gmail",
5
5
  "main": "inboxsdk.js",
6
6
  "author": "Streak",
package/src/inboxsdk.d.ts CHANGED
@@ -33,6 +33,9 @@ import type {
33
33
  default as Toolbars,
34
34
  LegacyToolbarButtonDescriptor,
35
35
  } from './platform-implementation-js/namespaces/toolbars';
36
+ import type CollapsibleSectionView from './platform-implementation-js/views/collapsible-section-view';
37
+ import type ListRouteView from './platform-implementation-js/views/route-view/list-route-view';
38
+ import type SectionView from './platform-implementation-js/views/section-view';
36
39
 
37
40
  export type { User };
38
41
 
@@ -254,14 +257,35 @@ export interface DraftLabelDescriptor {
254
257
  count?: string | number;
255
258
  }
256
259
 
260
+ /**
261
+ * This type is used to describe labels that you add to {@link ThreadRowView} and {@link CollapsibleSectionView}.
262
+ */
257
263
  export interface LabelDescriptor {
264
+ /**
265
+ * Text of the label.
266
+ *
267
+ * @todo marked as required in the docs.
268
+ */
258
269
  title?: string;
270
+ /** @internal is this still used? */
259
271
  titleHtml?: string;
272
+ /** A background color to put on the icon element if present. */
273
+ iconBackgroundColor?: string;
274
+ /**
275
+ * URL for the icon to show on the label. Should be a local extension file URL or a HTTPS URL.
276
+ *
277
+ * @todo marked as required in the docs
278
+ */
260
279
  iconUrl?: string;
280
+ /** A CSS class to apply to the icon. */
261
281
  iconClass?: string;
282
+ /** Html for the icon to show on the label. This property can't be used with iconUrl or iconClass. */
262
283
  iconHtml?: string;
284
+ /** The text color of the label. */
263
285
  foregroundColor?: string;
286
+ /** The background color of the label. */
264
287
  backgroundColor?: string;
288
+ /** Max width for the label title.The default label title max-width is 90px */
265
289
  maxWidth?: string;
266
290
  }
267
291
 
@@ -273,13 +297,7 @@ export interface ThreadRowAttachmentIconDescriptor {
273
297
 
274
298
  export { NavItemView };
275
299
 
276
- export interface SectionView extends EventEmitter {
277
- remove(): void;
278
- }
279
-
280
- export interface CollapsibleSectionView extends SectionView {
281
- setCollapsed(value: boolean): void;
282
- }
300
+ export { SectionView, CollapsibleSectionView };
283
301
 
284
302
  export class RouteView extends EventEmitter {
285
303
  constructor(
@@ -297,12 +315,74 @@ export class RouteView extends EventEmitter {
297
315
  isCustomRouteBelongingToApp(): boolean;
298
316
  }
299
317
 
300
- export interface ListRouteView extends RouteView {
301
- addCollapsibleSection(options: any): CollapsibleSectionView;
302
- addSection(options: any): SectionView;
303
- refresh(): void;
318
+ /**
319
+ * Represents the a single row to render in {@link SectionView}s and {@link CollapsibleSectionView}s
320
+ */
321
+ export interface RowDescriptor {
322
+ /** First textual column */
323
+ title: string;
324
+ /** Second textual column */
325
+ body: string;
326
+ /** Last text right-aligned. Often used for dates. */
327
+ shortDetailText: string;
328
+ /**
329
+ * Whether the row should be rendered as read or unread similar to Gmail styles.
330
+ *
331
+ * @TODO is this actually required like the docs say?
332
+ */
333
+ isRead?: string;
334
+ /** Any labels that should be rendered. */
335
+ labels: LabelDescriptor[];
336
+ /** An optional class to apply to the icon. */
337
+ iconClass?: string;
338
+ /** An optional HTML to an icon to display on the left side of the row */
339
+ iconHtml?: string;
340
+ /** An optional url to an icon to display on the left side of the row */
341
+ iconUrl?: string;
342
+ /** The name of the route to navigate to when the row is clicked on. */
343
+ routeID?: string;
344
+ /** The parameters of the route being navigated to when the row is clicked on. */
345
+ routeParams?: string[];
346
+ /** Callback for when the row is clicked on. */
347
+ onClick?(e: unknown): void;
304
348
  }
305
349
 
350
+ /**
351
+ * The properties required to create a {@link SectionView} or {@link CollapsibleSectionView}.
352
+ */
353
+ export interface SectionDescriptor {
354
+ /** Main title */
355
+ title: string;
356
+ /** Subtitle */
357
+ subtitle?: string | null;
358
+ /** Link to display in the summary area of the {@link SectionView}. Typically page counts are displayed here. */
359
+ titleLinkText?: string;
360
+ /** A function to call when the title link has been clicked. */
361
+ onTitleLinkClick?(e: MouseEvent): void;
362
+ /** Whether to display a dropdown arrow for more options on the collapsible section. */
363
+ hasDropdown?: boolean;
364
+ /**
365
+ * A function to call when the dropdown is opened. Your function is passed an event object with a single dropdown property.
366
+ */
367
+ onDropdownClick?(e: unknown): void;
368
+ /** The rows that should be shown. */
369
+ tableRows?: RowDescriptor[];
370
+ /** An arbitrary HTML element to place above the table rows but below the title. */
371
+ contentElement?: HTMLElement;
372
+ /** A link to place in the footer of the {@link SectionView}. */
373
+ footerLinkText?: string;
374
+ /** A function to call when the link in the footer is clicked. */
375
+ onFooterLinkClick?(e: MouseEvent): void;
376
+ /** @internal */
377
+ orderHint?: unknown;
378
+ /** @internal */
379
+ footerLinkIconUrl?: unknown;
380
+ /** @internal */
381
+ footerLinkIconClass?: unknown;
382
+ }
383
+
384
+ export { ListRouteView };
385
+
306
386
  export interface CustomRouteView extends RouteView {
307
387
  getElement(): HTMLElement;
308
388
  }
@@ -1,61 +1,15 @@
1
1
  import * as Kefir from 'kefir';
2
2
  import type { Bus } from 'kefir-bus';
3
3
  import type GmailDriver from '../gmail-driver';
4
+ import type { SectionDescriptor } from '../../../../inboxsdk';
4
5
  declare class GmailCollapsibleSectionView {
5
- _driver: GmailDriver;
6
- _groupOrderHint: number;
7
- _isReadyDeferred: Record<string, any>;
8
- _isCollapsible: boolean;
9
- _collapsibleSectionDescriptor: Record<string, any>;
10
- _isSearch: boolean;
11
- _element: HTMLElement | null | undefined;
12
- _headerElement: HTMLElement | null | undefined;
13
- _titleElement: HTMLElement | null | undefined;
14
- _bodyElement: HTMLElement | null | undefined;
15
- _contentElement: HTMLElement | null | undefined;
16
- _tableBodyElement: HTMLElement | null | undefined;
17
- _collapsedContainer: HTMLElement | null | undefined;
18
- _messageElement: HTMLElement | null | undefined;
19
- _footerElement: HTMLElement | null | undefined;
20
- _eventStream: Bus<any, unknown>;
21
- _isCollapsed: boolean;
22
- _inboxDropdownButtonView: Record<string, any> | null | undefined;
23
- _dropdownViewController: Record<string, any> | null | undefined;
6
+ #private;
24
7
  constructor(driver: GmailDriver, groupOrderHint: number, isSearch: boolean, isCollapsible: boolean);
25
8
  destroy(): void;
26
9
  getElement(): HTMLElement;
27
10
  getEventStream(): Bus<any, unknown>;
28
- setCollapsibleSectionDescriptorProperty(collapsibleSectionDescriptorProperty: Kefir.Observable<Record<string, any> | null | undefined, unknown>): void;
11
+ setCollapsibleSectionDescriptorProperty(collapsibleSectionDescriptorProperty: Kefir.Observable<SectionDescriptor | null | undefined, unknown>): void;
29
12
  setCollapsed(value: boolean): void;
30
- _updateValues(collapsibleSectionDescriptor: Record<string, any> | null | undefined): void;
31
- _setupElement(collapsibleSectionDescriptor: Record<string, any>): void;
32
- _setupHeader(collapsibleSectionDescriptor: Record<string, any>): void;
33
- _setupGmailv2Header(headerElement: HTMLElement, collapsibleSectionDescriptor: Record<string, any>): void;
34
- _setupFooter(): void;
35
- _updateElement(collapsibleSectionDescriptor: Record<string, any>): void;
36
- _updateHeader(collapsibleSectionDescriptor: Record<string, any>): void;
37
- _updateTitle(collapsibleSectionDescriptor: Record<string, any>): void;
38
- _updateSubtitle(collapsibleSectionDescriptor: Record<string, any>): void;
39
- _updateSummaryText(collapsibleSectionDescriptor: Record<string, any>): void;
40
- _updateDropdown(collapsibleSectionDescriptor: Record<string, any>): void;
41
- _updateContentElement(collapsibleSectionDescriptor: Record<string, any>): void;
42
- _updateTableRows(collapsibleSectionDescriptor: Record<string, any>): void;
43
- _renderTable(tableRows: Array<Record<string, any>>): void;
44
- _updateMessageElement(collapsibleSectionDescriptor: Record<string, any>): void;
45
- _showLoadingMessage(): void;
46
- _showEmptyMessage(): void;
47
- _updateFooter(collapsibleSectionDescriptor: Record<string, any>): void;
48
- _toggleCollapseState(): void;
49
- _collapse(): void;
50
- _expand(): void;
51
- _addToCollapsedContainer(): void;
52
- _removeFromCollapsedContainer(): void;
53
- _pulloutSectionsFromCollapsedContainer(container: HTMLElement): void;
54
- _readdToCollapsedContainer(): void;
55
- _isCollapsedContainer(element: any): any;
56
- _recollapse(children: Array<Record<string, any>>): void;
57
- _createCollapsedContainer(): void;
58
- _destroyCollapsedContainer(): void;
59
13
  }
60
14
  export default GmailCollapsibleSectionView;
61
15
  //# sourceMappingURL=gmail-collapsible-section-view.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"gmail-collapsible-section-view.d.ts","sourceRoot":"","sources":["../../../../../../../src/platform-implementation-js/dom-driver/gmail/views/gmail-collapsible-section-view.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAOrC,OAAO,KAAK,WAAW,MAAM,iBAAiB,CAAC;AAE/C,cAAM,2BAA2B;IAC/B,OAAO,EAAE,WAAW,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACtC,cAAc,EAAE,OAAO,CAAC;IACxB,6BAA6B,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IACxD,SAAS,EAAE,OAAO,CAAC;IACnB,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AE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAqBhD,yBAAyB;IAczB,0BAA0B;CAO3B;AAiID,eAAe,2BAA2B,CAAC"}
1
+ {"version":3,"file":"gmail-collapsible-section-view.d.ts","sourceRoot":"","sources":["../../../../../../../src/platform-implementation-js/dom-driver/gmail/views/gmail-collapsible-section-view.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAOrC,OAAO,KAAK,WAAW,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAGV,iBAAiB,EAClB,MAAM,sBAAsB,CAAC;AAE9B,cAAM,2BAA2B;;gBAuB7B,MAAM,EAAE,WAAW,EACnB,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,OAAO,EACjB,aAAa,EAAE,OAAO;IAUxB,OAAO;IAcP,UAAU,IAAI,WAAW;IAOzB,cAAc;IAId,uCAAuC,CACrC,oCAAoC,EAAE,KAAK,CAAC,UAAU,CACpD,iBAAiB,GAAG,IAAI,GAAG,SAAS,EACpC,OAAO,CACR;IASH,YAAY,CAAC,KAAK,EAAE,OAAO;CAkrB5B;AAiID,eAAe,2BAA2B,CAAC"}
@@ -5,6 +5,7 @@ import GmailThreadView from '../gmail-thread-view';
5
5
  import GmailCollapsibleSectionView from '../gmail-collapsible-section-view';
6
6
  import type GmailDriver from '../../gmail-driver';
7
7
  import type GmailRouteProcessor from '../gmail-route-view/gmail-route-processor';
8
+ import { type SectionDescriptor } from '../../../../../inboxsdk';
8
9
  declare class GmailRouteView {
9
10
  #private;
10
11
  _type: string;
@@ -43,8 +44,8 @@ declare class GmailRouteView {
43
44
  getType(): string;
44
45
  isCustomRouteBelongingToApp(): boolean;
45
46
  getParams: () => Record<string, string>;
46
- addCollapsibleSection(sectionDescriptorProperty: Kefir.Observable<Record<string, any> | null | undefined, unknown>, groupOrderHint: any): GmailCollapsibleSectionView;
47
- addSection(sectionDescriptorProperty: Kefir.Observable<Record<string, any> | null | undefined, unknown>, groupOrderHint: any): GmailCollapsibleSectionView;
47
+ addCollapsibleSection(sectionDescriptorProperty: Kefir.Observable<SectionDescriptor | null | undefined, unknown>, groupOrderHint: number): GmailCollapsibleSectionView;
48
+ addSection(sectionDescriptorProperty: Kefir.Observable<SectionDescriptor | null | undefined, unknown>, groupOrderHint: number): GmailCollapsibleSectionView;
48
49
  _setupCustomViewElement(): void;
49
50
  _monitorLeftNavHeight(): void;
50
51
  _setCustomViewElementHeight(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"gmail-route-view.d.ts","sourceRoot":"","sources":["../../../../../../../../src/platform-implementation-js/dom-driver/gmail/views/gmail-route-view/gmail-route-view.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAOrC,OAAO,gBAAgB,MAAM,wBAAwB,CAAC;AACtD,OAAO,eAAe,MAAM,sBAAsB,CAAC;AACnD,OAAO,2BAA2B,MAAM,mCAAmC,CAAC;AAG5E,OAAO,KAAK,WAAW,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,mBAAmB,MAAM,2CAA2C,CAAC;AASjF,cAAM,cAAc;;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,cAAc,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC1C,QAAQ,kCAAkB;IAC1B,aAAa,EAAE,gBAAgB,EAAE,CAAC;IAClC,oBAAoB,EAAE,mBAAmB,CAAC;IAE1C,YAAY,EAAE,GAAG,CACb;QAAE,SAAS,EAAE,qBAAqB,CAAC;QAAC,IAAI,EAAE,gBAAgB,CAAA;KAAE,GAC5D;QACE,SAAS,EAAE,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,gBAAgB,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAyBvC,gBAAgB,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAcvC,cAAc,IAAI,OAAO;IAOzB,mBAAmB,IAAI,OAAO;IAI9B,cAAc,IAAI,OAAO;IAQzB,qBAAqB,IAAI,OAAO;IAMhC,aAAa,IAAI,OAAO;IAQxB,YAAY,IAAI,OAAO;IAKvB,YAAY,IAAI,MAAM;IAoBtB,cAAc,IAAI,OAAO;IAIzB,YAAY,IAAI,OAAO;IASvB,gBAAgB,IAAI,OAAO;IAI3B,qBAAqB,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAQ5C,mBAAmB,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAe1C,qBAAqB,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAuC5C,uBAAuB,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAM9C,aAAa,IAAI,MAAM;IAUvB,UAAU,IAAI,MAAM;IAmBpB,OAAO;IAoBP,kBAAkB;IAClB,YAAY;IAIZ,4BAA4B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE;IAOvD,0BAA0B;CAG3B;AAED,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"gmail-route-view.d.ts","sourceRoot":"","sources":["../../../../../../../../src/platform-implementation-js/dom-driver/gmail/views/gmail-route-view/gmail-route-view.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAOrC,OAAO,gBAAgB,MAAM,wBAAwB,CAAC;AACtD,OAAO,eAAe,MAAM,sBAAsB,CAAC;AACnD,OAAO,2BAA2B,MAAM,mCAAmC,CAAC;AAG5E,OAAO,KAAK,WAAW,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,mBAAmB,MAAM,2CAA2C,C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@@ -1,5 +1,6 @@
1
1
  import type * as Kefir from 'kefir';
2
2
  import type GmailCollapsibleSectionView from '../dom-driver/gmail/views/gmail-collapsible-section-view';
3
+ import { SectionDescriptor } from '../../inboxsdk';
3
4
  export type MinRouteViewDriver = {
4
5
  getRouteType(): string;
5
6
  getRouteID(): string;
@@ -12,7 +13,7 @@ export type RouteViewDriver = MinRouteViewDriver & {
12
13
  getType(): string;
13
14
  getHash(): string;
14
15
  addSection(sectionDescriptorProperty: Kefir.Observable<Record<string, any> | null | undefined, unknown>, groupOrderHint: any): GmailCollapsibleSectionView;
15
- addCollapsibleSection(sectionDescriptorProperty: Kefir.Observable<Record<string, any> | null | undefined, unknown>, groupOrderHint: any): GmailCollapsibleSectionView;
16
+ addCollapsibleSection(sectionDescriptorProperty: Kefir.Observable<SectionDescriptor | null | undefined, unknown>, groupOrderHint: any): GmailCollapsibleSectionView;
16
17
  getCustomViewElement(): HTMLElement | null | undefined;
17
18
  setFullWidth(fullWidth: boolean): void;
18
19
  };
@@ -1 +1 @@
1
- {"version":3,"file":"route-view-driver.d.ts","sourceRoot":"","sources":["../../../../../src/platform-implementation-js/driver-interfaces/route-view-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,2BAA2B,MAAM,0DAA0D,CAAC;AAExG,MAAM,MAAM,kBAAkB,GAAG;IAC/B,YAAY,IAAI,MAAM,CAAC;IACvB,UAAU,IAAI,MAAM,CAAC;IACrB,SAAS,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,cAAc,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC;IACjE,UAAU,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,kBAAkB,GAAG;IACjD,OAAO,IAAI,IAAI,CAAC;IAChB,OAAO,IAAI,MAAM,CAAC;IAClB,OAAO,IAAI,MAAM,CAAC;IAClB,UAAU,CACR,yBAAyB,EAAE,KAAK,CAAC,UAAU,CACzC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,GAAG,SAAS,EACtC,OAAO,CACR,EACD,cAAc,EAAE,GAAG,GAClB,2BAA2B,CAAC;IAC/B,qBAAqB,CACnB,yBAAyB,EAAE,KAAK,CAAC,UAAU,CACzC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,GAAG,SAAS,EACtC,OAAO,CACR,EACD,cAAc,EAAE,GAAG,GAClB,2BAA2B,CAAC;IAC/B,oBAAoB,IAAI,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;IACvD,YAAY,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAAC;CACxC,CAAC"}
1
+ {"version":3,"file":"route-view-driver.d.ts","sourceRoot":"","sources":["../../../../../src/platform-implementation-js/driver-interfaces/route-view-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,2BAA2B,MAAM,0DAA0D,CAAC;AACxG,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,YAAY,IAAI,MAAM,CAAC;IACvB,UAAU,IAAI,MAAM,CAAC;IACrB,SAAS,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,cAAc,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC;IACjE,UAAU,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,kBAAkB,GAAG;IACjD,OAAO,IAAI,IAAI,CAAC;IAChB,OAAO,IAAI,MAAM,CAAC;IAClB,OAAO,IAAI,MAAM,CAAC;IAClB,UAAU,CACR,yBAAyB,EAAE,KAAK,CAAC,UAAU,CACzC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,GAAG,SAAS,EACtC,OAAO,CACR,EACD,cAAc,EAAE,GAAG,GAClB,2BAA2B,CAAC;IAC/B,qBAAqB,CACnB,yBAAyB,EAAE,KAAK,CAAC,UAAU,CACzC,iBAAiB,GAAG,IAAI,GAAG,SAAS,EACpC,OAAO,CACR,EACD,cAAc,EAAE,GAAG,GAClB,2BAA2B,CAAC;IAC/B,oBAAoB,IAAI,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;IACvD,YAAY,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAAC;CACxC,CAAC"}
@@ -1,10 +1,21 @@
1
1
  import EventEmitter from '../lib/safe-event-emitter';
2
2
  import type { Driver } from '../driver-interfaces/driver';
3
3
  import type GmailCollapsibleSectionView from '../dom-driver/gmail/views/gmail-collapsible-section-view';
4
+ /**
5
+ * {@link CollapsibleSectionView}s allow you to display additional content on ListRouteViews. They are typically rendered as additional content above the list of threads below. The visual style is similar to that of multiple inbox sections used in native Gmail. Note that the rendering may vary slightly depending on the actual ListRouteView that the {@link CollapsibleSectionView} is rendered in. For example, {@link CollapsibleSectionViews} rendered on search results pages use different header styles to match Gmail's style more accurately.
6
+
7
+ * You can either render rows (that are visually similar to Gmail rows) or custom content in your {@link CollapsibleSectionView}. Until content is provided, the SectionView will simply display a "Loading..." indicator.
8
+ *
9
+ * @see ListRouteView.addCollapsibleSection for more information.
10
+ * @todo the docs mention this class extending SectionView. That doesn't seem to be the case.
11
+ */
4
12
  declare class CollapsibleSectionView extends EventEmitter {
13
+ #private;
14
+ /** This property is set to true once the view is destroyed. */
5
15
  destroyed: boolean;
6
16
  constructor(collapsibleSectionViewDriver: GmailCollapsibleSectionView, driver: Driver);
7
17
  setCollapsed(value: boolean): void;
18
+ /** Removes this section from the current Route */
8
19
  remove(): void;
9
20
  destroy(): void;
10
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"collapsible-section-view.d.ts","sourceRoot":"","sources":["../../../../../src/platform-implementation-js/views/collapsible-section-view.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,2BAA2B,CAAC;AAErD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,KAAK,2BAA2B,MAAM,0DAA0D,CAAC;AAGxG,cAAM,sBAAuB,SAAQ,YAAY;IAC/C,SAAS,EAAE,OAAO,CAAC;gBAGjB,4BAA4B,EAAE,2BAA2B,EACzD,MAAM,EAAE,MAAM;IAYhB,YAAY,CAAC,KAAK,EAAE,OAAO;IAI3B,MAAM;IAIN,OAAO;CAKR;AA4CD,eAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"collapsible-section-view.d.ts","sourceRoot":"","sources":["../../../../../src/platform-implementation-js/views/collapsible-section-view.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,2BAA2B,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,KAAK,2BAA2B,MAAM,0DAA0D,CAAC;AAExG;;;;;;;EAOE;AACF,cAAM,sBAAuB,SAAQ,YAAY;;IAC/C,+DAA+D;IAC/D,SAAS,EAAE,OAAO,CAAC;gBAIjB,4BAA4B,EAAE,2BAA2B,EACzD,MAAM,EAAE,MAAM;IAShB,YAAY,CAAC,KAAK,EAAE,OAAO;IAI3B,kDAAkD;IAClD,MAAM;IAIN,OAAO;CAIR;AA4CD,eAAe,sBAAsB,CAAC"}
@@ -1,12 +1,23 @@
1
1
  import RouteView from './route-view';
2
+ import { Observable } from 'kefir';
2
3
  import CollapsibleSectionView from '../collapsible-section-view';
3
4
  import SectionView from '../section-view';
4
5
  import type { RouteViewDriver } from '../../driver-interfaces/route-view-driver';
5
6
  import type { Driver } from '../../driver-interfaces/driver';
7
+ import type { SectionDescriptor } from '../../../inboxsdk';
8
+ /**
9
+ * Extends {@link RouteView}. {@link ListRouteView}s represent pages within Gmail that show a list of emails. Typical examples are the Inbox, Sent Mail, Drafts, etc. However, views like the Conversation view or Settings would not be a ListRouteView.
10
+ */
6
11
  declare class ListRouteView extends RouteView {
12
+ #private;
7
13
  constructor(routeViewDriver: RouteViewDriver, driver: Driver, appId: string);
8
- addCollapsibleSection(collapsibleSectionDescriptor: Record<string, any> | null | undefined): CollapsibleSectionView;
14
+ /**
15
+ * Adds a collapsible section to the top of the page.
16
+ */
17
+ addCollapsibleSection(collapsibleSectionDescriptor: SectionDescriptor | Observable<SectionDescriptor | null | undefined, unknown> | null | undefined): CollapsibleSectionView;
18
+ /** Adds a non-collapsible section to the top of the page. */
9
19
  addSection(sectionDescriptor: Record<string, any> | null | undefined): SectionView;
20
+ /** Simulates a click on the Gmail thread list refresh button. */
10
21
  refresh(): void;
11
22
  }
12
23
  export default ListRouteView;
@@ -1 +1 @@
1
- {"version":3,"file":"list-route-view.d.ts","sourceRoot":"","sources":["../../../../../../src/platform-implementation-js/views/route-view/list-route-view.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,cAAc,CAAC;AAGrC,OAAO,sBAAsB,MAAM,6BAA6B,CAAC;AACjE,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAE1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAE7D,cAAM,aAAc,SAAQ,SAAS;gBACvB,eAAe,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAa3E,qBAAqB,CACnB,4BAA4B,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,GAAG,SAAS,GACnE,sBAAsB;IAezB,UAAU,CACR,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,GAAG,SAAS,GACxD,WAAW;IAWd,OAAO;CAGR;AAgBD,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"list-route-view.d.ts","sourceRoot":"","sources":["../../../../../../src/platform-implementation-js/views/route-view/list-route-view.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAc,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,sBAAsB,MAAM,6BAA6B,CAAC;AACjE,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D;;GAEG;AACH,cAAM,aAAc,SAAQ,SAAS;;gBAMvB,eAAe,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAS3E;;OAEG;IACH,qBAAqB,CACnB,4BAA4B,EACxB,iBAAiB,GACjB,UAAU,CAAC,iBAAiB,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,CAAC,GACzD,IAAI,GACJ,SAAS,GACZ,sBAAsB;IAoBzB,6DAA6D;IAC7D,UAAU,CACR,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,GAAG,SAAS,GACxD,WAAW;IAUd,iEAAiE;IACjE,OAAO;CAWR;AAED,eAAe,aAAa,CAAC"}
@@ -2,6 +2,7 @@ import EventEmitter from '../lib/safe-event-emitter';
2
2
  import type { Driver } from '../driver-interfaces/driver';
3
3
  import type GmailCollapsibleSectionView from '../dom-driver/gmail/views/gmail-collapsible-section-view';
4
4
  declare class SectionView extends EventEmitter {
5
+ #private;
5
6
  destroyed: boolean;
6
7
  constructor(sectionViewDriver: GmailCollapsibleSectionView, driver: Driver);
7
8
  remove(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"section-view.d.ts","sourceRoot":"","sources":["../../../../../src/platform-implementation-js/views/section-view.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,2BAA2B,CAAC;AAErD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,KAAK,2BAA2B,MAAM,0DAA0D,CAAC;AAGxG,cAAM,WAAY,SAAQ,YAAY;IACpC,SAAS,EAAE,OAAO,CAAC;gBAEP,iBAAiB,EAAE,2BAA2B,EAAE,MAAM,EAAE,MAAM;IAW1E,MAAM;IAIN,OAAO;CAKR;AAoDD,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"section-view.d.ts","sourceRoot":"","sources":["../../../../../src/platform-implementation-js/views/section-view.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,2BAA2B,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,KAAK,2BAA2B,MAAM,0DAA0D,CAAC;AAExG,cAAM,WAAY,SAAQ,YAAY;;IACpC,SAAS,EAAE,OAAO,CAAC;gBAGP,iBAAiB,EAAE,2BAA2B,EAAE,MAAM,EAAE,MAAM;IAQ1E,MAAM;IAIN,OAAO;CAIR;AAoDD,eAAe,WAAW,CAAC"}