@inboxsdk/core 2.2.8 → 2.2.10
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 +68 -42
- package/inboxsdk.js.map +1 -1
- package/package.json +1 -1
- package/pageWorld.js +243 -22
- package/pageWorld.js.map +1 -1
- package/src/inboxsdk.d.ts +5 -0
- package/src/injected-js/gmail/setup-gmail-interceptor.d.ts.map +1 -1
- package/src/injected-js/message-metadata-holder.d.ts +1 -0
- package/src/injected-js/message-metadata-holder.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-response-processor.d.ts +2 -4
- package/src/platform-implementation-js/dom-driver/gmail/gmail-response-processor.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-sync-response-processor.d.ts +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-sync-response-processor.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-address-changes-stream.d.ts +4 -4
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-address-changes-stream.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-address-information-extractor.d.ts +2 -2
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-address-information-extractor.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-recipients.d.ts +2 -2
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-recipients.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view.d.ts +6 -6
- 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/get-updated-contact.d.ts +2 -2
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-message-view/get-updated-contact.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-message-view.d.ts +3 -3
- 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/src/platform-implementation-js/driver-interfaces/compose-view-driver.d.ts +2 -2
- package/src/platform-implementation-js/driver-interfaces/compose-view-driver.d.ts.map +1 -1
- package/src/platform-implementation-js/lib/extract-contact-from-email-contact-string.d.ts +2 -2
- package/src/platform-implementation-js/lib/extract-contact-from-email-contact-string.d.ts.map +1 -1
- package/src/platform-implementation-js/views/compose-view.d.ts +4 -4
- package/src/platform-implementation-js/views/compose-view.d.ts.map +1 -1
- package/src/platform-implementation-js/views/conversations/message-view.d.ts +3 -3
- package/src/platform-implementation-js/views/conversations/message-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.10-1763685333177-98e6efede22d933e";
|
|
375
375
|
if (false) {}
|
|
376
376
|
|
|
377
377
|
/***/ }),
|
|
@@ -1335,10 +1335,15 @@ const GmailElementGetter = {
|
|
|
1335
1335
|
/* harmony import */ var lodash_flatten__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_flatten__WEBPACK_IMPORTED_MODULE_0__);
|
|
1336
1336
|
/* harmony import */ var lodash_last__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6456);
|
|
1337
1337
|
/* harmony import */ var lodash_last__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_last__WEBPACK_IMPORTED_MODULE_1__);
|
|
1338
|
-
/* harmony import */ var
|
|
1339
|
-
/* harmony import */ var
|
|
1340
|
-
/* harmony import */ var
|
|
1341
|
-
/* harmony import */ var
|
|
1338
|
+
/* harmony import */ var lodash_uniqBy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8496);
|
|
1339
|
+
/* harmony import */ var lodash_uniqBy__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqBy__WEBPACK_IMPORTED_MODULE_2__);
|
|
1340
|
+
/* harmony import */ var transducers_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6046);
|
|
1341
|
+
/* harmony import */ var transducers_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(transducers_js__WEBPACK_IMPORTED_MODULE_3__);
|
|
1342
|
+
/* harmony import */ var _common_html_to_text__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6305);
|
|
1343
|
+
/* harmony import */ var _common_assert__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1602);
|
|
1344
|
+
/* harmony import */ var _lib_extract_contact_from_email_contact_string__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3324);
|
|
1345
|
+
|
|
1346
|
+
|
|
1342
1347
|
|
|
1343
1348
|
|
|
1344
1349
|
|
|
@@ -1585,7 +1590,7 @@ function serializeArray(array, noArrayNewLines, includeExplicitNulls) {
|
|
|
1585
1590
|
}
|
|
1586
1591
|
function readDraftId(response, messageID) {
|
|
1587
1592
|
const decoded = deserialize(response).value;
|
|
1588
|
-
const msgA =
|
|
1593
|
+
const msgA = transducers_js__WEBPACK_IMPORTED_MODULE_3___default().toArray(decoded, transducers_js__WEBPACK_IMPORTED_MODULE_3___default().compose((transducers_js__WEBPACK_IMPORTED_MODULE_3___default().cat), transducers_js__WEBPACK_IMPORTED_MODULE_3___default().filter(Array.isArray), (transducers_js__WEBPACK_IMPORTED_MODULE_3___default().cat), transducers_js__WEBPACK_IMPORTED_MODULE_3___default().filter(x => x[0] === 'ms' && x[1] === messageID), transducers_js__WEBPACK_IMPORTED_MODULE_3___default().take(1), transducers_js__WEBPACK_IMPORTED_MODULE_3___default().map(x => x[60])))[0];
|
|
1589
1594
|
if (msgA) {
|
|
1590
1595
|
const match = msgA.match(/^msg-[^:]:(\S+)$/i);
|
|
1591
1596
|
return match && match[1];
|
|
@@ -1729,30 +1734,42 @@ function extractThreadsFromDeserialized(value) {
|
|
|
1729
1734
|
value: thread
|
|
1730
1735
|
})));
|
|
1731
1736
|
}
|
|
1732
|
-
const _extractMessageIdsFromThreadBatchRequestXf =
|
|
1737
|
+
const _extractMessageIdsFromThreadBatchRequestXf = transducers_js__WEBPACK_IMPORTED_MODULE_3___default().compose((transducers_js__WEBPACK_IMPORTED_MODULE_3___default().cat), (transducers_js__WEBPACK_IMPORTED_MODULE_3___default().cat), transducers_js__WEBPACK_IMPORTED_MODULE_3___default().filter(item => item[0] === 'cs'), transducers_js__WEBPACK_IMPORTED_MODULE_3___default().map(item => [item[1], item[2]]));
|
|
1733
1738
|
function extractMessageIdsFromThreadBatchRequest(response) {
|
|
1734
1739
|
const {
|
|
1735
1740
|
value
|
|
1736
1741
|
} = deserialize(response);
|
|
1737
|
-
return
|
|
1742
|
+
return transducers_js__WEBPACK_IMPORTED_MODULE_3___default().toObj(value, _extractMessageIdsFromThreadBatchRequestXf);
|
|
1738
1743
|
}
|
|
1739
1744
|
function cleanupPeopleLine(peopleHtml) {
|
|
1740
1745
|
// Removes possible headings like "To: " that get added on the Sent page, and
|
|
1741
1746
|
// removes a class that's specific to the current preview pane setting.
|
|
1742
1747
|
return peopleHtml.replace(/^[^<]*/, '').replace(/(<span[^>]*) class="[^"]*"/g, '$1');
|
|
1743
1748
|
}
|
|
1744
|
-
const _extractThreadArraysFromResponseArrayXf =
|
|
1749
|
+
const _extractThreadArraysFromResponseArrayXf = transducers_js__WEBPACK_IMPORTED_MODULE_3___default().compose((transducers_js__WEBPACK_IMPORTED_MODULE_3___default().cat), transducers_js__WEBPACK_IMPORTED_MODULE_3___default().filter(item => item[0] === 'tb'), transducers_js__WEBPACK_IMPORTED_MODULE_3___default().map(item => item[2]), (transducers_js__WEBPACK_IMPORTED_MODULE_3___default().cat));
|
|
1745
1750
|
function _extractThreadArraysFromResponseArray(threadResponseArray) {
|
|
1746
1751
|
return t.toArray(threadResponseArray, _extractThreadArraysFromResponseArrayXf);
|
|
1747
1752
|
}
|
|
1748
|
-
const _extractThreadsFromConversationViewResponseArrayXf =
|
|
1753
|
+
const _extractThreadsFromConversationViewResponseArrayXf = transducers_js__WEBPACK_IMPORTED_MODULE_3___default().compose((transducers_js__WEBPACK_IMPORTED_MODULE_3___default().cat), transducers_js__WEBPACK_IMPORTED_MODULE_3___default().filter(item => item[0] === 'cs'), transducers_js__WEBPACK_IMPORTED_MODULE_3___default().map(item => ({
|
|
1749
1754
|
threadID: item[1],
|
|
1750
1755
|
messageIDs: item[8]
|
|
1751
1756
|
})));
|
|
1752
|
-
const _extractMessagesFromResponseArrayXf =
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1757
|
+
const _extractMessagesFromResponseArrayXf = transducers_js__WEBPACK_IMPORTED_MODULE_3___default().compose((transducers_js__WEBPACK_IMPORTED_MODULE_3___default().cat), transducers_js__WEBPACK_IMPORTED_MODULE_3___default().filter(item => item[0] === 'ms'), transducers_js__WEBPACK_IMPORTED_MODULE_3___default().map(item => {
|
|
1758
|
+
const m = {
|
|
1759
|
+
messageID: item[1],
|
|
1760
|
+
date: item[7],
|
|
1761
|
+
recipients: undefined
|
|
1762
|
+
};
|
|
1763
|
+
if (Array.isArray(item[13])) {
|
|
1764
|
+
m.recipients = item[13].slice(1, 4).filter(b => b != null).flat().map(_lib_extract_contact_from_email_contact_string__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A);
|
|
1765
|
+
} else if (Array.isArray(item[37])) {
|
|
1766
|
+
m.recipients = lodash_uniqBy__WEBPACK_IMPORTED_MODULE_2___default()(item[37].slice(0, 5).filter(b => Array.isArray(b)).flat(), b => b[1]).map(b => ({
|
|
1767
|
+
emailAddress: b[1],
|
|
1768
|
+
name: b[0] ?? undefined
|
|
1769
|
+
}));
|
|
1770
|
+
}
|
|
1771
|
+
return m;
|
|
1772
|
+
}));
|
|
1756
1773
|
function extractMessages(response) {
|
|
1757
1774
|
// regular view=cv requests have a top level array length of 1
|
|
1758
1775
|
// whereas view=cv requests when you refresh Gmail while looking at a thread
|
|
@@ -1765,7 +1782,9 @@ function extractMessages(response) {
|
|
|
1765
1782
|
const messages = t.toArray(value, _extractMessagesFromResponseArrayXf);
|
|
1766
1783
|
const messageMap = {};
|
|
1767
1784
|
messages.forEach(message => {
|
|
1768
|
-
|
|
1785
|
+
if (message.messageID != null) {
|
|
1786
|
+
messageMap[message.messageID] = message;
|
|
1787
|
+
}
|
|
1769
1788
|
});
|
|
1770
1789
|
return threads.map(_ref2 => {
|
|
1771
1790
|
let {
|
|
@@ -2646,7 +2665,7 @@ options.insert = htmlElement => {
|
|
|
2646
2665
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
2647
2666
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
2648
2667
|
///@ts-ignore
|
|
2649
|
-
"2.2.
|
|
2668
|
+
"2.2.10-1763685333177-98e6efede22d933e");
|
|
2650
2669
|
document.head.append(htmlElement);
|
|
2651
2670
|
};
|
|
2652
2671
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -9951,7 +9970,7 @@ function isValidEmail(candidate) {
|
|
|
9951
9970
|
;// CONCATENATED MODULE: ./src/platform-implementation-js/lib/extract-contact-from-email-contact-string.ts
|
|
9952
9971
|
|
|
9953
9972
|
function extractContactFromEmailContactString(contactInfoString) {
|
|
9954
|
-
let name
|
|
9973
|
+
let name;
|
|
9955
9974
|
let emailAddress = null;
|
|
9956
9975
|
const contactInfoParts = contactInfoString.split('<');
|
|
9957
9976
|
const firstPartTrimmed = contactInfoParts[0].replace(/\u202c/g, '').trim();
|
|
@@ -10294,7 +10313,7 @@ options.insert = htmlElement => {
|
|
|
10294
10313
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
10295
10314
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
10296
10315
|
///@ts-ignore
|
|
10297
|
-
"2.2.
|
|
10316
|
+
"2.2.10-1763685333177-98e6efede22d933e");
|
|
10298
10317
|
document.head.append(htmlElement);
|
|
10299
10318
|
};
|
|
10300
10319
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -12375,7 +12394,7 @@ class MessageView extends safe_event_emitter/* default */.A {
|
|
|
12375
12394
|
this.#driver.getLogger().deprecationWarning('MessageView.getRecipients', 'MessageView.getRecipientEmailAddresses() or MessageView.getRecipientsFull()');
|
|
12376
12395
|
return this.getRecipientEmailAddresses().map(emailAddress => ({
|
|
12377
12396
|
emailAddress,
|
|
12378
|
-
name:
|
|
12397
|
+
name: undefined
|
|
12379
12398
|
}));
|
|
12380
12399
|
}
|
|
12381
12400
|
getRecipientEmailAddresses() {
|
|
@@ -12598,7 +12617,7 @@ function updateContactCacheFromModal(headerContact) {
|
|
|
12598
12617
|
if (cache[emailAddress]) continue;
|
|
12599
12618
|
let modalContact = {
|
|
12600
12619
|
emailAddress,
|
|
12601
|
-
name:
|
|
12620
|
+
name: undefined
|
|
12602
12621
|
};
|
|
12603
12622
|
const name = span.getAttribute('name');
|
|
12604
12623
|
if (name) {
|
|
@@ -12849,7 +12868,10 @@ class GmailMessageView {
|
|
|
12849
12868
|
let recipients = this.#recipientsFull;
|
|
12850
12869
|
if (recipients) return recipients;
|
|
12851
12870
|
const threadID = this.#threadViewDriver.getInternalID();
|
|
12852
|
-
recipients = this.#recipientsFull = await this.#driver.getPageCommunicator().getMessageRecipients(threadID, this.#element)
|
|
12871
|
+
recipients = this.#recipientsFull = (await this.#driver.getPageCommunicator().getMessageRecipients(threadID, this.#element))?.map(recipient => ({
|
|
12872
|
+
name: recipient.name ?? undefined,
|
|
12873
|
+
emailAddress: recipient.emailAddress
|
|
12874
|
+
}));
|
|
12853
12875
|
if (!recipients) {
|
|
12854
12876
|
this.#driver.getLogger().error(new Error('Failed to find message recipients from response'), {
|
|
12855
12877
|
threadID
|
|
@@ -14390,8 +14412,10 @@ class GmailThreadView {
|
|
|
14390
14412
|
let threadID;
|
|
14391
14413
|
const idElement = this.#element.querySelector('[data-thread-perm-id]');
|
|
14392
14414
|
if (!idElement) throw new Error('threadID element not found');
|
|
14393
|
-
|
|
14394
|
-
|
|
14415
|
+
|
|
14416
|
+
// the string value can be 'undefined'
|
|
14417
|
+
const attributeValue = idElement.getAttribute('data-thread-perm-id');
|
|
14418
|
+
this.#syncThreadID = typeof attributeValue === 'string' && attributeValue !== 'undefined' ? attributeValue : null;
|
|
14395
14419
|
threadID = idElement.getAttribute('data-legacy-thread-id');
|
|
14396
14420
|
if (!threadID) {
|
|
14397
14421
|
const err = new Error('Failed to get id for thread: data-legacy-thread-id attribute missing');
|
|
@@ -14422,10 +14446,12 @@ class GmailThreadView {
|
|
|
14422
14446
|
let threadID;
|
|
14423
14447
|
const idElement = this.#element.querySelector('[data-thread-perm-id]');
|
|
14424
14448
|
if (!idElement) throw new Error('threadID element not found');
|
|
14425
|
-
|
|
14426
|
-
|
|
14449
|
+
|
|
14450
|
+
// the string value can be 'undefined'
|
|
14451
|
+
const attributeValue = idElement.getAttribute('data-thread-perm-id');
|
|
14452
|
+
const syncThreadID = this.#syncThreadID = typeof attributeValue === 'string' && attributeValue !== 'undefined' ? attributeValue : null;
|
|
14427
14453
|
this.#threadID = threadID = idElement.getAttribute('data-legacy-thread-id');
|
|
14428
|
-
if (!threadID) {
|
|
14454
|
+
if (!threadID && syncThreadID) {
|
|
14429
14455
|
this.#threadID = threadID = await this.#driver.getOldGmailThreadIdFromSyncThreadId(syncThreadID);
|
|
14430
14456
|
}
|
|
14431
14457
|
if (this.#threadID) return this.#threadID;else throw new Error('Failed to get id for thread');
|
|
@@ -14510,18 +14536,10 @@ class GmailThreadView {
|
|
|
14510
14536
|
onClick: button.onClick
|
|
14511
14537
|
};
|
|
14512
14538
|
const buttonElement = buttonOptions.buttonView.getElement();
|
|
14513
|
-
const spacer = document.createElement('span');
|
|
14514
|
-
const spacerID = 'inboxsdk__thread_view_footer_button_spacer';
|
|
14515
|
-
spacer.style.width = '8px';
|
|
14516
|
-
spacer.id = spacerID;
|
|
14517
14539
|
|
|
14518
14540
|
// Sometimes it is there right away
|
|
14519
14541
|
const subjectToolbarElement = this.#findBottomReplyToolbarElement();
|
|
14520
14542
|
if (subjectToolbarElement) {
|
|
14521
|
-
const reactionButton = this.#element.querySelector('.amn .wrsVRe');
|
|
14522
|
-
if (reactionButton && !this.#element.querySelector(`#${spacerID}`)) {
|
|
14523
|
-
subjectToolbarElement.appendChild(spacer);
|
|
14524
|
-
}
|
|
14525
14543
|
subjectToolbarElement.appendChild(buttonElement);
|
|
14526
14544
|
}
|
|
14527
14545
|
|
|
@@ -14530,10 +14548,6 @@ class GmailThreadView {
|
|
|
14530
14548
|
if (mutationsList.some(mutation => mutation.type === 'childList')) {
|
|
14531
14549
|
const subjectToolbarElement = this.#findBottomReplyToolbarElement();
|
|
14532
14550
|
if (subjectToolbarElement && !subjectToolbarElement.contains(buttonElement)) {
|
|
14533
|
-
const reactionButton = this.#element.querySelector('.amn .wrsVRe');
|
|
14534
|
-
if (reactionButton && !this.#element.querySelector(`#${spacerID}`)) {
|
|
14535
|
-
subjectToolbarElement.appendChild(spacer);
|
|
14536
|
-
}
|
|
14537
14551
|
subjectToolbarElement.appendChild(buttonElement);
|
|
14538
14552
|
}
|
|
14539
14553
|
}
|
|
@@ -14592,8 +14606,20 @@ class GmailThreadView {
|
|
|
14592
14606
|
return toolbarContainerElement;
|
|
14593
14607
|
}
|
|
14594
14608
|
#findBottomReplyToolbarElement() {
|
|
14595
|
-
|
|
14596
|
-
|
|
14609
|
+
// Get all .amn elements (may exist in multiple locations due to A/B testing)
|
|
14610
|
+
var allAmnElements = this.#element.querySelectorAll('.amn');
|
|
14611
|
+
|
|
14612
|
+
// Find the visible .amn element (handles A/B testing where one might be hidden)
|
|
14613
|
+
for (const element of allAmnElements) {
|
|
14614
|
+
const isInsideTable = element.closest('table') !== null;
|
|
14615
|
+
const isHidden = window.getComputedStyle(element).display === 'none';
|
|
14616
|
+
if (!isInsideTable && !isHidden) {
|
|
14617
|
+
return element;
|
|
14618
|
+
}
|
|
14619
|
+
}
|
|
14620
|
+
|
|
14621
|
+
// Fallback to the first one if no visible element found
|
|
14622
|
+
return allAmnElements[0] || null;
|
|
14597
14623
|
}
|
|
14598
14624
|
#isToolbarContainerRelevant(toolbarContainerElement) {
|
|
14599
14625
|
if (toolbarContainerElement.parentElement.parentElement === this.#element.parentElement.parentElement) {
|
|
@@ -15044,7 +15070,7 @@ options.insert = htmlElement => {
|
|
|
15044
15070
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
15045
15071
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
15046
15072
|
///@ts-ignore
|
|
15047
|
-
"2.2.
|
|
15073
|
+
"2.2.10-1763685333177-98e6efede22d933e");
|
|
15048
15074
|
document.head.append(htmlElement);
|
|
15049
15075
|
};
|
|
15050
15076
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -19804,7 +19830,7 @@ mole_view_module_options.insert = htmlElement => {
|
|
|
19804
19830
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
19805
19831
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
19806
19832
|
///@ts-ignore
|
|
19807
|
-
"2.2.
|
|
19833
|
+
"2.2.10-1763685333177-98e6efede22d933e");
|
|
19808
19834
|
document.head.append(htmlElement);
|
|
19809
19835
|
};
|
|
19810
19836
|
mole_view_module_options.domAPI = (styleDomAPI_default());
|