@inboxsdk/core 2.2.17 → 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 +276 -106
- 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/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 {
|
|
@@ -10336,7 +10380,7 @@ options.insert = htmlElement => {
|
|
|
10336
10380
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
10337
10381
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
10338
10382
|
///@ts-ignore
|
|
10339
|
-
"2.2.
|
|
10383
|
+
"2.2.18-1784839996724-a8a6fe2c9e69b0e7");
|
|
10340
10384
|
document.head.append(htmlElement);
|
|
10341
10385
|
};
|
|
10342
10386
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -11480,7 +11524,7 @@ if (!globalThis.__InboxSDKImpLoader) {
|
|
|
11480
11524
|
await onready;
|
|
11481
11525
|
const {
|
|
11482
11526
|
makePlatformImplementation
|
|
11483
|
-
} = await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
11527
|
+
} = await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3948));
|
|
11484
11528
|
return makePlatformImplementation(appId, opts, {
|
|
11485
11529
|
piMainStarted,
|
|
11486
11530
|
piLoadStarted,
|
|
@@ -11629,7 +11673,7 @@ class Keyboard {
|
|
|
11629
11673
|
|
|
11630
11674
|
/***/ }),
|
|
11631
11675
|
|
|
11632
|
-
/***/
|
|
11676
|
+
/***/ 3948:
|
|
11633
11677
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
11634
11678
|
|
|
11635
11679
|
"use strict";
|
|
@@ -14067,7 +14111,7 @@ class GmailToolbarView {
|
|
|
14067
14111
|
}
|
|
14068
14112
|
}
|
|
14069
14113
|
_addToOpenMoreMenu(buttonDescriptor) {
|
|
14070
|
-
const moreMenu = gmail_element_getter/* default */.
|
|
14114
|
+
const moreMenu = gmail_element_getter/* default */.Ay.getActiveMoreMenu();
|
|
14071
14115
|
if (!moreMenu) {
|
|
14072
14116
|
return;
|
|
14073
14117
|
}
|
|
@@ -14724,7 +14768,7 @@ class GmailThreadView {
|
|
|
14724
14768
|
async #logAddonElementInfo() {
|
|
14725
14769
|
if (hasLoggedAddonInfo) return;
|
|
14726
14770
|
function readInfo() {
|
|
14727
|
-
const container = gmail_element_getter/* default */.
|
|
14771
|
+
const container = gmail_element_getter/* default */.Ay.getAddonSidebarContainerElement();
|
|
14728
14772
|
if (!container) return null;
|
|
14729
14773
|
const isDisplayNone = {
|
|
14730
14774
|
parent: container.parentElement ? container.parentElement.style.display === 'none' : null,
|
|
@@ -15098,7 +15142,7 @@ options.insert = htmlElement => {
|
|
|
15098
15142
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
15099
15143
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
15100
15144
|
///@ts-ignore
|
|
15101
|
-
"2.2.
|
|
15145
|
+
"2.2.18-1784839996724-a8a6fe2c9e69b0e7");
|
|
15102
15146
|
document.head.append(htmlElement);
|
|
15103
15147
|
};
|
|
15104
15148
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -15975,7 +16019,7 @@ class GmailRouteView {
|
|
|
15975
16019
|
this._setCustomViewElementHeight();
|
|
15976
16020
|
}
|
|
15977
16021
|
_monitorLeftNavHeight() {
|
|
15978
|
-
var leftNav = gmail_element_getter/* default */.
|
|
16022
|
+
var leftNav = gmail_element_getter/* default */.Ay.getLeftNavHeightElement();
|
|
15979
16023
|
if (!leftNav) {
|
|
15980
16024
|
return;
|
|
15981
16025
|
}
|
|
@@ -15987,11 +16031,11 @@ class GmailRouteView {
|
|
|
15987
16031
|
});
|
|
15988
16032
|
}
|
|
15989
16033
|
_setCustomViewElementHeight() {
|
|
15990
|
-
const leftNav = gmail_element_getter/* default */.
|
|
15991
|
-
const gtalkButtons = gmail_element_getter/* default */.
|
|
16034
|
+
const leftNav = gmail_element_getter/* default */.Ay.getLeftNavHeightElement();
|
|
16035
|
+
const gtalkButtons = gmail_element_getter/* default */.Ay.getGtalkButtons();
|
|
15992
16036
|
const customViewEl = this._customViewElement;
|
|
15993
16037
|
if (!leftNav || !customViewEl) throw new Error('Should not happen');
|
|
15994
|
-
const contentSectionElement = gmail_element_getter/* default */.
|
|
16038
|
+
const contentSectionElement = gmail_element_getter/* default */.Ay.getContentSectionElement();
|
|
15995
16039
|
const contentSectionElementBottomMargin = contentSectionElement ? parseInt(getComputedStyle(contentSectionElement).marginBottom, 10) : 0;
|
|
15996
16040
|
customViewEl.style.height = `${parseInt(leftNav.style.height, 10) + (gtalkButtons ? gtalkButtons.offsetHeight : 0) - contentSectionElementBottomMargin}px`;
|
|
15997
16041
|
}
|
|
@@ -16066,7 +16110,7 @@ class GmailRouteView {
|
|
|
16066
16110
|
threadContainerElement
|
|
16067
16111
|
};
|
|
16068
16112
|
}
|
|
16069
|
-
const previewPaneContainerElement = gmail_element_getter/* default */.
|
|
16113
|
+
const previewPaneContainerElement = gmail_element_getter/* default */.Ay.getPreviewPaneContainerElement();
|
|
16070
16114
|
if (previewPaneContainerElement) {
|
|
16071
16115
|
return {
|
|
16072
16116
|
previewPaneContainerElement
|
|
@@ -16097,7 +16141,7 @@ class GmailRouteView {
|
|
|
16097
16141
|
}
|
|
16098
16142
|
_setupScrollStream() {
|
|
16099
16143
|
const SCROLL_DEBOUNCE_MS = 100;
|
|
16100
|
-
const scrollContainer = gmail_element_getter/* default */.
|
|
16144
|
+
const scrollContainer = gmail_element_getter/* default */.Ay.getScrollContainer();
|
|
16101
16145
|
const {
|
|
16102
16146
|
scrollTop: cachedScrollTop
|
|
16103
16147
|
} = this._cachedRouteData;
|
|
@@ -16320,7 +16364,7 @@ class GmailRouteView {
|
|
|
16320
16364
|
|
|
16321
16365
|
// Used to click gmail refresh button in thread lists
|
|
16322
16366
|
refresh() {
|
|
16323
|
-
var el = gmail_element_getter/* default */.
|
|
16367
|
+
var el = gmail_element_getter/* default */.Ay.getToolbarElement().querySelector('div.T-I.nu');
|
|
16324
16368
|
if (el) {
|
|
16325
16369
|
var prevActive = document.activeElement;
|
|
16326
16370
|
var prevClassName = el.className;
|
|
@@ -16343,7 +16387,7 @@ class GmailRouteView {
|
|
|
16343
16387
|
return routeID.split('/').filter(part => part[0] === ':').map(part => part.substring(1));
|
|
16344
16388
|
}
|
|
16345
16389
|
_getThreadContainerElement() {
|
|
16346
|
-
return gmail_element_getter/* default */.
|
|
16390
|
+
return gmail_element_getter/* default */.Ay.getThreadContainerElement();
|
|
16347
16391
|
}
|
|
16348
16392
|
}
|
|
16349
16393
|
/* harmony default export */ const gmail_route_view = (GmailRouteView);
|
|
@@ -17211,7 +17255,7 @@ function isBodyDarkTheme() {
|
|
|
17211
17255
|
}
|
|
17212
17256
|
const stylesStream = kefir_bus_default()();
|
|
17213
17257
|
async function trackGmailStyles() {
|
|
17214
|
-
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()) {
|
|
17215
17259
|
return;
|
|
17216
17260
|
}
|
|
17217
17261
|
document.head.setAttribute('data-inboxsdk-gmail-style-tracker', 'true');
|
|
@@ -17365,7 +17409,7 @@ class GmailAppMenuItemView extends events.EventEmitter {
|
|
|
17365
17409
|
iconClassName
|
|
17366
17410
|
} = this.#menuItemDescriptor ?? {};
|
|
17367
17411
|
if (iconUrl) {
|
|
17368
|
-
const rawTheme = gmail_element_getter/* default */.
|
|
17412
|
+
const rawTheme = gmail_element_getter/* default */.Ay.isDarkTheme() ? iconUrl.darkTheme : iconUrl.lightTheme;
|
|
17369
17413
|
if (!rawTheme) return;
|
|
17370
17414
|
const theme = typeof rawTheme === 'string' ? rawTheme : rawTheme.default;
|
|
17371
17415
|
const activeImg = typeof rawTheme === 'string' ? rawTheme : rawTheme.active;
|
|
@@ -17533,7 +17577,7 @@ class CollapsiblePanelView extends safe_event_emitter/* default */.A {
|
|
|
17533
17577
|
if (!iconUrl) {
|
|
17534
17578
|
return;
|
|
17535
17579
|
}
|
|
17536
|
-
const theme = gmail_element_getter/* default */.
|
|
17580
|
+
const theme = gmail_element_getter/* default */.Ay.isDarkTheme() ? iconUrl.darkTheme : iconUrl.lightTheme;
|
|
17537
17581
|
if (!theme) {
|
|
17538
17582
|
return;
|
|
17539
17583
|
}
|
|
@@ -17679,7 +17723,7 @@ async function addCollapsiblePanel(driver, panelDescriptor, insertIndex) {
|
|
|
17679
17723
|
const injectionContainer = await waitForAppMenuParentReady();
|
|
17680
17724
|
const collapsiblePanelView = new CollapsiblePanelView(driver, panelDescriptor);
|
|
17681
17725
|
if (!injectionContainer || !collapsiblePanelView.element) return;
|
|
17682
|
-
const appMenu = await gmail_element_getter/* default */.
|
|
17726
|
+
const appMenu = await gmail_element_getter/* default */.Ay.getAppMenuAsync();
|
|
17683
17727
|
if (!appMenu) return;
|
|
17684
17728
|
const panelNodes = injectionContainer.querySelectorAll(CollapsiblePanelView.elementSelectors.NATIVE) ?? [];
|
|
17685
17729
|
const siblingElement = Number.isInteger(insertIndex) ? panelNodes[insertIndex] ?? null : null;
|
|
@@ -17691,9 +17735,9 @@ async function addCollapsiblePanel(driver, panelDescriptor, insertIndex) {
|
|
|
17691
17735
|
return collapsiblePanelView;
|
|
17692
17736
|
}
|
|
17693
17737
|
const waitForAppMenuParentReady = once_default()(async () => {
|
|
17694
|
-
if (!gmail_element_getter/* default */.
|
|
17738
|
+
if (!gmail_element_getter/* default */.Ay.isStandalone()) {
|
|
17695
17739
|
try {
|
|
17696
|
-
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());
|
|
17697
17741
|
return menuParentElement;
|
|
17698
17742
|
} catch (e) {
|
|
17699
17743
|
lib_logger/* default */.A.error(e);
|
|
@@ -17747,13 +17791,13 @@ class AppMenuItemView extends safe_event_emitter/* default */.A {
|
|
|
17747
17791
|
static #menuItemToPanelMap = new Map();
|
|
17748
17792
|
static #appMenuItemViews = new Set();
|
|
17749
17793
|
static getAllPanels() {
|
|
17750
|
-
const appMenuElement = gmail_element_getter/* default */.
|
|
17794
|
+
const appMenuElement = gmail_element_getter/* default */.Ay.getAppMenuContainer();
|
|
17751
17795
|
const nativePanels = appMenuElement?.querySelectorAll(`.${collapsible_panel_view_NATIVE_CLASS}`);
|
|
17752
17796
|
return Array.from(nativePanels ?? []);
|
|
17753
17797
|
}
|
|
17754
17798
|
static getActivePanel() {
|
|
17755
17799
|
let useSdkActiveSelector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
17756
|
-
const appMenuElement = gmail_element_getter/* default */.
|
|
17800
|
+
const appMenuElement = gmail_element_getter/* default */.Ay.getAppMenuContainer();
|
|
17757
17801
|
const {
|
|
17758
17802
|
ACTIVE,
|
|
17759
17803
|
SDK_ACTIVE
|
|
@@ -17782,11 +17826,11 @@ class AppMenuItemView extends safe_event_emitter/* default */.A {
|
|
|
17782
17826
|
return element.classList.contains(NATIVE_CLASS);
|
|
17783
17827
|
}
|
|
17784
17828
|
static getAllMenuItems() {
|
|
17785
|
-
const appMenuElement = gmail_element_getter/* default */.
|
|
17829
|
+
const appMenuElement = gmail_element_getter/* default */.Ay.getAppMenuContainer();
|
|
17786
17830
|
return Array.from(appMenuElement?.querySelectorAll(`.${NATIVE_CLASS}`) ?? []);
|
|
17787
17831
|
}
|
|
17788
17832
|
static getActiveMenuItem() {
|
|
17789
|
-
const appMenuElement = gmail_element_getter/* default */.
|
|
17833
|
+
const appMenuElement = gmail_element_getter/* default */.Ay.getAppMenuContainer();
|
|
17790
17834
|
const {
|
|
17791
17835
|
ACTIVE,
|
|
17792
17836
|
SDK_ACTIVE
|
|
@@ -17816,7 +17860,7 @@ class AppMenuItemView extends safe_event_emitter/* default */.A {
|
|
|
17816
17860
|
}
|
|
17817
17861
|
static #adjustTooltipNub() {
|
|
17818
17862
|
// adjust all menu items' collapsible panel's tooltip nub position
|
|
17819
|
-
const appMenuElement = gmail_element_getter/* default */.
|
|
17863
|
+
const appMenuElement = gmail_element_getter/* default */.Ay.getAppMenu();
|
|
17820
17864
|
for (const menuItem of appMenuElement?.querySelectorAll(`.${NATIVE_CLASS}`) ?? []) {
|
|
17821
17865
|
const panel = AppMenuItemView.#menuItemToPanelMap.get(menuItem);
|
|
17822
17866
|
if (!panel) continue;
|
|
@@ -17887,7 +17931,7 @@ class AppMenuItemView extends safe_event_emitter/* default */.A {
|
|
|
17887
17931
|
});
|
|
17888
17932
|
}
|
|
17889
17933
|
static #_ = async function init() {
|
|
17890
|
-
const gmailAppMenu = await gmail_element_getter/* default */.
|
|
17934
|
+
const gmailAppMenu = await gmail_element_getter/* default */.Ay.getAppMenuAsync();
|
|
17891
17935
|
if (!gmailAppMenu) {
|
|
17892
17936
|
return;
|
|
17893
17937
|
}
|
|
@@ -17906,7 +17950,7 @@ class AppMenuItemView extends safe_event_emitter/* default */.A {
|
|
|
17906
17950
|
// Set up event listeners we use to control menu UI
|
|
17907
17951
|
// We intercept some events emitted on Gmail (native) menu items to gain full control of the menu (menu items and panels).
|
|
17908
17952
|
// Thus, some native event handlers won't be invoked so we replicate the Gmail's behavior by ourselves.
|
|
17909
|
-
const appMenuElement = gmail_element_getter/* default */.
|
|
17953
|
+
const appMenuElement = gmail_element_getter/* default */.Ay.getAppMenuContainer();
|
|
17910
17954
|
for (const nativeMenuItem of appMenuElement?.querySelectorAll(`.${NATIVE_CLASS}:not(.${INBOXSDK_CLASS})`) ?? []) {
|
|
17911
17955
|
// Gmail uses this listener for panel hover state activation. It's prevented from propagation and we handle UI updates
|
|
17912
17956
|
const buttonElement = nativeMenuItem.querySelector('.V6.CL');
|
|
@@ -17940,7 +17984,7 @@ class AppMenuItemView extends safe_event_emitter/* default */.A {
|
|
|
17940
17984
|
HOVER
|
|
17941
17985
|
} = GmailAppMenuItemView.elementCss;
|
|
17942
17986
|
function handleActivate() {
|
|
17943
|
-
const appMenuElement = gmail_element_getter/* default */.
|
|
17987
|
+
const appMenuElement = gmail_element_getter/* default */.Ay.getAppMenuContainer();
|
|
17944
17988
|
|
|
17945
17989
|
// deactivate menu items and handle keyboard accessibility
|
|
17946
17990
|
for (const menuItem_ of appMenuElement?.querySelectorAll(`.${NATIVE_CLASS}`) ?? []) {
|
|
@@ -17970,7 +18014,7 @@ class AppMenuItemView extends safe_event_emitter/* default */.A {
|
|
|
17970
18014
|
const panel = AppMenuItemView.#menuItemToPanelMap.get(menuItem);
|
|
17971
18015
|
const activeMenuItem = AppMenuItemView.getActiveMenuItem();
|
|
17972
18016
|
const activePanel = AppMenuItemView.getActivePanel();
|
|
17973
|
-
const burgerMenuOpen = gmail_element_getter/* default */.
|
|
18017
|
+
const burgerMenuOpen = gmail_element_getter/* default */.Ay.isAppBurgerMenuOpen();
|
|
17974
18018
|
|
|
17975
18019
|
// hover-styled panel is displayed for collapsed burger menu
|
|
17976
18020
|
if (activeMenuItem === menuItem && activePanel === panel && burgerMenuOpen) return;
|
|
@@ -18015,7 +18059,7 @@ class AppMenuItemView extends safe_event_emitter/* default */.A {
|
|
|
18015
18059
|
const activePanel = AppMenuItemView.getActivePanel();
|
|
18016
18060
|
const activeMenuItemPanel = activeMenuItem && AppMenuItemView.#menuItemToPanelMap.get(activeMenuItem);
|
|
18017
18061
|
if (mouseEvent.relatedTarget instanceof Node && (menuItem.contains(mouseEvent.relatedTarget) || activePanel?.contains(mouseEvent.relatedTarget))) return;
|
|
18018
|
-
const burgerMenuOpen = gmail_element_getter/* default */.
|
|
18062
|
+
const burgerMenuOpen = gmail_element_getter/* default */.Ay.isAppBurgerMenuOpen();
|
|
18019
18063
|
if (activePanel === activeMenuItemPanel && burgerMenuOpen) return;
|
|
18020
18064
|
|
|
18021
18065
|
// unhover menu item
|
|
@@ -18048,8 +18092,8 @@ class AppMenuItemView extends safe_event_emitter/* default */.A {
|
|
|
18048
18092
|
for (const panel of document.querySelectorAll(CollapsiblePanelView.elementSelectors.NATIVE) ?? []) {
|
|
18049
18093
|
panel.classList.toggle(CollapsiblePanelView.elementCss.PANEL_LESS, isPanelLess);
|
|
18050
18094
|
}
|
|
18051
|
-
gmail_element_getter/* default */.
|
|
18052
|
-
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);
|
|
18053
18097
|
break;
|
|
18054
18098
|
}
|
|
18055
18099
|
case 'route-activated':
|
|
@@ -18115,7 +18159,7 @@ class AppMenuItemView extends safe_event_emitter/* default */.A {
|
|
|
18115
18159
|
const descriptor = {
|
|
18116
18160
|
...panelDescriptor,
|
|
18117
18161
|
className: classnames_default()(panelDescriptor.className, {
|
|
18118
|
-
[CollapsiblePanelView.elementCss.COLLAPSED]: !gmail_element_getter/* default */.
|
|
18162
|
+
[CollapsiblePanelView.elementCss.COLLAPSED]: !gmail_element_getter/* default */.Ay.isAppBurgerMenuOpen(),
|
|
18119
18163
|
[CollapsiblePanelView.elementCss.PANEL_LESS]: AppMenuItemView.#isPanelLess()
|
|
18120
18164
|
})
|
|
18121
18165
|
};
|
|
@@ -18228,7 +18272,7 @@ class AppMenu {
|
|
|
18228
18272
|
if (!isShown) {
|
|
18229
18273
|
return;
|
|
18230
18274
|
}
|
|
18231
|
-
const appMenu = await gmail_element_getter/* default */.
|
|
18275
|
+
const appMenu = await gmail_element_getter/* default */.Ay.getAppMenuAsync();
|
|
18232
18276
|
if (!appMenu) {
|
|
18233
18277
|
return;
|
|
18234
18278
|
}
|
|
@@ -18271,7 +18315,7 @@ class AppMenu {
|
|
|
18271
18315
|
* @returns whether or not the AppMenu Burger is uncollapsed or not.
|
|
18272
18316
|
*/
|
|
18273
18317
|
isMenuOpen() {
|
|
18274
|
-
return gmail_element_getter/* default */.
|
|
18318
|
+
return gmail_element_getter/* default */.Ay.isAppBurgerMenuOpen();
|
|
18275
18319
|
}
|
|
18276
18320
|
|
|
18277
18321
|
/**
|
|
@@ -18290,7 +18334,7 @@ class AppMenu {
|
|
|
18290
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.
|
|
18291
18335
|
*/
|
|
18292
18336
|
async isShown() {
|
|
18293
|
-
const result = await gmail_element_getter/* default */.
|
|
18337
|
+
const result = await gmail_element_getter/* default */.Ay.getAppMenuAsync();
|
|
18294
18338
|
return !!result;
|
|
18295
18339
|
}
|
|
18296
18340
|
static #monitorInitialized = false;
|
|
@@ -18306,7 +18350,7 @@ class AppMenu {
|
|
|
18306
18350
|
return;
|
|
18307
18351
|
}
|
|
18308
18352
|
this.#monitorInitialized = true;
|
|
18309
|
-
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, {
|
|
18310
18354
|
childList: true,
|
|
18311
18355
|
subtree: true,
|
|
18312
18356
|
attributes: true,
|
|
@@ -19864,7 +19908,7 @@ mole_view_module_options.insert = htmlElement => {
|
|
|
19864
19908
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
19865
19909
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
19866
19910
|
///@ts-ignore
|
|
19867
|
-
"2.2.
|
|
19911
|
+
"2.2.18-1784839996724-a8a6fe2c9e69b0e7");
|
|
19868
19912
|
document.head.append(htmlElement);
|
|
19869
19913
|
};
|
|
19870
19914
|
mole_view_module_options.domAPI = (styleDomAPI_default());
|
|
@@ -19877,6 +19921,105 @@ var mole_view_module_update = injectStylesIntoStyleTag_default()(mole_view_modul
|
|
|
19877
19921
|
|
|
19878
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);
|
|
19879
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
|
+
}
|
|
19880
20023
|
;// CONCATENATED MODULE: ./src/platform-implementation-js/dom-driver/gmail/widgets/gmail-mole-view-driver.ts
|
|
19881
20024
|
|
|
19882
20025
|
|
|
@@ -19889,7 +20032,26 @@ var mole_view_module_update = injectStylesIntoStyleTag_default()(mole_view_modul
|
|
|
19889
20032
|
|
|
19890
20033
|
|
|
19891
20034
|
|
|
20035
|
+
|
|
19892
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
|
+
};
|
|
19893
20055
|
class GmailMoleViewDriver {
|
|
19894
20056
|
static #page;
|
|
19895
20057
|
static #moleParentReadyEvent = kefir_bus_default()();
|
|
@@ -19914,22 +20076,22 @@ class GmailMoleViewDriver {
|
|
|
19914
20076
|
},
|
|
19915
20077
|
watchers: [{
|
|
19916
20078
|
tag: "mole",
|
|
19917
|
-
selectors: [
|
|
20079
|
+
selectors: [Selector.Mole],
|
|
19918
20080
|
sources: ["moleParent"]
|
|
19919
20081
|
}, {
|
|
19920
20082
|
tag: "moleParent",
|
|
19921
|
-
selectors: [
|
|
20083
|
+
selectors: [gmail_element_getter/* MOLE_PARENT_SELECTOR */.pG],
|
|
19922
20084
|
sources: [null]
|
|
19923
20085
|
}],
|
|
19924
20086
|
finders: {
|
|
19925
20087
|
["moleParent"]: {
|
|
19926
|
-
fn: root => [root.querySelector(
|
|
20088
|
+
fn: root => [root.querySelector(gmail_element_getter/* MOLE_PARENT_SELECTOR */.pG)].filter(isNotNil/* default */.A),
|
|
19927
20089
|
interval(elementCount, timeRunning) {
|
|
19928
20090
|
return timeRunning <= 15_000 && elementCount === 0 ? 100 : 5_000;
|
|
19929
20091
|
}
|
|
19930
20092
|
},
|
|
19931
20093
|
["mole"]: {
|
|
19932
|
-
fn: root => root.querySelectorAll(
|
|
20094
|
+
fn: root => root.querySelectorAll(Selector.Mole),
|
|
19933
20095
|
interval(elementCount, timeRunning) {
|
|
19934
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
|
|
19935
20097
|
//
|
|
@@ -19962,9 +20124,15 @@ class GmailMoleViewDriver {
|
|
|
19962
20124
|
case 'add':
|
|
19963
20125
|
{
|
|
19964
20126
|
const el = change.value.getValue();
|
|
19965
|
-
if (el.matches(
|
|
20127
|
+
if (el.matches(Selector.ComposeMole)) {
|
|
19966
20128
|
this.#maybeMoveMole(el);
|
|
19967
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));
|
|
19968
20136
|
break;
|
|
19969
20137
|
}
|
|
19970
20138
|
}
|
|
@@ -20063,7 +20231,7 @@ class GmailMoleViewDriver {
|
|
|
20063
20231
|
this.#driver.logger.error(new Error('Mole show invariant violated. `lastMole` is not an HTMLElement'));
|
|
20064
20232
|
return;
|
|
20065
20233
|
}
|
|
20066
|
-
const dw = moleParent.closest(
|
|
20234
|
+
const dw = moleParent.closest(gmail_element_getter/* MOLE_CONTAINER_SELECTOR */.MY);
|
|
20067
20235
|
if (dw) {
|
|
20068
20236
|
dw.classList.add('inboxsdk__moles_in_use', mole_view_module/* inboxsdkMolesInUse */.jq);
|
|
20069
20237
|
}
|
|
@@ -20081,7 +20249,7 @@ class GmailMoleViewDriver {
|
|
|
20081
20249
|
// If the gmail mode has settled, we've been loaded for 10 seconds, and
|
|
20082
20250
|
// we don't have the mole parent yet, then force the mole parent to load
|
|
20083
20251
|
// by opening a compose view and then closing it.
|
|
20084
|
-
kefir_esm.fromPromise(gmail_element_getter/* default */.
|
|
20252
|
+
kefir_esm.fromPromise(gmail_element_getter/* default */.Ay.waitForGmailModeToSettle()).flatMap(() => {
|
|
20085
20253
|
// delay until we've passed TimestampOnReady + 5 seconds
|
|
20086
20254
|
return this.#driver.delayToTimeAfterReady(5_000);
|
|
20087
20255
|
}).takeUntilBy(moleParentReadyEvent).takeUntilBy(this.#stopper).onValue(async () => {
|
|
@@ -21422,7 +21590,7 @@ class GmailNavItemView {
|
|
|
21422
21590
|
this._level = level || 0;
|
|
21423
21591
|
this._navItemNumber = ++NUMBER_OF_GMAIL_NAV_ITEM_VIEWS_CREATED;
|
|
21424
21592
|
this._orderGroup = orderGroup;
|
|
21425
|
-
this._isNewLeftNavParent = !gmail_element_getter/* default */.
|
|
21593
|
+
this._isNewLeftNavParent = !gmail_element_getter/* default */.Ay.shouldAddNavItemsInline() && this._level === 1;
|
|
21426
21594
|
this._element = this.#setupElement();
|
|
21427
21595
|
}
|
|
21428
21596
|
#setupElement(navItemDescriptor) {
|
|
@@ -21541,7 +21709,7 @@ class GmailNavItemView {
|
|
|
21541
21709
|
// nested items (i.e. the current item is of type GROUPER and we're in Gmailv2).
|
|
21542
21710
|
const indentationFactor = this._type === nav_item_types.GROUPER || this._isNewLeftNavParent ? this._level - 1 : this._level;
|
|
21543
21711
|
const element = gmailNavItemView.getElement();
|
|
21544
|
-
if (!gmail_element_getter/* default */.
|
|
21712
|
+
if (!gmail_element_getter/* default */.Ay.shouldAddNavItemsInline()) {
|
|
21545
21713
|
(0,querySelectorOrFail/* default */.A)(element, '.TN').style.marginLeft = 6 * indentationFactor + 'px';
|
|
21546
21714
|
} else {
|
|
21547
21715
|
(0,querySelectorOrFail/* default */.A)(element, '.TN').style.marginLeft = getLeftIndentationPaddingValue() * indentationFactor + 'px';
|
|
@@ -21633,7 +21801,7 @@ class GmailNavItemView {
|
|
|
21633
21801
|
hAlign: 'left',
|
|
21634
21802
|
vAlign: 'top'
|
|
21635
21803
|
};
|
|
21636
|
-
const container = gmail_element_getter/* default */.
|
|
21804
|
+
const container = gmail_element_getter/* default */.Ay.getLeftNavContainerElement();
|
|
21637
21805
|
if (!container) throw new Error('leftNavContainer not found');
|
|
21638
21806
|
buttonOptions.dropdownShowFunction = event => {
|
|
21639
21807
|
// bhZ is the class to indicate the left nav is collapsible mode
|
|
@@ -22135,7 +22303,7 @@ async function addNavItem(driver, orderGroup, navItemDescriptor, navMenuInjectio
|
|
|
22135
22303
|
await waitForMenuReady();
|
|
22136
22304
|
const gmailNavItemView = new GmailNavItemView(driver, orderGroup, 1);
|
|
22137
22305
|
gmailNavItemView.setNavItemDescriptor(navItemDescriptor);
|
|
22138
|
-
if (!gmail_element_getter/* default */.
|
|
22306
|
+
if (!gmail_element_getter/* default */.Ay.isStandalone()) {
|
|
22139
22307
|
attachGmailNavItemView(gmailNavItemView, navMenuInjectionContainer);
|
|
22140
22308
|
}
|
|
22141
22309
|
return gmailNavItemView;
|
|
@@ -22144,7 +22312,7 @@ async function addNavItemToPanel(driver, orderGroup, navItemDescriptor, panelEle
|
|
|
22144
22312
|
await waitForMenuReady();
|
|
22145
22313
|
const gmailNavItemView = new GmailNavItemView(driver, orderGroup, 1);
|
|
22146
22314
|
gmailNavItemView.setNavItemDescriptor(navItemDescriptor);
|
|
22147
|
-
if (!gmail_element_getter/* default */.
|
|
22315
|
+
if (!gmail_element_getter/* default */.Ay.isStandalone()) {
|
|
22148
22316
|
if (gmailNavItemView.isSection()) {
|
|
22149
22317
|
const container = getPanelSectionNavItemContainerElement(panelElement);
|
|
22150
22318
|
attachGmailNavItemView(gmailNavItemView, container);
|
|
@@ -22156,14 +22324,14 @@ async function addNavItemToPanel(driver, orderGroup, navItemDescriptor, panelEle
|
|
|
22156
22324
|
return gmailNavItemView;
|
|
22157
22325
|
}
|
|
22158
22326
|
const waitForMenuReady = once_default()(async () => {
|
|
22159
|
-
const appMenu = await gmail_element_getter/* default */.
|
|
22327
|
+
const appMenu = await gmail_element_getter/* default */.Ay.getAppMenuAsync();
|
|
22160
22328
|
if (!appMenu) {
|
|
22161
22329
|
await waitForNavMenuReady();
|
|
22162
22330
|
}
|
|
22163
22331
|
});
|
|
22164
22332
|
const waitForNavMenuReady = once_default()(async () => {
|
|
22165
|
-
if (!gmail_element_getter/* default */.
|
|
22166
|
-
await gmail_element_getter/* default */.
|
|
22333
|
+
if (!gmail_element_getter/* default */.Ay.isStandalone()) {
|
|
22334
|
+
await gmail_element_getter/* default */.Ay.waitForGmailModeToSettle();
|
|
22167
22335
|
await (0,wait_for/* default */.A)(() => document.querySelector('.aeN[role=navigation], .aeN [role=navigation]'));
|
|
22168
22336
|
// Wait for contents of navmenu to load (needed to figure out if it's integrated gmail mode)
|
|
22169
22337
|
await (0,wait_for/* default */.A)(() => document.querySelector('.Ls77Lb.aZ6 > .pp'));
|
|
@@ -22175,12 +22343,12 @@ function _attachNavItemView(gmailNavItemView, navMenuInjectionContainer) {
|
|
|
22175
22343
|
(0,insert_element_in_order/* default */.A)(navMenuInjectionContainer, gmailNavItemView.getElement());
|
|
22176
22344
|
};
|
|
22177
22345
|
}
|
|
22178
|
-
if (!gmail_element_getter/* default */.
|
|
22346
|
+
if (!gmail_element_getter/* default */.Ay.shouldAddNavItemsInline()) {
|
|
22179
22347
|
// If we're in the modern (non-classic-hangouts) leftnav, then put
|
|
22180
22348
|
// the added nav items in a floating section at the bottom separate
|
|
22181
22349
|
// from the Mail section.
|
|
22182
22350
|
return function () {
|
|
22183
|
-
const navMenuInjectionContainer = gmail_element_getter/* default */.
|
|
22351
|
+
const navMenuInjectionContainer = gmail_element_getter/* default */.Ay.getSeparateSectionNavItemMenuInjectionContainer();
|
|
22184
22352
|
if (!navMenuInjectionContainer) {
|
|
22185
22353
|
throw new Error('should not happen');
|
|
22186
22354
|
}
|
|
@@ -22210,7 +22378,7 @@ function _createNavItemsHolder() {
|
|
|
22210
22378
|
const holder = document.createElement('div');
|
|
22211
22379
|
holder.setAttribute('class', 'LrBjie inboxsdk__navMenu');
|
|
22212
22380
|
holder.innerHTML = '<div class="TK"></div>';
|
|
22213
|
-
const navMenuInjectionContainer = gmail_element_getter/* default */.
|
|
22381
|
+
const navMenuInjectionContainer = gmail_element_getter/* default */.Ay.getSameSectionNavItemMenuInjectionContainer();
|
|
22214
22382
|
if (!navMenuInjectionContainer) throw new Error('should not happen');
|
|
22215
22383
|
navMenuInjectionContainer.insertBefore(holder, navMenuInjectionContainer.children[2]);
|
|
22216
22384
|
(0,make_mutation_observer_stream/* default */.A)(holder, {
|
|
@@ -22228,7 +22396,7 @@ function _createNavItemsHolder() {
|
|
|
22228
22396
|
|
|
22229
22397
|
|
|
22230
22398
|
async function addAppMenuItem(driver, menuItemDescriptor) {
|
|
22231
|
-
const appMenuInjectionContainer = await gmail_element_getter/* default */.
|
|
22399
|
+
const appMenuInjectionContainer = await gmail_element_getter/* default */.Ay.getAppMenuAsync();
|
|
22232
22400
|
const gmailAppMenuItemView = new GmailAppMenuItemView(driver, menuItemDescriptor);
|
|
22233
22401
|
try {
|
|
22234
22402
|
if (!appMenuInjectionContainer) return undefined;
|
|
@@ -22665,9 +22833,9 @@ function showCustomThreadList(driver, customRouteID, onActivate, params) {
|
|
|
22665
22833
|
let findIdFailure = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : _findIdFailure;
|
|
22666
22834
|
const uniqueSearch = setupSearchReplacing(driver, customRouteID, onActivate, findIdFailure);
|
|
22667
22835
|
const customHash = document.location.hash;
|
|
22668
|
-
const searchInput = gmail_element_getter/* default */.
|
|
22836
|
+
const searchInput = gmail_element_getter/* default */.Ay.getSearchInput();
|
|
22669
22837
|
if (!searchInput) throw new Error('could not find search input');
|
|
22670
|
-
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, {
|
|
22671
22839
|
attributes: true,
|
|
22672
22840
|
attributeOldValue: true
|
|
22673
22841
|
}).filter(mutationRecords => {
|
|
@@ -22698,7 +22866,7 @@ var show_custom_route_view = __webpack_require__(3759);
|
|
|
22698
22866
|
|
|
22699
22867
|
|
|
22700
22868
|
function showNativeRouteView(_gmailDriver) {
|
|
22701
|
-
const contentSectionElement = gmail_element_getter/* default */.
|
|
22869
|
+
const contentSectionElement = gmail_element_getter/* default */.Ay.getContentSectionElement();
|
|
22702
22870
|
if (!contentSectionElement) {
|
|
22703
22871
|
return;
|
|
22704
22872
|
}
|
|
@@ -22796,10 +22964,10 @@ function registerSearchSuggestionsProvider(driver, handler) {
|
|
|
22796
22964
|
}).map(event => event.suggestions);
|
|
22797
22965
|
|
|
22798
22966
|
// Wait for the first routeViewDriver to happen before looking for the search box.
|
|
22799
|
-
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);
|
|
22800
22968
|
|
|
22801
22969
|
// Wait for the search box to be focused before looking for the suggestions box.
|
|
22802
|
-
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();
|
|
22803
22971
|
|
|
22804
22972
|
// This stream emits an event after every time Gmail changes the suggestions
|
|
22805
22973
|
// list.
|
|
@@ -23245,7 +23413,7 @@ function _createAppButtonElement(driver, onclick) {
|
|
|
23245
23413
|
event.preventDefault();
|
|
23246
23414
|
onclick(event);
|
|
23247
23415
|
});
|
|
23248
|
-
const topAccountContainer = gmail_element_getter/* default */.
|
|
23416
|
+
const topAccountContainer = gmail_element_getter/* default */.Ay.getTopAccountContainer();
|
|
23249
23417
|
if (!topAccountContainer) {
|
|
23250
23418
|
const err = new Error('Could not make button');
|
|
23251
23419
|
const banner = document.querySelector('[role=banner]');
|
|
@@ -23266,7 +23434,7 @@ function _createAppButtonElement(driver, onclick) {
|
|
|
23266
23434
|
throw err;
|
|
23267
23435
|
}
|
|
23268
23436
|
try {
|
|
23269
|
-
if (!gmail_element_getter/* default */.
|
|
23437
|
+
if (!gmail_element_getter/* default */.Ay.isGplusEnabled()) {
|
|
23270
23438
|
element.classList.add('inboxsdk__appButton_noGPlus');
|
|
23271
23439
|
}
|
|
23272
23440
|
insertionElement.insertBefore(element, insertionElement.lastElementChild);
|
|
@@ -23287,8 +23455,8 @@ function _updateTitle(element, descriptor) {
|
|
|
23287
23455
|
|
|
23288
23456
|
|
|
23289
23457
|
function addToolbarButtonForApp(gmailDriver, buttonDescriptor) {
|
|
23290
|
-
return gmail_element_getter/* default */.
|
|
23291
|
-
if (gmail_element_getter/* default */.
|
|
23458
|
+
return gmail_element_getter/* default */.Ay.waitForGmailModeToSettle().then(() => {
|
|
23459
|
+
if (gmail_element_getter/* default */.Ay.isStandalone()) {
|
|
23292
23460
|
return new Promise((_resolve, _reject) => {
|
|
23293
23461
|
//never complete
|
|
23294
23462
|
});
|
|
@@ -23427,7 +23595,7 @@ function setupRouteViewDriverStream(gmailRouteProcessor, driver) {
|
|
|
23427
23595
|
// getMainContentElementChangedStream doesn't respect custom views so filter
|
|
23428
23596
|
// out events from it. This filter is needed if the user is already at a custom
|
|
23429
23597
|
// view of another InboxSDK instance while this starts up.
|
|
23430
|
-
gmail_element_getter/* default */.
|
|
23598
|
+
gmail_element_getter/* default */.Ay.getMainContentElementChangedStream().map(_event => ({
|
|
23431
23599
|
urlObject: getURLObject(document.location.href),
|
|
23432
23600
|
type: 'NATIVE'
|
|
23433
23601
|
})).filter(options => gmailRouteProcessor.isNativeRoute(options.urlObject.name))]).map(options => {
|
|
@@ -23438,7 +23606,7 @@ function setupRouteViewDriverStream(gmailRouteProcessor, driver) {
|
|
|
23438
23606
|
if (type === 'NATIVE' && urlObject.name === 'search') {
|
|
23439
23607
|
const customListRouteId = customListSearchStringsToRouteIds.get(urlObject.params[0]);
|
|
23440
23608
|
if (customListRouteId) {
|
|
23441
|
-
const searchInput = gmail_element_getter/* default */.
|
|
23609
|
+
const searchInput = gmail_element_getter/* default */.Ay.getSearchInput();
|
|
23442
23610
|
if (!searchInput) throw new Error('Should not happen');
|
|
23443
23611
|
searchInput.value = '';
|
|
23444
23612
|
|
|
@@ -23738,7 +23906,7 @@ class NativeGmailNavItemView {
|
|
|
23738
23906
|
|
|
23739
23907
|
function getNativeNavItem(driver, label) {
|
|
23740
23908
|
return (0,wait_for/* default */.A)(() => {
|
|
23741
|
-
const navContainer = gmail_element_getter/* default */.
|
|
23909
|
+
const navContainer = gmail_element_getter/* default */.Ay.getLeftNavContainerElement();
|
|
23742
23910
|
if (!navContainer) return null;
|
|
23743
23911
|
return navContainer.querySelector(`.aim a[href*="#${label}"]`);
|
|
23744
23912
|
}, 300 * 1000).then(labelLinkElement => {
|
|
@@ -23751,7 +23919,7 @@ function getNativeNavItem(driver, label) {
|
|
|
23751
23919
|
}
|
|
23752
23920
|
return labelElement.__nativeGmailNavItemView;
|
|
23753
23921
|
}).catch(err => {
|
|
23754
|
-
if (gmail_element_getter/* default */.
|
|
23922
|
+
if (gmail_element_getter/* default */.Ay.isStandalone()) {
|
|
23755
23923
|
// never resolve
|
|
23756
23924
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
23757
23925
|
return new Promise((_resolve, _reject) => {});
|
|
@@ -23850,14 +24018,14 @@ function registerSearchQueryRewriter(pageCommunicator, obj) {
|
|
|
23850
24018
|
|
|
23851
24019
|
|
|
23852
24020
|
async function openComposeWindow(_gmailDriver) {
|
|
23853
|
-
await gmail_element_getter/* default */.
|
|
23854
|
-
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()) {
|
|
23855
24023
|
throw new Error('Can not open new compose while in standalone window');
|
|
23856
24024
|
}
|
|
23857
|
-
if (!gmail_element_getter/* default */.
|
|
23858
|
-
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());
|
|
23859
24027
|
}
|
|
23860
|
-
const composeButton = gmail_element_getter/* default */.
|
|
24028
|
+
const composeButton = gmail_element_getter/* default */.Ay.getComposeButton();
|
|
23861
24029
|
if (!composeButton) throw new Error('Could not find compose button');
|
|
23862
24030
|
(0,simulate_mouse_event/* simulateClick */.jp)(composeButton);
|
|
23863
24031
|
}
|
|
@@ -23869,7 +24037,7 @@ var gmail_app_sidebar_view = __webpack_require__(2893);
|
|
|
23869
24037
|
|
|
23870
24038
|
|
|
23871
24039
|
function suppressAddon(driver, addonTitle) {
|
|
23872
|
-
(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 => {
|
|
23873
24041
|
// .J-KU-Jg is pre-2018-07-30 element?
|
|
23874
24042
|
const elementToWatch = iconContainerElement.querySelector('.J-KU-Jg, [role=tablist], .brC-bsf-aT5-aOt');
|
|
23875
24043
|
if (!elementToWatch) {
|
|
@@ -24130,6 +24298,7 @@ function parseListPeopleByKnownIdResponse(data) {
|
|
|
24130
24298
|
|
|
24131
24299
|
|
|
24132
24300
|
|
|
24301
|
+
|
|
24133
24302
|
|
|
24134
24303
|
|
|
24135
24304
|
/**
|
|
@@ -24248,6 +24417,7 @@ class GmailDriver {
|
|
|
24248
24417
|
gmailLoadEvent(this);
|
|
24249
24418
|
(0,override_gmail_back_button/* default */.A)(this, this.#gmailRouteProcessor);
|
|
24250
24419
|
trackGmailStyles();
|
|
24420
|
+
syncMoleSpacerWithRightColumn(this);
|
|
24251
24421
|
temporaryTrackDownloadUrlValidity(this);
|
|
24252
24422
|
if (opts.suppressAddonTitle != null) {
|
|
24253
24423
|
suppressAddon(this, opts.suppressAddonTitle);
|
|
@@ -24558,7 +24728,7 @@ class GmailDriver {
|
|
|
24558
24728
|
}
|
|
24559
24729
|
setShowNativeNavMarker(isNative) {
|
|
24560
24730
|
this.#navMarkerHiddenChanged.emit(null);
|
|
24561
|
-
const leftNavContainerElement = gmail_element_getter/* default */.
|
|
24731
|
+
const leftNavContainerElement = gmail_element_getter/* default */.Ay.getLeftNavContainerElement();
|
|
24562
24732
|
if (leftNavContainerElement) {
|
|
24563
24733
|
if (isNative) {
|
|
24564
24734
|
leftNavContainerElement.classList.remove('inboxsdk__hide_native_marker');
|
|
@@ -24572,8 +24742,8 @@ class GmailDriver {
|
|
|
24572
24742
|
}
|
|
24573
24743
|
setShowNativeAddonSidebar(isNative) {
|
|
24574
24744
|
this.#addonSidebarHiddenChanged.emit(null);
|
|
24575
|
-
const addonContainerElement = gmail_element_getter/* default */.
|
|
24576
|
-
const mainContentBodyContainerElement = gmail_element_getter/* default */.
|
|
24745
|
+
const addonContainerElement = gmail_element_getter/* default */.Ay.getAddonSidebarContainerElement();
|
|
24746
|
+
const mainContentBodyContainerElement = gmail_element_getter/* default */.Ay.getMainContentBodyContainerElement();
|
|
24577
24747
|
if (addonContainerElement && mainContentBodyContainerElement) {
|
|
24578
24748
|
const parent = mainContentBodyContainerElement.parentElement;
|
|
24579
24749
|
if (!parent) return;
|
|
@@ -24684,12 +24854,12 @@ class GmailDriver {
|
|
|
24684
24854
|
return appSidebar.addGlobalSidebarContentPanel(descriptor);
|
|
24685
24855
|
}
|
|
24686
24856
|
waitForGlobalSidebarReady() {
|
|
24687
|
-
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());
|
|
24688
24858
|
if (condition()) {
|
|
24689
24859
|
return kefir_esm.constant(undefined);
|
|
24690
24860
|
}
|
|
24691
24861
|
return (0,stream_wait_for/* default */.A)(condition).map(() => undefined).mapErrors(err => {
|
|
24692
|
-
const el =
|
|
24862
|
+
const el = gmail_element_getter/* default */.Ay.getCompanionSidebarColumnElement();
|
|
24693
24863
|
this.#logger.error(err, {
|
|
24694
24864
|
reason: 'waitForGlobalSidebarReady timed out',
|
|
24695
24865
|
aUxHtml: el ? (0,censorHTMLtree/* default */.A)(el) : null
|
|
@@ -24700,7 +24870,7 @@ class GmailDriver {
|
|
|
24700
24870
|
getGlobalSidebar() {
|
|
24701
24871
|
let appSidebarView = this.#appSidebarView;
|
|
24702
24872
|
if (!appSidebarView) {
|
|
24703
|
-
const companionSidebarContentContainerEl = gmail_element_getter/* default */.
|
|
24873
|
+
const companionSidebarContentContainerEl = gmail_element_getter/* default */.Ay.getCompanionSidebarContentContainerElement();
|
|
24704
24874
|
if (!companionSidebarContentContainerEl) throw new Error('did not find companionSidebarContentContainerEl');
|
|
24705
24875
|
appSidebarView = this.#appSidebarView = new gmail_app_sidebar_view/* default */.A(this, companionSidebarContentContainerEl);
|
|
24706
24876
|
}
|