@inboxsdk/core 2.2.16 → 2.2.18
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 +284 -110
- package/inboxsdk.js.map +1 -1
- package/package.json +1 -1
- package/pageWorld.js.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/sync-mole-spacer-with-right-column.d.ts +8 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/sync-mole-spacer-with-right-column.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-element-getter.d.ts +20 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-element-getter.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/primary/index.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/widgets/gmail-mole-view-driver.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.18-1784839996724-a8a6fe2c9e69b0e7";
|
|
375
375
|
if (false) {}
|
|
376
376
|
|
|
377
377
|
/***/ }),
|
|
@@ -630,8 +630,8 @@ function isGoogleChatEnabled() {
|
|
|
630
630
|
|
|
631
631
|
|
|
632
632
|
function overrideGmailBackButton(gmailDriver, gmailRouteProcessor) {
|
|
633
|
-
_gmail_element_getter__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
634
|
-
if (_gmail_element_getter__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
633
|
+
_gmail_element_getter__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Ay.waitForGmailModeToSettle().then(function () {
|
|
634
|
+
if (_gmail_element_getter__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Ay.isStandalone()) {
|
|
635
635
|
return;
|
|
636
636
|
}
|
|
637
637
|
_setupManagement(gmailDriver, gmailRouteProcessor);
|
|
@@ -664,7 +664,7 @@ const handleGmailRouteView = (0,ud__WEBPACK_IMPORTED_MODULE_2__.defn)(module, fu
|
|
|
664
664
|
}
|
|
665
665
|
});
|
|
666
666
|
function _bindToBackButton(gmailDriver, gmailRouteView) {
|
|
667
|
-
const backButton = _gmail_element_getter__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
667
|
+
const backButton = _gmail_element_getter__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Ay.getThreadBackButton();
|
|
668
668
|
if (!backButton) {
|
|
669
669
|
return;
|
|
670
670
|
}
|
|
@@ -801,13 +801,13 @@ function setupComposeViewDriverStream(gmailDriver, messageViewDriverStream, xhrI
|
|
|
801
801
|
return impStream.flatMapLatest(imp => imp(gmailDriver, messageViewDriverStream, xhrInterceptorStream));
|
|
802
802
|
}
|
|
803
803
|
function imp(gmailDriver, messageViewDriverStream, xhrInterceptorStream) {
|
|
804
|
-
return kefir_esm.fromPromise(gmail_element_getter/* default */.
|
|
804
|
+
return kefir_esm.fromPromise(gmail_element_getter/* default */.Ay.waitForGmailModeToSettle()).flatMap(() => {
|
|
805
805
|
let elementStream;
|
|
806
806
|
let isStandalone = false;
|
|
807
|
-
if (gmail_element_getter/* default */.
|
|
807
|
+
if (gmail_element_getter/* default */.Ay.isStandaloneComposeWindow()) {
|
|
808
808
|
elementStream = _setupStandaloneComposeElementStream();
|
|
809
809
|
isStandalone = true;
|
|
810
|
-
} else if (gmail_element_getter/* default */.
|
|
810
|
+
} else if (gmail_element_getter/* default */.Ay.isStandaloneThreadWindow()) {
|
|
811
811
|
elementStream = kefir_esm.never();
|
|
812
812
|
} else {
|
|
813
813
|
elementStream = _setupStandardComposeElementStream();
|
|
@@ -822,14 +822,14 @@ function imp(gmailDriver, messageViewDriverStream, xhrInterceptorStream) {
|
|
|
822
822
|
}))))).flatMap(composeViewDriver => composeViewDriver.ready());
|
|
823
823
|
}
|
|
824
824
|
function _setupStandardComposeElementStream() {
|
|
825
|
-
return _waitForContainerAndMonitorChildrenStream(() => gmail_element_getter/* default */.
|
|
825
|
+
return _waitForContainerAndMonitorChildrenStream(() => gmail_element_getter/* default */.Ay.getComposeWindowContainer()).flatMap(composeGrandParent => {
|
|
826
826
|
const composeParentEl = composeGrandParent.el.querySelector('div.AD');
|
|
827
827
|
if (composeParentEl) {
|
|
828
828
|
return (0,make_element_child_stream/* default */.A)(composeParentEl).takeUntilBy(composeGrandParent.removalStream).map(_informElement('composeFullscreenStateChanged'));
|
|
829
829
|
} else {
|
|
830
830
|
return kefir_esm.never();
|
|
831
831
|
}
|
|
832
|
-
}).merge(gmail_element_getter/* default */.
|
|
832
|
+
}).merge(gmail_element_getter/* default */.Ay.getFullscreenComposeWindowContainerStream().flatMap(_ref => {
|
|
833
833
|
let {
|
|
834
834
|
el,
|
|
835
835
|
removalStream
|
|
@@ -865,7 +865,7 @@ function _setupStandardComposeElementStream() {
|
|
|
865
865
|
}).flatMap(makeElementStreamMerger());
|
|
866
866
|
}
|
|
867
867
|
function _setupStandaloneComposeElementStream() {
|
|
868
|
-
return _waitForContainerAndMonitorChildrenStream(() => gmail_element_getter/* default */.
|
|
868
|
+
return _waitForContainerAndMonitorChildrenStream(() => gmail_element_getter/* default */.Ay.StandaloneCompose.getComposeWindowContainer());
|
|
869
869
|
}
|
|
870
870
|
function _waitForContainerAndMonitorChildrenStream(containerFn) {
|
|
871
871
|
return kefir_esm.interval(2000, undefined) // TODO replace this with page-parser-tree
|
|
@@ -903,7 +903,7 @@ function _informElement(eventName) {
|
|
|
903
903
|
const ACTIVE_ADD_ON_ICON_SELECTOR = '.J-KU-KO';
|
|
904
904
|
|
|
905
905
|
const showCustomRouteView = (0,ud__WEBPACK_IMPORTED_MODULE_1__.defn)(module, function showCustomRouteView(gmailDriver, element) {
|
|
906
|
-
const contentSectionElement = _gmail_element_getter__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
906
|
+
const contentSectionElement = _gmail_element_getter__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Ay.getContentSectionElement();
|
|
907
907
|
if (!contentSectionElement) {
|
|
908
908
|
return;
|
|
909
909
|
}
|
|
@@ -926,7 +926,7 @@ const showCustomRouteView = (0,ud__WEBPACK_IMPORTED_MODULE_1__.defn)(module, fun
|
|
|
926
926
|
});
|
|
927
927
|
|
|
928
928
|
//if any thread sidebar addons are enabled then we need to turn them off
|
|
929
|
-
const companionSidebarIconContainerEl = _gmail_element_getter__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .
|
|
929
|
+
const companionSidebarIconContainerEl = _gmail_element_getter__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Ay.getCompanionSidebarIconContainerElement();
|
|
930
930
|
if (companionSidebarIconContainerEl) {
|
|
931
931
|
const activeThreadAddOnIcon = companionSidebarIconContainerEl.querySelector(ACTIVE_ADD_ON_ICON_SELECTOR);
|
|
932
932
|
if (activeThreadAddOnIcon) {
|
|
@@ -956,7 +956,10 @@ function _getCustomViewContainerElement(contentSectionElement) {
|
|
|
956
956
|
|
|
957
957
|
// EXPORTS
|
|
958
958
|
__webpack_require__.d(__webpack_exports__, {
|
|
959
|
-
|
|
959
|
+
y2: () => (/* binding */ COMPANION_SIDEBAR_PANEL_WRAPPER_CLASS),
|
|
960
|
+
MY: () => (/* binding */ MOLE_CONTAINER_SELECTOR),
|
|
961
|
+
pG: () => (/* binding */ MOLE_PARENT_SELECTOR),
|
|
962
|
+
Ay: () => (/* binding */ gmail_element_getter)
|
|
960
963
|
});
|
|
961
964
|
|
|
962
965
|
// EXTERNAL MODULE: ./node_modules/lodash/once.js
|
|
@@ -1053,6 +1056,31 @@ const APP_MENU = '.aeN.WR.a6o.anZ.nH.oy8Mbf[role=navigation]';
|
|
|
1053
1056
|
*/
|
|
1054
1057
|
const NAV_MENU = '.aeN.WR.nH.oy8Mbf[role=navigation]';
|
|
1055
1058
|
|
|
1059
|
+
/**
|
|
1060
|
+
* The right-hand column holding the companion sidebar. Both the panel and the
|
|
1061
|
+
* icon rail live inside it.
|
|
1062
|
+
*/
|
|
1063
|
+
const COMPANION_SIDEBAR_COLUMN = 'div.aUx';
|
|
1064
|
+
|
|
1065
|
+
/**
|
|
1066
|
+
* Class on the companion sidebar's outer wrapper before the 2024-11-07 Gmail
|
|
1067
|
+
* update, when the wrapper and the content container were the same element.
|
|
1068
|
+
*/
|
|
1069
|
+
const COMPANION_SIDEBAR_LEGACY_WRAPPER_CLASS = 'bq9';
|
|
1070
|
+
|
|
1071
|
+
/**
|
|
1072
|
+
* Class on the companion sidebar's outer wrapper in the layout Gmail shipped
|
|
1073
|
+
* 2024-11-07, which moved the sidebar icons to the right of the panel. Absent
|
|
1074
|
+
* on older layouts, which use {@link COMPANION_SIDEBAR_LEGACY_WRAPPER_CLASS}.
|
|
1075
|
+
*/
|
|
1076
|
+
const COMPANION_SIDEBAR_PANEL_WRAPPER_CLASS = 'WN9Ejb';
|
|
1077
|
+
|
|
1078
|
+
/** Outer flex container for the mole strip (spacers + mole area). Lazily created by Gmail. */
|
|
1079
|
+
const MOLE_CONTAINER_SELECTOR = 'div.dw';
|
|
1080
|
+
|
|
1081
|
+
/** The element compose windows and moles are appended to. */
|
|
1082
|
+
const MOLE_PARENT_SELECTOR = `${MOLE_CONTAINER_SELECTOR} .nH > .nH > .no`;
|
|
1083
|
+
|
|
1056
1084
|
// TODO Figure out if these functions can and should be able to return null
|
|
1057
1085
|
const GmailElementGetter = {
|
|
1058
1086
|
getActiveMoreMenu() {
|
|
@@ -1068,6 +1096,9 @@ const GmailElementGetter = {
|
|
|
1068
1096
|
// only for Gmailv1 + Gmailv2-before-2018-07-30?
|
|
1069
1097
|
return document.querySelector('.no > .nn.bnl');
|
|
1070
1098
|
},
|
|
1099
|
+
getCompanionSidebarColumnElement() {
|
|
1100
|
+
return document.querySelector(COMPANION_SIDEBAR_COLUMN);
|
|
1101
|
+
},
|
|
1071
1102
|
getCompanionSidebarContentContainerElement() {
|
|
1072
1103
|
return document.querySelector('.brC-brG');
|
|
1073
1104
|
},
|
|
@@ -1075,6 +1106,21 @@ const GmailElementGetter = {
|
|
|
1075
1106
|
getCompanionSidebarIconContainerElement() {
|
|
1076
1107
|
return document.querySelector('.brC-aT5-aOt-Jw');
|
|
1077
1108
|
},
|
|
1109
|
+
/**
|
|
1110
|
+
* The wrapper Google's own companions (Calendar, Keep, Tasks, Contacts) and
|
|
1111
|
+
* SDK content panels both render their body inside. Gmail hides it with
|
|
1112
|
+
* `display: none` rather than removing it when nothing is open.
|
|
1113
|
+
*
|
|
1114
|
+
* @param contentContainerEl pass this when you already hold the content
|
|
1115
|
+
* container, so the wrapper is derived from that same element.
|
|
1116
|
+
*/
|
|
1117
|
+
getCompanionSidebarOuterWrapperElement(contentContainerEl) {
|
|
1118
|
+
const companionSidebarContentContainerEl = contentContainerEl ?? GmailElementGetter.getCompanionSidebarContentContainerElement();
|
|
1119
|
+
if (!companionSidebarContentContainerEl) return null;
|
|
1120
|
+
// TODO: Once the changes to the GMail DOM have been entirely ramped, drop
|
|
1121
|
+
// the ternary here and always get the parentElement. (Jun 20, 2018)
|
|
1122
|
+
return companionSidebarContentContainerEl.classList.contains(COMPANION_SIDEBAR_LEGACY_WRAPPER_CLASS) ? companionSidebarContentContainerEl : companionSidebarContentContainerEl.parentElement;
|
|
1123
|
+
},
|
|
1078
1124
|
getComposeButton() {
|
|
1079
1125
|
if ((0,isIntegratedViewGmail/* default */.Ay)()) {
|
|
1080
1126
|
return document.querySelector('.aIH .aic div[role=button].L3');
|
|
@@ -1082,7 +1128,7 @@ const GmailElementGetter = {
|
|
|
1082
1128
|
return document.querySelector('[gh=cm]');
|
|
1083
1129
|
},
|
|
1084
1130
|
getComposeWindowContainer() {
|
|
1085
|
-
return document.querySelector(
|
|
1131
|
+
return document.querySelector(MOLE_PARENT_SELECTOR);
|
|
1086
1132
|
},
|
|
1087
1133
|
getContentSectionElement() {
|
|
1088
1134
|
// New method for finding the content section element that also supports
|
|
@@ -2665,7 +2711,7 @@ options.insert = htmlElement => {
|
|
|
2665
2711
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
2666
2712
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
2667
2713
|
///@ts-ignore
|
|
2668
|
-
"2.2.
|
|
2714
|
+
"2.2.18-1784839996724-a8a6fe2c9e69b0e7");
|
|
2669
2715
|
document.head.append(htmlElement);
|
|
2670
2716
|
};
|
|
2671
2717
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -3090,7 +3136,7 @@ class GmailAppSidebarPrimary {
|
|
|
3090
3136
|
if (contentContainer) contentContainer.classList.remove('companion_container_app_sidebar_visible');
|
|
3091
3137
|
}
|
|
3092
3138
|
#openSidebarAndActivateButton(buttonContainer, isGlobal) {
|
|
3093
|
-
const companionSidebarIconContainerEl = gmail_element_getter/* default */.
|
|
3139
|
+
const companionSidebarIconContainerEl = gmail_element_getter/* default */.Ay.getCompanionSidebarIconContainerElement();
|
|
3094
3140
|
if (!companionSidebarIconContainerEl) throw new Error('Could not find companion sidebar icon container element');
|
|
3095
3141
|
const activeButtonContainer = this.#getActiveButtonContainer();
|
|
3096
3142
|
if (activeButtonContainer) {
|
|
@@ -3113,20 +3159,18 @@ class GmailAppSidebarPrimary {
|
|
|
3113
3159
|
if (isGlobal) this.#companionSidebarContentContainerEl.classList.add('companion_global_app_sidebar_visible');
|
|
3114
3160
|
}
|
|
3115
3161
|
#setupElement() {
|
|
3116
|
-
const companionSidebarIconContainerEl = gmail_element_getter/* default */.
|
|
3162
|
+
const companionSidebarIconContainerEl = gmail_element_getter/* default */.Ay.getCompanionSidebarIconContainerElement();
|
|
3117
3163
|
if (!companionSidebarIconContainerEl) throw new Error('Could not find companion sidebar icon container element');
|
|
3118
3164
|
this.#companionSidebarContentContainerEl.setAttribute('data-sdk-sidebar-instance-id', this.#instanceId);
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
// always get the parentElement. (Jun 20, 2018)
|
|
3122
|
-
this.#companionSidebarOuterWrapper = this.#companionSidebarContentContainerEl.classList.contains('bq9') ? this.#companionSidebarContentContainerEl : this.#companionSidebarContentContainerEl.parentElement;
|
|
3123
|
-
if (!this.#companionSidebarOuterWrapper) {
|
|
3165
|
+
const companionSidebarOuterWrapper = gmail_element_getter/* default */.Ay.getCompanionSidebarOuterWrapperElement(this.#companionSidebarContentContainerEl);
|
|
3166
|
+
if (!companionSidebarOuterWrapper) {
|
|
3124
3167
|
throw new Error('should not happen: failed to find companionSidebarOuterWrapper');
|
|
3125
3168
|
}
|
|
3169
|
+
this.#companionSidebarOuterWrapper = companionSidebarOuterWrapper;
|
|
3126
3170
|
|
|
3127
3171
|
// detect 2024-11-07 gmail update that moved sidebar icons to the right of
|
|
3128
3172
|
// the sidebar
|
|
3129
|
-
if (this.#companionSidebarOuterWrapper.classList.contains(
|
|
3173
|
+
if (this.#companionSidebarOuterWrapper.classList.contains(gmail_element_getter/* COMPANION_SIDEBAR_PANEL_WRAPPER_CLASS */.y2)) {
|
|
3130
3174
|
document.body.classList.add('inboxsdk__sidebar_icons_right');
|
|
3131
3175
|
this.#driver.getLogger().eventSite('sidebar_icons_right');
|
|
3132
3176
|
}
|
|
@@ -5662,7 +5706,7 @@ class GmailComposeView {
|
|
|
5662
5706
|
if (this.#isStandalone) {
|
|
5663
5707
|
this.#isFullscreen = true;
|
|
5664
5708
|
} else {
|
|
5665
|
-
const fullScreenContainer = gmail_element_getter/* default */.
|
|
5709
|
+
const fullScreenContainer = gmail_element_getter/* default */.Ay.getFullscreenComposeWindowContainer();
|
|
5666
5710
|
if (!fullScreenContainer) {
|
|
5667
5711
|
this.#isFullscreen = false;
|
|
5668
5712
|
} else {
|
|
@@ -6149,10 +6193,12 @@ class GmailComposeView {
|
|
|
6149
6193
|
return result;
|
|
6150
6194
|
}
|
|
6151
6195
|
getCloseButton() {
|
|
6152
|
-
|
|
6196
|
+
// Prefer legacy <img> titlebar controls; fall back to newer <button class="Ha">.
|
|
6197
|
+
return this.#element.querySelectorAll('.Hm > img')[2] || (0,querySelectorOrFail/* default */.A)(this.#element, '.Hm .Ha');
|
|
6153
6198
|
}
|
|
6154
6199
|
getMoleSwitchButton() {
|
|
6155
|
-
|
|
6200
|
+
// Prefer legacy <img> titlebar controls; fall back to newer <button class="Hq">.
|
|
6201
|
+
return this.#element.querySelectorAll('.Hm > img')[1] || (0,querySelectorOrFail/* default */.A)(this.#element, '.Hm .Hq');
|
|
6156
6202
|
}
|
|
6157
6203
|
getBottomBarTable() {
|
|
6158
6204
|
return (0,querySelectorOrFail/* default */.A)(this.#element, '.aoP .aDh > table');
|
|
@@ -6289,14 +6335,16 @@ class GmailComposeView {
|
|
|
6289
6335
|
setMinimized(minimized) {
|
|
6290
6336
|
if (minimized !== this.isMinimized()) {
|
|
6291
6337
|
if (this.#isInlineReplyForm) throw new Error('Not implemented for inline compose views');
|
|
6292
|
-
|
|
6338
|
+
// Prefer legacy <img>; fall back to newer <button class="Hl">.
|
|
6339
|
+
const minimizeButton = this.#element.querySelector('.Hm > img') || (0,querySelectorOrFail/* default */.A)(this.#element, '.Hm .Hl');
|
|
6293
6340
|
(0,simulate_mouse_event/* simulateClick */.jp)(minimizeButton);
|
|
6294
6341
|
}
|
|
6295
6342
|
}
|
|
6296
6343
|
setFullscreen(fullscreen) {
|
|
6297
6344
|
if (fullscreen !== this.isFullscreen()) {
|
|
6298
6345
|
if (this.#isInlineReplyForm) throw new Error('Not implemented for inline compose views');
|
|
6299
|
-
|
|
6346
|
+
// Prefer legacy <img>; fall back to newer <button class="Hq">.
|
|
6347
|
+
const fullscreenButton = this.#element.querySelector('.Hm > img:nth-of-type(2)') || (0,querySelectorOrFail/* default */.A)(this.#element, '.Hm .Hq');
|
|
6300
6348
|
(0,simulate_mouse_event/* simulateClick */.jp)(fullscreenButton);
|
|
6301
6349
|
}
|
|
6302
6350
|
}
|
|
@@ -10332,7 +10380,7 @@ options.insert = htmlElement => {
|
|
|
10332
10380
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
10333
10381
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
10334
10382
|
///@ts-ignore
|
|
10335
|
-
"2.2.
|
|
10383
|
+
"2.2.18-1784839996724-a8a6fe2c9e69b0e7");
|
|
10336
10384
|
document.head.append(htmlElement);
|
|
10337
10385
|
};
|
|
10338
10386
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -11476,7 +11524,7 @@ if (!globalThis.__InboxSDKImpLoader) {
|
|
|
11476
11524
|
await onready;
|
|
11477
11525
|
const {
|
|
11478
11526
|
makePlatformImplementation
|
|
11479
|
-
} = await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
11527
|
+
} = await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3948));
|
|
11480
11528
|
return makePlatformImplementation(appId, opts, {
|
|
11481
11529
|
piMainStarted,
|
|
11482
11530
|
piLoadStarted,
|
|
@@ -11625,7 +11673,7 @@ class Keyboard {
|
|
|
11625
11673
|
|
|
11626
11674
|
/***/ }),
|
|
11627
11675
|
|
|
11628
|
-
/***/
|
|
11676
|
+
/***/ 3948:
|
|
11629
11677
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
11630
11678
|
|
|
11631
11679
|
"use strict";
|
|
@@ -14063,7 +14111,7 @@ class GmailToolbarView {
|
|
|
14063
14111
|
}
|
|
14064
14112
|
}
|
|
14065
14113
|
_addToOpenMoreMenu(buttonDescriptor) {
|
|
14066
|
-
const moreMenu = gmail_element_getter/* default */.
|
|
14114
|
+
const moreMenu = gmail_element_getter/* default */.Ay.getActiveMoreMenu();
|
|
14067
14115
|
if (!moreMenu) {
|
|
14068
14116
|
return;
|
|
14069
14117
|
}
|
|
@@ -14720,7 +14768,7 @@ class GmailThreadView {
|
|
|
14720
14768
|
async #logAddonElementInfo() {
|
|
14721
14769
|
if (hasLoggedAddonInfo) return;
|
|
14722
14770
|
function readInfo() {
|
|
14723
|
-
const container = gmail_element_getter/* default */.
|
|
14771
|
+
const container = gmail_element_getter/* default */.Ay.getAddonSidebarContainerElement();
|
|
14724
14772
|
if (!container) return null;
|
|
14725
14773
|
const isDisplayNone = {
|
|
14726
14774
|
parent: container.parentElement ? container.parentElement.style.display === 'none' : null,
|
|
@@ -15094,7 +15142,7 @@ options.insert = htmlElement => {
|
|
|
15094
15142
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
15095
15143
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
15096
15144
|
///@ts-ignore
|
|
15097
|
-
"2.2.
|
|
15145
|
+
"2.2.18-1784839996724-a8a6fe2c9e69b0e7");
|
|
15098
15146
|
document.head.append(htmlElement);
|
|
15099
15147
|
};
|
|
15100
15148
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -15971,7 +16019,7 @@ class GmailRouteView {
|
|
|
15971
16019
|
this._setCustomViewElementHeight();
|
|
15972
16020
|
}
|
|
15973
16021
|
_monitorLeftNavHeight() {
|
|
15974
|
-
var leftNav = gmail_element_getter/* default */.
|
|
16022
|
+
var leftNav = gmail_element_getter/* default */.Ay.getLeftNavHeightElement();
|
|
15975
16023
|
if (!leftNav) {
|
|
15976
16024
|
return;
|
|
15977
16025
|
}
|
|
@@ -15983,11 +16031,11 @@ class GmailRouteView {
|
|
|
15983
16031
|
});
|
|
15984
16032
|
}
|
|
15985
16033
|
_setCustomViewElementHeight() {
|
|
15986
|
-
const leftNav = gmail_element_getter/* default */.
|
|
15987
|
-
const gtalkButtons = gmail_element_getter/* default */.
|
|
16034
|
+
const leftNav = gmail_element_getter/* default */.Ay.getLeftNavHeightElement();
|
|
16035
|
+
const gtalkButtons = gmail_element_getter/* default */.Ay.getGtalkButtons();
|
|
15988
16036
|
const customViewEl = this._customViewElement;
|
|
15989
16037
|
if (!leftNav || !customViewEl) throw new Error('Should not happen');
|
|
15990
|
-
const contentSectionElement = gmail_element_getter/* default */.
|
|
16038
|
+
const contentSectionElement = gmail_element_getter/* default */.Ay.getContentSectionElement();
|
|
15991
16039
|
const contentSectionElementBottomMargin = contentSectionElement ? parseInt(getComputedStyle(contentSectionElement).marginBottom, 10) : 0;
|
|
15992
16040
|
customViewEl.style.height = `${parseInt(leftNav.style.height, 10) + (gtalkButtons ? gtalkButtons.offsetHeight : 0) - contentSectionElementBottomMargin}px`;
|
|
15993
16041
|
}
|
|
@@ -16062,7 +16110,7 @@ class GmailRouteView {
|
|
|
16062
16110
|
threadContainerElement
|
|
16063
16111
|
};
|
|
16064
16112
|
}
|
|
16065
|
-
const previewPaneContainerElement = gmail_element_getter/* default */.
|
|
16113
|
+
const previewPaneContainerElement = gmail_element_getter/* default */.Ay.getPreviewPaneContainerElement();
|
|
16066
16114
|
if (previewPaneContainerElement) {
|
|
16067
16115
|
return {
|
|
16068
16116
|
previewPaneContainerElement
|
|
@@ -16093,7 +16141,7 @@ class GmailRouteView {
|
|
|
16093
16141
|
}
|
|
16094
16142
|
_setupScrollStream() {
|
|
16095
16143
|
const SCROLL_DEBOUNCE_MS = 100;
|
|
16096
|
-
const scrollContainer = gmail_element_getter/* default */.
|
|
16144
|
+
const scrollContainer = gmail_element_getter/* default */.Ay.getScrollContainer();
|
|
16097
16145
|
const {
|
|
16098
16146
|
scrollTop: cachedScrollTop
|
|
16099
16147
|
} = this._cachedRouteData;
|
|
@@ -16316,7 +16364,7 @@ class GmailRouteView {
|
|
|
16316
16364
|
|
|
16317
16365
|
// Used to click gmail refresh button in thread lists
|
|
16318
16366
|
refresh() {
|
|
16319
|
-
var el = gmail_element_getter/* default */.
|
|
16367
|
+
var el = gmail_element_getter/* default */.Ay.getToolbarElement().querySelector('div.T-I.nu');
|
|
16320
16368
|
if (el) {
|
|
16321
16369
|
var prevActive = document.activeElement;
|
|
16322
16370
|
var prevClassName = el.className;
|
|
@@ -16339,7 +16387,7 @@ class GmailRouteView {
|
|
|
16339
16387
|
return routeID.split('/').filter(part => part[0] === ':').map(part => part.substring(1));
|
|
16340
16388
|
}
|
|
16341
16389
|
_getThreadContainerElement() {
|
|
16342
|
-
return gmail_element_getter/* default */.
|
|
16390
|
+
return gmail_element_getter/* default */.Ay.getThreadContainerElement();
|
|
16343
16391
|
}
|
|
16344
16392
|
}
|
|
16345
16393
|
/* harmony default export */ const gmail_route_view = (GmailRouteView);
|
|
@@ -17207,7 +17255,7 @@ function isBodyDarkTheme() {
|
|
|
17207
17255
|
}
|
|
17208
17256
|
const stylesStream = kefir_bus_default()();
|
|
17209
17257
|
async function trackGmailStyles() {
|
|
17210
|
-
if (document.head.hasAttribute('data-inboxsdk-gmail-style-tracker') || gmail_element_getter/* default */.
|
|
17258
|
+
if (document.head.hasAttribute('data-inboxsdk-gmail-style-tracker') || gmail_element_getter/* default */.Ay.isStandalone()) {
|
|
17211
17259
|
return;
|
|
17212
17260
|
}
|
|
17213
17261
|
document.head.setAttribute('data-inboxsdk-gmail-style-tracker', 'true');
|
|
@@ -17361,7 +17409,7 @@ class GmailAppMenuItemView extends events.EventEmitter {
|
|
|
17361
17409
|
iconClassName
|
|
17362
17410
|
} = this.#menuItemDescriptor ?? {};
|
|
17363
17411
|
if (iconUrl) {
|
|
17364
|
-
const rawTheme = gmail_element_getter/* default */.
|
|
17412
|
+
const rawTheme = gmail_element_getter/* default */.Ay.isDarkTheme() ? iconUrl.darkTheme : iconUrl.lightTheme;
|
|
17365
17413
|
if (!rawTheme) return;
|
|
17366
17414
|
const theme = typeof rawTheme === 'string' ? rawTheme : rawTheme.default;
|
|
17367
17415
|
const activeImg = typeof rawTheme === 'string' ? rawTheme : rawTheme.active;
|
|
@@ -17529,7 +17577,7 @@ class CollapsiblePanelView extends safe_event_emitter/* default */.A {
|
|
|
17529
17577
|
if (!iconUrl) {
|
|
17530
17578
|
return;
|
|
17531
17579
|
}
|
|
17532
|
-
const theme = gmail_element_getter/* default */.
|
|
17580
|
+
const theme = gmail_element_getter/* default */.Ay.isDarkTheme() ? iconUrl.darkTheme : iconUrl.lightTheme;
|
|
17533
17581
|
if (!theme) {
|
|
17534
17582
|
return;
|
|
17535
17583
|
}
|
|
@@ -17675,7 +17723,7 @@ async function addCollapsiblePanel(driver, panelDescriptor, insertIndex) {
|
|
|
17675
17723
|
const injectionContainer = await waitForAppMenuParentReady();
|
|
17676
17724
|
const collapsiblePanelView = new CollapsiblePanelView(driver, panelDescriptor);
|
|
17677
17725
|
if (!injectionContainer || !collapsiblePanelView.element) return;
|
|
17678
|
-
const appMenu = await gmail_element_getter/* default */.
|
|
17726
|
+
const appMenu = await gmail_element_getter/* default */.Ay.getAppMenuAsync();
|
|
17679
17727
|
if (!appMenu) return;
|
|
17680
17728
|
const panelNodes = injectionContainer.querySelectorAll(CollapsiblePanelView.elementSelectors.NATIVE) ?? [];
|
|
17681
17729
|
const siblingElement = Number.isInteger(insertIndex) ? panelNodes[insertIndex] ?? null : null;
|
|
@@ -17687,9 +17735,9 @@ async function addCollapsiblePanel(driver, panelDescriptor, insertIndex) {
|
|
|
17687
17735
|
return collapsiblePanelView;
|
|
17688
17736
|
}
|
|
17689
17737
|
const waitForAppMenuParentReady = once_default()(async () => {
|
|
17690
|
-
if (!gmail_element_getter/* default */.
|
|
17738
|
+
if (!gmail_element_getter/* default */.Ay.isStandalone()) {
|
|
17691
17739
|
try {
|
|
17692
|
-
const menuParentElement = await (0,wait_for/* default */.A)(() => gmail_element_getter/* default */.
|
|
17740
|
+
const menuParentElement = await (0,wait_for/* default */.A)(() => gmail_element_getter/* default */.Ay.getAppMenuContainer());
|
|
17693
17741
|
return menuParentElement;
|
|
17694
17742
|
} catch (e) {
|
|
17695
17743
|
lib_logger/* default */.A.error(e);
|
|
@@ -17743,13 +17791,13 @@ class AppMenuItemView extends safe_event_emitter/* default */.A {
|
|
|
17743
17791
|
static #menuItemToPanelMap = new Map();
|
|
17744
17792
|
static #appMenuItemViews = new Set();
|
|
17745
17793
|
static getAllPanels() {
|
|
17746
|
-
const appMenuElement = gmail_element_getter/* default */.
|
|
17794
|
+
const appMenuElement = gmail_element_getter/* default */.Ay.getAppMenuContainer();
|
|
17747
17795
|
const nativePanels = appMenuElement?.querySelectorAll(`.${collapsible_panel_view_NATIVE_CLASS}`);
|
|
17748
17796
|
return Array.from(nativePanels ?? []);
|
|
17749
17797
|
}
|
|
17750
17798
|
static getActivePanel() {
|
|
17751
17799
|
let useSdkActiveSelector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
17752
|
-
const appMenuElement = gmail_element_getter/* default */.
|
|
17800
|
+
const appMenuElement = gmail_element_getter/* default */.Ay.getAppMenuContainer();
|
|
17753
17801
|
const {
|
|
17754
17802
|
ACTIVE,
|
|
17755
17803
|
SDK_ACTIVE
|
|
@@ -17778,11 +17826,11 @@ class AppMenuItemView extends safe_event_emitter/* default */.A {
|
|
|
17778
17826
|
return element.classList.contains(NATIVE_CLASS);
|
|
17779
17827
|
}
|
|
17780
17828
|
static getAllMenuItems() {
|
|
17781
|
-
const appMenuElement = gmail_element_getter/* default */.
|
|
17829
|
+
const appMenuElement = gmail_element_getter/* default */.Ay.getAppMenuContainer();
|
|
17782
17830
|
return Array.from(appMenuElement?.querySelectorAll(`.${NATIVE_CLASS}`) ?? []);
|
|
17783
17831
|
}
|
|
17784
17832
|
static getActiveMenuItem() {
|
|
17785
|
-
const appMenuElement = gmail_element_getter/* default */.
|
|
17833
|
+
const appMenuElement = gmail_element_getter/* default */.Ay.getAppMenuContainer();
|
|
17786
17834
|
const {
|
|
17787
17835
|
ACTIVE,
|
|
17788
17836
|
SDK_ACTIVE
|
|
@@ -17812,7 +17860,7 @@ class AppMenuItemView extends safe_event_emitter/* default */.A {
|
|
|
17812
17860
|
}
|
|
17813
17861
|
static #adjustTooltipNub() {
|
|
17814
17862
|
// adjust all menu items' collapsible panel's tooltip nub position
|
|
17815
|
-
const appMenuElement = gmail_element_getter/* default */.
|
|
17863
|
+
const appMenuElement = gmail_element_getter/* default */.Ay.getAppMenu();
|
|
17816
17864
|
for (const menuItem of appMenuElement?.querySelectorAll(`.${NATIVE_CLASS}`) ?? []) {
|
|
17817
17865
|
const panel = AppMenuItemView.#menuItemToPanelMap.get(menuItem);
|
|
17818
17866
|
if (!panel) continue;
|
|
@@ -17883,7 +17931,7 @@ class AppMenuItemView extends safe_event_emitter/* default */.A {
|
|
|
17883
17931
|
});
|
|
17884
17932
|
}
|
|
17885
17933
|
static #_ = async function init() {
|
|
17886
|
-
const gmailAppMenu = await gmail_element_getter/* default */.
|
|
17934
|
+
const gmailAppMenu = await gmail_element_getter/* default */.Ay.getAppMenuAsync();
|
|
17887
17935
|
if (!gmailAppMenu) {
|
|
17888
17936
|
return;
|
|
17889
17937
|
}
|
|
@@ -17902,7 +17950,7 @@ class AppMenuItemView extends safe_event_emitter/* default */.A {
|
|
|
17902
17950
|
// Set up event listeners we use to control menu UI
|
|
17903
17951
|
// We intercept some events emitted on Gmail (native) menu items to gain full control of the menu (menu items and panels).
|
|
17904
17952
|
// Thus, some native event handlers won't be invoked so we replicate the Gmail's behavior by ourselves.
|
|
17905
|
-
const appMenuElement = gmail_element_getter/* default */.
|
|
17953
|
+
const appMenuElement = gmail_element_getter/* default */.Ay.getAppMenuContainer();
|
|
17906
17954
|
for (const nativeMenuItem of appMenuElement?.querySelectorAll(`.${NATIVE_CLASS}:not(.${INBOXSDK_CLASS})`) ?? []) {
|
|
17907
17955
|
// Gmail uses this listener for panel hover state activation. It's prevented from propagation and we handle UI updates
|
|
17908
17956
|
const buttonElement = nativeMenuItem.querySelector('.V6.CL');
|
|
@@ -17936,7 +17984,7 @@ class AppMenuItemView extends safe_event_emitter/* default */.A {
|
|
|
17936
17984
|
HOVER
|
|
17937
17985
|
} = GmailAppMenuItemView.elementCss;
|
|
17938
17986
|
function handleActivate() {
|
|
17939
|
-
const appMenuElement = gmail_element_getter/* default */.
|
|
17987
|
+
const appMenuElement = gmail_element_getter/* default */.Ay.getAppMenuContainer();
|
|
17940
17988
|
|
|
17941
17989
|
// deactivate menu items and handle keyboard accessibility
|
|
17942
17990
|
for (const menuItem_ of appMenuElement?.querySelectorAll(`.${NATIVE_CLASS}`) ?? []) {
|
|
@@ -17966,7 +18014,7 @@ class AppMenuItemView extends safe_event_emitter/* default */.A {
|
|
|
17966
18014
|
const panel = AppMenuItemView.#menuItemToPanelMap.get(menuItem);
|
|
17967
18015
|
const activeMenuItem = AppMenuItemView.getActiveMenuItem();
|
|
17968
18016
|
const activePanel = AppMenuItemView.getActivePanel();
|
|
17969
|
-
const burgerMenuOpen = gmail_element_getter/* default */.
|
|
18017
|
+
const burgerMenuOpen = gmail_element_getter/* default */.Ay.isAppBurgerMenuOpen();
|
|
17970
18018
|
|
|
17971
18019
|
// hover-styled panel is displayed for collapsed burger menu
|
|
17972
18020
|
if (activeMenuItem === menuItem && activePanel === panel && burgerMenuOpen) return;
|
|
@@ -18011,7 +18059,7 @@ class AppMenuItemView extends safe_event_emitter/* default */.A {
|
|
|
18011
18059
|
const activePanel = AppMenuItemView.getActivePanel();
|
|
18012
18060
|
const activeMenuItemPanel = activeMenuItem && AppMenuItemView.#menuItemToPanelMap.get(activeMenuItem);
|
|
18013
18061
|
if (mouseEvent.relatedTarget instanceof Node && (menuItem.contains(mouseEvent.relatedTarget) || activePanel?.contains(mouseEvent.relatedTarget))) return;
|
|
18014
|
-
const burgerMenuOpen = gmail_element_getter/* default */.
|
|
18062
|
+
const burgerMenuOpen = gmail_element_getter/* default */.Ay.isAppBurgerMenuOpen();
|
|
18015
18063
|
if (activePanel === activeMenuItemPanel && burgerMenuOpen) return;
|
|
18016
18064
|
|
|
18017
18065
|
// unhover menu item
|
|
@@ -18044,8 +18092,8 @@ class AppMenuItemView extends safe_event_emitter/* default */.A {
|
|
|
18044
18092
|
for (const panel of document.querySelectorAll(CollapsiblePanelView.elementSelectors.NATIVE) ?? []) {
|
|
18045
18093
|
panel.classList.toggle(CollapsiblePanelView.elementCss.PANEL_LESS, isPanelLess);
|
|
18046
18094
|
}
|
|
18047
|
-
gmail_element_getter/* default */.
|
|
18048
|
-
gmail_element_getter/* default */.
|
|
18095
|
+
gmail_element_getter/* default */.Ay.getAppMenu()?.classList.toggle('aTO', isPanelLess);
|
|
18096
|
+
gmail_element_getter/* default */.Ay.getAppHeader()?.classList.toggle('aTO', isPanelLess);
|
|
18049
18097
|
break;
|
|
18050
18098
|
}
|
|
18051
18099
|
case 'route-activated':
|
|
@@ -18111,7 +18159,7 @@ class AppMenuItemView extends safe_event_emitter/* default */.A {
|
|
|
18111
18159
|
const descriptor = {
|
|
18112
18160
|
...panelDescriptor,
|
|
18113
18161
|
className: classnames_default()(panelDescriptor.className, {
|
|
18114
|
-
[CollapsiblePanelView.elementCss.COLLAPSED]: !gmail_element_getter/* default */.
|
|
18162
|
+
[CollapsiblePanelView.elementCss.COLLAPSED]: !gmail_element_getter/* default */.Ay.isAppBurgerMenuOpen(),
|
|
18115
18163
|
[CollapsiblePanelView.elementCss.PANEL_LESS]: AppMenuItemView.#isPanelLess()
|
|
18116
18164
|
})
|
|
18117
18165
|
};
|
|
@@ -18224,7 +18272,7 @@ class AppMenu {
|
|
|
18224
18272
|
if (!isShown) {
|
|
18225
18273
|
return;
|
|
18226
18274
|
}
|
|
18227
|
-
const appMenu = await gmail_element_getter/* default */.
|
|
18275
|
+
const appMenu = await gmail_element_getter/* default */.Ay.getAppMenuAsync();
|
|
18228
18276
|
if (!appMenu) {
|
|
18229
18277
|
return;
|
|
18230
18278
|
}
|
|
@@ -18267,7 +18315,7 @@ class AppMenu {
|
|
|
18267
18315
|
* @returns whether or not the AppMenu Burger is uncollapsed or not.
|
|
18268
18316
|
*/
|
|
18269
18317
|
isMenuOpen() {
|
|
18270
|
-
return gmail_element_getter/* default */.
|
|
18318
|
+
return gmail_element_getter/* default */.Ay.isAppBurgerMenuOpen();
|
|
18271
18319
|
}
|
|
18272
18320
|
|
|
18273
18321
|
/**
|
|
@@ -18286,7 +18334,7 @@ class AppMenu {
|
|
|
18286
18334
|
* @returns true if the app menu is visible. At time of writing, this typically means they have chose to enable Chat, Meet, or both.
|
|
18287
18335
|
*/
|
|
18288
18336
|
async isShown() {
|
|
18289
|
-
const result = await gmail_element_getter/* default */.
|
|
18337
|
+
const result = await gmail_element_getter/* default */.Ay.getAppMenuAsync();
|
|
18290
18338
|
return !!result;
|
|
18291
18339
|
}
|
|
18292
18340
|
static #monitorInitialized = false;
|
|
@@ -18302,7 +18350,7 @@ class AppMenu {
|
|
|
18302
18350
|
return;
|
|
18303
18351
|
}
|
|
18304
18352
|
this.#monitorInitialized = true;
|
|
18305
|
-
kefir_esm["default"].fromPromise(gmail_element_getter/* default */.
|
|
18353
|
+
kefir_esm["default"].fromPromise(gmail_element_getter/* default */.Ay.getAppMenuAsync()).filter(isNotNil/* default */.A).flatMap(appMenu => (0,make_mutation_observer_chunked_stream/* default */.A)(appMenu, {
|
|
18306
18354
|
childList: true,
|
|
18307
18355
|
subtree: true,
|
|
18308
18356
|
attributes: true,
|
|
@@ -19860,7 +19908,7 @@ mole_view_module_options.insert = htmlElement => {
|
|
|
19860
19908
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
19861
19909
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
19862
19910
|
///@ts-ignore
|
|
19863
|
-
"2.2.
|
|
19911
|
+
"2.2.18-1784839996724-a8a6fe2c9e69b0e7");
|
|
19864
19912
|
document.head.append(htmlElement);
|
|
19865
19913
|
};
|
|
19866
19914
|
mole_view_module_options.domAPI = (styleDomAPI_default());
|
|
@@ -19873,6 +19921,105 @@ var mole_view_module_update = injectStylesIntoStyleTag_default()(mole_view_modul
|
|
|
19873
19921
|
|
|
19874
19922
|
/* harmony default export */ const widgets_mole_view_module = (mole_view_module/* default */.Ay && mole_view_module/* default */.Ay.locals ? mole_view_module/* default */.Ay.locals : undefined);
|
|
19875
19923
|
|
|
19924
|
+
;// CONCATENATED MODULE: ./src/platform-implementation-js/dom-driver/gmail/gmail-driver/sync-mole-spacer-with-right-column.ts
|
|
19925
|
+
|
|
19926
|
+
|
|
19927
|
+
|
|
19928
|
+
/**
|
|
19929
|
+
* Gmail keeps compose/SDK moles clear of the right side panel by widening a flex
|
|
19930
|
+
* spacer at the end of the mole container.
|
|
19931
|
+
*
|
|
19932
|
+
* Gmail drives that spacer for its OWN companion panels (Calendar, Keep, Tasks,
|
|
19933
|
+
* Contacts) but not for InboxSDK content panels, which render in the same
|
|
19934
|
+
* companion sidebar wrapper. So whenever the sidebar column resizes (or the
|
|
19935
|
+
* first mole appears) we match the spacer using Gmail's own formula — companion
|
|
19936
|
+
* content width + rail inset
|
|
19937
|
+
*/
|
|
19938
|
+
|
|
19939
|
+
const MOLE_SPACER_SELECTOR = `${gmail_element_getter/* MOLE_CONTAINER_SELECTOR */.MY} > .jAmAWb`;
|
|
19940
|
+
|
|
19941
|
+
/**
|
|
19942
|
+
* Dispatched by the mole driver whenever a mole is added. Creating a mole
|
|
19943
|
+
* doesn't resize the sidebar column, so our observer wouldn't otherwise fire.
|
|
19944
|
+
*/
|
|
19945
|
+
const MOLE_SPACER_REFRESH_EVENT = 'inboxsdk__refreshMoleSpacer';
|
|
19946
|
+
|
|
19947
|
+
/** Prevents multiple InboxSDK instances from each installing the observer. */
|
|
19948
|
+
const INSTALLED_ATTR = 'data-inboxsdk-mole-spacer-sync';
|
|
19949
|
+
|
|
19950
|
+
/**
|
|
19951
|
+
* The rail-inset width Gmail keeps on the spacer when only the icon rail is
|
|
19952
|
+
* showing. We hardcode it because there are cases where we
|
|
19953
|
+
* wouldn't be able to grab it from the DOM.
|
|
19954
|
+
*/
|
|
19955
|
+
const RAIL_INSET_WIDTH = 66;
|
|
19956
|
+
function syncMoleSpacerWithRightColumn(driver) {
|
|
19957
|
+
const ResizeObserver = __webpack_require__.g.ResizeObserver;
|
|
19958
|
+
if (!ResizeObserver) return;
|
|
19959
|
+
const root = document.documentElement;
|
|
19960
|
+
if (root.hasAttribute(INSTALLED_ATTR)) return;
|
|
19961
|
+
root.setAttribute(INSTALLED_ATTR, 'true');
|
|
19962
|
+
(0,wait_for/* default */.A)(() => gmail_element_getter/* default */.Ay.getCompanionSidebarColumnElement()).then(rightColumn => {
|
|
19963
|
+
let scheduled = false;
|
|
19964
|
+
// Coalesce bursts of mutations into a single read+write per frame so we
|
|
19965
|
+
// don't thrash layout with getBoundingClientRect on every notification.
|
|
19966
|
+
const update = () => {
|
|
19967
|
+
if (scheduled) return;
|
|
19968
|
+
scheduled = true;
|
|
19969
|
+
requestAnimationFrame(() => {
|
|
19970
|
+
scheduled = false;
|
|
19971
|
+
try {
|
|
19972
|
+
updateSpacer();
|
|
19973
|
+
} catch (err) {
|
|
19974
|
+
driver.getLogger().error(err);
|
|
19975
|
+
}
|
|
19976
|
+
});
|
|
19977
|
+
};
|
|
19978
|
+
|
|
19979
|
+
// Width changes when a panel opens/closes/resizes.
|
|
19980
|
+
new ResizeObserver(update).observe(rightColumn);
|
|
19981
|
+
|
|
19982
|
+
// A mole appearing (which also creates the spacer on the very first one)
|
|
19983
|
+
// doesn't touch the right column, so the mole driver signals us directly.
|
|
19984
|
+
document.addEventListener(MOLE_SPACER_REFRESH_EVENT, update);
|
|
19985
|
+
update();
|
|
19986
|
+
}).catch(() => {
|
|
19987
|
+
// No right column on this page (e.g. a Gmail surface without the side
|
|
19988
|
+
// panel). Nothing to keep the moles clear of.
|
|
19989
|
+
});
|
|
19990
|
+
}
|
|
19991
|
+
function updateSpacer() {
|
|
19992
|
+
// The mole container has two `.jAmAWb` flex spacers: the left one (index 0)
|
|
19993
|
+
// and the right one (last).
|
|
19994
|
+
const spacers = document.querySelectorAll(MOLE_SPACER_SELECTOR);
|
|
19995
|
+
const spacer = spacers[spacers.length - 1];
|
|
19996
|
+
// The spacer is part of the mole container, which Gmail loads lazily once a
|
|
19997
|
+
// compose/thread view has been used. Until it exists there is nothing to size.
|
|
19998
|
+
if (!spacer) return;
|
|
19999
|
+
const companion = gmail_element_getter/* default */.Ay.getCompanionSidebarOuterWrapperElement();
|
|
20000
|
+
// The wrapper stays in the DOM when collapsed (`display: none`); only count
|
|
20001
|
+
// it when a companion/SDK panel is actually showing.
|
|
20002
|
+
const companionWidth = companion && getComputedStyle(companion).display !== 'none' ? companion.getBoundingClientRect().width : 0;
|
|
20003
|
+
|
|
20004
|
+
// Match Gmail: content width + rail inset.
|
|
20005
|
+
// When no panel is open, companionWidth is 0 and we restore the rail inset
|
|
20006
|
+
const targetWidth = companionWidth > 0 ? companionWidth + RAIL_INSET_WIDTH : RAIL_INSET_WIDTH;
|
|
20007
|
+
const target = `${targetWidth}px`;
|
|
20008
|
+
if (spacer.style.width !== target) {
|
|
20009
|
+
spacer.style.width = target;
|
|
20010
|
+
refreshComposeToolbars();
|
|
20011
|
+
}
|
|
20012
|
+
}
|
|
20013
|
+
|
|
20014
|
+
/**
|
|
20015
|
+
* Widening the spacer moves the mole (`.AD`) but Gmail doesn't refresh the
|
|
20016
|
+
* `position: fixed; left` it pins on the compose bottom bar (`.aDj.ahe`), so the
|
|
20017
|
+
* toolbar is left behind at its old coordinates. A window resize makes Gmail
|
|
20018
|
+
* re-lay-out the compose toolbars back under the mole.
|
|
20019
|
+
*/
|
|
20020
|
+
function refreshComposeToolbars() {
|
|
20021
|
+
(0,fake_window_resize/* default */.A)();
|
|
20022
|
+
}
|
|
19876
20023
|
;// CONCATENATED MODULE: ./src/platform-implementation-js/dom-driver/gmail/widgets/gmail-mole-view-driver.ts
|
|
19877
20024
|
|
|
19878
20025
|
|
|
@@ -19885,7 +20032,26 @@ var mole_view_module_update = injectStylesIntoStyleTag_default()(mole_view_modul
|
|
|
19885
20032
|
|
|
19886
20033
|
|
|
19887
20034
|
|
|
20035
|
+
|
|
19888
20036
|
const gmail_mole_view_driver_INBOXSDK_CLASS = 'inboxsdk__mole_view';
|
|
20037
|
+
|
|
20038
|
+
/**
|
|
20039
|
+
* Compose and SDK mole selector.
|
|
20040
|
+
*
|
|
20041
|
+
* @note 2023-10-11 on :not selectors:
|
|
20042
|
+
*
|
|
20043
|
+
* style*="order: 2147483647;" is the left mole spacer.
|
|
20044
|
+
*
|
|
20045
|
+
* style*="order: 0;" is the right mole spacer.
|
|
20046
|
+
*
|
|
20047
|
+
* .aJl is the chat placeholder.
|
|
20048
|
+
*/
|
|
20049
|
+
const MOLE_SELECTOR = `${gmail_element_getter/* MOLE_PARENT_SELECTOR */.pG} > *:not([style*="order: 0;"], [style*="order: 2147483647;"], .aJl)`;
|
|
20050
|
+
const Selector = {
|
|
20051
|
+
Mole: MOLE_SELECTOR,
|
|
20052
|
+
ComposeMole: `${MOLE_SELECTOR}.nn.nH`,
|
|
20053
|
+
ChatMolePlaceholder: `${gmail_element_getter/* MOLE_PARENT_SELECTOR */.pG} > .aJl`
|
|
20054
|
+
};
|
|
19889
20055
|
class GmailMoleViewDriver {
|
|
19890
20056
|
static #page;
|
|
19891
20057
|
static #moleParentReadyEvent = kefir_bus_default()();
|
|
@@ -19910,22 +20076,22 @@ class GmailMoleViewDriver {
|
|
|
19910
20076
|
},
|
|
19911
20077
|
watchers: [{
|
|
19912
20078
|
tag: "mole",
|
|
19913
|
-
selectors: [
|
|
20079
|
+
selectors: [Selector.Mole],
|
|
19914
20080
|
sources: ["moleParent"]
|
|
19915
20081
|
}, {
|
|
19916
20082
|
tag: "moleParent",
|
|
19917
|
-
selectors: [
|
|
20083
|
+
selectors: [gmail_element_getter/* MOLE_PARENT_SELECTOR */.pG],
|
|
19918
20084
|
sources: [null]
|
|
19919
20085
|
}],
|
|
19920
20086
|
finders: {
|
|
19921
20087
|
["moleParent"]: {
|
|
19922
|
-
fn: root => [root.querySelector(
|
|
20088
|
+
fn: root => [root.querySelector(gmail_element_getter/* MOLE_PARENT_SELECTOR */.pG)].filter(isNotNil/* default */.A),
|
|
19923
20089
|
interval(elementCount, timeRunning) {
|
|
19924
20090
|
return timeRunning <= 15_000 && elementCount === 0 ? 100 : 5_000;
|
|
19925
20091
|
}
|
|
19926
20092
|
},
|
|
19927
20093
|
["mole"]: {
|
|
19928
|
-
fn: root => root.querySelectorAll(
|
|
20094
|
+
fn: root => root.querySelectorAll(Selector.Mole),
|
|
19929
20095
|
interval(elementCount, timeRunning) {
|
|
19930
20096
|
// For initial Gmail load, we want to prevent an issue where compose moles are reordered to the left SDK moles after 5 seconds when
|
|
19931
20097
|
//
|
|
@@ -19958,9 +20124,15 @@ class GmailMoleViewDriver {
|
|
|
19958
20124
|
case 'add':
|
|
19959
20125
|
{
|
|
19960
20126
|
const el = change.value.getValue();
|
|
19961
|
-
if (el.matches(
|
|
20127
|
+
if (el.matches(Selector.ComposeMole)) {
|
|
19962
20128
|
this.#maybeMoveMole(el);
|
|
19963
20129
|
}
|
|
20130
|
+
|
|
20131
|
+
// A new mole must clear whatever panel is open in the right column.
|
|
20132
|
+
// The spacer that does that lives outside the mole parent (and is
|
|
20133
|
+
// itself created alongside the first mole), so poke the sync that
|
|
20134
|
+
// sizes it — adding a mole doesn't resize the column on its own.
|
|
20135
|
+
document.dispatchEvent(new CustomEvent(MOLE_SPACER_REFRESH_EVENT));
|
|
19964
20136
|
break;
|
|
19965
20137
|
}
|
|
19966
20138
|
}
|
|
@@ -20059,7 +20231,7 @@ class GmailMoleViewDriver {
|
|
|
20059
20231
|
this.#driver.logger.error(new Error('Mole show invariant violated. `lastMole` is not an HTMLElement'));
|
|
20060
20232
|
return;
|
|
20061
20233
|
}
|
|
20062
|
-
const dw = moleParent.closest(
|
|
20234
|
+
const dw = moleParent.closest(gmail_element_getter/* MOLE_CONTAINER_SELECTOR */.MY);
|
|
20063
20235
|
if (dw) {
|
|
20064
20236
|
dw.classList.add('inboxsdk__moles_in_use', mole_view_module/* inboxsdkMolesInUse */.jq);
|
|
20065
20237
|
}
|
|
@@ -20077,7 +20249,7 @@ class GmailMoleViewDriver {
|
|
|
20077
20249
|
// If the gmail mode has settled, we've been loaded for 10 seconds, and
|
|
20078
20250
|
// we don't have the mole parent yet, then force the mole parent to load
|
|
20079
20251
|
// by opening a compose view and then closing it.
|
|
20080
|
-
kefir_esm.fromPromise(gmail_element_getter/* default */.
|
|
20252
|
+
kefir_esm.fromPromise(gmail_element_getter/* default */.Ay.waitForGmailModeToSettle()).flatMap(() => {
|
|
20081
20253
|
// delay until we've passed TimestampOnReady + 5 seconds
|
|
20082
20254
|
return this.#driver.delayToTimeAfterReady(5_000);
|
|
20083
20255
|
}).takeUntilBy(moleParentReadyEvent).takeUntilBy(this.#stopper).onValue(async () => {
|
|
@@ -21418,7 +21590,7 @@ class GmailNavItemView {
|
|
|
21418
21590
|
this._level = level || 0;
|
|
21419
21591
|
this._navItemNumber = ++NUMBER_OF_GMAIL_NAV_ITEM_VIEWS_CREATED;
|
|
21420
21592
|
this._orderGroup = orderGroup;
|
|
21421
|
-
this._isNewLeftNavParent = !gmail_element_getter/* default */.
|
|
21593
|
+
this._isNewLeftNavParent = !gmail_element_getter/* default */.Ay.shouldAddNavItemsInline() && this._level === 1;
|
|
21422
21594
|
this._element = this.#setupElement();
|
|
21423
21595
|
}
|
|
21424
21596
|
#setupElement(navItemDescriptor) {
|
|
@@ -21537,7 +21709,7 @@ class GmailNavItemView {
|
|
|
21537
21709
|
// nested items (i.e. the current item is of type GROUPER and we're in Gmailv2).
|
|
21538
21710
|
const indentationFactor = this._type === nav_item_types.GROUPER || this._isNewLeftNavParent ? this._level - 1 : this._level;
|
|
21539
21711
|
const element = gmailNavItemView.getElement();
|
|
21540
|
-
if (!gmail_element_getter/* default */.
|
|
21712
|
+
if (!gmail_element_getter/* default */.Ay.shouldAddNavItemsInline()) {
|
|
21541
21713
|
(0,querySelectorOrFail/* default */.A)(element, '.TN').style.marginLeft = 6 * indentationFactor + 'px';
|
|
21542
21714
|
} else {
|
|
21543
21715
|
(0,querySelectorOrFail/* default */.A)(element, '.TN').style.marginLeft = getLeftIndentationPaddingValue() * indentationFactor + 'px';
|
|
@@ -21629,7 +21801,7 @@ class GmailNavItemView {
|
|
|
21629
21801
|
hAlign: 'left',
|
|
21630
21802
|
vAlign: 'top'
|
|
21631
21803
|
};
|
|
21632
|
-
const container = gmail_element_getter/* default */.
|
|
21804
|
+
const container = gmail_element_getter/* default */.Ay.getLeftNavContainerElement();
|
|
21633
21805
|
if (!container) throw new Error('leftNavContainer not found');
|
|
21634
21806
|
buttonOptions.dropdownShowFunction = event => {
|
|
21635
21807
|
// bhZ is the class to indicate the left nav is collapsible mode
|
|
@@ -22131,7 +22303,7 @@ async function addNavItem(driver, orderGroup, navItemDescriptor, navMenuInjectio
|
|
|
22131
22303
|
await waitForMenuReady();
|
|
22132
22304
|
const gmailNavItemView = new GmailNavItemView(driver, orderGroup, 1);
|
|
22133
22305
|
gmailNavItemView.setNavItemDescriptor(navItemDescriptor);
|
|
22134
|
-
if (!gmail_element_getter/* default */.
|
|
22306
|
+
if (!gmail_element_getter/* default */.Ay.isStandalone()) {
|
|
22135
22307
|
attachGmailNavItemView(gmailNavItemView, navMenuInjectionContainer);
|
|
22136
22308
|
}
|
|
22137
22309
|
return gmailNavItemView;
|
|
@@ -22140,7 +22312,7 @@ async function addNavItemToPanel(driver, orderGroup, navItemDescriptor, panelEle
|
|
|
22140
22312
|
await waitForMenuReady();
|
|
22141
22313
|
const gmailNavItemView = new GmailNavItemView(driver, orderGroup, 1);
|
|
22142
22314
|
gmailNavItemView.setNavItemDescriptor(navItemDescriptor);
|
|
22143
|
-
if (!gmail_element_getter/* default */.
|
|
22315
|
+
if (!gmail_element_getter/* default */.Ay.isStandalone()) {
|
|
22144
22316
|
if (gmailNavItemView.isSection()) {
|
|
22145
22317
|
const container = getPanelSectionNavItemContainerElement(panelElement);
|
|
22146
22318
|
attachGmailNavItemView(gmailNavItemView, container);
|
|
@@ -22152,14 +22324,14 @@ async function addNavItemToPanel(driver, orderGroup, navItemDescriptor, panelEle
|
|
|
22152
22324
|
return gmailNavItemView;
|
|
22153
22325
|
}
|
|
22154
22326
|
const waitForMenuReady = once_default()(async () => {
|
|
22155
|
-
const appMenu = await gmail_element_getter/* default */.
|
|
22327
|
+
const appMenu = await gmail_element_getter/* default */.Ay.getAppMenuAsync();
|
|
22156
22328
|
if (!appMenu) {
|
|
22157
22329
|
await waitForNavMenuReady();
|
|
22158
22330
|
}
|
|
22159
22331
|
});
|
|
22160
22332
|
const waitForNavMenuReady = once_default()(async () => {
|
|
22161
|
-
if (!gmail_element_getter/* default */.
|
|
22162
|
-
await gmail_element_getter/* default */.
|
|
22333
|
+
if (!gmail_element_getter/* default */.Ay.isStandalone()) {
|
|
22334
|
+
await gmail_element_getter/* default */.Ay.waitForGmailModeToSettle();
|
|
22163
22335
|
await (0,wait_for/* default */.A)(() => document.querySelector('.aeN[role=navigation], .aeN [role=navigation]'));
|
|
22164
22336
|
// Wait for contents of navmenu to load (needed to figure out if it's integrated gmail mode)
|
|
22165
22337
|
await (0,wait_for/* default */.A)(() => document.querySelector('.Ls77Lb.aZ6 > .pp'));
|
|
@@ -22171,12 +22343,12 @@ function _attachNavItemView(gmailNavItemView, navMenuInjectionContainer) {
|
|
|
22171
22343
|
(0,insert_element_in_order/* default */.A)(navMenuInjectionContainer, gmailNavItemView.getElement());
|
|
22172
22344
|
};
|
|
22173
22345
|
}
|
|
22174
|
-
if (!gmail_element_getter/* default */.
|
|
22346
|
+
if (!gmail_element_getter/* default */.Ay.shouldAddNavItemsInline()) {
|
|
22175
22347
|
// If we're in the modern (non-classic-hangouts) leftnav, then put
|
|
22176
22348
|
// the added nav items in a floating section at the bottom separate
|
|
22177
22349
|
// from the Mail section.
|
|
22178
22350
|
return function () {
|
|
22179
|
-
const navMenuInjectionContainer = gmail_element_getter/* default */.
|
|
22351
|
+
const navMenuInjectionContainer = gmail_element_getter/* default */.Ay.getSeparateSectionNavItemMenuInjectionContainer();
|
|
22180
22352
|
if (!navMenuInjectionContainer) {
|
|
22181
22353
|
throw new Error('should not happen');
|
|
22182
22354
|
}
|
|
@@ -22206,7 +22378,7 @@ function _createNavItemsHolder() {
|
|
|
22206
22378
|
const holder = document.createElement('div');
|
|
22207
22379
|
holder.setAttribute('class', 'LrBjie inboxsdk__navMenu');
|
|
22208
22380
|
holder.innerHTML = '<div class="TK"></div>';
|
|
22209
|
-
const navMenuInjectionContainer = gmail_element_getter/* default */.
|
|
22381
|
+
const navMenuInjectionContainer = gmail_element_getter/* default */.Ay.getSameSectionNavItemMenuInjectionContainer();
|
|
22210
22382
|
if (!navMenuInjectionContainer) throw new Error('should not happen');
|
|
22211
22383
|
navMenuInjectionContainer.insertBefore(holder, navMenuInjectionContainer.children[2]);
|
|
22212
22384
|
(0,make_mutation_observer_stream/* default */.A)(holder, {
|
|
@@ -22224,7 +22396,7 @@ function _createNavItemsHolder() {
|
|
|
22224
22396
|
|
|
22225
22397
|
|
|
22226
22398
|
async function addAppMenuItem(driver, menuItemDescriptor) {
|
|
22227
|
-
const appMenuInjectionContainer = await gmail_element_getter/* default */.
|
|
22399
|
+
const appMenuInjectionContainer = await gmail_element_getter/* default */.Ay.getAppMenuAsync();
|
|
22228
22400
|
const gmailAppMenuItemView = new GmailAppMenuItemView(driver, menuItemDescriptor);
|
|
22229
22401
|
try {
|
|
22230
22402
|
if (!appMenuInjectionContainer) return undefined;
|
|
@@ -22661,9 +22833,9 @@ function showCustomThreadList(driver, customRouteID, onActivate, params) {
|
|
|
22661
22833
|
let findIdFailure = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : _findIdFailure;
|
|
22662
22834
|
const uniqueSearch = setupSearchReplacing(driver, customRouteID, onActivate, findIdFailure);
|
|
22663
22835
|
const customHash = document.location.hash;
|
|
22664
|
-
const searchInput = gmail_element_getter/* default */.
|
|
22836
|
+
const searchInput = gmail_element_getter/* default */.Ay.getSearchInput();
|
|
22665
22837
|
if (!searchInput) throw new Error('could not find search input');
|
|
22666
|
-
const inputStream = gmail_element_getter/* default */.
|
|
22838
|
+
const inputStream = gmail_element_getter/* default */.Ay.getMainContentElementChangedStream().changes().take(1).map(() => searchInput).flatMapLatest(input => (0,make_mutation_observer_chunked_stream/* default */.A)(input, {
|
|
22667
22839
|
attributes: true,
|
|
22668
22840
|
attributeOldValue: true
|
|
22669
22841
|
}).filter(mutationRecords => {
|
|
@@ -22694,7 +22866,7 @@ var show_custom_route_view = __webpack_require__(3759);
|
|
|
22694
22866
|
|
|
22695
22867
|
|
|
22696
22868
|
function showNativeRouteView(_gmailDriver) {
|
|
22697
|
-
const contentSectionElement = gmail_element_getter/* default */.
|
|
22869
|
+
const contentSectionElement = gmail_element_getter/* default */.Ay.getContentSectionElement();
|
|
22698
22870
|
if (!contentSectionElement) {
|
|
22699
22871
|
return;
|
|
22700
22872
|
}
|
|
@@ -22792,10 +22964,10 @@ function registerSearchSuggestionsProvider(driver, handler) {
|
|
|
22792
22964
|
}).map(event => event.suggestions);
|
|
22793
22965
|
|
|
22794
22966
|
// Wait for the first routeViewDriver to happen before looking for the search box.
|
|
22795
|
-
const searchBoxStream = driver.getRouteViewDriverStream().toProperty(() => null).map(() => gmail_element_getter/* default */.
|
|
22967
|
+
const searchBoxStream = driver.getRouteViewDriverStream().toProperty(() => null).map(() => gmail_element_getter/* default */.Ay.getSearchInput()).filter(isNotNil/* default */.A).take(1);
|
|
22796
22968
|
|
|
22797
22969
|
// Wait for the search box to be focused before looking for the suggestions box.
|
|
22798
|
-
const suggestionsBoxTbodyStream = searchBoxStream.flatMapLatest(searchBox => kefir_esm.fromEvents(searchBox, 'focus')).map(() => gmail_element_getter/* default */.
|
|
22970
|
+
const suggestionsBoxTbodyStream = searchBoxStream.flatMapLatest(searchBox => kefir_esm.fromEvents(searchBox, 'focus')).map(() => gmail_element_getter/* default */.Ay.getSearchSuggestionsBoxParent()).filter(isNotNil/* default */.A).flatMapLatest(make_element_child_stream/* default */.A).map(x => x.el.firstElementChild).take(1).toProperty();
|
|
22799
22971
|
|
|
22800
22972
|
// This stream emits an event after every time Gmail changes the suggestions
|
|
22801
22973
|
// list.
|
|
@@ -23241,7 +23413,7 @@ function _createAppButtonElement(driver, onclick) {
|
|
|
23241
23413
|
event.preventDefault();
|
|
23242
23414
|
onclick(event);
|
|
23243
23415
|
});
|
|
23244
|
-
const topAccountContainer = gmail_element_getter/* default */.
|
|
23416
|
+
const topAccountContainer = gmail_element_getter/* default */.Ay.getTopAccountContainer();
|
|
23245
23417
|
if (!topAccountContainer) {
|
|
23246
23418
|
const err = new Error('Could not make button');
|
|
23247
23419
|
const banner = document.querySelector('[role=banner]');
|
|
@@ -23262,7 +23434,7 @@ function _createAppButtonElement(driver, onclick) {
|
|
|
23262
23434
|
throw err;
|
|
23263
23435
|
}
|
|
23264
23436
|
try {
|
|
23265
|
-
if (!gmail_element_getter/* default */.
|
|
23437
|
+
if (!gmail_element_getter/* default */.Ay.isGplusEnabled()) {
|
|
23266
23438
|
element.classList.add('inboxsdk__appButton_noGPlus');
|
|
23267
23439
|
}
|
|
23268
23440
|
insertionElement.insertBefore(element, insertionElement.lastElementChild);
|
|
@@ -23283,8 +23455,8 @@ function _updateTitle(element, descriptor) {
|
|
|
23283
23455
|
|
|
23284
23456
|
|
|
23285
23457
|
function addToolbarButtonForApp(gmailDriver, buttonDescriptor) {
|
|
23286
|
-
return gmail_element_getter/* default */.
|
|
23287
|
-
if (gmail_element_getter/* default */.
|
|
23458
|
+
return gmail_element_getter/* default */.Ay.waitForGmailModeToSettle().then(() => {
|
|
23459
|
+
if (gmail_element_getter/* default */.Ay.isStandalone()) {
|
|
23288
23460
|
return new Promise((_resolve, _reject) => {
|
|
23289
23461
|
//never complete
|
|
23290
23462
|
});
|
|
@@ -23423,7 +23595,7 @@ function setupRouteViewDriverStream(gmailRouteProcessor, driver) {
|
|
|
23423
23595
|
// getMainContentElementChangedStream doesn't respect custom views so filter
|
|
23424
23596
|
// out events from it. This filter is needed if the user is already at a custom
|
|
23425
23597
|
// view of another InboxSDK instance while this starts up.
|
|
23426
|
-
gmail_element_getter/* default */.
|
|
23598
|
+
gmail_element_getter/* default */.Ay.getMainContentElementChangedStream().map(_event => ({
|
|
23427
23599
|
urlObject: getURLObject(document.location.href),
|
|
23428
23600
|
type: 'NATIVE'
|
|
23429
23601
|
})).filter(options => gmailRouteProcessor.isNativeRoute(options.urlObject.name))]).map(options => {
|
|
@@ -23434,7 +23606,7 @@ function setupRouteViewDriverStream(gmailRouteProcessor, driver) {
|
|
|
23434
23606
|
if (type === 'NATIVE' && urlObject.name === 'search') {
|
|
23435
23607
|
const customListRouteId = customListSearchStringsToRouteIds.get(urlObject.params[0]);
|
|
23436
23608
|
if (customListRouteId) {
|
|
23437
|
-
const searchInput = gmail_element_getter/* default */.
|
|
23609
|
+
const searchInput = gmail_element_getter/* default */.Ay.getSearchInput();
|
|
23438
23610
|
if (!searchInput) throw new Error('Should not happen');
|
|
23439
23611
|
searchInput.value = '';
|
|
23440
23612
|
|
|
@@ -23734,7 +23906,7 @@ class NativeGmailNavItemView {
|
|
|
23734
23906
|
|
|
23735
23907
|
function getNativeNavItem(driver, label) {
|
|
23736
23908
|
return (0,wait_for/* default */.A)(() => {
|
|
23737
|
-
const navContainer = gmail_element_getter/* default */.
|
|
23909
|
+
const navContainer = gmail_element_getter/* default */.Ay.getLeftNavContainerElement();
|
|
23738
23910
|
if (!navContainer) return null;
|
|
23739
23911
|
return navContainer.querySelector(`.aim a[href*="#${label}"]`);
|
|
23740
23912
|
}, 300 * 1000).then(labelLinkElement => {
|
|
@@ -23747,7 +23919,7 @@ function getNativeNavItem(driver, label) {
|
|
|
23747
23919
|
}
|
|
23748
23920
|
return labelElement.__nativeGmailNavItemView;
|
|
23749
23921
|
}).catch(err => {
|
|
23750
|
-
if (gmail_element_getter/* default */.
|
|
23922
|
+
if (gmail_element_getter/* default */.Ay.isStandalone()) {
|
|
23751
23923
|
// never resolve
|
|
23752
23924
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
23753
23925
|
return new Promise((_resolve, _reject) => {});
|
|
@@ -23846,14 +24018,14 @@ function registerSearchQueryRewriter(pageCommunicator, obj) {
|
|
|
23846
24018
|
|
|
23847
24019
|
|
|
23848
24020
|
async function openComposeWindow(_gmailDriver) {
|
|
23849
|
-
await gmail_element_getter/* default */.
|
|
23850
|
-
if (gmail_element_getter/* default */.
|
|
24021
|
+
await gmail_element_getter/* default */.Ay.waitForGmailModeToSettle();
|
|
24022
|
+
if (gmail_element_getter/* default */.Ay.isStandaloneComposeWindow() || gmail_element_getter/* default */.Ay.isStandaloneThreadWindow()) {
|
|
23851
24023
|
throw new Error('Can not open new compose while in standalone window');
|
|
23852
24024
|
}
|
|
23853
|
-
if (!gmail_element_getter/* default */.
|
|
23854
|
-
await (0,wait_for/* default */.A)(() => !!gmail_element_getter/* default */.
|
|
24025
|
+
if (!gmail_element_getter/* default */.Ay.getComposeButton()) {
|
|
24026
|
+
await (0,wait_for/* default */.A)(() => !!gmail_element_getter/* default */.Ay.getComposeButton());
|
|
23855
24027
|
}
|
|
23856
|
-
const composeButton = gmail_element_getter/* default */.
|
|
24028
|
+
const composeButton = gmail_element_getter/* default */.Ay.getComposeButton();
|
|
23857
24029
|
if (!composeButton) throw new Error('Could not find compose button');
|
|
23858
24030
|
(0,simulate_mouse_event/* simulateClick */.jp)(composeButton);
|
|
23859
24031
|
}
|
|
@@ -23865,7 +24037,7 @@ var gmail_app_sidebar_view = __webpack_require__(2893);
|
|
|
23865
24037
|
|
|
23866
24038
|
|
|
23867
24039
|
function suppressAddon(driver, addonTitle) {
|
|
23868
|
-
(0,stream_wait_for/* default */.A)(() => gmail_element_getter/* default */.
|
|
24040
|
+
(0,stream_wait_for/* default */.A)(() => gmail_element_getter/* default */.Ay.getCompanionSidebarIconContainerElement()).map(iconContainerElement => {
|
|
23869
24041
|
// .J-KU-Jg is pre-2018-07-30 element?
|
|
23870
24042
|
const elementToWatch = iconContainerElement.querySelector('.J-KU-Jg, [role=tablist], .brC-bsf-aT5-aOt');
|
|
23871
24043
|
if (!elementToWatch) {
|
|
@@ -24126,6 +24298,7 @@ function parseListPeopleByKnownIdResponse(data) {
|
|
|
24126
24298
|
|
|
24127
24299
|
|
|
24128
24300
|
|
|
24301
|
+
|
|
24129
24302
|
|
|
24130
24303
|
|
|
24131
24304
|
/**
|
|
@@ -24244,6 +24417,7 @@ class GmailDriver {
|
|
|
24244
24417
|
gmailLoadEvent(this);
|
|
24245
24418
|
(0,override_gmail_back_button/* default */.A)(this, this.#gmailRouteProcessor);
|
|
24246
24419
|
trackGmailStyles();
|
|
24420
|
+
syncMoleSpacerWithRightColumn(this);
|
|
24247
24421
|
temporaryTrackDownloadUrlValidity(this);
|
|
24248
24422
|
if (opts.suppressAddonTitle != null) {
|
|
24249
24423
|
suppressAddon(this, opts.suppressAddonTitle);
|
|
@@ -24554,7 +24728,7 @@ class GmailDriver {
|
|
|
24554
24728
|
}
|
|
24555
24729
|
setShowNativeNavMarker(isNative) {
|
|
24556
24730
|
this.#navMarkerHiddenChanged.emit(null);
|
|
24557
|
-
const leftNavContainerElement = gmail_element_getter/* default */.
|
|
24731
|
+
const leftNavContainerElement = gmail_element_getter/* default */.Ay.getLeftNavContainerElement();
|
|
24558
24732
|
if (leftNavContainerElement) {
|
|
24559
24733
|
if (isNative) {
|
|
24560
24734
|
leftNavContainerElement.classList.remove('inboxsdk__hide_native_marker');
|
|
@@ -24568,8 +24742,8 @@ class GmailDriver {
|
|
|
24568
24742
|
}
|
|
24569
24743
|
setShowNativeAddonSidebar(isNative) {
|
|
24570
24744
|
this.#addonSidebarHiddenChanged.emit(null);
|
|
24571
|
-
const addonContainerElement = gmail_element_getter/* default */.
|
|
24572
|
-
const mainContentBodyContainerElement = gmail_element_getter/* default */.
|
|
24745
|
+
const addonContainerElement = gmail_element_getter/* default */.Ay.getAddonSidebarContainerElement();
|
|
24746
|
+
const mainContentBodyContainerElement = gmail_element_getter/* default */.Ay.getMainContentBodyContainerElement();
|
|
24573
24747
|
if (addonContainerElement && mainContentBodyContainerElement) {
|
|
24574
24748
|
const parent = mainContentBodyContainerElement.parentElement;
|
|
24575
24749
|
if (!parent) return;
|
|
@@ -24680,12 +24854,12 @@ class GmailDriver {
|
|
|
24680
24854
|
return appSidebar.addGlobalSidebarContentPanel(descriptor);
|
|
24681
24855
|
}
|
|
24682
24856
|
waitForGlobalSidebarReady() {
|
|
24683
|
-
const condition = () => gmail_element_getter/* default */.
|
|
24857
|
+
const condition = () => gmail_element_getter/* default */.Ay.getCompanionSidebarContentContainerElement() && (gmail_element_getter/* default */.Ay.getCompanionSidebarIconContainerElement() || gmail_element_getter/* default */.Ay.getAddonSidebarContainerElement());
|
|
24684
24858
|
if (condition()) {
|
|
24685
24859
|
return kefir_esm.constant(undefined);
|
|
24686
24860
|
}
|
|
24687
24861
|
return (0,stream_wait_for/* default */.A)(condition).map(() => undefined).mapErrors(err => {
|
|
24688
|
-
const el =
|
|
24862
|
+
const el = gmail_element_getter/* default */.Ay.getCompanionSidebarColumnElement();
|
|
24689
24863
|
this.#logger.error(err, {
|
|
24690
24864
|
reason: 'waitForGlobalSidebarReady timed out',
|
|
24691
24865
|
aUxHtml: el ? (0,censorHTMLtree/* default */.A)(el) : null
|
|
@@ -24696,7 +24870,7 @@ class GmailDriver {
|
|
|
24696
24870
|
getGlobalSidebar() {
|
|
24697
24871
|
let appSidebarView = this.#appSidebarView;
|
|
24698
24872
|
if (!appSidebarView) {
|
|
24699
|
-
const companionSidebarContentContainerEl = gmail_element_getter/* default */.
|
|
24873
|
+
const companionSidebarContentContainerEl = gmail_element_getter/* default */.Ay.getCompanionSidebarContentContainerElement();
|
|
24700
24874
|
if (!companionSidebarContentContainerEl) throw new Error('did not find companionSidebarContentContainerEl');
|
|
24701
24875
|
appSidebarView = this.#appSidebarView = new gmail_app_sidebar_view/* default */.A(this, companionSidebarContentContainerEl);
|
|
24702
24876
|
}
|