@inboxsdk/core 2.1.37 → 2.1.38
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 +409 -463
- package/package.json +1 -1
- package/pageWorld.js +13 -12
- package/src/common/isNotNil.d.ts.map +1 -0
- package/src/inboxsdk.d.ts +1 -1
- package/src/injected-js/xhr-proxy-factory.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/register-search-suggestions-provider.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/setup-compose-view-driver-stream.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/setup-route-view-driver-stream.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-custom-thread-list.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/user-info.d.ts +2 -2
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/user-info.d.ts.map +1 -1
- 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 +2 -2
- 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/native-gmail-nav-item-view.d.ts.map +1 -1
- package/src/platform-implementation-js/platform-implementation.d.ts.map +1 -1
- package/src/platform-implementation-js/views/conversations/attachment-card-view.d.ts +3 -5
- package/src/platform-implementation-js/views/conversations/attachment-card-view.d.ts.map +1 -1
- package/src/platform-implementation-js/views/conversations/custom-message-view.d.ts +4 -12
- package/src/platform-implementation-js/views/conversations/custom-message-view.d.ts.map +1 -1
- package/src/platform-implementation-js/views/conversations/message-view.d.ts +7 -7
- package/src/platform-implementation-js/views/conversations/message-view.d.ts.map +1 -1
- package/src/platform-implementation-js/views/route-view/dummy-route-view-driver.d.ts +1 -2
- package/src/platform-implementation-js/views/route-view/dummy-route-view-driver.d.ts.map +1 -1
- package/src/platform-implementation-js/lib/isNotNil.d.ts.map +0 -1
- /package/src/{platform-implementation-js/lib → common}/isNotNil.d.ts +0 -0
package/inboxsdk.js
CHANGED
|
@@ -863,6 +863,21 @@ function isElementVisible(el) {
|
|
|
863
863
|
|
|
864
864
|
/***/ }),
|
|
865
865
|
|
|
866
|
+
/***/ 6230:
|
|
867
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
868
|
+
|
|
869
|
+
"use strict";
|
|
870
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
871
|
+
/* harmony export */ "Z": () => (/* binding */ isNotNil)
|
|
872
|
+
/* harmony export */ });
|
|
873
|
+
// Type predicate to avoid opting out of strict type checking in filter operations.
|
|
874
|
+
// Adapted from https://stackoverflow.com/a/46700791
|
|
875
|
+
function isNotNil(value) {
|
|
876
|
+
return value != null;
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
/***/ }),
|
|
880
|
+
|
|
866
881
|
/***/ 7403:
|
|
867
882
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
868
883
|
|
|
@@ -875,7 +890,7 @@ function isElementVisible(el) {
|
|
|
875
890
|
|
|
876
891
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- SDK_VERSION is injected by webpack
|
|
877
892
|
///@ts-ignore
|
|
878
|
-
const BUILD_VERSION = "2.1.
|
|
893
|
+
const BUILD_VERSION = "2.1.38-1712087227941-d4c8bfd8eba680c6";
|
|
879
894
|
if (false) {}
|
|
880
895
|
|
|
881
896
|
/***/ }),
|
|
@@ -1287,6 +1302,8 @@ function makeElementStreamMerger() {
|
|
|
1287
1302
|
var gmail_element_getter = __webpack_require__(2851);
|
|
1288
1303
|
// EXTERNAL MODULE: ./src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view.ts + 31 modules
|
|
1289
1304
|
var gmail_compose_view = __webpack_require__(1166);
|
|
1305
|
+
// EXTERNAL MODULE: ./src/common/isNotNil.ts
|
|
1306
|
+
var isNotNil = __webpack_require__(6230);
|
|
1290
1307
|
;// CONCATENATED MODULE: ./src/platform-implementation-js/dom-driver/gmail/gmail-driver/setup-compose-view-driver-stream.ts
|
|
1291
1308
|
/* module decorator */ module = __webpack_require__.hmd(module);
|
|
1292
1309
|
|
|
@@ -1297,14 +1314,15 @@ var gmail_compose_view = __webpack_require__(1166);
|
|
|
1297
1314
|
|
|
1298
1315
|
|
|
1299
1316
|
|
|
1317
|
+
|
|
1300
1318
|
var impStream = js_default()(module, imp);
|
|
1301
1319
|
function setupComposeViewDriverStream(gmailDriver, messageViewDriverStream, xhrInterceptorStream) {
|
|
1302
1320
|
return impStream.flatMapLatest(imp => imp(gmailDriver, messageViewDriverStream, xhrInterceptorStream));
|
|
1303
1321
|
}
|
|
1304
1322
|
function imp(gmailDriver, messageViewDriverStream, xhrInterceptorStream) {
|
|
1305
1323
|
return kefir_esm.fromPromise(gmail_element_getter/* default.waitForGmailModeToSettle */.Z.waitForGmailModeToSettle()).flatMap(() => {
|
|
1306
|
-
|
|
1307
|
-
|
|
1324
|
+
let elementStream;
|
|
1325
|
+
let isStandalone = false;
|
|
1308
1326
|
if (gmail_element_getter/* default.isStandaloneComposeWindow */.Z.isStandaloneComposeWindow()) {
|
|
1309
1327
|
elementStream = _setupStandaloneComposeElementStream();
|
|
1310
1328
|
isStandalone = true;
|
|
@@ -1324,7 +1342,7 @@ function imp(gmailDriver, messageViewDriverStream, xhrInterceptorStream) {
|
|
|
1324
1342
|
}
|
|
1325
1343
|
function _setupStandardComposeElementStream() {
|
|
1326
1344
|
return _waitForContainerAndMonitorChildrenStream(() => gmail_element_getter/* default.getComposeWindowContainer */.Z.getComposeWindowContainer()).flatMap(composeGrandParent => {
|
|
1327
|
-
|
|
1345
|
+
const composeParentEl = composeGrandParent.el.querySelector('div.AD');
|
|
1328
1346
|
if (composeParentEl) {
|
|
1329
1347
|
return (0,make_element_child_stream/* default */.Z)(composeParentEl).takeUntilBy(composeGrandParent.removalStream).map(_informElement('composeFullscreenStateChanged'));
|
|
1330
1348
|
} else {
|
|
@@ -1353,7 +1371,7 @@ function _setupStandardComposeElementStream() {
|
|
|
1353
1371
|
el,
|
|
1354
1372
|
removalStream: removalStream.merge(hiddenStream).take(1)
|
|
1355
1373
|
};
|
|
1356
|
-
}).filter(
|
|
1374
|
+
}).filter(isNotNil/* default */.Z)).flatMap(event => {
|
|
1357
1375
|
if (!event) throw new Error('Should not happen');
|
|
1358
1376
|
const el = event.el.querySelector('[role=dialog]');
|
|
1359
1377
|
if (!el || !el.querySelector('form')) {
|
|
@@ -2344,7 +2362,7 @@ function _getArrayValueFromPath(responseArray, path) {
|
|
|
2344
2362
|
/* unused harmony exports extractThreadsFromSearchResponse_20220909, replaceThreadsInSearchResponse_20220909 */
|
|
2345
2363
|
/* harmony import */ var bignumber_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4431);
|
|
2346
2364
|
/* harmony import */ var bignumber_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(bignumber_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
2347
|
-
/* harmony import */ var
|
|
2365
|
+
/* harmony import */ var _common_isNotNil__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6230);
|
|
2348
2366
|
|
|
2349
2367
|
|
|
2350
2368
|
function extractThreadsFromSearchResponse(response) {
|
|
@@ -2378,7 +2396,7 @@ function extractThreadsFromSearchResponse(response) {
|
|
|
2378
2396
|
}))
|
|
2379
2397
|
}
|
|
2380
2398
|
};
|
|
2381
|
-
}).filter(
|
|
2399
|
+
}).filter(_common_isNotNil__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z);
|
|
2382
2400
|
}
|
|
2383
2401
|
function extractThreadsFromSearchResponse_20220909(parsedResponse) {
|
|
2384
2402
|
const threadDescriptors = parsedResponse && parsedResponse[2];
|
|
@@ -2403,7 +2421,7 @@ function extractThreadsFromSearchResponse_20220909(parsedResponse) {
|
|
|
2403
2421
|
}))
|
|
2404
2422
|
}
|
|
2405
2423
|
};
|
|
2406
|
-
}).filter(
|
|
2424
|
+
}).filter(_common_isNotNil__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z);
|
|
2407
2425
|
}
|
|
2408
2426
|
function extractThreadsFromThreadResponse(response) {
|
|
2409
2427
|
const parsedResponse = JSON.parse(response);
|
|
@@ -2456,7 +2474,7 @@ function extractThreadsFromThreadResponse(response) {
|
|
|
2456
2474
|
}
|
|
2457
2475
|
};
|
|
2458
2476
|
}
|
|
2459
|
-
}).filter(
|
|
2477
|
+
}).filter(_common_isNotNil__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z);
|
|
2460
2478
|
}
|
|
2461
2479
|
function extractThreadsFromThreadResponse_20220909(parsedResponse) {
|
|
2462
2480
|
const threadDescriptors = parsedResponse && parsedResponse[1];
|
|
@@ -2505,7 +2523,7 @@ function extractThreadsFromThreadResponse_20220909(parsedResponse) {
|
|
|
2505
2523
|
}
|
|
2506
2524
|
};
|
|
2507
2525
|
}
|
|
2508
|
-
}).filter(
|
|
2526
|
+
}).filter(_common_isNotNil__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z);
|
|
2509
2527
|
}
|
|
2510
2528
|
function getRecipientsFromMessageDescriptor(messageDescriptor) {
|
|
2511
2529
|
if (!messageDescriptor[2]) return;
|
|
@@ -4900,8 +4918,8 @@ function getAddressInformationExtractor(addressType, composeView) {
|
|
|
4900
4918
|
}
|
|
4901
4919
|
};
|
|
4902
4920
|
}
|
|
4903
|
-
// EXTERNAL MODULE: ./src/
|
|
4904
|
-
var isNotNil = __webpack_require__(
|
|
4921
|
+
// EXTERNAL MODULE: ./src/common/isNotNil.ts
|
|
4922
|
+
var isNotNil = __webpack_require__(6230);
|
|
4905
4923
|
;// CONCATENATED MODULE: ./src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-recipients.ts
|
|
4906
4924
|
|
|
4907
4925
|
|
|
@@ -5676,6 +5694,7 @@ function setFromEmail(driver, gmailComposeView, email) {
|
|
|
5676
5694
|
|
|
5677
5695
|
|
|
5678
5696
|
|
|
5697
|
+
|
|
5679
5698
|
|
|
5680
5699
|
|
|
5681
5700
|
let hasReportedMissingBody = false;
|
|
@@ -5792,7 +5811,7 @@ class GmailComposeView {
|
|
|
5792
5811
|
return null;
|
|
5793
5812
|
}
|
|
5794
5813
|
}
|
|
5795
|
-
}).filter(
|
|
5814
|
+
}).filter(isNotNil/* default */.Z);
|
|
5796
5815
|
this.#eventStream.plug(kefir_esm.merge([saveAndSendStream, kefir_esm.fromEvents(this.#element, 'buttonAdded').map(() => {
|
|
5797
5816
|
return {
|
|
5798
5817
|
eventName: 'buttonAdded'
|
|
@@ -10610,7 +10629,7 @@ options.insert = htmlElement => {
|
|
|
10610
10629
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
10611
10630
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
10612
10631
|
///@ts-ignore
|
|
10613
|
-
"2.1.
|
|
10632
|
+
"2.1.38-1712087227941-d4c8bfd8eba680c6");
|
|
10614
10633
|
document.head.append(htmlElement);
|
|
10615
10634
|
};
|
|
10616
10635
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -10720,21 +10739,6 @@ style="width: 396px; height: 18px; max-height: 18px; padding: 5px; color: rgb(34
|
|
|
10720
10739
|
|
|
10721
10740
|
/***/ }),
|
|
10722
10741
|
|
|
10723
|
-
/***/ 8727:
|
|
10724
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
10725
|
-
|
|
10726
|
-
"use strict";
|
|
10727
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
10728
|
-
/* harmony export */ "Z": () => (/* binding */ isNotNil)
|
|
10729
|
-
/* harmony export */ });
|
|
10730
|
-
// Type predicate to avoid opting out of strict type checking in filter operations.
|
|
10731
|
-
// Adapted from https://stackoverflow.com/a/46700791
|
|
10732
|
-
function isNotNil(value) {
|
|
10733
|
-
return value != null;
|
|
10734
|
-
}
|
|
10735
|
-
|
|
10736
|
-
/***/ }),
|
|
10737
|
-
|
|
10738
10742
|
/***/ 3045:
|
|
10739
10743
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
10740
10744
|
|
|
@@ -11752,7 +11756,7 @@ if (!globalThis.__InboxSDKImpLoader) {
|
|
|
11752
11756
|
await onready;
|
|
11753
11757
|
const {
|
|
11754
11758
|
makePlatformImplementation
|
|
11755
|
-
} = await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
11759
|
+
} = await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1359));
|
|
11756
11760
|
return makePlatformImplementation(appId, opts, {
|
|
11757
11761
|
piMainStarted,
|
|
11758
11762
|
piLoadStarted,
|
|
@@ -11833,99 +11837,6 @@ class Compose {
|
|
|
11833
11837
|
|
|
11834
11838
|
/***/ }),
|
|
11835
11839
|
|
|
11836
|
-
/***/ 5558:
|
|
11837
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
11838
|
-
|
|
11839
|
-
"use strict";
|
|
11840
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
11841
|
-
/* harmony export */ "ZP": () => (__WEBPACK_DEFAULT_EXPORT__),
|
|
11842
|
-
/* harmony export */ "kI": () => (/* binding */ MessageViewToolbarSectionNames)
|
|
11843
|
-
/* harmony export */ });
|
|
11844
|
-
/* unused harmony export MessageViewViewStates */
|
|
11845
|
-
/* harmony import */ var kefir__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6609);
|
|
11846
|
-
/* harmony import */ var _common_get_or_fail__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7791);
|
|
11847
|
-
/* harmony import */ var _views_conversations_thread_view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7422);
|
|
11848
|
-
/* harmony import */ var _views_conversations_message_view__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5052);
|
|
11849
|
-
/* harmony import */ var _lib_handler_registry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3208);
|
|
11850
|
-
|
|
11851
|
-
|
|
11852
|
-
|
|
11853
|
-
|
|
11854
|
-
|
|
11855
|
-
const memberMap = new WeakMap();
|
|
11856
|
-
const MessageViewViewStates = Object.freeze({
|
|
11857
|
-
/**
|
|
11858
|
-
* One case where a {@link MessageView} is 'HIDDEN' is when there are too many messages in a thread,
|
|
11859
|
-
* and the message doesn't show at all.
|
|
11860
|
-
*/
|
|
11861
|
-
HIDDEN: 'HIDDEN',
|
|
11862
|
-
/**
|
|
11863
|
-
* {@link MessageView}s are collapsed when they are partially shown. The {@link MessageView}'s subject line and timestamp is visible, but the body of the message may be truncated.
|
|
11864
|
-
*/
|
|
11865
|
-
COLLAPSED: 'COLLAPSED',
|
|
11866
|
-
EXPANDED: 'EXPANDED'
|
|
11867
|
-
});
|
|
11868
|
-
const MessageViewToolbarSectionNames = Object.freeze({
|
|
11869
|
-
MORE: 'MORE'
|
|
11870
|
-
});
|
|
11871
|
-
class Conversations {
|
|
11872
|
-
MessageViewViewStates = MessageViewViewStates;
|
|
11873
|
-
MessageViewToolbarSectionNames = MessageViewToolbarSectionNames;
|
|
11874
|
-
constructor(appId, driver, membrane) {
|
|
11875
|
-
const members = {
|
|
11876
|
-
appId,
|
|
11877
|
-
driver,
|
|
11878
|
-
threadViewHandlerRegistry: new _lib_handler_registry__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z(),
|
|
11879
|
-
messageViewHandlerRegistries: {
|
|
11880
|
-
all: new _lib_handler_registry__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z(),
|
|
11881
|
-
loaded: new _lib_handler_registry__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z()
|
|
11882
|
-
},
|
|
11883
|
-
attachmentCardViewHandlerRegistry: new _lib_handler_registry__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z()
|
|
11884
|
-
};
|
|
11885
|
-
memberMap.set(this, members);
|
|
11886
|
-
driver.getStopper().onValue(() => {
|
|
11887
|
-
members.threadViewHandlerRegistry.dumpHandlers();
|
|
11888
|
-
members.messageViewHandlerRegistries.all.dumpHandlers();
|
|
11889
|
-
members.messageViewHandlerRegistries.loaded.dumpHandlers();
|
|
11890
|
-
});
|
|
11891
|
-
driver.getAttachmentCardViewDriverStream().filter(cardDriver => cardDriver.getAttachmentType() === 'FILE').onValue(attachmentCardViewDriver => {
|
|
11892
|
-
const attachmentCardView = membrane.get(attachmentCardViewDriver);
|
|
11893
|
-
members.attachmentCardViewHandlerRegistry.addTarget(attachmentCardView);
|
|
11894
|
-
});
|
|
11895
|
-
_setupViewDriverWatcher(appId, driver.getThreadViewDriverStream().filter(t => !t.isLoadingStub()), _views_conversations_thread_view__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, members.threadViewHandlerRegistry, this, membrane);
|
|
11896
|
-
_setupViewDriverWatcher(appId, driver.getMessageViewDriverStream(), _views_conversations_message_view__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, members.messageViewHandlerRegistries.all, this, membrane);
|
|
11897
|
-
_setupViewDriverWatcher(appId, driver.getMessageViewDriverStream().flatMap(messageViewDriver => messageViewDriver.isLoaded() ? kefir__WEBPACK_IMPORTED_MODULE_0__.constant(messageViewDriver) : messageViewDriver.getEventStream().filter(event => event.eventName === 'messageLoad').map(() => messageViewDriver).take(1)), _views_conversations_message_view__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, members.messageViewHandlerRegistries.loaded, this, membrane);
|
|
11898
|
-
}
|
|
11899
|
-
registerThreadViewHandler(handler) {
|
|
11900
|
-
return (0,_common_get_or_fail__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(memberMap, this).threadViewHandlerRegistry.registerHandler(handler);
|
|
11901
|
-
}
|
|
11902
|
-
registerMessageViewHandler(handler) {
|
|
11903
|
-
return (0,_common_get_or_fail__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(memberMap, this).messageViewHandlerRegistries.loaded.registerHandler(handler);
|
|
11904
|
-
}
|
|
11905
|
-
registerMessageViewHandlerAll(handler) {
|
|
11906
|
-
return (0,_common_get_or_fail__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(memberMap, this).messageViewHandlerRegistries.all.registerHandler(handler);
|
|
11907
|
-
}
|
|
11908
|
-
registerFileAttachmentCardViewHandler(handler) {
|
|
11909
|
-
return (0,_common_get_or_fail__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(memberMap, this).attachmentCardViewHandlerRegistry.registerHandler(handler);
|
|
11910
|
-
}
|
|
11911
|
-
}
|
|
11912
|
-
function _setupViewDriverWatcher(appId, stream, ViewClass, handlerRegistry, ConversationsInstance, membrane) {
|
|
11913
|
-
var combinedStream = stream.map(function (viewDriver) {
|
|
11914
|
-
const view = membrane.get(viewDriver);
|
|
11915
|
-
return {
|
|
11916
|
-
viewDriver,
|
|
11917
|
-
view
|
|
11918
|
-
};
|
|
11919
|
-
});
|
|
11920
|
-
// A delay is currently necessary so that ThreadView can wait for its MessageViews.
|
|
11921
|
-
combinedStream.flatMap(event => event.viewDriver.getReadyStream().map(() => event).takeUntilBy(kefir__WEBPACK_IMPORTED_MODULE_0__.fromEvents(event.view, 'destroy'))).onValue(function (event) {
|
|
11922
|
-
handlerRegistry.addTarget(event.view);
|
|
11923
|
-
});
|
|
11924
|
-
}
|
|
11925
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Conversations);
|
|
11926
|
-
|
|
11927
|
-
/***/ }),
|
|
11928
|
-
|
|
11929
11840
|
/***/ 326:
|
|
11930
11841
|
/***/ ((module, __webpack_exports__, __webpack_require__) => {
|
|
11931
11842
|
|
|
@@ -12440,7 +12351,7 @@ function _updateNavMenu(members, newRouteViewDriver) {
|
|
|
12440
12351
|
|
|
12441
12352
|
/***/ }),
|
|
12442
12353
|
|
|
12443
|
-
/***/
|
|
12354
|
+
/***/ 1359:
|
|
12444
12355
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
12445
12356
|
|
|
12446
12357
|
"use strict";
|
|
@@ -12484,43 +12395,45 @@ class Membrane {
|
|
|
12484
12395
|
;// CONCATENATED MODULE: ./src/platform-implementation-js/views/conversations/attachment-card-view.ts
|
|
12485
12396
|
|
|
12486
12397
|
class AttachmentCardView extends safe_event_emitter/* default */.Z {
|
|
12398
|
+
#attachmentCardImplementation;
|
|
12399
|
+
#driver;
|
|
12400
|
+
#membrane;
|
|
12401
|
+
destroyed = false;
|
|
12487
12402
|
constructor(attachmentCardImplementation, driver, membrane) {
|
|
12488
12403
|
super();
|
|
12489
|
-
this
|
|
12490
|
-
this
|
|
12491
|
-
this
|
|
12492
|
-
this.
|
|
12493
|
-
this._attachmentCardImplementation.getStopper().onValue(() => {
|
|
12404
|
+
this.#driver = driver;
|
|
12405
|
+
this.#membrane = membrane;
|
|
12406
|
+
this.#attachmentCardImplementation = attachmentCardImplementation;
|
|
12407
|
+
this.#attachmentCardImplementation.getStopper().onValue(() => {
|
|
12494
12408
|
this.destroyed = true;
|
|
12495
12409
|
this.emit('destroy');
|
|
12496
12410
|
});
|
|
12497
12411
|
}
|
|
12498
12412
|
getAttachmentType() {
|
|
12499
|
-
return this.
|
|
12413
|
+
return this.#attachmentCardImplementation.getAttachmentType();
|
|
12500
12414
|
}
|
|
12501
12415
|
addButton(buttonOptions) {
|
|
12502
|
-
this.
|
|
12416
|
+
this.#attachmentCardImplementation.addButton(buttonOptions);
|
|
12503
12417
|
}
|
|
12504
12418
|
getTitle() {
|
|
12505
|
-
return this.
|
|
12419
|
+
return this.#attachmentCardImplementation.getTitle();
|
|
12506
12420
|
}
|
|
12507
12421
|
|
|
12508
12422
|
/**
|
|
12509
12423
|
* @deprecated Please use the same-named method on the AttachmentCardClickEvent object instead.
|
|
12510
12424
|
*/
|
|
12511
12425
|
getDownloadURL() {
|
|
12512
|
-
this.
|
|
12513
|
-
if (this.
|
|
12426
|
+
this.#driver.getLogger().deprecationWarning('AttachmentCardView.getDownloadURL', 'AttachmentCardView.addButton -> onClick -> AttachmentCardClickEvent');
|
|
12427
|
+
if (this.#driver.getOpts().REQUESTED_API_VERSION !== 1) {
|
|
12514
12428
|
throw new Error('This method was discontinued after API version 1');
|
|
12515
12429
|
}
|
|
12516
|
-
return this.
|
|
12430
|
+
return this.#attachmentCardImplementation.getDownloadURL();
|
|
12517
12431
|
}
|
|
12518
12432
|
getMessageView() {
|
|
12519
|
-
const messageViewDriver = this.
|
|
12520
|
-
return messageViewDriver ? this.
|
|
12433
|
+
const messageViewDriver = this.#attachmentCardImplementation.getMessageViewDriver();
|
|
12434
|
+
return messageViewDriver ? this.#membrane.get(messageViewDriver) : null;
|
|
12521
12435
|
}
|
|
12522
12436
|
}
|
|
12523
|
-
/* harmony default export */ const attachment_card_view = (AttachmentCardView);
|
|
12524
12437
|
// EXTERNAL MODULE: ./node_modules/lodash/find.js
|
|
12525
12438
|
var find = __webpack_require__(3311);
|
|
12526
12439
|
var find_default = /*#__PURE__*/__webpack_require__.n(find);
|
|
@@ -12851,8 +12764,260 @@ class GmailAttachmentCardView {
|
|
|
12851
12764
|
}
|
|
12852
12765
|
}
|
|
12853
12766
|
/* harmony default export */ const gmail_attachment_card_view = (GmailAttachmentCardView);
|
|
12854
|
-
// EXTERNAL MODULE: ./
|
|
12855
|
-
var
|
|
12767
|
+
// EXTERNAL MODULE: ./node_modules/asap/browser-asap.js
|
|
12768
|
+
var browser_asap = __webpack_require__(9272);
|
|
12769
|
+
var browser_asap_default = /*#__PURE__*/__webpack_require__.n(browser_asap);
|
|
12770
|
+
// EXTERNAL MODULE: ./src/platform-implementation-js/views/conversations/thread-view.ts
|
|
12771
|
+
var thread_view = __webpack_require__(7422);
|
|
12772
|
+
// EXTERNAL MODULE: ./src/platform-implementation-js/lib/handler-registry.ts
|
|
12773
|
+
var handler_registry = __webpack_require__(3208);
|
|
12774
|
+
;// CONCATENATED MODULE: ./src/platform-implementation-js/namespaces/conversations.ts
|
|
12775
|
+
|
|
12776
|
+
|
|
12777
|
+
|
|
12778
|
+
|
|
12779
|
+
|
|
12780
|
+
const memberMap = new WeakMap();
|
|
12781
|
+
const MessageViewViewStates = Object.freeze({
|
|
12782
|
+
/**
|
|
12783
|
+
* One case where a {@link MessageView} is 'HIDDEN' is when there are too many messages in a thread,
|
|
12784
|
+
* and the message doesn't show at all.
|
|
12785
|
+
*/
|
|
12786
|
+
HIDDEN: 'HIDDEN',
|
|
12787
|
+
/**
|
|
12788
|
+
* {@link MessageView}s are collapsed when they are partially shown. The {@link MessageView}'s subject line and timestamp is visible, but the body of the message may be truncated.
|
|
12789
|
+
*/
|
|
12790
|
+
COLLAPSED: 'COLLAPSED',
|
|
12791
|
+
EXPANDED: 'EXPANDED'
|
|
12792
|
+
});
|
|
12793
|
+
const MessageViewToolbarSectionNames = Object.freeze({
|
|
12794
|
+
MORE: 'MORE'
|
|
12795
|
+
});
|
|
12796
|
+
class Conversations {
|
|
12797
|
+
MessageViewViewStates = MessageViewViewStates;
|
|
12798
|
+
MessageViewToolbarSectionNames = MessageViewToolbarSectionNames;
|
|
12799
|
+
constructor(appId, driver, membrane) {
|
|
12800
|
+
const members = {
|
|
12801
|
+
appId,
|
|
12802
|
+
driver,
|
|
12803
|
+
threadViewHandlerRegistry: new handler_registry/* default */.Z(),
|
|
12804
|
+
messageViewHandlerRegistries: {
|
|
12805
|
+
all: new handler_registry/* default */.Z(),
|
|
12806
|
+
loaded: new handler_registry/* default */.Z()
|
|
12807
|
+
},
|
|
12808
|
+
attachmentCardViewHandlerRegistry: new handler_registry/* default */.Z()
|
|
12809
|
+
};
|
|
12810
|
+
memberMap.set(this, members);
|
|
12811
|
+
driver.getStopper().onValue(() => {
|
|
12812
|
+
members.threadViewHandlerRegistry.dumpHandlers();
|
|
12813
|
+
members.messageViewHandlerRegistries.all.dumpHandlers();
|
|
12814
|
+
members.messageViewHandlerRegistries.loaded.dumpHandlers();
|
|
12815
|
+
});
|
|
12816
|
+
driver.getAttachmentCardViewDriverStream().filter(cardDriver => cardDriver.getAttachmentType() === 'FILE').onValue(attachmentCardViewDriver => {
|
|
12817
|
+
const attachmentCardView = membrane.get(attachmentCardViewDriver);
|
|
12818
|
+
members.attachmentCardViewHandlerRegistry.addTarget(attachmentCardView);
|
|
12819
|
+
});
|
|
12820
|
+
_setupViewDriverWatcher(appId, driver.getThreadViewDriverStream().filter(t => !t.isLoadingStub()), thread_view/* default */.Z, members.threadViewHandlerRegistry, this, membrane);
|
|
12821
|
+
_setupViewDriverWatcher(appId, driver.getMessageViewDriverStream(), MessageView, members.messageViewHandlerRegistries.all, this, membrane);
|
|
12822
|
+
_setupViewDriverWatcher(appId, driver.getMessageViewDriverStream().flatMap(messageViewDriver => messageViewDriver.isLoaded() ? kefir_esm.constant(messageViewDriver) : messageViewDriver.getEventStream().filter(event => event.eventName === 'messageLoad').map(() => messageViewDriver).take(1)), MessageView, members.messageViewHandlerRegistries.loaded, this, membrane);
|
|
12823
|
+
}
|
|
12824
|
+
registerThreadViewHandler(handler) {
|
|
12825
|
+
return (0,get_or_fail/* default */.Z)(memberMap, this).threadViewHandlerRegistry.registerHandler(handler);
|
|
12826
|
+
}
|
|
12827
|
+
registerMessageViewHandler(handler) {
|
|
12828
|
+
return (0,get_or_fail/* default */.Z)(memberMap, this).messageViewHandlerRegistries.loaded.registerHandler(handler);
|
|
12829
|
+
}
|
|
12830
|
+
registerMessageViewHandlerAll(handler) {
|
|
12831
|
+
return (0,get_or_fail/* default */.Z)(memberMap, this).messageViewHandlerRegistries.all.registerHandler(handler);
|
|
12832
|
+
}
|
|
12833
|
+
registerFileAttachmentCardViewHandler(handler) {
|
|
12834
|
+
return (0,get_or_fail/* default */.Z)(memberMap, this).attachmentCardViewHandlerRegistry.registerHandler(handler);
|
|
12835
|
+
}
|
|
12836
|
+
}
|
|
12837
|
+
function _setupViewDriverWatcher(appId, stream, ViewClass, handlerRegistry, ConversationsInstance, membrane) {
|
|
12838
|
+
var combinedStream = stream.map(function (viewDriver) {
|
|
12839
|
+
const view = membrane.get(viewDriver);
|
|
12840
|
+
return {
|
|
12841
|
+
viewDriver,
|
|
12842
|
+
view
|
|
12843
|
+
};
|
|
12844
|
+
});
|
|
12845
|
+
// A delay is currently necessary so that ThreadView can wait for its MessageViews.
|
|
12846
|
+
combinedStream.flatMap(event => event.viewDriver.getReadyStream().map(() => event).takeUntilBy(kefir_esm.fromEvents(event.view, 'destroy'))).onValue(function (event) {
|
|
12847
|
+
handlerRegistry.addTarget(event.view);
|
|
12848
|
+
});
|
|
12849
|
+
}
|
|
12850
|
+
/* harmony default export */ const conversations = (Conversations);
|
|
12851
|
+
;// CONCATENATED MODULE: ./src/platform-implementation-js/views/conversations/message-view.ts
|
|
12852
|
+
|
|
12853
|
+
|
|
12854
|
+
|
|
12855
|
+
class MessageView extends safe_event_emitter/* default */.Z {
|
|
12856
|
+
destroyed = false;
|
|
12857
|
+
#driver;
|
|
12858
|
+
#linksInBody;
|
|
12859
|
+
#membrane;
|
|
12860
|
+
#messageViewImplementation;
|
|
12861
|
+
constructor(messageViewImplementation, membrane, driver) {
|
|
12862
|
+
super();
|
|
12863
|
+
this.#driver = driver;
|
|
12864
|
+
this.#linksInBody = null;
|
|
12865
|
+
this.#membrane = membrane;
|
|
12866
|
+
this.#messageViewImplementation = messageViewImplementation;
|
|
12867
|
+
this.#bindToEventStream(messageViewImplementation.getEventStream());
|
|
12868
|
+
}
|
|
12869
|
+
addAttachmentCardView(cardOptions) {
|
|
12870
|
+
const attachmentCardViewDriver = this.#messageViewImplementation.addAttachmentCard(cardOptions);
|
|
12871
|
+
const attachmentCardView = this.#membrane.get(attachmentCardViewDriver);
|
|
12872
|
+
attachmentCardViewDriver.getPreviewClicks().onValue(e => {
|
|
12873
|
+
if (cardOptions.previewOnClick) {
|
|
12874
|
+
cardOptions.previewOnClick({
|
|
12875
|
+
attachmentCardView,
|
|
12876
|
+
preventDefault: () => e.preventDefault()
|
|
12877
|
+
});
|
|
12878
|
+
}
|
|
12879
|
+
});
|
|
12880
|
+
return attachmentCardView;
|
|
12881
|
+
}
|
|
12882
|
+
|
|
12883
|
+
// TODO why is this a separate method?
|
|
12884
|
+
addAttachmentCardViewNoPreview(cardOptions) {
|
|
12885
|
+
return this.addAttachmentCardView(cardOptions);
|
|
12886
|
+
}
|
|
12887
|
+
addAttachmentsToolbarButton(buttonOptions) {
|
|
12888
|
+
this.#messageViewImplementation.addButtonToDownloadAllArea({
|
|
12889
|
+
tooltip: buttonOptions.tooltip,
|
|
12890
|
+
iconUrl: buttonOptions.iconUrl,
|
|
12891
|
+
onClick: () => {
|
|
12892
|
+
const attachmentCardViews = this.#messageViewImplementation.getAttachmentCardViewDrivers().map(cardDriver => this.#membrane.get(cardDriver));
|
|
12893
|
+
buttonOptions.onClick({
|
|
12894
|
+
attachmentCardViews
|
|
12895
|
+
});
|
|
12896
|
+
}
|
|
12897
|
+
});
|
|
12898
|
+
}
|
|
12899
|
+
addToolbarButton(buttonOptions) {
|
|
12900
|
+
if (typeof buttonOptions.onClick !== 'function' || typeof buttonOptions.title !== 'string' || !Object.prototype.hasOwnProperty.call(MessageViewToolbarSectionNames, buttonOptions.section)) {
|
|
12901
|
+
throw new Error('Missing required properties on MessageViewToolbarButtonDescriptor object');
|
|
12902
|
+
}
|
|
12903
|
+
this.#messageViewImplementation.addMoreMenuItem(buttonOptions);
|
|
12904
|
+
}
|
|
12905
|
+
getBodyElement() {
|
|
12906
|
+
return this.#messageViewImplementation.getContentsElement();
|
|
12907
|
+
}
|
|
12908
|
+
getMessageID() {
|
|
12909
|
+
this.#driver.getLogger().deprecationWarning('messageView.getMessageID', 'messageView.getMessageIDAsync');
|
|
12910
|
+
return this.#messageViewImplementation.getMessageID();
|
|
12911
|
+
}
|
|
12912
|
+
getMessageIDAsync() {
|
|
12913
|
+
return this.#messageViewImplementation.getMessageIDAsync();
|
|
12914
|
+
}
|
|
12915
|
+
|
|
12916
|
+
// TODO non-file-attachment card views are asynchronously loaded. Add some sort of
|
|
12917
|
+
// registerAttachmentCardViewHandler function to listen for other types of
|
|
12918
|
+
// attachment cards if we want to continue support for them.
|
|
12919
|
+
getFileAttachmentCardViews() {
|
|
12920
|
+
return this.#messageViewImplementation.getAttachmentCardViewDrivers().filter(cardDriver => cardDriver.getAttachmentType() === 'FILE').map(attachmentCardViewDriver => this.#membrane.get(attachmentCardViewDriver));
|
|
12921
|
+
}
|
|
12922
|
+
|
|
12923
|
+
// Deprecated name
|
|
12924
|
+
getAttachmentCardViews() {
|
|
12925
|
+
this.#driver.getLogger().deprecationWarning('MessageView.getAttachmentCardViews', 'MessageView.getFileAttachmentCardViews');
|
|
12926
|
+
if (this.#driver.getOpts().REQUESTED_API_VERSION !== 1) {
|
|
12927
|
+
throw new Error('This method was discontinued after API version 1');
|
|
12928
|
+
}
|
|
12929
|
+
return this.getFileAttachmentCardViews();
|
|
12930
|
+
}
|
|
12931
|
+
isElementInQuotedArea(element) {
|
|
12932
|
+
return this.#messageViewImplementation.isElementInQuotedArea(element);
|
|
12933
|
+
}
|
|
12934
|
+
isLoaded() {
|
|
12935
|
+
return this.#messageViewImplementation.isLoaded();
|
|
12936
|
+
}
|
|
12937
|
+
getLinksInBody() {
|
|
12938
|
+
if (!this.#linksInBody) {
|
|
12939
|
+
const anchors = this.getBodyElement().querySelectorAll('a');
|
|
12940
|
+
this.#linksInBody = Array.from(anchors).map(anchor => ({
|
|
12941
|
+
text: anchor.textContent,
|
|
12942
|
+
html: anchor.innerHTML,
|
|
12943
|
+
href: anchor.href,
|
|
12944
|
+
element: anchor,
|
|
12945
|
+
isInQuotedArea: this.isElementInQuotedArea(anchor)
|
|
12946
|
+
}));
|
|
12947
|
+
}
|
|
12948
|
+
return this.#linksInBody;
|
|
12949
|
+
}
|
|
12950
|
+
getSender() {
|
|
12951
|
+
return this.#messageViewImplementation.getSender();
|
|
12952
|
+
}
|
|
12953
|
+
getRecipients() {
|
|
12954
|
+
this.#driver.getLogger().deprecationWarning('MessageView.getRecipients', 'MessageView.getRecipientEmailAddresses() or MessageView.getRecipientsFull()');
|
|
12955
|
+
return this.getRecipientEmailAddresses().map(emailAddress => ({
|
|
12956
|
+
emailAddress,
|
|
12957
|
+
name: null
|
|
12958
|
+
}));
|
|
12959
|
+
}
|
|
12960
|
+
getRecipientEmailAddresses() {
|
|
12961
|
+
return this.#messageViewImplementation.getRecipientEmailAddresses();
|
|
12962
|
+
}
|
|
12963
|
+
getRecipientsFull() {
|
|
12964
|
+
return this.#messageViewImplementation.getRecipientsFull();
|
|
12965
|
+
}
|
|
12966
|
+
getThreadView() {
|
|
12967
|
+
return this.#membrane.get(this.#messageViewImplementation.getThreadViewDriver());
|
|
12968
|
+
}
|
|
12969
|
+
getDateString() {
|
|
12970
|
+
return this.#messageViewImplementation.getDateString();
|
|
12971
|
+
}
|
|
12972
|
+
addAttachmentIcon(iconDescriptor) {
|
|
12973
|
+
return this.#messageViewImplementation.addAttachmentIcon(iconDescriptor);
|
|
12974
|
+
}
|
|
12975
|
+
getViewState() {
|
|
12976
|
+
return MessageViewViewStates[this.#messageViewImplementation.getViewState()];
|
|
12977
|
+
}
|
|
12978
|
+
hasOpenReply() {
|
|
12979
|
+
this.#driver.getLogger().deprecationWarning('MessageView.hasOpenReply');
|
|
12980
|
+
if (this.#driver.getOpts().REQUESTED_API_VERSION !== 1) {
|
|
12981
|
+
throw new Error('This method was discontinued after API version 1');
|
|
12982
|
+
}
|
|
12983
|
+
return this.#messageViewImplementation.hasOpenReply();
|
|
12984
|
+
}
|
|
12985
|
+
#bindToEventStream(stream) {
|
|
12986
|
+
stream.onEnd(() => {
|
|
12987
|
+
this.destroyed = true;
|
|
12988
|
+
this.emit('destroy');
|
|
12989
|
+
this.removeAllListeners();
|
|
12990
|
+
});
|
|
12991
|
+
stream.filter(event => event.type !== 'internal' && event.eventName === 'contactHover').onValue(event => {
|
|
12992
|
+
this.emit(event.eventName, {
|
|
12993
|
+
contactType: event.contactType,
|
|
12994
|
+
contact: event.contact,
|
|
12995
|
+
messageView: this,
|
|
12996
|
+
threadView: this.getThreadView()
|
|
12997
|
+
});
|
|
12998
|
+
});
|
|
12999
|
+
if (this.isLoaded()) {
|
|
13000
|
+
browser_asap_default()(() => {
|
|
13001
|
+
this.emit('load', {
|
|
13002
|
+
messageView: this
|
|
13003
|
+
});
|
|
13004
|
+
});
|
|
13005
|
+
} else {
|
|
13006
|
+
stream.filter(event => event.eventName === 'messageLoad').onValue(() => {
|
|
13007
|
+
this.emit('load', {
|
|
13008
|
+
messageView: this
|
|
13009
|
+
});
|
|
13010
|
+
});
|
|
13011
|
+
}
|
|
13012
|
+
stream.filter(event => event.eventName === 'viewStateChange').onValue(event => {
|
|
13013
|
+
this.emit('viewStateChange', {
|
|
13014
|
+
oldViewState: MessageViewViewStates[event.oldValue],
|
|
13015
|
+
newViewState: MessageViewViewStates[event.newValue],
|
|
13016
|
+
messageView: this
|
|
13017
|
+
});
|
|
13018
|
+
});
|
|
13019
|
+
}
|
|
13020
|
+
}
|
|
12856
13021
|
// EXTERNAL MODULE: ./node_modules/lodash/sortBy.js
|
|
12857
13022
|
var sortBy = __webpack_require__(9734);
|
|
12858
13023
|
var sortBy_default = /*#__PURE__*/__webpack_require__.n(sortBy);
|
|
@@ -13575,7 +13740,7 @@ class GmailMessageView {
|
|
|
13575
13740
|
attributes: true,
|
|
13576
13741
|
attributeFilter: ['class'],
|
|
13577
13742
|
attributeOldValue: true
|
|
13578
|
-
}).takeUntilBy(this.#stopper).map(
|
|
13743
|
+
}).takeUntilBy(this.#stopper).map(mutation => {
|
|
13579
13744
|
const currentClassList = mutation.target.classList;
|
|
13580
13745
|
const mutationOldValue = mutation.oldValue;
|
|
13581
13746
|
let oldValue;
|
|
@@ -13599,14 +13764,14 @@ class GmailMessageView {
|
|
|
13599
13764
|
newValue,
|
|
13600
13765
|
currentClassList
|
|
13601
13766
|
};
|
|
13602
|
-
}).map(
|
|
13767
|
+
}).map(event => {
|
|
13603
13768
|
if (event.newValue === 'EXPANDED' && event.oldValue !== 'EXPANDED') {
|
|
13604
13769
|
self.#checkMessageOpenState(event.currentClassList);
|
|
13605
13770
|
}
|
|
13606
13771
|
return event;
|
|
13607
|
-
}).filter(
|
|
13772
|
+
}).filter(event => {
|
|
13608
13773
|
return event.newValue !== event.oldValue && !!event.oldValue && !!event.newValue;
|
|
13609
|
-
}).map(
|
|
13774
|
+
}).map(event => {
|
|
13610
13775
|
return {
|
|
13611
13776
|
eventName: 'viewStateChange',
|
|
13612
13777
|
oldValue: event.oldValue,
|
|
@@ -13744,8 +13909,6 @@ function _extractContactInformation(span) {
|
|
|
13744
13909
|
};
|
|
13745
13910
|
}
|
|
13746
13911
|
/* harmony default export */ const gmail_message_view = (GmailMessageView);
|
|
13747
|
-
// EXTERNAL MODULE: ./src/platform-implementation-js/views/conversations/thread-view.ts
|
|
13748
|
-
var thread_view = __webpack_require__(7422);
|
|
13749
13912
|
// EXTERNAL MODULE: ./node_modules/pdelay/js/index.js
|
|
13750
13913
|
var pdelay_js = __webpack_require__(443);
|
|
13751
13914
|
// EXTERNAL MODULE: ./src/platform-implementation-js/lib/idMap.ts + 1 modules
|
|
@@ -13756,95 +13919,98 @@ var SimpleElementView = __webpack_require__(8989);
|
|
|
13756
13919
|
|
|
13757
13920
|
|
|
13758
13921
|
class CustomMessageView extends safe_event_emitter/* default */.Z {
|
|
13759
|
-
|
|
13760
|
-
|
|
13761
|
-
|
|
13922
|
+
#el;
|
|
13923
|
+
#iconEl;
|
|
13924
|
+
#contentEl;
|
|
13925
|
+
#contentHeaderEl;
|
|
13926
|
+
#contentBodyEl;
|
|
13927
|
+
destroyed = false;
|
|
13928
|
+
#stopper = js_default()();
|
|
13929
|
+
#isCollapsed = true;
|
|
13930
|
+
#lastDescriptor;
|
|
13762
13931
|
constructor(descriptorStream, onReady) {
|
|
13763
13932
|
super();
|
|
13764
|
-
this.
|
|
13765
|
-
|
|
13766
|
-
|
|
13767
|
-
|
|
13768
|
-
|
|
13933
|
+
this.#el = document.createElement('div');
|
|
13934
|
+
this.#el.classList.add('inboxsdk__custom_message_view');
|
|
13935
|
+
this.#el.classList.add('inboxsdk__custom_message_view_collapsed');
|
|
13936
|
+
this.#iconEl = document.createElement('div');
|
|
13937
|
+
this.#iconEl.classList.add('inboxsdk__custom_message_view_icon');
|
|
13938
|
+
this.#contentEl = document.createElement('div');
|
|
13939
|
+
this.#contentEl.classList.add('inboxsdk__custom_message_view_content');
|
|
13940
|
+
this.#contentHeaderEl = document.createElement('div');
|
|
13941
|
+
this.#contentHeaderEl.classList.add('inboxsdk__custom_message_view_header');
|
|
13942
|
+
this.#contentBodyEl = document.createElement('div');
|
|
13943
|
+
this.#contentBodyEl.classList.add('inboxsdk__custom_message_view_body');
|
|
13944
|
+
this.#el.appendChild(this.#iconEl);
|
|
13945
|
+
this.#el.appendChild(this.#contentEl);
|
|
13946
|
+
this.#el.addEventListener('click', e => {
|
|
13947
|
+
if (this.#isCollapsed) {
|
|
13948
|
+
this.expand();
|
|
13949
|
+
e.preventDefault();
|
|
13950
|
+
e.stopPropagation();
|
|
13951
|
+
}
|
|
13952
|
+
});
|
|
13953
|
+
this.#contentHeaderEl.addEventListener('click', e => {
|
|
13954
|
+
this.collapse();
|
|
13955
|
+
e.preventDefault();
|
|
13956
|
+
e.stopPropagation();
|
|
13957
|
+
});
|
|
13958
|
+
descriptorStream.takeUntilBy(this.#stopper).onValue(descriptor => {
|
|
13959
|
+
this.#el.setAttribute('data-inboxsdk-sortdate', String(descriptor.sortDate.getTime()));
|
|
13960
|
+
const previousDescriptor = this.#lastDescriptor;
|
|
13961
|
+
this.#lastDescriptor = descriptor;
|
|
13769
13962
|
if (!previousDescriptor || previousDescriptor.iconUrl !== descriptor.iconUrl) {
|
|
13770
13963
|
const img = document.createElement('img');
|
|
13771
13964
|
img.src = descriptor.iconUrl;
|
|
13772
|
-
this.
|
|
13773
|
-
this.
|
|
13965
|
+
this.#iconEl.innerHTML = '';
|
|
13966
|
+
this.#iconEl.appendChild(img);
|
|
13774
13967
|
}
|
|
13775
|
-
if ((!previousDescriptor || previousDescriptor.collapsedEl !== descriptor.collapsedEl) && this
|
|
13968
|
+
if ((!previousDescriptor || previousDescriptor.collapsedEl !== descriptor.collapsedEl) && this.#isCollapsed) {
|
|
13776
13969
|
if (previousDescriptor) previousDescriptor.collapsedEl.remove();
|
|
13777
|
-
this.
|
|
13970
|
+
this.#contentEl.appendChild(descriptor.collapsedEl);
|
|
13778
13971
|
}
|
|
13779
13972
|
if (!previousDescriptor || previousDescriptor.headerEl !== descriptor.headerEl) {
|
|
13780
13973
|
if (previousDescriptor) previousDescriptor.headerEl.remove();
|
|
13781
|
-
this.
|
|
13974
|
+
this.#contentHeaderEl.appendChild(descriptor.headerEl);
|
|
13782
13975
|
}
|
|
13783
13976
|
if (!previousDescriptor || previousDescriptor.bodyEl !== descriptor.bodyEl) {
|
|
13784
13977
|
if (previousDescriptor) previousDescriptor.bodyEl.remove();
|
|
13785
|
-
this.
|
|
13978
|
+
this.#contentBodyEl.appendChild(descriptor.bodyEl);
|
|
13786
13979
|
}
|
|
13787
13980
|
}).take(1).onValue(onReady);
|
|
13788
13981
|
}
|
|
13789
13982
|
destroy() {
|
|
13790
|
-
if (this.
|
|
13791
|
-
this.
|
|
13792
|
-
this.
|
|
13983
|
+
if (this.destroyed) return;
|
|
13984
|
+
this.destroyed = true;
|
|
13985
|
+
this.#stopper.destroy();
|
|
13793
13986
|
this.emit('destroy');
|
|
13794
|
-
this.
|
|
13987
|
+
this.#el.remove();
|
|
13795
13988
|
}
|
|
13796
13989
|
expand() {
|
|
13797
|
-
this
|
|
13798
|
-
const descriptor = this
|
|
13990
|
+
this.#isCollapsed = false;
|
|
13991
|
+
const descriptor = this.#lastDescriptor;
|
|
13799
13992
|
if (descriptor) descriptor.collapsedEl.remove();
|
|
13800
|
-
this.
|
|
13801
|
-
this.
|
|
13802
|
-
this.
|
|
13993
|
+
this.#contentEl.appendChild(this.#contentHeaderEl);
|
|
13994
|
+
this.#contentEl.appendChild(this.#contentBodyEl);
|
|
13995
|
+
this.#el.classList.remove('inboxsdk__custom_message_view_collapsed');
|
|
13803
13996
|
this.emit('expanded');
|
|
13804
13997
|
}
|
|
13805
13998
|
collapse() {
|
|
13806
|
-
this
|
|
13807
|
-
this.
|
|
13808
|
-
this.
|
|
13809
|
-
const descriptor = this
|
|
13999
|
+
this.#isCollapsed = true;
|
|
14000
|
+
this.#contentHeaderEl.remove();
|
|
14001
|
+
this.#contentBodyEl.remove();
|
|
14002
|
+
const descriptor = this.#lastDescriptor;
|
|
13810
14003
|
if (descriptor) {
|
|
13811
|
-
this.
|
|
14004
|
+
this.#contentEl.appendChild(descriptor.collapsedEl);
|
|
13812
14005
|
}
|
|
13813
|
-
this.
|
|
14006
|
+
this.#el.classList.add('inboxsdk__custom_message_view_collapsed');
|
|
13814
14007
|
this.emit('collapsed');
|
|
13815
14008
|
}
|
|
13816
14009
|
getElement() {
|
|
13817
|
-
return this
|
|
14010
|
+
return this.#el;
|
|
13818
14011
|
}
|
|
13819
14012
|
getSortDate() {
|
|
13820
|
-
if (this
|
|
13821
|
-
}
|
|
13822
|
-
_setupElement() {
|
|
13823
|
-
this._el = document.createElement('div');
|
|
13824
|
-
this._el.classList.add('inboxsdk__custom_message_view');
|
|
13825
|
-
this._el.classList.add('inboxsdk__custom_message_view_collapsed');
|
|
13826
|
-
this._iconEl = document.createElement('div');
|
|
13827
|
-
this._iconEl.classList.add('inboxsdk__custom_message_view_icon');
|
|
13828
|
-
this._contentEl = document.createElement('div');
|
|
13829
|
-
this._contentEl.classList.add('inboxsdk__custom_message_view_content');
|
|
13830
|
-
this._contentHeaderEl = document.createElement('div');
|
|
13831
|
-
this._contentHeaderEl.classList.add('inboxsdk__custom_message_view_header');
|
|
13832
|
-
this._contentBodyEl = document.createElement('div');
|
|
13833
|
-
this._contentBodyEl.classList.add('inboxsdk__custom_message_view_body');
|
|
13834
|
-
this._el.appendChild(this._iconEl);
|
|
13835
|
-
this._el.appendChild(this._contentEl);
|
|
13836
|
-
this._el.addEventListener('click', e => {
|
|
13837
|
-
if (this._isCollapsed) {
|
|
13838
|
-
this.expand();
|
|
13839
|
-
e.preventDefault();
|
|
13840
|
-
e.stopPropagation();
|
|
13841
|
-
}
|
|
13842
|
-
});
|
|
13843
|
-
this._contentHeaderEl.addEventListener('click', e => {
|
|
13844
|
-
this.collapse();
|
|
13845
|
-
e.preventDefault();
|
|
13846
|
-
e.stopPropagation();
|
|
13847
|
-
});
|
|
14013
|
+
if (this.#lastDescriptor) return this.#lastDescriptor.sortDate;else return null;
|
|
13848
14014
|
}
|
|
13849
14015
|
}
|
|
13850
14016
|
// EXTERNAL MODULE: ./src/platform-implementation-js/dom-driver/gmail/gmail-element-getter.ts + 2 modules
|
|
@@ -13852,9 +14018,6 @@ var gmail_element_getter = __webpack_require__(2851);
|
|
|
13852
14018
|
// EXTERNAL MODULE: ./node_modules/lodash/escape.js
|
|
13853
14019
|
var lodash_escape = __webpack_require__(1675);
|
|
13854
14020
|
var escape_default = /*#__PURE__*/__webpack_require__.n(lodash_escape);
|
|
13855
|
-
// EXTERNAL MODULE: ./node_modules/asap/browser-asap.js
|
|
13856
|
-
var browser_asap = __webpack_require__(9272);
|
|
13857
|
-
var browser_asap_default = /*#__PURE__*/__webpack_require__.n(browser_asap);
|
|
13858
14021
|
// EXTERNAL MODULE: ./src/platform-implementation-js/lib/stream-wait-for.ts
|
|
13859
14022
|
var stream_wait_for = __webpack_require__(3511);
|
|
13860
14023
|
// EXTERNAL MODULE: ./src/platform-implementation-js/lib/dom/insert-element-in-order.ts
|
|
@@ -15333,7 +15496,7 @@ options.insert = htmlElement => {
|
|
|
15333
15496
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
15334
15497
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
15335
15498
|
///@ts-ignore
|
|
15336
|
-
"2.1.
|
|
15499
|
+
"2.1.38-1712087227941-d4c8bfd8eba680c6");
|
|
15337
15500
|
document.head.append(htmlElement);
|
|
15338
15501
|
};
|
|
15339
15502
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -15950,8 +16113,8 @@ function _getLabelHTML(label) {
|
|
|
15950
16113
|
// EXTERNAL MODULE: ./node_modules/page-parser-tree/js/index.js
|
|
15951
16114
|
var page_parser_tree_js = __webpack_require__(6330);
|
|
15952
16115
|
var page_parser_tree_js_default = /*#__PURE__*/__webpack_require__.n(page_parser_tree_js);
|
|
15953
|
-
// EXTERNAL MODULE: ./src/
|
|
15954
|
-
var isNotNil = __webpack_require__(
|
|
16116
|
+
// EXTERNAL MODULE: ./src/common/isNotNil.ts
|
|
16117
|
+
var isNotNil = __webpack_require__(6230);
|
|
15955
16118
|
;// CONCATENATED MODULE: ./src/platform-implementation-js/dom-driver/gmail/views/gmail-route-view/page-parser.ts
|
|
15956
16119
|
|
|
15957
16120
|
|
|
@@ -16586,7 +16749,7 @@ const dummyPacket = Object.freeze({
|
|
|
16586
16749
|
// do nothing
|
|
16587
16750
|
})
|
|
16588
16751
|
});
|
|
16589
|
-
const
|
|
16752
|
+
const butter_bar_memberMap = new WeakMap();
|
|
16590
16753
|
class ButterBar {
|
|
16591
16754
|
constructor(appId, driver) {
|
|
16592
16755
|
const members = {
|
|
@@ -16594,7 +16757,7 @@ class ButterBar {
|
|
|
16594
16757
|
messagesByKey: new Map(),
|
|
16595
16758
|
queuedPackets: []
|
|
16596
16759
|
};
|
|
16597
|
-
|
|
16760
|
+
butter_bar_memberMap.set(this, members);
|
|
16598
16761
|
}
|
|
16599
16762
|
showMessage(options) {
|
|
16600
16763
|
defaults_default()(options, {
|
|
@@ -16604,7 +16767,7 @@ class ButterBar {
|
|
|
16604
16767
|
persistent: false
|
|
16605
16768
|
});
|
|
16606
16769
|
this.hideMessage(options.messageKey);
|
|
16607
|
-
const members = (0,get_or_fail/* default */.Z)(
|
|
16770
|
+
const members = (0,get_or_fail/* default */.Z)(butter_bar_memberMap, this);
|
|
16608
16771
|
const butterBarDriver = members.driver.getButterBarDriver();
|
|
16609
16772
|
const messageId = Date.now() + '-' + Math.random();
|
|
16610
16773
|
{
|
|
@@ -16718,7 +16881,7 @@ class ButterBar {
|
|
|
16718
16881
|
}
|
|
16719
16882
|
hideMessage(messageKey) {
|
|
16720
16883
|
if (messageKey) {
|
|
16721
|
-
const members = (0,get_or_fail/* default */.Z)(
|
|
16884
|
+
const members = (0,get_or_fail/* default */.Z)(butter_bar_memberMap, this);
|
|
16722
16885
|
const message = members.messagesByKey.get(messageKey);
|
|
16723
16886
|
if (message) {
|
|
16724
16887
|
message.destroy();
|
|
@@ -16726,15 +16889,13 @@ class ButterBar {
|
|
|
16726
16889
|
}
|
|
16727
16890
|
}
|
|
16728
16891
|
hideGmailMessage() {
|
|
16729
|
-
const members = (0,get_or_fail/* default */.Z)(
|
|
16892
|
+
const members = (0,get_or_fail/* default */.Z)(butter_bar_memberMap, this);
|
|
16730
16893
|
const butterBarDriver = members.driver.getButterBarDriver();
|
|
16731
16894
|
butterBarDriver.hideGmailMessage();
|
|
16732
16895
|
}
|
|
16733
16896
|
}
|
|
16734
16897
|
// EXTERNAL MODULE: ./src/platform-implementation-js/namespaces/compose.ts
|
|
16735
16898
|
var compose = __webpack_require__(8731);
|
|
16736
|
-
// EXTERNAL MODULE: ./src/platform-implementation-js/namespaces/conversations.ts
|
|
16737
|
-
var conversations = __webpack_require__(5558);
|
|
16738
16899
|
// EXTERNAL MODULE: ./src/platform-implementation-js/namespaces/keyboard.ts + 1 modules
|
|
16739
16900
|
var keyboard = __webpack_require__(326);
|
|
16740
16901
|
// EXTERNAL MODULE: ./src/platform-implementation-js/widgets/modal-view.ts
|
|
@@ -16929,8 +17090,6 @@ const widgets_memberMap = new Map();
|
|
|
16929
17090
|
/* harmony default export */ const widgets = (Widgets);
|
|
16930
17091
|
// EXTERNAL MODULE: ./src/platform-implementation-js/namespaces/modal.ts
|
|
16931
17092
|
var modal = __webpack_require__(4198);
|
|
16932
|
-
// EXTERNAL MODULE: ./src/platform-implementation-js/lib/handler-registry.ts
|
|
16933
|
-
var handler_registry = __webpack_require__(3208);
|
|
16934
17093
|
;// CONCATENATED MODULE: ./src/platform-implementation-js/namespaces/lists.ts
|
|
16935
17094
|
|
|
16936
17095
|
|
|
@@ -19423,7 +19582,7 @@ mole_view_module_options.insert = htmlElement => {
|
|
|
19423
19582
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
19424
19583
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
19425
19584
|
///@ts-ignore
|
|
19426
|
-
"2.1.
|
|
19585
|
+
"2.1.38-1712087227941-d4c8bfd8eba680c6");
|
|
19427
19586
|
document.head.append(htmlElement);
|
|
19428
19587
|
};
|
|
19429
19588
|
mole_view_module_options.domAPI = (styleDomAPI_default());
|
|
@@ -20357,23 +20516,24 @@ var uniqBy_default = /*#__PURE__*/__webpack_require__.n(uniqBy);
|
|
|
20357
20516
|
;// CONCATENATED MODULE: ./src/platform-implementation-js/dom-driver/gmail/gmail-driver/user-info.ts
|
|
20358
20517
|
|
|
20359
20518
|
|
|
20519
|
+
|
|
20360
20520
|
class UserInfo {
|
|
20521
|
+
#userEmail;
|
|
20361
20522
|
constructor(driver) {
|
|
20362
|
-
this
|
|
20363
|
-
this._userEmail = driver.getUserEmailAddress();
|
|
20523
|
+
this.#userEmail = driver.getUserEmailAddress();
|
|
20364
20524
|
}
|
|
20365
20525
|
|
|
20366
|
-
|
|
20526
|
+
/** @deprecated */
|
|
20367
20527
|
getUserName() {
|
|
20368
20528
|
const nameEl = document.querySelector('div.gb_w div.gb_B .gb_D');
|
|
20369
20529
|
if (nameEl) {
|
|
20370
20530
|
return nameEl.textContent;
|
|
20371
20531
|
}
|
|
20372
|
-
const contact = find_default()(this.getAccountSwitcherContactList(), contact => contact.emailAddress === this
|
|
20532
|
+
const contact = find_default()(this.getAccountSwitcherContactList(), contact => contact.emailAddress === this.#userEmail);
|
|
20373
20533
|
if (contact && contact.name != null) {
|
|
20374
20534
|
return contact.name;
|
|
20375
20535
|
}
|
|
20376
|
-
return this
|
|
20536
|
+
return this.#userEmail;
|
|
20377
20537
|
}
|
|
20378
20538
|
|
|
20379
20539
|
/** @deprecated */
|
|
@@ -20387,7 +20547,7 @@ class UserInfo {
|
|
|
20387
20547
|
name: nameEl.textContent,
|
|
20388
20548
|
emailAddress: emailAddressEl.textContent
|
|
20389
20549
|
};
|
|
20390
|
-
}).filter(
|
|
20550
|
+
}).filter(isNotNil/* default */.Z);
|
|
20391
20551
|
const extras = Array.from(document.querySelectorAll('[role=banner] div[aria-label] div > a[target="_blank"] > img + div')).map(el => {
|
|
20392
20552
|
const match = el.children[1].textContent.match(/\S+/);
|
|
20393
20553
|
if (!match) {
|
|
@@ -21726,6 +21886,8 @@ var immutability_helper_default = /*#__PURE__*/__webpack_require__.n(immutabilit
|
|
|
21726
21886
|
|
|
21727
21887
|
|
|
21728
21888
|
|
|
21889
|
+
|
|
21890
|
+
|
|
21729
21891
|
const threadListHandlersToSearchStrings = new Map();
|
|
21730
21892
|
const MAX_THREADS_PER_PAGE = 50;
|
|
21731
21893
|
|
|
@@ -21892,8 +22054,8 @@ const setupSearchReplacing = (driver, customRouteID, onActivate, findIdFailure)
|
|
|
21892
22054
|
total = 0;
|
|
21893
22055
|
threadDescriptors = [];
|
|
21894
22056
|
}
|
|
21895
|
-
const initialIDPairs = threadDescriptors.map(threadDescriptorToInitialIDPair).filter(
|
|
21896
|
-
const idPairsWithRFC = (await Promise.all(initialIDPairs.map(pair => initialIDPairToIDPairWithRFC(driver, pair, findIdFailure)))).filter(
|
|
22057
|
+
const initialIDPairs = threadDescriptors.map(threadDescriptorToInitialIDPair).filter(isNotNil/* default */.Z);
|
|
22058
|
+
const idPairsWithRFC = (await Promise.all(initialIDPairs.map(pair => initialIDPairToIDPairWithRFC(driver, pair, findIdFailure)))).filter(isNotNil/* default */.Z);
|
|
21897
22059
|
const messageIDQuery = idPairsWithRFC.length > 0 ? idPairsWithRFC.map(_ref2 => {
|
|
21898
22060
|
let {
|
|
21899
22061
|
rfcId
|
|
@@ -21914,7 +22076,9 @@ const setupSearchReplacing = (driver, customRouteID, onActivate, findIdFailure)
|
|
|
21914
22076
|
const searchResultsResponse_promise = driver.getPageCommunicator().ajaxInterceptStream.filter(e => e.type === 'searchResultsResponse' && e.query === newQuery && e.start === start).map(x => x.response).take(1).toPromise();
|
|
21915
22077
|
|
|
21916
22078
|
// Figure out any gmail thread ids we don't know yet.
|
|
21917
|
-
|
|
22079
|
+
// Use uniqBy to remove duplicates which cause issues with Gmail sometimes
|
|
22080
|
+
// https://github.com/InboxSDK/InboxSDK/issues/1130
|
|
22081
|
+
const completedIDPairs = uniqBy_default()((await Promise.all(idPairsWithRFC.map(pair => idPairWithRFCToCompletedIDPair(driver, pair, findIdFailure)))).filter(isNotNil/* default */.Z), p => p.gtid);
|
|
21918
22082
|
const response = await searchResultsResponse_promise;
|
|
21919
22083
|
driver.signalCustomThreadListActivity(customRouteID);
|
|
21920
22084
|
|
|
@@ -21928,7 +22092,7 @@ const setupSearchReplacing = (driver, customRouteID, onActivate, findIdFailure)
|
|
|
21928
22092
|
gtid
|
|
21929
22093
|
} = _ref3;
|
|
21930
22094
|
return find_default()(extractedThreads, t => t.oldGmailThreadID === gtid);
|
|
21931
|
-
}).filter(
|
|
22095
|
+
}).filter(isNotNil/* default */.Z);
|
|
21932
22096
|
const doesNeedReorder = extractedThreads.length !== extractedThreadsInCompletedIDPairsOrder.length || extractedThreads.some((extractedThread, index) => extractedThread !== extractedThreadsInCompletedIDPairsOrder[index]);
|
|
21933
22097
|
let reorderedThreads;
|
|
21934
22098
|
if (doesNeedReorder) {
|
|
@@ -22127,6 +22291,7 @@ function copyAndValidateAutocompleteResults(driver, results) {
|
|
|
22127
22291
|
|
|
22128
22292
|
|
|
22129
22293
|
|
|
22294
|
+
|
|
22130
22295
|
function registerSearchSuggestionsProvider(driver, handler) {
|
|
22131
22296
|
// We inject the app-provided suggestions into Gmail's AJAX response. Then we
|
|
22132
22297
|
// watch the DOM for our injected suggestions to show up and attach click and
|
|
@@ -22169,10 +22334,10 @@ function registerSearchSuggestionsProvider(driver, handler) {
|
|
|
22169
22334
|
}).map(event => event.suggestions);
|
|
22170
22335
|
|
|
22171
22336
|
// Wait for the first routeViewDriver to happen before looking for the search box.
|
|
22172
|
-
const searchBoxStream = driver.getRouteViewDriverStream().toProperty(() => null).map(() => gmail_element_getter/* default.getSearchInput */.Z.getSearchInput()).filter(
|
|
22337
|
+
const searchBoxStream = driver.getRouteViewDriverStream().toProperty(() => null).map(() => gmail_element_getter/* default.getSearchInput */.Z.getSearchInput()).filter(isNotNil/* default */.Z).take(1);
|
|
22173
22338
|
|
|
22174
22339
|
// Wait for the search box to be focused before looking for the suggestions box.
|
|
22175
|
-
const suggestionsBoxTbodyStream = searchBoxStream.flatMapLatest(searchBox => kefir_esm.fromEvents(searchBox, 'focus')).map(() => gmail_element_getter/* default.getSearchSuggestionsBoxParent */.Z.getSearchSuggestionsBoxParent()).filter(
|
|
22340
|
+
const suggestionsBoxTbodyStream = searchBoxStream.flatMapLatest(searchBox => kefir_esm.fromEvents(searchBox, 'focus')).map(() => gmail_element_getter/* default.getSearchSuggestionsBoxParent */.Z.getSearchSuggestionsBoxParent()).filter(isNotNil/* default */.Z).flatMapLatest(make_element_child_stream/* default */.Z).map(x => x.el.firstElementChild).take(1).toProperty();
|
|
22176
22341
|
|
|
22177
22342
|
// This stream emits an event after every time Gmail changes the suggestions
|
|
22178
22343
|
// list.
|
|
@@ -22708,6 +22873,7 @@ function routeIDmatchesHash(routeID, hash) {
|
|
|
22708
22873
|
|
|
22709
22874
|
|
|
22710
22875
|
|
|
22876
|
+
|
|
22711
22877
|
function setupRouteViewDriverStream(gmailRouteProcessor, driver) {
|
|
22712
22878
|
const customRouteIDs = driver.getCustomRouteIDs();
|
|
22713
22879
|
const customListRouteIDs = driver.getCustomListRouteIDs();
|
|
@@ -22857,7 +23023,7 @@ function setupRouteViewDriverStream(gmailRouteProcessor, driver) {
|
|
|
22857
23023
|
return;
|
|
22858
23024
|
}
|
|
22859
23025
|
return new gmail_route_view(options, gmailRouteProcessor, driver);
|
|
22860
|
-
}).filter(
|
|
23026
|
+
}).filter(isNotNil/* default */.Z).map(gmailRouteView => {
|
|
22861
23027
|
if (latestGmailRouteView) {
|
|
22862
23028
|
latestGmailRouteView.destroy();
|
|
22863
23029
|
}
|
|
@@ -22881,6 +23047,7 @@ function setupRouteViewDriverStream(gmailRouteProcessor, driver) {
|
|
|
22881
23047
|
|
|
22882
23048
|
|
|
22883
23049
|
|
|
23050
|
+
|
|
22884
23051
|
class NativeGmailNavItemView {
|
|
22885
23052
|
_activeMarkerElement = null;
|
|
22886
23053
|
_isActive = false;
|
|
@@ -22899,7 +23066,7 @@ class NativeGmailNavItemView {
|
|
|
22899
23066
|
if (parentElement) {
|
|
22900
23067
|
(0,make_mutation_observer_chunked_stream/* default */.Z)(parentElement, {
|
|
22901
23068
|
childList: true
|
|
22902
|
-
}).map(() => parentElement.querySelector(`.aim a[href*="#${this._navItemName}"]`)).filter(
|
|
23069
|
+
}).map(() => parentElement.querySelector(`.aim a[href*="#${this._navItemName}"]`)).filter(isNotNil/* default */.Z).map(link => findParent(link, el => el.classList.contains('aim'))).filter(isNotNil/* default */.Z).filter(newElement => newElement !== this._element).onValue(newElement => {
|
|
22903
23070
|
if (newElement) {
|
|
22904
23071
|
const currentContainerElement = this._itemContainerElement;
|
|
22905
23072
|
if (currentContainerElement) {
|
|
@@ -24219,14 +24386,14 @@ class PlatformImplementation extends safe_event_emitter/* default */.Z {
|
|
|
24219
24386
|
};
|
|
24220
24387
|
platform_implementation_memberMap.set(this, members);
|
|
24221
24388
|
if (false) {}
|
|
24222
|
-
const membrane = new Membrane([[gmail_compose_view/* default */.Z, viewDriver => new compose_view/* default */.Z(driver, viewDriver, membrane)], [gmail_attachment_card_view, viewDriver => new
|
|
24389
|
+
const membrane = new Membrane([[gmail_compose_view/* default */.Z, viewDriver => new compose_view/* default */.Z(driver, viewDriver, membrane)], [gmail_attachment_card_view, viewDriver => new AttachmentCardView(viewDriver, driver, membrane)], [gmail_message_view, viewDriver => new MessageView(viewDriver, membrane, driver)], [gmail_thread_view, viewDriver => new thread_view/* default */.Z(viewDriver, appId, driver, membrane)], [gmail_thread_row_view/* default */.Z, viewDriver => new ThreadRowView(viewDriver)], [gmail_route_view, viewDriver => new route_view/* default */.Z(viewDriver)], [dummy_route_view_driver/* default */.Z, viewDriver => new route_view/* default */.Z(viewDriver)]]);
|
|
24223
24390
|
this.destroyed = false;
|
|
24224
24391
|
this.LOADER_VERSION = LOADER_VERSION;
|
|
24225
24392
|
this.IMPL_VERSION = version/* BUILD_VERSION */.b;
|
|
24226
24393
|
this.ButterBar = new ButterBar(appId, driver);
|
|
24227
24394
|
driver.setButterBar(this.ButterBar);
|
|
24228
24395
|
this.Compose = new compose/* default */.Z(driver, membrane);
|
|
24229
|
-
this.Conversations = new conversations
|
|
24396
|
+
this.Conversations = new conversations(appId, driver, membrane);
|
|
24230
24397
|
this.Keyboard = new keyboard/* default */.Z(appId, appName, appIconUrl, driver);
|
|
24231
24398
|
this.User = new User(driver, piOpts);
|
|
24232
24399
|
this.Lists = new Lists(appId, driver, membrane);
|
|
@@ -24791,227 +24958,6 @@ class ContentPanelView extends _lib_safe_event_emitter__WEBPACK_IMPORTED_MODULE_
|
|
|
24791
24958
|
|
|
24792
24959
|
/***/ }),
|
|
24793
24960
|
|
|
24794
|
-
/***/ 5052:
|
|
24795
|
-
/***/ ((module, __webpack_exports__, __webpack_require__) => {
|
|
24796
|
-
|
|
24797
|
-
"use strict";
|
|
24798
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
24799
|
-
/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
24800
|
-
/* harmony export */ });
|
|
24801
|
-
/* harmony import */ var ud__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1010);
|
|
24802
|
-
/* harmony import */ var asap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9272);
|
|
24803
|
-
/* harmony import */ var asap__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(asap__WEBPACK_IMPORTED_MODULE_0__);
|
|
24804
|
-
/* harmony import */ var _lib_safe_event_emitter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6666);
|
|
24805
|
-
/* harmony import */ var _common_get_or_fail__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7791);
|
|
24806
|
-
/* harmony import */ var _namespaces_conversations__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5558);
|
|
24807
|
-
/* module decorator */ module = __webpack_require__.hmd(module);
|
|
24808
|
-
|
|
24809
|
-
|
|
24810
|
-
|
|
24811
|
-
|
|
24812
|
-
|
|
24813
|
-
const memberMap = (0,ud__WEBPACK_IMPORTED_MODULE_3__.defonce)(module, () => new WeakMap());
|
|
24814
|
-
class MessageView extends _lib_safe_event_emitter__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z {
|
|
24815
|
-
destroyed = false;
|
|
24816
|
-
constructor(messageViewImplementation, appId, membrane, Conversations, driver) {
|
|
24817
|
-
super();
|
|
24818
|
-
const members = {
|
|
24819
|
-
messageViewImplementation,
|
|
24820
|
-
membrane,
|
|
24821
|
-
Conversations,
|
|
24822
|
-
driver,
|
|
24823
|
-
linksInBody: null
|
|
24824
|
-
};
|
|
24825
|
-
memberMap.set(this, members);
|
|
24826
|
-
_bindToEventStream(this, members, messageViewImplementation.getEventStream());
|
|
24827
|
-
}
|
|
24828
|
-
addAttachmentCardView(cardOptions) {
|
|
24829
|
-
const {
|
|
24830
|
-
messageViewImplementation,
|
|
24831
|
-
membrane
|
|
24832
|
-
} = (0,_common_get_or_fail__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(memberMap, this);
|
|
24833
|
-
const attachmentCardViewDriver = messageViewImplementation.addAttachmentCard(cardOptions);
|
|
24834
|
-
const attachmentCardView = membrane.get(attachmentCardViewDriver);
|
|
24835
|
-
attachmentCardViewDriver.getPreviewClicks().onValue(e => {
|
|
24836
|
-
if (cardOptions.previewOnClick) {
|
|
24837
|
-
cardOptions.previewOnClick({
|
|
24838
|
-
attachmentCardView,
|
|
24839
|
-
preventDefault: () => e.preventDefault()
|
|
24840
|
-
});
|
|
24841
|
-
}
|
|
24842
|
-
});
|
|
24843
|
-
return attachmentCardView;
|
|
24844
|
-
}
|
|
24845
|
-
|
|
24846
|
-
// TODO why is this a separate method?
|
|
24847
|
-
addAttachmentCardViewNoPreview(cardOptions) {
|
|
24848
|
-
return this.addAttachmentCardView(cardOptions);
|
|
24849
|
-
}
|
|
24850
|
-
addAttachmentsToolbarButton(buttonOptions) {
|
|
24851
|
-
const {
|
|
24852
|
-
messageViewImplementation,
|
|
24853
|
-
membrane
|
|
24854
|
-
} = (0,_common_get_or_fail__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(memberMap, this);
|
|
24855
|
-
messageViewImplementation.addButtonToDownloadAllArea({
|
|
24856
|
-
tooltip: buttonOptions.tooltip,
|
|
24857
|
-
iconUrl: buttonOptions.iconUrl,
|
|
24858
|
-
onClick: () => {
|
|
24859
|
-
const attachmentCardViews = messageViewImplementation.getAttachmentCardViewDrivers().map(cardDriver => membrane.get(cardDriver));
|
|
24860
|
-
buttonOptions.onClick({
|
|
24861
|
-
attachmentCardViews
|
|
24862
|
-
});
|
|
24863
|
-
}
|
|
24864
|
-
});
|
|
24865
|
-
}
|
|
24866
|
-
addToolbarButton(buttonOptions) {
|
|
24867
|
-
if (typeof buttonOptions.onClick !== 'function' || typeof buttonOptions.title !== 'string' || !Object.prototype.hasOwnProperty.call(_namespaces_conversations__WEBPACK_IMPORTED_MODULE_2__/* .MessageViewToolbarSectionNames */ .kI, buttonOptions.section)) {
|
|
24868
|
-
throw new Error('Missing required properties on MessageViewToolbarButtonDescriptor object');
|
|
24869
|
-
}
|
|
24870
|
-
const {
|
|
24871
|
-
messageViewImplementation
|
|
24872
|
-
} = (0,_common_get_or_fail__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(memberMap, this);
|
|
24873
|
-
messageViewImplementation.addMoreMenuItem(buttonOptions);
|
|
24874
|
-
}
|
|
24875
|
-
getBodyElement() {
|
|
24876
|
-
return (0,_common_get_or_fail__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(memberMap, this).messageViewImplementation.getContentsElement();
|
|
24877
|
-
}
|
|
24878
|
-
getMessageID() {
|
|
24879
|
-
(0,_common_get_or_fail__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(memberMap, this).driver.getLogger().deprecationWarning('messageView.getMessageID', 'messageView.getMessageIDAsync');
|
|
24880
|
-
return (0,_common_get_or_fail__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(memberMap, this).messageViewImplementation.getMessageID();
|
|
24881
|
-
}
|
|
24882
|
-
getMessageIDAsync() {
|
|
24883
|
-
return (0,_common_get_or_fail__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(memberMap, this).messageViewImplementation.getMessageIDAsync();
|
|
24884
|
-
}
|
|
24885
|
-
|
|
24886
|
-
// TODO non-file-attachment card views are asynchronously loaded. Add some sort of
|
|
24887
|
-
// registerAttachmentCardViewHandler function to listen for other types of
|
|
24888
|
-
// attachment cards if we want to continue support for them.
|
|
24889
|
-
getFileAttachmentCardViews() {
|
|
24890
|
-
const {
|
|
24891
|
-
messageViewImplementation,
|
|
24892
|
-
membrane
|
|
24893
|
-
} = (0,_common_get_or_fail__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(memberMap, this);
|
|
24894
|
-
return messageViewImplementation.getAttachmentCardViewDrivers().filter(cardDriver => cardDriver.getAttachmentType() === 'FILE').map(attachmentCardViewDriver => membrane.get(attachmentCardViewDriver));
|
|
24895
|
-
}
|
|
24896
|
-
|
|
24897
|
-
// Deprecated name
|
|
24898
|
-
getAttachmentCardViews() {
|
|
24899
|
-
const {
|
|
24900
|
-
driver
|
|
24901
|
-
} = (0,_common_get_or_fail__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(memberMap, this);
|
|
24902
|
-
driver.getLogger().deprecationWarning('MessageView.getAttachmentCardViews', 'MessageView.getFileAttachmentCardViews');
|
|
24903
|
-
if (driver.getOpts().REQUESTED_API_VERSION !== 1) {
|
|
24904
|
-
throw new Error('This method was discontinued after API version 1');
|
|
24905
|
-
}
|
|
24906
|
-
return this.getFileAttachmentCardViews();
|
|
24907
|
-
}
|
|
24908
|
-
isElementInQuotedArea(element) {
|
|
24909
|
-
return (0,_common_get_or_fail__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(memberMap, this).messageViewImplementation.isElementInQuotedArea(element);
|
|
24910
|
-
}
|
|
24911
|
-
isLoaded() {
|
|
24912
|
-
return (0,_common_get_or_fail__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(memberMap, this).messageViewImplementation.isLoaded();
|
|
24913
|
-
}
|
|
24914
|
-
getLinksInBody() {
|
|
24915
|
-
const members = (0,_common_get_or_fail__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(memberMap, this);
|
|
24916
|
-
if (!members.linksInBody) {
|
|
24917
|
-
const anchors = this.getBodyElement().querySelectorAll('a');
|
|
24918
|
-
members.linksInBody = Array.from(anchors).map(anchor => ({
|
|
24919
|
-
text: anchor.textContent,
|
|
24920
|
-
html: anchor.innerHTML,
|
|
24921
|
-
href: anchor.href,
|
|
24922
|
-
element: anchor,
|
|
24923
|
-
isInQuotedArea: this.isElementInQuotedArea(anchor)
|
|
24924
|
-
}));
|
|
24925
|
-
}
|
|
24926
|
-
return members.linksInBody;
|
|
24927
|
-
}
|
|
24928
|
-
getSender() {
|
|
24929
|
-
return (0,_common_get_or_fail__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(memberMap, this).messageViewImplementation.getSender();
|
|
24930
|
-
}
|
|
24931
|
-
getRecipients() {
|
|
24932
|
-
(0,_common_get_or_fail__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(memberMap, this).driver.getLogger().deprecationWarning('MessageView.getRecipients', 'MessageView.getRecipientEmailAddresses() or MessageView.getRecipientsFull()');
|
|
24933
|
-
return this.getRecipientEmailAddresses().map(emailAddress => ({
|
|
24934
|
-
emailAddress,
|
|
24935
|
-
name: null
|
|
24936
|
-
}));
|
|
24937
|
-
}
|
|
24938
|
-
getRecipientEmailAddresses() {
|
|
24939
|
-
return (0,_common_get_or_fail__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(memberMap, this).messageViewImplementation.getRecipientEmailAddresses();
|
|
24940
|
-
}
|
|
24941
|
-
getRecipientsFull() {
|
|
24942
|
-
return (0,_common_get_or_fail__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(memberMap, this).messageViewImplementation.getRecipientsFull();
|
|
24943
|
-
}
|
|
24944
|
-
getThreadView() {
|
|
24945
|
-
const {
|
|
24946
|
-
messageViewImplementation,
|
|
24947
|
-
membrane
|
|
24948
|
-
} = (0,_common_get_or_fail__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(memberMap, this);
|
|
24949
|
-
return membrane.get(messageViewImplementation.getThreadViewDriver());
|
|
24950
|
-
}
|
|
24951
|
-
getDateString() {
|
|
24952
|
-
return (0,_common_get_or_fail__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(memberMap, this).messageViewImplementation.getDateString();
|
|
24953
|
-
}
|
|
24954
|
-
addAttachmentIcon(iconDescriptor) {
|
|
24955
|
-
return (0,_common_get_or_fail__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(memberMap, this).messageViewImplementation.addAttachmentIcon(iconDescriptor);
|
|
24956
|
-
}
|
|
24957
|
-
getViewState() {
|
|
24958
|
-
const members = (0,_common_get_or_fail__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(memberMap, this);
|
|
24959
|
-
return members.Conversations.MessageViewViewStates[members.messageViewImplementation.getViewState()];
|
|
24960
|
-
}
|
|
24961
|
-
hasOpenReply() {
|
|
24962
|
-
const {
|
|
24963
|
-
driver
|
|
24964
|
-
} = (0,_common_get_or_fail__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(memberMap, this);
|
|
24965
|
-
driver.getLogger().deprecationWarning('MessageView.hasOpenReply');
|
|
24966
|
-
if (driver.getOpts().REQUESTED_API_VERSION !== 1) {
|
|
24967
|
-
throw new Error('This method was discontinued after API version 1');
|
|
24968
|
-
}
|
|
24969
|
-
return (0,_common_get_or_fail__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(memberMap, this).messageViewImplementation.hasOpenReply();
|
|
24970
|
-
}
|
|
24971
|
-
}
|
|
24972
|
-
function _bindToEventStream(messageView, members, stream) {
|
|
24973
|
-
stream.onEnd(function () {
|
|
24974
|
-
messageView.destroyed = true;
|
|
24975
|
-
messageView.emit('destroy');
|
|
24976
|
-
messageView.removeAllListeners();
|
|
24977
|
-
});
|
|
24978
|
-
stream.filter(function (event) {
|
|
24979
|
-
return event.type !== 'internal' && event.eventName === 'contactHover';
|
|
24980
|
-
}).onValue(function (event) {
|
|
24981
|
-
messageView.emit(event.eventName, {
|
|
24982
|
-
contactType: event.contactType,
|
|
24983
|
-
contact: event.contact,
|
|
24984
|
-
messageView: messageView,
|
|
24985
|
-
threadView: messageView.getThreadView()
|
|
24986
|
-
});
|
|
24987
|
-
});
|
|
24988
|
-
if (messageView.isLoaded()) {
|
|
24989
|
-
asap__WEBPACK_IMPORTED_MODULE_0___default()(() => {
|
|
24990
|
-
messageView.emit('load', {
|
|
24991
|
-
messageView
|
|
24992
|
-
});
|
|
24993
|
-
});
|
|
24994
|
-
} else {
|
|
24995
|
-
stream.filter(event => event.eventName === 'messageLoad').onValue(() => {
|
|
24996
|
-
messageView.emit('load', {
|
|
24997
|
-
messageView: messageView
|
|
24998
|
-
});
|
|
24999
|
-
});
|
|
25000
|
-
}
|
|
25001
|
-
stream.filter(function (event) {
|
|
25002
|
-
return event.eventName === 'viewStateChange';
|
|
25003
|
-
}).onValue(function (event) {
|
|
25004
|
-
messageView.emit('viewStateChange', {
|
|
25005
|
-
oldViewState: members.Conversations.MessageViewViewStates[event.oldValue],
|
|
25006
|
-
newViewState: members.Conversations.MessageViewViewStates[event.newValue],
|
|
25007
|
-
messageView: messageView
|
|
25008
|
-
});
|
|
25009
|
-
});
|
|
25010
|
-
}
|
|
25011
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MessageView);
|
|
25012
|
-
|
|
25013
|
-
/***/ }),
|
|
25014
|
-
|
|
25015
24961
|
/***/ 7422:
|
|
25016
24962
|
/***/ ((module, __webpack_exports__, __webpack_require__) => {
|
|
25017
24963
|
|
|
@@ -25179,8 +25125,8 @@ const membersMap = (0,ud__WEBPACK_IMPORTED_MODULE_2__.defonce)(module, () => new
|
|
|
25179
25125
|
|
|
25180
25126
|
|
|
25181
25127
|
class DummyRouteViewDriver {
|
|
25182
|
-
|
|
25183
|
-
|
|
25128
|
+
#eventStream = kefir_bus__WEBPACK_IMPORTED_MODULE_0___default()();
|
|
25129
|
+
#stopper = kefir_stopper__WEBPACK_IMPORTED_MODULE_1___default()();
|
|
25184
25130
|
getRouteType() {
|
|
25185
25131
|
return 'UNKNOWN';
|
|
25186
25132
|
}
|
|
@@ -25191,14 +25137,14 @@ class DummyRouteViewDriver {
|
|
|
25191
25137
|
return {};
|
|
25192
25138
|
}
|
|
25193
25139
|
getEventStream() {
|
|
25194
|
-
return this
|
|
25140
|
+
return this.#eventStream;
|
|
25195
25141
|
}
|
|
25196
25142
|
getStopper() {
|
|
25197
|
-
return this
|
|
25143
|
+
return this.#stopper;
|
|
25198
25144
|
}
|
|
25199
25145
|
destroy() {
|
|
25200
|
-
this.
|
|
25201
|
-
this.
|
|
25146
|
+
this.#eventStream.end();
|
|
25147
|
+
this.#stopper.destroy();
|
|
25202
25148
|
}
|
|
25203
25149
|
}
|
|
25204
25150
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DummyRouteViewDriver);
|