@inboxsdk/core 2.1.26 → 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 +240 -226
- package/package.json +1 -1
- package/src/inboxsdk.d.ts +91 -11
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-collapsible-section-view.d.ts +3 -49
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-collapsible-section-view.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-route-view/gmail-route-view.d.ts +3 -2
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-route-view/gmail-route-view.d.ts.map +1 -1
- package/src/platform-implementation-js/driver-interfaces/route-view-driver.d.ts +2 -1
- package/src/platform-implementation-js/driver-interfaces/route-view-driver.d.ts.map +1 -1
- package/src/platform-implementation-js/views/collapsible-section-view.d.ts +11 -0
- package/src/platform-implementation-js/views/collapsible-section-view.d.ts.map +1 -1
- package/src/platform-implementation-js/views/route-view/list-route-view.d.ts +12 -1
- package/src/platform-implementation-js/views/route-view/list-route-view.d.ts.map +1 -1
- package/src/platform-implementation-js/views/section-view.d.ts +1 -0
- package/src/platform-implementation-js/views/section-view.d.ts.map +1 -1
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.
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
12167
|
-
|
|
12168
|
-
|
|
12169
|
-
|
|
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
|
|
12177
|
-
const
|
|
12178
|
-
|
|
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
|
|
12184
|
-
const
|
|
12185
|
-
|
|
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
|
-
|
|
12200
|
+
this.#routeViewDriver.refresh();
|
|
12191
12201
|
}
|
|
12192
|
-
|
|
12193
|
-
|
|
12194
|
-
|
|
12195
|
-
|
|
12196
|
-
|
|
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
|
-
|
|
15220
|
-
|
|
15221
|
-
|
|
15222
|
-
|
|
15223
|
-
|
|
15224
|
-
|
|
15225
|
-
|
|
15226
|
-
|
|
15227
|
-
|
|
15228
|
-
|
|
15229
|
-
|
|
15230
|
-
|
|
15231
|
-
|
|
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
|
|
15234
|
-
this
|
|
15235
|
-
this
|
|
15236
|
-
this
|
|
15237
|
-
this
|
|
15238
|
-
this
|
|
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
|
|
15242
|
-
if (this
|
|
15243
|
-
if (this
|
|
15244
|
-
if (this
|
|
15245
|
-
if (this
|
|
15246
|
-
if (this
|
|
15247
|
-
if (this
|
|
15248
|
-
if (this
|
|
15249
|
-
if (this
|
|
15250
|
-
if (this
|
|
15251
|
-
if (this
|
|
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
|
|
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
|
|
15273
|
+
return this.#eventStream;
|
|
15260
15274
|
}
|
|
15261
15275
|
setCollapsibleSectionDescriptorProperty(collapsibleSectionDescriptorProperty) {
|
|
15262
|
-
const stoppedProperty = collapsibleSectionDescriptorProperty.takeUntilBy(this.
|
|
15263
|
-
stoppedProperty.onValue(x => this
|
|
15264
|
-
stoppedProperty.take(1).onValue(() => 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
|
|
15281
|
+
if (!this.#isCollapsible) {
|
|
15268
15282
|
return;
|
|
15269
15283
|
}
|
|
15270
|
-
this.
|
|
15271
|
-
if (value) this
|
|
15284
|
+
this.#isReadyDeferred.promise.then(() => {
|
|
15285
|
+
if (value) this.#collapse();else this.#expand();
|
|
15272
15286
|
});
|
|
15273
15287
|
}
|
|
15274
|
-
|
|
15275
|
-
const element = this
|
|
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
|
|
15286
|
-
this
|
|
15299
|
+
this.#setupElement(collapsibleSectionDescriptor);
|
|
15300
|
+
this.#showLoadingMessage();
|
|
15287
15301
|
} else {
|
|
15288
|
-
this
|
|
15289
|
-
}
|
|
15290
|
-
this
|
|
15291
|
-
this
|
|
15292
|
-
this
|
|
15293
|
-
this
|
|
15294
|
-
this
|
|
15295
|
-
this
|
|
15296
|
-
this
|
|
15297
|
-
this
|
|
15298
|
-
this
|
|
15299
|
-
this
|
|
15300
|
-
}
|
|
15301
|
-
|
|
15302
|
-
const element = this
|
|
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
|
|
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
|
|
15307
|
-
this
|
|
15308
|
-
const bodyElement = this
|
|
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
|
|
15327
|
+
const contentElement = this.#contentElement = document.createElement('div');
|
|
15314
15328
|
bodyContentsElement.appendChild(contentElement);
|
|
15315
|
-
const messageElement = this
|
|
15329
|
+
const messageElement = this.#messageElement = document.createElement('div');
|
|
15316
15330
|
bodyContentsElement.appendChild(messageElement);
|
|
15317
|
-
const tableBodyElement = this
|
|
15331
|
+
const tableBodyElement = this.#tableBodyElement = document.createElement('div');
|
|
15318
15332
|
bodyContentsElement.appendChild(tableBodyElement);
|
|
15319
|
-
this
|
|
15320
|
-
if (this
|
|
15321
|
-
kefir_esm.fromEvents(this
|
|
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
|
|
15324
|
-
kefir_esm.fromEvents(element, 'readdToCollapsedContainer').onValue(() => this
|
|
15325
|
-
this.
|
|
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
|
-
|
|
15332
|
-
const headerElement = this
|
|
15345
|
+
#setupHeader(collapsibleSectionDescriptor) {
|
|
15346
|
+
const headerElement = this.#headerElement = document.createElement('div');
|
|
15333
15347
|
headerElement.classList.add('inboxsdk__resultsSection_header', 'Wg');
|
|
15334
|
-
this
|
|
15335
|
-
if (this
|
|
15348
|
+
this.#setupGmailv2Header(headerElement, collapsibleSectionDescriptor);
|
|
15349
|
+
if (this.#element) this.#element.appendChild(headerElement);
|
|
15336
15350
|
}
|
|
15337
|
-
|
|
15338
|
-
const titleElement = this
|
|
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
|
|
15357
|
+
if (this.#isSearch) floatRightElement.classList.add('Wg');
|
|
15344
15358
|
headerElement.appendChild(titleElement);
|
|
15345
15359
|
headerElement.appendChild(floatRightElement);
|
|
15346
15360
|
}
|
|
15347
|
-
|
|
15348
|
-
const footerElement = this
|
|
15361
|
+
#setupFooter() {
|
|
15362
|
+
const footerElement = this.#footerElement = document.createElement('div');
|
|
15349
15363
|
footerElement.classList.add('inboxsdk__resultsSection_footer');
|
|
15350
|
-
if (this
|
|
15364
|
+
if (this.#bodyElement) this.#bodyElement.appendChild(footerElement);
|
|
15351
15365
|
}
|
|
15352
|
-
|
|
15353
|
-
if (this.
|
|
15354
|
-
const element = this
|
|
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.
|
|
15370
|
+
this.#eventStream.emit({
|
|
15357
15371
|
type: 'update',
|
|
15358
15372
|
property: 'orderHint'
|
|
15359
15373
|
});
|
|
15360
15374
|
}
|
|
15361
15375
|
}
|
|
15362
|
-
|
|
15363
|
-
if (this
|
|
15364
|
-
if (this
|
|
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
|
|
15380
|
+
if (this.#headerElement) this.#headerElement.style.display = 'none';
|
|
15367
15381
|
}
|
|
15368
15382
|
}
|
|
15369
|
-
|
|
15370
|
-
if (this.
|
|
15383
|
+
#updateTitle(collapsibleSectionDescriptor) {
|
|
15384
|
+
if (this.#collapsibleSectionDescriptor.title !== collapsibleSectionDescriptor.title) {
|
|
15371
15385
|
const selector = 'h3 > .Wn';
|
|
15372
|
-
if (this
|
|
15373
|
-
(0,querySelectorOrFail/* default */.Z)(this
|
|
15386
|
+
if (this.#titleElement) {
|
|
15387
|
+
(0,querySelectorOrFail/* default */.Z)(this.#titleElement, selector).textContent = collapsibleSectionDescriptor.title;
|
|
15374
15388
|
}
|
|
15375
15389
|
}
|
|
15376
15390
|
}
|
|
15377
|
-
|
|
15378
|
-
const titleElement = this
|
|
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.
|
|
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
|
-
|
|
15401
|
-
const headerElement = this
|
|
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.
|
|
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"> ', '<div class="J-J5-Ji amH">', '<span class="Dj">', '<span></span>', '</span>', ' ', '</div>', '</span>'].join('');
|
|
15413
|
-
this.
|
|
15427
|
+
this.#eventStream.plug(kefir_esm.fromEvents(summaryTextElement, 'click').map(() => ({
|
|
15414
15428
|
eventName: 'titleLinkClicked',
|
|
15415
|
-
sectionDescriptor: this
|
|
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
|
-
|
|
15444
|
+
#updateDropdown(collapsibleSectionDescriptor) {
|
|
15431
15445
|
if (!collapsibleSectionDescriptor.hasDropdown || !collapsibleSectionDescriptor.onDropdownClick) {
|
|
15432
|
-
if (this
|
|
15433
|
-
if (this
|
|
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
|
|
15436
|
-
const inboxDropdownButtonView = this
|
|
15437
|
-
this
|
|
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
|
|
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.
|
|
15448
|
-
if (this
|
|
15461
|
+
} else if (collapsibleSectionDescriptor.onDropdownClick !== this.#collapsibleSectionDescriptor.onDropdownClick) {
|
|
15462
|
+
if (this.#dropdownViewController) this.#dropdownViewController.setDropdownShowFunction(collapsibleSectionDescriptor.onDropdownClick);
|
|
15449
15463
|
}
|
|
15450
15464
|
}
|
|
15451
15465
|
}
|
|
15452
|
-
|
|
15453
|
-
const contentElement = this
|
|
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
|
-
|
|
15477
|
+
#updateTableRows(collapsibleSectionDescriptor) {
|
|
15464
15478
|
const {
|
|
15465
15479
|
tableRows
|
|
15466
15480
|
} = collapsibleSectionDescriptor;
|
|
15467
|
-
const tableBodyElement = this
|
|
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
|
|
15488
|
+
this.#renderTable(tableRows);
|
|
15475
15489
|
}
|
|
15476
15490
|
}
|
|
15477
|
-
|
|
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
|
|
15495
|
+
if (this.#tableBodyElement) this.#tableBodyElement.appendChild(tableElement);
|
|
15482
15496
|
const tbody = tableElement.querySelector('tbody');
|
|
15483
|
-
const eventStream = this
|
|
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
|
-
|
|
15497
|
-
const messageElement = this
|
|
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
|
|
15518
|
+
this.#showEmptyMessage();
|
|
15505
15519
|
}
|
|
15506
15520
|
}
|
|
15507
|
-
|
|
15508
|
-
const messageElement = this
|
|
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
|
-
|
|
15517
|
-
const messageElement = this
|
|
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
|
-
|
|
15526
|
-
const footerElement = this
|
|
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.
|
|
15550
|
+
this.#eventStream.plug(kefir_esm.fromEvents(footerLinkElement, 'click').map(() => {
|
|
15537
15551
|
return {
|
|
15538
15552
|
eventName: 'footerClicked',
|
|
15539
|
-
sectionDescriptor: this
|
|
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
|
-
|
|
15547
|
-
if (this
|
|
15548
|
-
this
|
|
15560
|
+
#toggleCollapseState() {
|
|
15561
|
+
if (this.#isCollapsed) {
|
|
15562
|
+
this.#expand();
|
|
15549
15563
|
} else {
|
|
15550
|
-
this
|
|
15564
|
+
this.#collapse();
|
|
15551
15565
|
}
|
|
15552
15566
|
}
|
|
15553
|
-
|
|
15554
|
-
const element = this
|
|
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
|
|
15560
|
-
this
|
|
15573
|
+
if (!this.#isSearch) {
|
|
15574
|
+
this.#addToCollapsedContainer();
|
|
15561
15575
|
}
|
|
15562
15576
|
const selector = 'h3 > img.Wp';
|
|
15563
|
-
if (this
|
|
15564
|
-
const arrowSpan = (0,querySelectorOrFail/* default */.Z)(this
|
|
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
|
|
15571
|
-
this
|
|
15572
|
-
this.
|
|
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
|
-
|
|
15577
|
-
const element = this
|
|
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
|
|
15583
|
-
this
|
|
15596
|
+
if (!this.#isSearch) {
|
|
15597
|
+
this.#removeFromCollapsedContainer();
|
|
15584
15598
|
}
|
|
15585
15599
|
const selector = 'h3 > img.Wp';
|
|
15586
|
-
if (this
|
|
15587
|
-
const arrowSpan = (0,querySelectorOrFail/* default */.Z)(this
|
|
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
|
|
15594
|
-
this
|
|
15595
|
-
this.
|
|
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
|
-
|
|
15600
|
-
const element = this
|
|
15613
|
+
#addToCollapsedContainer() {
|
|
15614
|
+
const element = this.#element;
|
|
15601
15615
|
if (!element) return;
|
|
15602
|
-
if (this
|
|
15603
|
-
if (this
|
|
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
|
|
15614
|
-
this
|
|
15627
|
+
if (otherCollapseContainer) this.#pulloutSectionsFromCollapsedContainer(otherCollapseContainer);
|
|
15628
|
+
this.#recollapse(elementsToRecollapse);
|
|
15615
15629
|
} else {
|
|
15616
|
-
this
|
|
15630
|
+
this.#readdToCollapsedContainer();
|
|
15617
15631
|
}
|
|
15618
15632
|
}
|
|
15619
|
-
|
|
15620
|
-
if (this
|
|
15621
|
-
const element = this
|
|
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
|
|
15631
|
-
this
|
|
15632
|
-
this
|
|
15644
|
+
this.#pulloutSectionsFromCollapsedContainer(container);
|
|
15645
|
+
this.#destroyCollapsedContainer();
|
|
15646
|
+
this.#recollapse(elementsToRecollapse.filter(child => child !== element));
|
|
15633
15647
|
}
|
|
15634
|
-
|
|
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
|
-
|
|
15641
|
-
const element = this
|
|
15654
|
+
#readdToCollapsedContainer() {
|
|
15655
|
+
const element = this.#element;
|
|
15642
15656
|
if (!element) return;
|
|
15643
|
-
if (this
|
|
15644
|
-
this.
|
|
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
|
|
15663
|
+
if (this.#isCollapsedContainer(element.previousElementSibling)) {
|
|
15650
15664
|
isPrepend = false;
|
|
15651
15665
|
collapsedContainer = element.previousElementSibling;
|
|
15652
|
-
} else if (this
|
|
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
|
|
15658
|
-
collapsedContainer = this
|
|
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
|
-
|
|
15680
|
+
#isCollapsedContainer(element) {
|
|
15667
15681
|
return element && element.classList.contains('inboxsdk__results_collapsedContainer');
|
|
15668
15682
|
}
|
|
15669
|
-
|
|
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
|
-
|
|
15680
|
-
const collapsedContainer = this
|
|
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
|
|
15697
|
+
const element = this.#element;
|
|
15684
15698
|
if (element) element.insertAdjacentElement('afterend', collapsedContainer);
|
|
15685
15699
|
}
|
|
15686
|
-
|
|
15687
|
-
if (this
|
|
15688
|
-
this.
|
|
15689
|
-
this
|
|
15700
|
+
#destroyCollapsedContainer() {
|
|
15701
|
+
if (this.#collapsedContainer) {
|
|
15702
|
+
this.#collapsedContainer.remove();
|
|
15703
|
+
this.#collapsedContainer = null;
|
|
15690
15704
|
}
|
|
15691
15705
|
}
|
|
15692
15706
|
}
|
|
@@ -19221,7 +19235,7 @@ options.insert = htmlElement => {
|
|
|
19221
19235
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
19222
19236
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
19223
19237
|
///@ts-ignore
|
|
19224
|
-
"2.1.
|
|
19238
|
+
"2.1.27-1706185810630-874edc85a14e17b3");
|
|
19225
19239
|
document.head.append(htmlElement);
|
|
19226
19240
|
};
|
|
19227
19241
|
options.domAPI = (styleDomAPI_default());
|
package/package.json
CHANGED
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
|
|
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
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
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
|
}
|
package/src/platform-implementation-js/dom-driver/gmail/views/gmail-collapsible-section-view.d.ts
CHANGED
|
@@ -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
|
-
|
|
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<
|
|
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;
|
|
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"}
|
package/src/platform-implementation-js/dom-driver/gmail/views/gmail-route-view/gmail-route-view.d.ts
CHANGED
|
@@ -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<
|
|
47
|
-
addSection(sectionDescriptorProperty: Kefir.Observable<
|
|
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;
|
|
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;AAQjF,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,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,oBAAoB,CAAC;QAChC,IAAI,EAAE,eAAe,CAAC;KACvB,EACH,OAAO,CACR,CAAC;IACF,kBAAkB,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;IACnD,WAAW,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,CAAC;IAChD,2BAA2B,EAAE,OAAO,CAAC;IACrC,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;gBAKpC,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,eAAe,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAClE,mBAAmB,EAAE,mBAAmB,EACxC,MAAM,EAAE,WAAW;IAiDrB,OAAO;IAyBP,OAAO,IAAI,MAAM;IAIjB,cAAc;;;;;;;IAId,UAAU;IAIV,oBAAoB,IAAI,WAAW,GAAG,IAAI,GAAG,SAAS;IAItD,eAAe,IAAI,gBAAgB,EAAE;IAIrC,aAAa,IAAI,eAAe,GAAG,IAAI,GAAG,SAAS;IAInD,OAAO,IAAI,MAAM;IAQjB,2BAA2B,IAAI,OAAO;IAItC,SAAS,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAuBpC;IAEH,qBAAqB,CACnB,yBAAyB,EAAE,KAAK,CAAC,UAAU,CACzC,iBAAiB,GAAG,IAAI,GAAG,SAAS,EACpC,OAAO,CACR,EACD,cAAc,EAAE,MAAM,GACrB,2BAA2B;IAQ9B,UAAU,CACR,yBAAyB,EAAE,KAAK,CAAC,UAAU,CACzC,iBAAiB,GAAG,IAAI,GAAG,SAAS,EACpC,OAAO,CACR,EACD,cAAc,EAAE,MAAM,GACrB,2BAA2B;IAoD9B,uBAAuB;IAUvB,qBAAqB;IAiBrB,2BAA2B;IAgB3B,cAAc;IA+Bd,sBAAsB,CAAC,cAAc,EAAE,WAAW;IAsGlD,kBAAkB;IAiHlB,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,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<
|
|
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;
|
|
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;
|
|
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
|
-
|
|
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;
|
|
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;
|
|
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"}
|