@inboxsdk/core 2.2.25 → 2.2.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 +215 -119
- package/inboxsdk.js.map +1 -1
- package/package.json +1 -1
- package/pageWorld.js.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-element-getter.d.ts +0 -4
- package/src/platform-implementation-js/dom-driver/gmail/gmail-element-getter.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/selectors.d.ts +159 -0
- package/src/platform-implementation-js/dom-driver/gmail/selectors.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-attachment-card-view.d.ts +0 -3
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-attachment-card-view.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/add-status-bar.d.ts +0 -1
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/add-status-bar.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view.d.ts +0 -2
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-message-view.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-thread-view.d.ts.map +1 -1
package/inboxsdk.js
CHANGED
|
@@ -18054,7 +18054,7 @@ options.insert = htmlElement => {
|
|
|
18054
18054
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
18055
18055
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
18056
18056
|
///@ts-ignore
|
|
18057
|
-
"2.2.
|
|
18057
|
+
"2.2.27-1790289405402-94d8cee7e8e37c39");
|
|
18058
18058
|
document.head.append(htmlElement);
|
|
18059
18059
|
};
|
|
18060
18060
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -23028,9 +23028,6 @@ class GmailComposeView {
|
|
|
23028
23028
|
getInsertMoreArea() {
|
|
23029
23029
|
return (0,querySelectorOrFail/* default */.A)(this.#element, '.eq');
|
|
23030
23030
|
}
|
|
23031
|
-
getInsertLinkButton() {
|
|
23032
|
-
return (0,querySelectorOrFail/* default */.A)(this.#element, '.e5.aaA.aMZ');
|
|
23033
|
-
}
|
|
23034
23031
|
getSendButton() {
|
|
23035
23032
|
return (0,querySelectorOrFail/* default */.A)(this.#element, '.IZ .Up div > div[role=button]:not(.Uo):not([aria-haspopup=true]):not([class^=inboxsdk_])');
|
|
23036
23033
|
}
|
|
@@ -23086,9 +23083,6 @@ class GmailComposeView {
|
|
|
23086
23083
|
getBottomBarTable() {
|
|
23087
23084
|
return (0,querySelectorOrFail/* default */.A)(this.#element, '.aoP .aDh > table');
|
|
23088
23085
|
}
|
|
23089
|
-
getBottomToolbarContainer() {
|
|
23090
|
-
return (0,querySelectorOrFail/* default */.A)(this.#element, '.aoP .aDj');
|
|
23091
|
-
}
|
|
23092
23086
|
getDiscardButton() {
|
|
23093
23087
|
return (0,querySelectorOrFail/* default */.A)(this.#element, '.gU .oh');
|
|
23094
23088
|
}
|
|
@@ -23226,9 +23220,7 @@ class GmailComposeView {
|
|
|
23226
23220
|
setFullscreen(fullscreen) {
|
|
23227
23221
|
if (fullscreen !== this.isFullscreen()) {
|
|
23228
23222
|
if (this.#isInlineReplyForm) throw new Error('Not implemented for inline compose views');
|
|
23229
|
-
|
|
23230
|
-
const fullscreenButton = this.#element.querySelector('.Hm > img:nth-of-type(2)') || (0,querySelectorOrFail/* default */.A)(this.#element, '.Hm .Hq');
|
|
23231
|
-
(0,simulate_mouse_event/* simulateClick */.jp)(fullscreenButton);
|
|
23223
|
+
(0,simulate_mouse_event/* simulateClick */.jp)(this.getMoleSwitchButton());
|
|
23232
23224
|
}
|
|
23233
23225
|
}
|
|
23234
23226
|
setTitleBarColor(color) {
|
|
@@ -24191,15 +24183,6 @@ var wait_for = __webpack_require__(5156);
|
|
|
24191
24183
|
|
|
24192
24184
|
|
|
24193
24185
|
|
|
24194
|
-
/**
|
|
24195
|
-
* The selector for the new app menu https://support.google.com/mail/answer/11555490 -- FEB 2023
|
|
24196
|
-
*/
|
|
24197
|
-
const APP_MENU = '.aeN.WR.a6o.anZ.nH.oy8Mbf[role=navigation]';
|
|
24198
|
-
/**
|
|
24199
|
-
* If the APP_MENU selector is not found, NAV_MENU _might_ be present.
|
|
24200
|
-
*/
|
|
24201
|
-
const NAV_MENU = '.aeN.WR.nH.oy8Mbf[role=navigation]';
|
|
24202
|
-
|
|
24203
24186
|
/**
|
|
24204
24187
|
* The right-hand column holding the companion sidebar. Both the panel and the
|
|
24205
24188
|
* icon rail live inside it.
|
|
@@ -24232,7 +24215,7 @@ const MOLE_PARENT_SELECTOR = `${MOLE_CONTAINER_SELECTOR} .nH > .nH > .no`;
|
|
|
24232
24215
|
* registry.
|
|
24233
24216
|
*/
|
|
24234
24217
|
class GmailElementGetter {
|
|
24235
|
-
/**
|
|
24218
|
+
/** Supplies the selector registry the lookups resolve through. */
|
|
24236
24219
|
#driver;
|
|
24237
24220
|
#appMenuAsync;
|
|
24238
24221
|
#mainContentElementChangedStream;
|
|
@@ -24343,7 +24326,7 @@ class GmailElementGetter {
|
|
|
24343
24326
|
}).toProperty();
|
|
24344
24327
|
}
|
|
24345
24328
|
getGtalkButtons() {
|
|
24346
|
-
return
|
|
24329
|
+
return this.#driver.selectors.querySelectorByKey(document, 'leftNav.gtalkButtons');
|
|
24347
24330
|
}
|
|
24348
24331
|
getLeftNavContainerElement() {
|
|
24349
24332
|
if (this.getAppMenu()) {
|
|
@@ -24352,10 +24335,10 @@ class GmailElementGetter {
|
|
|
24352
24335
|
if ((0,isIntegratedViewGmail/* default */.Ay)()) {
|
|
24353
24336
|
return document.querySelector('div[role=navigation] + div.aqn');
|
|
24354
24337
|
}
|
|
24355
|
-
return
|
|
24338
|
+
return this.#driver.selectors.querySelectorByKey(document, 'leftNav.root');
|
|
24356
24339
|
}
|
|
24357
24340
|
getLeftNavHeightElement() {
|
|
24358
|
-
return
|
|
24341
|
+
return this.#driver.selectors.querySelectorByKey(document, 'leftNav.root');
|
|
24359
24342
|
}
|
|
24360
24343
|
getMainContentBodyContainerElement() {
|
|
24361
24344
|
return document.querySelector('.no > .nn.bkK');
|
|
@@ -24405,8 +24388,8 @@ class GmailElementGetter {
|
|
|
24405
24388
|
if (!this.isStandalone()) {
|
|
24406
24389
|
await this.waitForGmailModeToSettle();
|
|
24407
24390
|
try {
|
|
24408
|
-
const element = await (0,wait_for/* default */.A)(() =>
|
|
24409
|
-
if (!
|
|
24391
|
+
const element = await (0,wait_for/* default */.A)(() => this.#driver.selectors.querySelectorByKey(document, 'leftNav.appMenuOrNavMenuFallback'));
|
|
24392
|
+
if (!this.getAppMenu()) {
|
|
24410
24393
|
return;
|
|
24411
24394
|
}
|
|
24412
24395
|
return element;
|
|
@@ -24416,22 +24399,22 @@ class GmailElementGetter {
|
|
|
24416
24399
|
}
|
|
24417
24400
|
}
|
|
24418
24401
|
getAppBurgerMenu() {
|
|
24419
|
-
return
|
|
24402
|
+
return this.#driver.selectors.querySelectorByKey(document, 'appMenu.burgerButton');
|
|
24420
24403
|
}
|
|
24421
24404
|
isAppBurgerMenuOpen() {
|
|
24422
24405
|
return this.getAppBurgerMenu()?.getAttribute('aria-expanded') === 'true';
|
|
24423
24406
|
}
|
|
24424
24407
|
getAppMenuContainer() {
|
|
24425
|
-
return
|
|
24408
|
+
return this.#driver.selectors.querySelectorByKey(document, 'appMenu.container');
|
|
24426
24409
|
}
|
|
24427
24410
|
getAppMenu() {
|
|
24428
|
-
return document.
|
|
24411
|
+
return this.#driver.selectors.querySelectorByKey(document, 'leftNav.appMenu');
|
|
24429
24412
|
}
|
|
24430
24413
|
getAppHeader() {
|
|
24431
|
-
return
|
|
24414
|
+
return this.#driver.selectors.querySelectorByKey(document, 'appMenu.header');
|
|
24432
24415
|
}
|
|
24433
24416
|
getSeparateSectionNavItemMenuInjectionContainer() {
|
|
24434
|
-
return
|
|
24417
|
+
return this.#driver.selectors.querySelectorByKey(document, 'leftNav.root');
|
|
24435
24418
|
}
|
|
24436
24419
|
getSameSectionNavItemMenuInjectionContainer() {
|
|
24437
24420
|
if ((0,isIntegratedViewGmail/* default */.Ay)()) {
|
|
@@ -24440,18 +24423,6 @@ class GmailElementGetter {
|
|
|
24440
24423
|
return document.querySelector('.aeN .n3');
|
|
24441
24424
|
}
|
|
24442
24425
|
}
|
|
24443
|
-
getRowListElementsContainer() {
|
|
24444
|
-
// This selector can find multiple elements but they should all be siblings
|
|
24445
|
-
// so it's fine because we get the common parent.
|
|
24446
|
-
return document.querySelector('.bGI.nH')?.parentElement ?? null;
|
|
24447
|
-
}
|
|
24448
|
-
getRowListElements() {
|
|
24449
|
-
const rowListElements = document.querySelectorAll('[gh=tl]');
|
|
24450
|
-
if (rowListElements.length === 0) {
|
|
24451
|
-
return null;
|
|
24452
|
-
}
|
|
24453
|
-
return Array.from(rowListElements);
|
|
24454
|
-
}
|
|
24455
24426
|
getScrollContainer() {
|
|
24456
24427
|
return document.querySelector('div.Tm.aeJ');
|
|
24457
24428
|
}
|
|
@@ -24461,9 +24432,6 @@ class GmailElementGetter {
|
|
|
24461
24432
|
getSearchSuggestionsBoxParent() {
|
|
24462
24433
|
return document.querySelector('table.gstl_50 > tbody > tr > td.gssb_e');
|
|
24463
24434
|
}
|
|
24464
|
-
getSidebarContainerElement() {
|
|
24465
|
-
return document.querySelector('[role=main] table.Bs > tr .y3');
|
|
24466
|
-
}
|
|
24467
24435
|
getThreadBackButton() {
|
|
24468
24436
|
let toolbarElement;
|
|
24469
24437
|
try {
|
|
@@ -24506,9 +24474,6 @@ class GmailElementGetter {
|
|
|
24506
24474
|
isDarkTheme() {
|
|
24507
24475
|
return document.body.classList.contains('inboxsdk__gmail_dark_theme');
|
|
24508
24476
|
}
|
|
24509
|
-
isPreviewPane() {
|
|
24510
|
-
return !!document.querySelector('.aia');
|
|
24511
|
-
}
|
|
24512
24477
|
isStandalone() {
|
|
24513
24478
|
return this.isStandaloneComposeWindow() || this.isStandaloneThreadWindow();
|
|
24514
24479
|
}
|
|
@@ -25814,7 +25779,7 @@ module.exports = assocIndexOf;
|
|
|
25814
25779
|
|
|
25815
25780
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- SDK_VERSION is injected by webpack
|
|
25816
25781
|
///@ts-ignore
|
|
25817
|
-
const BUILD_VERSION = "2.2.
|
|
25782
|
+
const BUILD_VERSION = "2.2.27-1790289405402-94d8cee7e8e37c39";
|
|
25818
25783
|
if (false) {}
|
|
25819
25784
|
|
|
25820
25785
|
/***/ }),
|
|
@@ -27606,7 +27571,7 @@ options.insert = htmlElement => {
|
|
|
27606
27571
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
27607
27572
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
27608
27573
|
///@ts-ignore
|
|
27609
|
-
"2.2.
|
|
27574
|
+
"2.2.27-1790289405402-94d8cee7e8e37c39");
|
|
27610
27575
|
document.head.append(htmlElement);
|
|
27611
27576
|
};
|
|
27612
27577
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -44521,7 +44486,6 @@ class StatusBar extends _views_SimpleElementView__WEBPACK_IMPORTED_MODULE_5__/*
|
|
|
44521
44486
|
super(createElement(orderHint, addAboveNativeStatusBar));
|
|
44522
44487
|
this._addAboveNativeStatusBar = addAboveNativeStatusBar;
|
|
44523
44488
|
this._gmailComposeView = gmailComposeView;
|
|
44524
|
-
this._nativeStatusContainer = (0,_lib_dom_querySelectorOrFail__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)(gmailComposeView.getElement(), '.iN > tbody .aDj');
|
|
44525
44489
|
this._setStatusBar();
|
|
44526
44490
|
this.setHeight(height);
|
|
44527
44491
|
}
|
|
@@ -44962,9 +44926,6 @@ class GmailAttachmentCardView {
|
|
|
44962
44926
|
throw err;
|
|
44963
44927
|
}
|
|
44964
44928
|
}
|
|
44965
|
-
_extractFileNameFromElement() {
|
|
44966
|
-
return (0,querySelectorOrFail/* default */.A)(this._element, '.aQA > span').textContent;
|
|
44967
|
-
}
|
|
44968
44929
|
_createNewElement(options) {
|
|
44969
44930
|
this._element = document.createElement('span');
|
|
44970
44931
|
this._element.classList.add('aZo');
|
|
@@ -45114,16 +45075,6 @@ class GmailAttachmentCardView {
|
|
|
45114
45075
|
buttonView.addClass('aQv');
|
|
45115
45076
|
this._getButtonContainerElement().appendChild(buttonView.getElement());
|
|
45116
45077
|
}
|
|
45117
|
-
_getPreviewImageUrl() {
|
|
45118
|
-
var previewImage = this._getPreviewImage();
|
|
45119
|
-
if (!previewImage) {
|
|
45120
|
-
return null;
|
|
45121
|
-
}
|
|
45122
|
-
return previewImage.src;
|
|
45123
|
-
}
|
|
45124
|
-
_getPreviewImage() {
|
|
45125
|
-
return this._element.querySelector('img.aQG');
|
|
45126
|
-
}
|
|
45127
45078
|
_getButtonContainerElement() {
|
|
45128
45079
|
return (0,querySelectorOrFail/* default */.A)(this._element, '.aQw');
|
|
45129
45080
|
}
|
|
@@ -45976,7 +45927,6 @@ function reemitClickEvent(event) {
|
|
|
45976
45927
|
|
|
45977
45928
|
|
|
45978
45929
|
|
|
45979
|
-
|
|
45980
45930
|
let hasSeenOldElement = false;
|
|
45981
45931
|
const MORE_MENU_WAIT_TIMEOUT = 5 * 1000;
|
|
45982
45932
|
const MORE_MENU_WAIT_STEP = 16;
|
|
@@ -46019,7 +45969,7 @@ class GmailMessageView {
|
|
|
46019
45969
|
// client side, so the new message added (from your reply) shows up in the UI right away and has a data-message-id but
|
|
46020
45970
|
// because it hasn't been synced to the server it does not have a data-legacy-messag-id
|
|
46021
45971
|
// so we wait until the message has been synced to the server before saying this is ready
|
|
46022
|
-
const messageIdElement = this.#
|
|
45972
|
+
const messageIdElement = this.#driver.selectors.querySelectorByKey(this.#element, 'messageView.syncIdElement');
|
|
46023
45973
|
if (messageIdElement) {
|
|
46024
45974
|
const syncMessageId = messageIdElement.getAttribute('data-message-id');
|
|
46025
45975
|
if (!syncMessageId) throw new Error('data-message-id attribute has no value');
|
|
@@ -46103,7 +46053,7 @@ class GmailMessageView {
|
|
|
46103
46053
|
getRecipients() {
|
|
46104
46054
|
let recipients = this.#recipients;
|
|
46105
46055
|
if (recipients) return recipients;
|
|
46106
|
-
const receipientSpans =
|
|
46056
|
+
const receipientSpans = this.#driver.selectors.querySelectorAllByKey(this.#element, 'messageView.recipientSpans');
|
|
46107
46057
|
recipients = this.#recipients = receipientSpans.map(span => {
|
|
46108
46058
|
return this.#getUpdatedContact({
|
|
46109
46059
|
name: span.getAttribute('name'),
|
|
@@ -46115,7 +46065,7 @@ class GmailMessageView {
|
|
|
46115
46065
|
getRecipientEmailAddresses() {
|
|
46116
46066
|
let recipients = this.#recipientEmailAddresses;
|
|
46117
46067
|
if (recipients) return recipients;
|
|
46118
|
-
const receipientSpans =
|
|
46068
|
+
const receipientSpans = this.#driver.selectors.querySelectorAllByKey(this.#element, 'messageView.recipientSpans');
|
|
46119
46069
|
recipients = this.#recipientEmailAddresses = receipientSpans.map(span => span.getAttribute('email') || '');
|
|
46120
46070
|
return recipients;
|
|
46121
46071
|
}
|
|
@@ -46256,7 +46206,7 @@ class GmailMessageView {
|
|
|
46256
46206
|
if (!ignoreLoadStatus && !this.#messageLoaded) {
|
|
46257
46207
|
throw new Error('tried to get message id before message is loaded');
|
|
46258
46208
|
}
|
|
46259
|
-
const messageIdElement = this.#
|
|
46209
|
+
const messageIdElement = this.#driver.selectors.querySelectorByKey(this.#element, 'messageView.legacyIdElement');
|
|
46260
46210
|
if (messageIdElement) {
|
|
46261
46211
|
const messageId = messageIdElement.getAttribute('data-legacy-message-id');
|
|
46262
46212
|
if (!messageId) throw new Error('message id attribute with no value, wtf?');
|
|
@@ -46343,9 +46293,9 @@ class GmailMessageView {
|
|
|
46343
46293
|
} else {
|
|
46344
46294
|
let attachmentDiv;
|
|
46345
46295
|
if (this.getViewState() === 'COLLAPSED') {
|
|
46346
|
-
attachmentDiv = (
|
|
46296
|
+
attachmentDiv = this.#driver.selectors.querySelectorByKeyOrFail(this.#element, 'messageView.attachmentIconSlotCollapsed');
|
|
46347
46297
|
} else {
|
|
46348
|
-
attachmentDiv = (
|
|
46298
|
+
attachmentDiv = this.#driver.selectors.querySelectorByKeyOrFail(this.#element, 'messageView.attachmentIconSlot');
|
|
46349
46299
|
}
|
|
46350
46300
|
const img = opts.iconHtml != null ? getCustomIconWrapper() : getImgElement();
|
|
46351
46301
|
const onClick = opts.onClick;
|
|
@@ -46506,7 +46456,7 @@ class GmailMessageView {
|
|
|
46506
46456
|
this.#setupReplyStream();
|
|
46507
46457
|
}
|
|
46508
46458
|
#setupReplyStream() {
|
|
46509
|
-
const replyContainer = this.#
|
|
46459
|
+
const replyContainer = this.#driver.selectors.querySelectorByKey(this.#element, 'messageView.replyContainer');
|
|
46510
46460
|
if (!replyContainer) {
|
|
46511
46461
|
return;
|
|
46512
46462
|
}
|
|
@@ -46559,7 +46509,7 @@ class GmailMessageView {
|
|
|
46559
46509
|
if (!self.#element.classList.contains('h7')) {
|
|
46560
46510
|
contactType = 'sender';
|
|
46561
46511
|
} else {
|
|
46562
|
-
if (self.#
|
|
46512
|
+
if (self.#driver.selectors.querySelectorByKeyOrFail(self.#element, 'messageView.senderHeading').contains(element)) {
|
|
46563
46513
|
contactType = 'sender';
|
|
46564
46514
|
} else {
|
|
46565
46515
|
contactType = 'recipient';
|
|
@@ -46576,14 +46526,15 @@ class GmailMessageView {
|
|
|
46576
46526
|
}));
|
|
46577
46527
|
}
|
|
46578
46528
|
#getAttachmentArea() {
|
|
46579
|
-
|
|
46580
|
-
|
|
46529
|
+
const attachmentArea = this.#driver.selectors.querySelectorByKey(this.#element, 'messageView.attachmentArea');
|
|
46530
|
+
if (attachmentArea) {
|
|
46531
|
+
return new gmail_attachment_area_view(attachmentArea, this.#driver, this);
|
|
46581
46532
|
}
|
|
46582
46533
|
return null;
|
|
46583
46534
|
}
|
|
46584
46535
|
#createAttachmentArea() {
|
|
46585
46536
|
const gmailAttachmentAreaView = new gmail_attachment_area_view(null, this.#driver, this);
|
|
46586
|
-
const beforeElement = (
|
|
46537
|
+
const beforeElement = this.#driver.selectors.querySelectorByKeyOrFail(this.#element, 'messageView.attachmentAreaAnchor');
|
|
46587
46538
|
const parentNode = beforeElement.parentNode;
|
|
46588
46539
|
if (!parentNode) throw new Error('parentNode not found');
|
|
46589
46540
|
parentNode.insertBefore(gmailAttachmentAreaView.getElement(), beforeElement);
|
|
@@ -47459,39 +47410,19 @@ class GmailThreadView {
|
|
|
47459
47410
|
const sidebar = this.#driver.getGlobalSidebar();
|
|
47460
47411
|
return sidebar.addThreadSidebarContentPanel(descriptor, this);
|
|
47461
47412
|
}
|
|
47462
|
-
#subjectContainerSelectors = {
|
|
47463
|
-
'2022_10_21': '.a98.iY > .nH',
|
|
47464
|
-
'2022_10_12': '.PeIF1d > .nH',
|
|
47465
|
-
[2018]: '.if > .nH'
|
|
47466
|
-
};
|
|
47467
|
-
#subjectContainerSelectorsAfterNov162023 = {
|
|
47468
|
-
'2023_11_16': '* > .nH'
|
|
47469
|
-
};
|
|
47470
47413
|
#subjectAISuggestionsContainerSelectors = {
|
|
47471
47414
|
'2024_04_26': '.nH > .einvLd'
|
|
47472
47415
|
};
|
|
47473
47416
|
addNoticeBar() {
|
|
47474
47417
|
const el = document.createElement('div');
|
|
47475
47418
|
el.className = (0,idMap/* default */.A)('thread_noticeBar');
|
|
47476
|
-
|
|
47477
|
-
|
|
47478
|
-
|
|
47479
|
-
|
|
47480
|
-
// thread view gmail update Nov 16, 2023
|
|
47481
|
-
selectorsToTry = this.#subjectContainerSelectorsAfterNov162023;
|
|
47482
|
-
}
|
|
47483
|
-
for (const [currentVersion, selector] of Object.entries(selectorsToTry)) {
|
|
47484
|
-
const el = this.#element.querySelector(selector);
|
|
47485
|
-
if (!el) {
|
|
47486
|
-
continue;
|
|
47487
|
-
}
|
|
47488
|
-
version = currentVersion;
|
|
47489
|
-
subjectContainer = el;
|
|
47490
|
-
break;
|
|
47491
|
-
}
|
|
47419
|
+
|
|
47420
|
+
// `.a98.iY` is the thread view gmail update Nov 16, 2023
|
|
47421
|
+
const subjectContainerKey = this.#element.matches('.a98.iY') ? 'threadView.subjectContainer' : 'threadView.subjectContainerLegacy';
|
|
47422
|
+
const subjectContainer = this.#driver.selectors.querySelectorByKey(this.#element, subjectContainerKey);
|
|
47492
47423
|
if (!subjectContainer) throw new Error('Failed to find subject container');
|
|
47493
47424
|
this.#driver.getLogger().eventSdkPassive('addNoticeBar subjectContainer', {
|
|
47494
|
-
version
|
|
47425
|
+
version: subjectContainerKey
|
|
47495
47426
|
});
|
|
47496
47427
|
|
|
47497
47428
|
// AI suggestions container could be rendered after the subject container so
|
|
@@ -47522,7 +47453,7 @@ class GmailThreadView {
|
|
|
47522
47453
|
if (!parentElement) throw new Error('missing parent element');
|
|
47523
47454
|
const customMessageView = new CustomMessageView(descriptorStream, () => {
|
|
47524
47455
|
this.#readyStream.onValue(async () => {
|
|
47525
|
-
const messageContainer = this.#
|
|
47456
|
+
const messageContainer = this.#driver.selectors.querySelectorByKey(this.#element, 'threadView.messageList');
|
|
47526
47457
|
if (!messageContainer) return;
|
|
47527
47458
|
let mostRecentDate = Number.MIN_SAFE_INTEGER;
|
|
47528
47459
|
let insertBeforeMessage;
|
|
@@ -47572,7 +47503,7 @@ class GmailThreadView {
|
|
|
47572
47503
|
customMessageView.getElement().classList.add('inboxsdk__custom_message_view_hidden');
|
|
47573
47504
|
|
|
47574
47505
|
// get the message element that contains the hidden messages notice
|
|
47575
|
-
let hiddenNoticeMessageElement = this.#
|
|
47506
|
+
let hiddenNoticeMessageElement = this.#driver.selectors.querySelectorByKey(this.#element, 'threadView.hiddenNoticeMessage');
|
|
47576
47507
|
let nativeHiddenNoticePresent = true;
|
|
47577
47508
|
if (!hiddenNoticeMessageElement) {
|
|
47578
47509
|
nativeHiddenNoticePresent = false;
|
|
@@ -47611,7 +47542,7 @@ class GmailThreadView {
|
|
|
47611
47542
|
const numberCustomHiddenMessages = this.#hiddenCustomMessageViews.size;
|
|
47612
47543
|
let numberNativeHiddenMessages = null;
|
|
47613
47544
|
if (nativeHiddenNoticePresent) {
|
|
47614
|
-
const nativeHiddenNoticeCountSpan = (
|
|
47545
|
+
const nativeHiddenNoticeCountSpan = this.#driver.selectors.querySelectorByKeyOrFail(hiddenNoticeMessageElement, 'threadView.hiddenNoticeCount');
|
|
47615
47546
|
numberNativeHiddenMessages = Number(nativeHiddenNoticeCountSpan.innerHTML);
|
|
47616
47547
|
if (isNaN(numberNativeHiddenMessages)) {
|
|
47617
47548
|
throw new Error("Couldn't find number of native hidden messages in dom structure");
|
|
@@ -47627,7 +47558,7 @@ class GmailThreadView {
|
|
|
47627
47558
|
if (!nativeHiddenNoticePresent) {
|
|
47628
47559
|
const fakeAppNoticeElement = document.createElement('span');
|
|
47629
47560
|
fakeAppNoticeElement.classList.add('adx');
|
|
47630
|
-
const insertionPoint = (
|
|
47561
|
+
const insertionPoint = this.#driver.selectors.querySelectorByKeyOrFail(hiddenNoticeMessageElement, 'threadView.hiddenNoticeSlot');
|
|
47631
47562
|
insertionPoint.appendChild(fakeAppNoticeElement);
|
|
47632
47563
|
}
|
|
47633
47564
|
const hiddenNoticeElement = (0,querySelectorOrFail/* default */.A)(hiddenNoticeMessageElement, '.adx');
|
|
@@ -47710,7 +47641,7 @@ class GmailThreadView {
|
|
|
47710
47641
|
if (this.#threadID) return this.#threadID;else throw new Error('Failed to get id for thread');
|
|
47711
47642
|
}
|
|
47712
47643
|
addLabel() {
|
|
47713
|
-
const labelContainer = this.#
|
|
47644
|
+
const labelContainer = this.#driver.selectors.querySelectorByKey(this.#element, 'threadView.labelContainer');
|
|
47714
47645
|
if (!labelContainer) {
|
|
47715
47646
|
throw new Error('Thread view label container not found');
|
|
47716
47647
|
}
|
|
@@ -47734,9 +47665,9 @@ class GmailThreadView {
|
|
|
47734
47665
|
return view;
|
|
47735
47666
|
}
|
|
47736
47667
|
addSubjectButton(button) {
|
|
47737
|
-
const subjectParent = this.#
|
|
47668
|
+
const subjectParent = this.#driver.selectors.querySelectorByKey(this.#element, 'threadView.subjectParent');
|
|
47738
47669
|
if (!subjectParent) {
|
|
47739
|
-
throw new querySelectorOrFail/* SelectorError */.a('.
|
|
47670
|
+
throw new querySelectorOrFail/* SelectorError */.a('threadView.subjectParent', {
|
|
47740
47671
|
cause: 'Subject wrapper element not found'
|
|
47741
47672
|
});
|
|
47742
47673
|
}
|
|
@@ -47773,13 +47704,12 @@ class GmailThreadView {
|
|
|
47773
47704
|
return new basic_button_view_controller/* default */.A(buttonOptions);
|
|
47774
47705
|
}
|
|
47775
47706
|
addFooterButton(button) {
|
|
47776
|
-
const
|
|
47777
|
-
const messagesContainer = this.#element.querySelector(messagesSelector);
|
|
47707
|
+
const messagesContainer = this.#driver.selectors.querySelectorByKey(this.#element, 'threadView.messagesContainer');
|
|
47778
47708
|
if (!messagesContainer) {
|
|
47779
47709
|
this.#driver.getLogger().eventSdkPassive('Footer button selector fail', {
|
|
47780
47710
|
html: (0,censorHTMLtree/* default */.A)(this.#element)
|
|
47781
47711
|
});
|
|
47782
|
-
throw new querySelectorOrFail/* SelectorError */.a(
|
|
47712
|
+
throw new querySelectorOrFail/* SelectorError */.a('threadView.messagesContainer', {
|
|
47783
47713
|
cause: 'Last message footer element not found'
|
|
47784
47714
|
});
|
|
47785
47715
|
}
|
|
@@ -47855,8 +47785,7 @@ class GmailThreadView {
|
|
|
47855
47785
|
return null;
|
|
47856
47786
|
}
|
|
47857
47787
|
#findSubjectToolbarElement() {
|
|
47858
|
-
|
|
47859
|
-
return toolbarContainerElement;
|
|
47788
|
+
return this.#driver.selectors.querySelectorByKey(this.#element, 'threadView.subjectToolbar');
|
|
47860
47789
|
}
|
|
47861
47790
|
#findBottomReplyToolbarElement() {
|
|
47862
47791
|
// Get all .amn elements (may exist in multiple locations due to A/B testing)
|
|
@@ -47898,7 +47827,7 @@ class GmailThreadView {
|
|
|
47898
47827
|
return false;
|
|
47899
47828
|
}
|
|
47900
47829
|
#setupMessageViewStream() {
|
|
47901
|
-
var openMessage = this.#
|
|
47830
|
+
var openMessage = this.#driver.selectors.querySelectorByKey(this.#element, 'threadView.openMessage');
|
|
47902
47831
|
if (!openMessage) {
|
|
47903
47832
|
var self = this;
|
|
47904
47833
|
setTimeout(function () {
|
|
@@ -47981,7 +47910,7 @@ class GmailThreadView {
|
|
|
47981
47910
|
}
|
|
47982
47911
|
#listenToExpandCollapseAll() {
|
|
47983
47912
|
//expand all
|
|
47984
|
-
const expandAllElementImg = this.#
|
|
47913
|
+
const expandAllElementImg = this.#driver.selectors.querySelectorByKey(this.#element, 'threadView.expandAllButton');
|
|
47985
47914
|
if (expandAllElementImg) {
|
|
47986
47915
|
const expandAllElement = findParent(expandAllElementImg, el => el.getAttribute('role') === 'button');
|
|
47987
47916
|
if (expandAllElement) {
|
|
@@ -47995,7 +47924,7 @@ class GmailThreadView {
|
|
|
47995
47924
|
}
|
|
47996
47925
|
|
|
47997
47926
|
//collapse all
|
|
47998
|
-
const collapseAllElementImg = this.#
|
|
47927
|
+
const collapseAllElementImg = this.#driver.selectors.querySelectorByKey(this.#element, 'threadView.collapseAllButton');
|
|
47999
47928
|
if (collapseAllElementImg) {
|
|
48000
47929
|
const collapseAllElement = findParent(collapseAllElementImg, el => el.getAttribute('role') === 'button');
|
|
48001
47930
|
if (collapseAllElement) {
|
|
@@ -48323,7 +48252,7 @@ options.insert = htmlElement => {
|
|
|
48323
48252
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
48324
48253
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
48325
48254
|
///@ts-ignore
|
|
48326
|
-
"2.2.
|
|
48255
|
+
"2.2.27-1790289405402-94d8cee7e8e37c39");
|
|
48327
48256
|
document.head.append(htmlElement);
|
|
48328
48257
|
};
|
|
48329
48258
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -53162,7 +53091,7 @@ mole_view_module_options.insert = htmlElement => {
|
|
|
53162
53091
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
53163
53092
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
53164
53093
|
///@ts-ignore
|
|
53165
|
-
"2.2.
|
|
53094
|
+
"2.2.27-1790289405402-94d8cee7e8e37c39");
|
|
53166
53095
|
document.head.append(htmlElement);
|
|
53167
53096
|
};
|
|
53168
53097
|
mole_view_module_options.domAPI = (styleDomAPI_default());
|
|
@@ -57593,12 +57522,140 @@ const GMAIL_SELECTORS = {
|
|
|
57593
57522
|
* Root: message element.
|
|
57594
57523
|
*/
|
|
57595
57524
|
'messageView.dateElement': ['.ads .gK .g3'],
|
|
57525
|
+
/**
|
|
57526
|
+
* The element carrying the message's sync id in `data-message-id`.
|
|
57527
|
+
* Root: message element.
|
|
57528
|
+
*/
|
|
57529
|
+
'messageView.syncIdElement': ['[data-message-id]'],
|
|
57530
|
+
/**
|
|
57531
|
+
* The element carrying `data-legacy-message-id`. The SDK also writes that
|
|
57532
|
+
* attribute onto `messageView.syncIdElement`, so a rung must match both.
|
|
57533
|
+
* Root: message element.
|
|
57534
|
+
*/
|
|
57535
|
+
'messageView.legacyIdElement': ['[data-legacy-message-id]'],
|
|
57536
|
+
/**
|
|
57537
|
+
* The header span attachment icons are added to, in an expanded message.
|
|
57538
|
+
* Root: message element.
|
|
57539
|
+
*/
|
|
57540
|
+
'messageView.attachmentIconSlot': ['td.gH div.gK span'],
|
|
57541
|
+
/**
|
|
57542
|
+
* The header span attachment icons are added to, in a collapsed message.
|
|
57543
|
+
* Root: message element.
|
|
57544
|
+
*/
|
|
57545
|
+
'messageView.attachmentIconSlotCollapsed': ['.adf.ads td.gH span'],
|
|
57546
|
+
/**
|
|
57547
|
+
* The container that holds an inline reply; watched for its class change.
|
|
57548
|
+
* Root: message element.
|
|
57549
|
+
*/
|
|
57550
|
+
'messageView.replyContainer': ['.ip'],
|
|
57551
|
+
/**
|
|
57552
|
+
* The sender heading of an expanded message; a hovered contact inside it is
|
|
57553
|
+
* the sender, and one outside it a recipient.
|
|
57554
|
+
* Root: message element.
|
|
57555
|
+
*/
|
|
57556
|
+
'messageView.senderHeading': ['h3.iw'],
|
|
57557
|
+
/**
|
|
57558
|
+
* Gmail's attachment area. The area the SDK builds carries the same class,
|
|
57559
|
+
* so this can also match that one.
|
|
57560
|
+
* Root: message element.
|
|
57561
|
+
*/
|
|
57562
|
+
'messageView.attachmentArea': ['.hq'],
|
|
57563
|
+
/**
|
|
57564
|
+
* The element the SDK's own attachment area is inserted before.
|
|
57565
|
+
* Root: message element.
|
|
57566
|
+
*/
|
|
57567
|
+
'messageView.attachmentAreaAnchor': ['.hi'],
|
|
57568
|
+
/**
|
|
57569
|
+
* The recipients' spans in a message header; each carries `email` and `name`.
|
|
57570
|
+
* Root: message element.
|
|
57571
|
+
*/
|
|
57572
|
+
'messageView.recipientSpans': ['.hb span[email]'],
|
|
57596
57573
|
/**
|
|
57597
57574
|
* The thread's subject heading. Read for its text, or walked child by child
|
|
57598
57575
|
* when it contains emoji images.
|
|
57599
57576
|
* Root: thread element.
|
|
57600
57577
|
*/
|
|
57601
57578
|
'threadView.subject': ['.ha h2'],
|
|
57579
|
+
/**
|
|
57580
|
+
* The list holding the thread's messages, which custom messages are
|
|
57581
|
+
* inserted into.
|
|
57582
|
+
* Root: thread element.
|
|
57583
|
+
*/
|
|
57584
|
+
'threadView.messageList': ['[role=list]'],
|
|
57585
|
+
/**
|
|
57586
|
+
* The message element that contains the hidden messages notice.
|
|
57587
|
+
* Root: thread element.
|
|
57588
|
+
*/
|
|
57589
|
+
'threadView.hiddenNoticeMessage': ['.adv'],
|
|
57590
|
+
/**
|
|
57591
|
+
* The span holding the number of messages Gmail has hidden; read as a number.
|
|
57592
|
+
* Root: `threadView.hiddenNoticeMessage`.
|
|
57593
|
+
*/
|
|
57594
|
+
'threadView.hiddenNoticeCount': ['.adx span'],
|
|
57595
|
+
/**
|
|
57596
|
+
* Where a stand-in notice is inserted when Gmail renders no native one.
|
|
57597
|
+
* Root: `threadView.hiddenNoticeMessage`.
|
|
57598
|
+
*/
|
|
57599
|
+
'threadView.hiddenNoticeSlot': ['.G3'],
|
|
57600
|
+
/**
|
|
57601
|
+
* The container an app's thread label is appended to, and re-appended to
|
|
57602
|
+
* whenever Gmail removes it.
|
|
57603
|
+
* Root: thread element.
|
|
57604
|
+
*/
|
|
57605
|
+
'threadView.labelContainer': ['.ha .J-J5-Ji'],
|
|
57606
|
+
/**
|
|
57607
|
+
* The subject wrapper that subject buttons are added to.
|
|
57608
|
+
* Root: thread element.
|
|
57609
|
+
*/
|
|
57610
|
+
'threadView.subjectParent': ['.V8djrc.byY'],
|
|
57611
|
+
/**
|
|
57612
|
+
* The messages container, whose last message footer holds footer buttons.
|
|
57613
|
+
* Root: thread element.
|
|
57614
|
+
*/
|
|
57615
|
+
'threadView.messagesContainer': ['div.nH .aHU'],
|
|
57616
|
+
/**
|
|
57617
|
+
* The toolbar beside the thread subject, which subject buttons are put in.
|
|
57618
|
+
* Root: thread element.
|
|
57619
|
+
*/
|
|
57620
|
+
'threadView.subjectToolbar': ['.bHJ'],
|
|
57621
|
+
/**
|
|
57622
|
+
* An expanded message. Its PARENT is the container the message view stream
|
|
57623
|
+
* watches, so stay at this depth.
|
|
57624
|
+
* Root: thread element.
|
|
57625
|
+
*/
|
|
57626
|
+
'threadView.openMessage': ['.h7'],
|
|
57627
|
+
/**
|
|
57628
|
+
* The expand-all icon. The code walks up to its `role=button` ancestor, so
|
|
57629
|
+
* stay at the image.
|
|
57630
|
+
* Root: thread element.
|
|
57631
|
+
*/
|
|
57632
|
+
'threadView.expandAllButton': ['img.gx'],
|
|
57633
|
+
/**
|
|
57634
|
+
* The collapse-all icon. The code walks up to its `role=button` ancestor, so
|
|
57635
|
+
* stay at the image.
|
|
57636
|
+
* Root: thread element.
|
|
57637
|
+
*/
|
|
57638
|
+
'threadView.collapseAllButton': ['img.gq'],
|
|
57639
|
+
/**
|
|
57640
|
+
* The subject container the notice bar is inserted into, in the current
|
|
57641
|
+
* thread view.
|
|
57642
|
+
* Root: thread element.
|
|
57643
|
+
*/
|
|
57644
|
+
'threadView.subjectContainer': [
|
|
57645
|
+
// 2023-11-16 thread-view redesign
|
|
57646
|
+
'* > .nH'],
|
|
57647
|
+
/**
|
|
57648
|
+
* The subject container the notice bar is inserted into, in the thread
|
|
57649
|
+
* views that predate the redesign.
|
|
57650
|
+
* Root: thread element.
|
|
57651
|
+
*/
|
|
57652
|
+
'threadView.subjectContainerLegacy': [
|
|
57653
|
+
// 2018 layout
|
|
57654
|
+
'.if > .nH',
|
|
57655
|
+
// 2022-10-21 layout
|
|
57656
|
+
'.a98.iY > .nH',
|
|
57657
|
+
// 2022-10-12 layout
|
|
57658
|
+
'.PeIF1d > .nH'],
|
|
57602
57659
|
/**
|
|
57603
57660
|
* The element holding the list toolbar and the thread list.
|
|
57604
57661
|
* Root: the row list element container.
|
|
@@ -57608,7 +57665,46 @@ const GMAIL_SELECTORS = {
|
|
|
57608
57665
|
* The toolbar above the thread list.
|
|
57609
57666
|
* Root: `routeView.rowListWrapper`.
|
|
57610
57667
|
*/
|
|
57611
|
-
'routeView.listToolbar': ['[gh=tm]', '.G-atb']
|
|
57668
|
+
'routeView.listToolbar': ['[gh=tm]', '.G-atb'],
|
|
57669
|
+
/**
|
|
57670
|
+
* The left nav column.
|
|
57671
|
+
* Root: `document`.
|
|
57672
|
+
*/
|
|
57673
|
+
'leftNav.root': ['.aeN'],
|
|
57674
|
+
/**
|
|
57675
|
+
* The left nav when Gmail shows the app menu
|
|
57676
|
+
* https://support.google.com/mail/answer/11555490
|
|
57677
|
+
* Root: `document`.
|
|
57678
|
+
*/
|
|
57679
|
+
'leftNav.appMenu': ['.aeN.WR.a6o.anZ.nH.oy8Mbf[role=navigation]'],
|
|
57680
|
+
/**
|
|
57681
|
+
* The app menu container, which holds the menu items and their panels.
|
|
57682
|
+
* Root: `document`.
|
|
57683
|
+
*/
|
|
57684
|
+
'appMenu.container': ['.aqk.aql.bkL'],
|
|
57685
|
+
/**
|
|
57686
|
+
* The main menu button in the Gmail header; its `aria-expanded` is read.
|
|
57687
|
+
* Root: `document`.
|
|
57688
|
+
*/
|
|
57689
|
+
'appMenu.burgerButton': ['header[role="banner"] > div > div > div[aria-expanded]'],
|
|
57690
|
+
/**
|
|
57691
|
+
* The app header, which toggles into panel-less mode with the app menu.
|
|
57692
|
+
* Root: `document`.
|
|
57693
|
+
*/
|
|
57694
|
+
'appMenu.header': ['.oy8Mbf.qp'],
|
|
57695
|
+
/**
|
|
57696
|
+
* The Hangouts buttons at the bottom of the left nav.
|
|
57697
|
+
* Root: `document`.
|
|
57698
|
+
*/
|
|
57699
|
+
'leftNav.gtalkButtons': ['.aeN .aj5.J-KU-Jg'],
|
|
57700
|
+
/**
|
|
57701
|
+
* This selector matches the app menu if it is or will be present, otherwise if
|
|
57702
|
+
* we're in a mode of Gmail without the app menu, then this might match the
|
|
57703
|
+
* collapsible panel left nav menu instead. We wait for this selector so we can
|
|
57704
|
+
* know when the app menu is ready or if it will never be ready.
|
|
57705
|
+
* Root: `document`.
|
|
57706
|
+
*/
|
|
57707
|
+
'leftNav.appMenuOrNavMenuFallback': ['.aeN.WR.nH.oy8Mbf[role=navigation]']
|
|
57612
57708
|
};
|
|
57613
57709
|
|
|
57614
57710
|
/** Resolved candidates for every key. The merge builds new lists. */
|