@inboxsdk/core 2.2.19 → 2.2.20
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 +71 -20
- 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/selectors.d.ts +46 -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-message-view.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-route-view/gmail-route-processor.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
|
@@ -371,7 +371,7 @@ function isNotNil(value) {
|
|
|
371
371
|
|
|
372
372
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- SDK_VERSION is injected by webpack
|
|
373
373
|
///@ts-ignore
|
|
374
|
-
const BUILD_VERSION = "2.2.
|
|
374
|
+
const BUILD_VERSION = "2.2.20-1787183471518-8065a08149d763a3";
|
|
375
375
|
if (false) {}
|
|
376
376
|
|
|
377
377
|
/***/ }),
|
|
@@ -2711,7 +2711,7 @@ options.insert = htmlElement => {
|
|
|
2711
2711
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
2712
2712
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
2713
2713
|
///@ts-ignore
|
|
2714
|
-
"2.2.
|
|
2714
|
+
"2.2.20-1787183471518-8065a08149d763a3");
|
|
2715
2715
|
document.head.append(htmlElement);
|
|
2716
2716
|
};
|
|
2717
2717
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -10377,7 +10377,7 @@ options.insert = htmlElement => {
|
|
|
10377
10377
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
10378
10378
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
10379
10379
|
///@ts-ignore
|
|
10380
|
-
"2.2.
|
|
10380
|
+
"2.2.20-1787183471518-8065a08149d763a3");
|
|
10381
10381
|
document.head.append(htmlElement);
|
|
10382
10382
|
};
|
|
10383
10383
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -12884,11 +12884,11 @@ class GmailMessageView {
|
|
|
12884
12884
|
throw new Error('tried to get message contents before message is loaded');
|
|
12885
12885
|
}
|
|
12886
12886
|
try {
|
|
12887
|
-
return (
|
|
12887
|
+
return this.#driver.selectors.querySelectorByKeyOrFail(this.#element, 'messageView.body');
|
|
12888
12888
|
} catch (err) {
|
|
12889
|
-
//
|
|
12889
|
+
// The registry does not report its own misses yet, so keep logging here.
|
|
12890
12890
|
this.#driver.getLogger().error(err);
|
|
12891
|
-
|
|
12891
|
+
throw err;
|
|
12892
12892
|
}
|
|
12893
12893
|
}
|
|
12894
12894
|
isElementInQuotedArea(element) {
|
|
@@ -12897,7 +12897,7 @@ class GmailMessageView {
|
|
|
12897
12897
|
getSender() {
|
|
12898
12898
|
let sender = this.#sender;
|
|
12899
12899
|
if (sender) return sender;
|
|
12900
|
-
const senderSpan = (
|
|
12900
|
+
const senderSpan = this.#driver.selectors.querySelectorByKeyOrFail(this.#element, 'messageView.senderSpan');
|
|
12901
12901
|
const emailAddress = senderSpan.getAttribute('email');
|
|
12902
12902
|
if (!emailAddress) throw new Error('Could not find email address');
|
|
12903
12903
|
sender = this.#sender = {
|
|
@@ -12942,7 +12942,7 @@ class GmailMessageView {
|
|
|
12942
12942
|
return recipients;
|
|
12943
12943
|
}
|
|
12944
12944
|
getDateString() {
|
|
12945
|
-
return (
|
|
12945
|
+
return this.#driver.selectors.querySelectorByKeyOrFail(this.#element, 'messageView.dateElement').title;
|
|
12946
12946
|
}
|
|
12947
12947
|
async getDate() {
|
|
12948
12948
|
const threadID = this.#threadViewDriver.getInternalID();
|
|
@@ -12988,15 +12988,12 @@ class GmailMessageView {
|
|
|
12988
12988
|
if (this.getViewState() !== 'EXPANDED') {
|
|
12989
12989
|
return null;
|
|
12990
12990
|
}
|
|
12991
|
-
return this.#
|
|
12991
|
+
return this.#driver.selectors.querySelectorByKey(this.#element, 'messageView.moreButton');
|
|
12992
12992
|
}
|
|
12993
12993
|
#getOpenMoreMenu() {
|
|
12994
|
-
const selector_2022_11_23 = 'td > div.nH.a98.iY > div.nH .aHU .b7.J-M[aria-haspopup=true]';
|
|
12995
|
-
const selector_2023_11_16 = 'div.nH.a98.iY > div.nH .aHU .b7.J-M[aria-haspopup=true]';
|
|
12996
|
-
const maybeMoreMenu = document.body.querySelector(selector_2023_11_16) || document.body.querySelector(selector_2022_11_23);
|
|
12997
12994
|
// This will find any message's open more menu! The caller needs to make
|
|
12998
12995
|
// sure it belongs to this message!
|
|
12999
|
-
return
|
|
12996
|
+
return this.#driver.selectors.querySelectorByKey(document.body, 'messageView.openMoreMenu');
|
|
13000
12997
|
}
|
|
13001
12998
|
#closeActiveEmailMenu() {
|
|
13002
12999
|
const moreButton = this.#getMoreButton();
|
|
@@ -13067,7 +13064,7 @@ class GmailMessageView {
|
|
|
13067
13064
|
if (!messageId) throw new Error('message id attribute with no value, wtf?');
|
|
13068
13065
|
return messageId;
|
|
13069
13066
|
}
|
|
13070
|
-
const messageEl = this.#
|
|
13067
|
+
const messageEl = this.#driver.selectors.querySelectorByKey(this.#element, 'messageView.legacyIdBody');
|
|
13071
13068
|
if (!messageEl) {
|
|
13072
13069
|
const err = new Error('Could not find message id element');
|
|
13073
13070
|
this.#driver.getLogger().error(err, {
|
|
@@ -14446,7 +14443,7 @@ class GmailThreadView {
|
|
|
14446
14443
|
hiddenNoticeElement.appendChild(appNoticeContainerElement);
|
|
14447
14444
|
}
|
|
14448
14445
|
getSubject() {
|
|
14449
|
-
|
|
14446
|
+
const subjectElement = this.#driver.selectors.querySelectorByKey(this.#element, 'threadView.subject');
|
|
14450
14447
|
if (!subjectElement) {
|
|
14451
14448
|
return '';
|
|
14452
14449
|
}
|
|
@@ -14470,7 +14467,7 @@ class GmailThreadView {
|
|
|
14470
14467
|
// Follows a similar structure to getThreadIDAsync, but gives up if async work is needed
|
|
14471
14468
|
getThreadID() {
|
|
14472
14469
|
if (this.#threadID) return this.#threadID;
|
|
14473
|
-
const idElement = this.#
|
|
14470
|
+
const idElement = this.#driver.selectors.querySelectorByKey(this.#element, 'threadView.idElement');
|
|
14474
14471
|
if (!idElement) throw new Error('threadID element not found');
|
|
14475
14472
|
|
|
14476
14473
|
// the string value can be 'undefined'
|
|
@@ -14506,7 +14503,7 @@ class GmailThreadView {
|
|
|
14506
14503
|
}
|
|
14507
14504
|
async getThreadIDAsync() {
|
|
14508
14505
|
if (this.#threadID) return this.#threadID;
|
|
14509
|
-
const idElement = this.#
|
|
14506
|
+
const idElement = this.#driver.selectors.querySelectorByKey(this.#element, 'threadView.idElement');
|
|
14510
14507
|
if (!idElement) throw new Error('threadID element not found');
|
|
14511
14508
|
|
|
14512
14509
|
// the string value can be 'undefined'
|
|
@@ -15134,7 +15131,7 @@ options.insert = htmlElement => {
|
|
|
15134
15131
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
15135
15132
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
15136
15133
|
///@ts-ignore
|
|
15137
|
-
"2.2.
|
|
15134
|
+
"2.2.20-1787183471518-8065a08149d763a3");
|
|
15138
15135
|
document.head.append(htmlElement);
|
|
15139
15136
|
};
|
|
15140
15137
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -19900,7 +19897,7 @@ mole_view_module_options.insert = htmlElement => {
|
|
|
19900
19897
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
19901
19898
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
19902
19899
|
///@ts-ignore
|
|
19903
|
-
"2.2.
|
|
19900
|
+
"2.2.20-1787183471518-8065a08149d763a3");
|
|
19904
19901
|
document.head.append(htmlElement);
|
|
19905
19902
|
};
|
|
19906
19903
|
mole_view_module_options.domAPI = (styleDomAPI_default());
|
|
@@ -20716,6 +20713,8 @@ class GmailRouteProcessor {
|
|
|
20716
20713
|
category: this.NativeRouteIDs.LABEL,
|
|
20717
20714
|
search: this.NativeRouteIDs.SEARCH,
|
|
20718
20715
|
'advanced-search': this.NativeRouteIDs.SEARCH,
|
|
20716
|
+
// Generated by selecting 'Filter messages like these' on a thread
|
|
20717
|
+
'create-filter': this.NativeRouteIDs.SEARCH,
|
|
20719
20718
|
trash: this.NativeRouteIDs.TRASH,
|
|
20720
20719
|
spam: this.NativeRouteIDs.SPAM,
|
|
20721
20720
|
apps: this.NativeRouteIDs.SEARCH,
|
|
@@ -24258,7 +24257,59 @@ const GMAIL_SELECTORS = {
|
|
|
24258
24257
|
* The title-bar cell holding the compose window buttons — inside the table above,
|
|
24259
24258
|
* but resolved against the same compose root.
|
|
24260
24259
|
*/
|
|
24261
|
-
'composeView.titleBarTd': ['.nH.Hy.aXJ table.cf.Ht td.Hm', '.nH.Hy.aXJ table.cf td.Hm']
|
|
24260
|
+
'composeView.titleBarTd': ['.nH.Hy.aXJ table.cf.Ht td.Hm', '.nH.Hy.aXJ table.cf td.Hm'],
|
|
24261
|
+
/**
|
|
24262
|
+
* Body of an open message.
|
|
24263
|
+
* Root: message element.
|
|
24264
|
+
*/
|
|
24265
|
+
'messageView.body': ['div.ii.gt', '.adP'],
|
|
24266
|
+
/**
|
|
24267
|
+
* Message body carrying the legacy `m<hex>` id class. Narrower than
|
|
24268
|
+
* `messageView.body` on purpose — the `.adP` rung does not carry that class.
|
|
24269
|
+
* Root: message element.
|
|
24270
|
+
*/
|
|
24271
|
+
'messageView.legacyIdBody': ['div.ii.gt'],
|
|
24272
|
+
/**
|
|
24273
|
+
* Element carrying the thread's id attributes.
|
|
24274
|
+
* Root: thread element.
|
|
24275
|
+
*/
|
|
24276
|
+
'threadView.idElement': ['[data-legacy-thread-id]'],
|
|
24277
|
+
/**
|
|
24278
|
+
* A message's open "more actions" menu. Gmail renders it outside
|
|
24279
|
+
* the message, so a match may belong to another message.
|
|
24280
|
+
* Root: `document.body`.
|
|
24281
|
+
*/
|
|
24282
|
+
'messageView.openMoreMenu': [
|
|
24283
|
+
// 2023-11-16 thread-view redesign
|
|
24284
|
+
'div.nH.a98.iY > div.nH .aHU .b7.J-M[aria-haspopup=true]',
|
|
24285
|
+
// 2022-11-23, same shape under an extra `td >`
|
|
24286
|
+
'td > div.nH.a98.iY > div.nH .aHU .b7.J-M[aria-haspopup=true]',
|
|
24287
|
+
// pre-2023 `.if` layout
|
|
24288
|
+
'td > div.nH.if > div.nH.aHU div.b7.J-M[aria-haspopup=true]'],
|
|
24289
|
+
/**
|
|
24290
|
+
* The "more actions" button that opens `messageView.openMoreMenu`.
|
|
24291
|
+
* Only present while the message is expanded.
|
|
24292
|
+
* Root: message element.
|
|
24293
|
+
*/
|
|
24294
|
+
'messageView.moreButton': ['tr.acZ div.T-I.J-J5-Ji.aap.L3[role=button][aria-haspopup]'],
|
|
24295
|
+
/**
|
|
24296
|
+
* The sender's span in a message header; carries the `email` and `name`
|
|
24297
|
+
* attributes the contact is built from.
|
|
24298
|
+
* Root: message element.
|
|
24299
|
+
*/
|
|
24300
|
+
'messageView.senderSpan': ['td.gF span[email]'],
|
|
24301
|
+
/**
|
|
24302
|
+
* The message's date element; the full date is read from its `title`,
|
|
24303
|
+
* not its text.
|
|
24304
|
+
* Root: message element.
|
|
24305
|
+
*/
|
|
24306
|
+
'messageView.dateElement': ['.ads .gK .g3'],
|
|
24307
|
+
/**
|
|
24308
|
+
* The thread's subject heading. Read for its text, or walked child by child
|
|
24309
|
+
* when it contains emoji images.
|
|
24310
|
+
* Root: thread element.
|
|
24311
|
+
*/
|
|
24312
|
+
'threadView.subject': ['.ha h2']
|
|
24262
24313
|
};
|
|
24263
24314
|
|
|
24264
24315
|
/** Resolved candidates for every key. The merge builds new lists. */
|