@inboxsdk/core 2.1.59 → 2.1.61
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 +192 -54
- package/inboxsdk.js.map +1 -1
- package/package.json +1 -1
- package/pageWorld.js.map +1 -1
- package/src/common/get-extension-id.d.ts +2 -1
- package/src/common/get-extension-id.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-menu-item-view.d.ts +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-menu-item-view.d.ts.map +1 -1
- package/src/platform-implementation-js/namespaces/app-menu.d.ts.map +1 -1
- package/src/platform-implementation-js/views/app-menu-item-view.d.ts +7 -0
- package/src/platform-implementation-js/views/app-menu-item-view.d.ts.map +1 -1
- package/src/platform-implementation-js/views/collapsible-panel-view.d.ts +1 -0
- package/src/platform-implementation-js/views/collapsible-panel-view.d.ts.map +1 -1
package/inboxsdk.js
CHANGED
|
@@ -371,7 +371,7 @@ function isNotNil(value) {
|
|
|
371
371
|
|
|
372
372
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- SDK_VERSION is injected by webpack
|
|
373
373
|
///@ts-ignore
|
|
374
|
-
const BUILD_VERSION = "2.1.
|
|
374
|
+
const BUILD_VERSION = "2.1.61-1718747129530-da0f4707d79e342c";
|
|
375
375
|
if (false) {}
|
|
376
376
|
|
|
377
377
|
/***/ }),
|
|
@@ -2646,7 +2646,7 @@ options.insert = htmlElement => {
|
|
|
2646
2646
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
2647
2647
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
2648
2648
|
///@ts-ignore
|
|
2649
|
-
"2.1.
|
|
2649
|
+
"2.1.61-1718747129530-da0f4707d79e342c");
|
|
2650
2650
|
document.head.append(htmlElement);
|
|
2651
2651
|
};
|
|
2652
2652
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -10197,7 +10197,7 @@ options.insert = htmlElement => {
|
|
|
10197
10197
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
10198
10198
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
10199
10199
|
///@ts-ignore
|
|
10200
|
-
"2.1.
|
|
10200
|
+
"2.1.61-1718747129530-da0f4707d79e342c");
|
|
10201
10201
|
document.head.append(htmlElement);
|
|
10202
10202
|
};
|
|
10203
10203
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -10347,17 +10347,35 @@ var sha256 = __webpack_require__(6049);
|
|
|
10347
10347
|
var sha256_default = /*#__PURE__*/__webpack_require__.n(sha256);
|
|
10348
10348
|
// EXTERNAL MODULE: ./src/common/ajax.ts + 1 modules
|
|
10349
10349
|
var ajax = __webpack_require__(8587);
|
|
10350
|
+
// EXTERNAL MODULE: ./node_modules/lodash/once.js
|
|
10351
|
+
var once = __webpack_require__(8921);
|
|
10352
|
+
var once_default = /*#__PURE__*/__webpack_require__.n(once);
|
|
10350
10353
|
;// CONCATENATED MODULE: ./src/common/get-extension-id.ts
|
|
10351
|
-
|
|
10352
|
-
|
|
10353
|
-
|
|
10354
|
-
|
|
10355
|
-
|
|
10356
|
-
|
|
10357
|
-
|
|
10354
|
+
|
|
10355
|
+
const getExtensionId = once_default()(() => {
|
|
10356
|
+
try {
|
|
10357
|
+
const chrome = globalThis.chrome;
|
|
10358
|
+
if (chrome?.runtime?.getURL) {
|
|
10359
|
+
return chrome.runtime.getURL('');
|
|
10360
|
+
}
|
|
10361
|
+
// MV2
|
|
10362
|
+
if (chrome?.extension?.getURL) {
|
|
10363
|
+
return chrome.extension.getURL('');
|
|
10364
|
+
}
|
|
10365
|
+
} catch (e) {
|
|
10366
|
+
// When an extension is reloaded or removed, then Chrome APIs in any of its
|
|
10367
|
+
// pre-existing content scripts start throwing "Extension context
|
|
10368
|
+
// invalidated" errors. We only use extension IDs for logging, so we
|
|
10369
|
+
// shouldn't treat this as fatal.
|
|
10370
|
+
console.error('Failed to read extension ID:', e);
|
|
10358
10371
|
}
|
|
10359
10372
|
return null;
|
|
10360
|
-
}
|
|
10373
|
+
});
|
|
10374
|
+
|
|
10375
|
+
// pre-cache the extension ID so we still know it inside this content script if
|
|
10376
|
+
// the extension is reloaded or removed later.
|
|
10377
|
+
getExtensionId();
|
|
10378
|
+
/* harmony default export */ const get_extension_id = (getExtensionId);
|
|
10361
10379
|
;// CONCATENATED MODULE: ./src/common/get-session-id.ts
|
|
10362
10380
|
function getSessionId() {
|
|
10363
10381
|
const attrValue = typeof document !== 'undefined' && document.documentElement.getAttribute('data-inboxsdk-session-id');
|
|
@@ -10473,7 +10491,7 @@ function logError(err, details, context) {
|
|
|
10473
10491
|
stuffToLog.push('\n\nExtension App Ids:', JSON.stringify(appIds, null, 2));
|
|
10474
10492
|
stuffToLog.push('\nSent by App:', sentByApp);
|
|
10475
10493
|
stuffToLog.push('\nSession Id:', sessionId);
|
|
10476
|
-
stuffToLog.push('\nExtension Id:',
|
|
10494
|
+
stuffToLog.push('\nExtension Id:', get_extension_id());
|
|
10477
10495
|
stuffToLog.push('\nInboxSDK Loader Version:', loaderVersion);
|
|
10478
10496
|
stuffToLog.push('\nInboxSDK Implementation Version:', implVersion);
|
|
10479
10497
|
console.error(...stuffToLog);
|
|
@@ -10486,7 +10504,7 @@ function logError(err, details, context) {
|
|
|
10486
10504
|
sentByApp,
|
|
10487
10505
|
sessionId,
|
|
10488
10506
|
emailHash: userEmailHash,
|
|
10489
|
-
extensionId:
|
|
10507
|
+
extensionId: get_extension_id(),
|
|
10490
10508
|
loaderVersion: loaderVersion,
|
|
10491
10509
|
implementationVersion: implVersion,
|
|
10492
10510
|
origin: document.location.origin,
|
|
@@ -11053,7 +11071,7 @@ function _trackEvent(appId, type, eventName, properties) {
|
|
|
11053
11071
|
};
|
|
11054
11072
|
if (type != 'gmail') {
|
|
11055
11073
|
Object.assign(event, {
|
|
11056
|
-
extensionId:
|
|
11074
|
+
extensionId: get_extension_id(),
|
|
11057
11075
|
appIds: getAppIdsProperty(appId)
|
|
11058
11076
|
});
|
|
11059
11077
|
} else {
|
|
@@ -14926,7 +14944,7 @@ options.insert = htmlElement => {
|
|
|
14926
14944
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
14927
14945
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
14928
14946
|
///@ts-ignore
|
|
14929
|
-
"2.1.
|
|
14947
|
+
"2.1.61-1718747129530-da0f4707d79e342c");
|
|
14930
14948
|
document.head.append(htmlElement);
|
|
14931
14949
|
};
|
|
14932
14950
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -17098,7 +17116,8 @@ const HEADING_ELEMENT_SELECTOR = '.apW';
|
|
|
17098
17116
|
class GmailAppMenuItemView extends events.EventEmitter {
|
|
17099
17117
|
static elementCss = {
|
|
17100
17118
|
HOVER: 'aIk',
|
|
17101
|
-
ACTIVE: 'apV'
|
|
17119
|
+
ACTIVE: 'apV',
|
|
17120
|
+
SDK_ACTIVE: 'inboxsdk__appMenuItem_active'
|
|
17102
17121
|
};
|
|
17103
17122
|
#menuItemDescriptor;
|
|
17104
17123
|
#element;
|
|
@@ -17250,7 +17269,8 @@ class CollapsiblePanelView extends safe_event_emitter/* default */.A {
|
|
|
17250
17269
|
HOVER: 'aJu',
|
|
17251
17270
|
COLLAPSED_HOVER: 'bym',
|
|
17252
17271
|
PANEL_LESS: 'a3W',
|
|
17253
|
-
TOGGLE_OPEN_STATE: 'aak'
|
|
17272
|
+
TOGGLE_OPEN_STATE: 'aak',
|
|
17273
|
+
SDK_ACTIVE: 'inboxsdk__collapsiblePanel_active'
|
|
17254
17274
|
};
|
|
17255
17275
|
#panelDescriptor;
|
|
17256
17276
|
#element;
|
|
@@ -17549,24 +17569,72 @@ class AppMenuItemView extends safe_event_emitter/* default */.A {
|
|
|
17549
17569
|
static #routeViewDriverStream;
|
|
17550
17570
|
static #menuItemToPanelMap = new Map();
|
|
17551
17571
|
static #appMenuItemViews = new Set();
|
|
17552
|
-
static
|
|
17572
|
+
static getAllPanels() {
|
|
17573
|
+
const appMenuElement = gmail_element_getter/* default */.A.getAppMenuContainer();
|
|
17574
|
+
const nativePanels = appMenuElement?.querySelectorAll(`.${collapsible_panel_view_NATIVE_CLASS}`);
|
|
17575
|
+
return Array.from(nativePanels ?? []);
|
|
17576
|
+
}
|
|
17577
|
+
static getActivePanel() {
|
|
17578
|
+
let useSdkActiveSelector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
17553
17579
|
const appMenuElement = gmail_element_getter/* default */.A.getAppMenuContainer();
|
|
17554
17580
|
const {
|
|
17555
|
-
ACTIVE
|
|
17581
|
+
ACTIVE,
|
|
17582
|
+
SDK_ACTIVE
|
|
17556
17583
|
} = CollapsiblePanelView.elementCss;
|
|
17557
|
-
const nativePanel = appMenuElement?.querySelector(`.${collapsible_panel_view_NATIVE_CLASS}.${ACTIVE}`);
|
|
17584
|
+
const nativePanel = appMenuElement?.querySelector(useSdkActiveSelector ? `.${collapsible_panel_view_NATIVE_CLASS}.${ACTIVE}.${SDK_ACTIVE}` : `.${collapsible_panel_view_NATIVE_CLASS}.${ACTIVE}`);
|
|
17558
17585
|
return nativePanel;
|
|
17559
17586
|
}
|
|
17560
|
-
static
|
|
17587
|
+
static deactivatePanel(panel) {
|
|
17588
|
+
const {
|
|
17589
|
+
ACTIVE,
|
|
17590
|
+
HOVER,
|
|
17591
|
+
SDK_ACTIVE
|
|
17592
|
+
} = CollapsiblePanelView.elementCss;
|
|
17593
|
+
panel.style.removeProperty('height');
|
|
17594
|
+
if (panel.classList.contains(HOVER)) {
|
|
17595
|
+
panel.classList.remove(HOVER);
|
|
17596
|
+
}
|
|
17597
|
+
if (panel.classList.contains(ACTIVE)) {
|
|
17598
|
+
panel.classList.remove(ACTIVE);
|
|
17599
|
+
}
|
|
17600
|
+
if (panel.classList.contains(SDK_ACTIVE)) {
|
|
17601
|
+
panel.classList.remove(SDK_ACTIVE);
|
|
17602
|
+
}
|
|
17603
|
+
}
|
|
17604
|
+
static isMenuItem(element) {
|
|
17605
|
+
return element.classList.contains(NATIVE_CLASS);
|
|
17606
|
+
}
|
|
17607
|
+
static getAllMenuItems() {
|
|
17608
|
+
const appMenuElement = gmail_element_getter/* default */.A.getAppMenuContainer();
|
|
17609
|
+
return Array.from(appMenuElement?.querySelectorAll(`.${NATIVE_CLASS}`) ?? []);
|
|
17610
|
+
}
|
|
17611
|
+
static getActiveMenuItem() {
|
|
17561
17612
|
const appMenuElement = gmail_element_getter/* default */.A.getAppMenuContainer();
|
|
17562
17613
|
const {
|
|
17563
|
-
ACTIVE
|
|
17614
|
+
ACTIVE,
|
|
17615
|
+
SDK_ACTIVE
|
|
17564
17616
|
} = GmailAppMenuItemView.elementCss;
|
|
17565
|
-
const button = appMenuElement?.querySelector(`.${NATIVE_CLASS}.${ACTIVE}`);
|
|
17617
|
+
const button = appMenuElement?.querySelector(`.${NATIVE_CLASS}.${ACTIVE}.${SDK_ACTIVE}`);
|
|
17566
17618
|
return button;
|
|
17567
17619
|
}
|
|
17620
|
+
static deactivateMenuItem(menuItem) {
|
|
17621
|
+
const {
|
|
17622
|
+
ACTIVE,
|
|
17623
|
+
HOVER,
|
|
17624
|
+
SDK_ACTIVE
|
|
17625
|
+
} = GmailAppMenuItemView.elementCss;
|
|
17626
|
+
if (menuItem.classList.contains(HOVER)) {
|
|
17627
|
+
menuItem.classList.remove(HOVER);
|
|
17628
|
+
}
|
|
17629
|
+
if (menuItem.classList.contains(ACTIVE)) {
|
|
17630
|
+
menuItem.classList.remove(ACTIVE);
|
|
17631
|
+
}
|
|
17632
|
+
if (menuItem.classList.contains(SDK_ACTIVE)) {
|
|
17633
|
+
menuItem.classList.remove(SDK_ACTIVE);
|
|
17634
|
+
}
|
|
17635
|
+
}
|
|
17568
17636
|
static #isPanelLess() {
|
|
17569
|
-
const activePanel = AppMenuItemView
|
|
17637
|
+
const activePanel = AppMenuItemView.getActivePanel(false);
|
|
17570
17638
|
return !activePanel;
|
|
17571
17639
|
}
|
|
17572
17640
|
static #adjustTooltipNub() {
|
|
@@ -17692,24 +17760,14 @@ class AppMenuItemView extends safe_event_emitter/* default */.A {
|
|
|
17692
17760
|
static #_3 = AppMenuItemView.#menuItemChangeStream.onValue(async v => {
|
|
17693
17761
|
const [type, menuItem, mouseEvent] = v;
|
|
17694
17762
|
const {
|
|
17695
|
-
ACTIVE,
|
|
17696
17763
|
HOVER
|
|
17697
17764
|
} = GmailAppMenuItemView.elementCss;
|
|
17698
17765
|
function handleActivate() {
|
|
17699
17766
|
const appMenuElement = gmail_element_getter/* default */.A.getAppMenuContainer();
|
|
17700
17767
|
|
|
17701
|
-
// deactivate active panel
|
|
17702
|
-
const activePanel = AppMenuItemView.#getActivePanel();
|
|
17703
|
-
if (activePanel) {
|
|
17704
|
-
activePanel.style.removeProperty('height');
|
|
17705
|
-
activePanel.classList.remove(CollapsiblePanelView.elementCss.ACTIVE);
|
|
17706
|
-
activePanel.classList.remove(CollapsiblePanelView.elementCss.HOVER);
|
|
17707
|
-
}
|
|
17708
|
-
|
|
17709
17768
|
// deactivate menu items and handle keyboard accessibility
|
|
17710
17769
|
for (const menuItem_ of appMenuElement?.querySelectorAll(`.${NATIVE_CLASS}`) ?? []) {
|
|
17711
|
-
|
|
17712
|
-
menuItem_.classList.remove(HOVER);
|
|
17770
|
+
AppMenuItemView.deactivateMenuItem(menuItem_);
|
|
17713
17771
|
// update tabindex
|
|
17714
17772
|
const iconElement = menuItem_.querySelector(ICON_ELEMENT_SELECTOR);
|
|
17715
17773
|
if (iconElement) {
|
|
@@ -17718,19 +17776,23 @@ class AppMenuItemView extends safe_event_emitter/* default */.A {
|
|
|
17718
17776
|
}
|
|
17719
17777
|
|
|
17720
17778
|
// activate menu item
|
|
17721
|
-
menuItem
|
|
17779
|
+
activateMenuItem(menuItem);
|
|
17722
17780
|
// activate panel
|
|
17723
17781
|
const panel = AppMenuItemView.#menuItemToPanelMap.get(menuItem);
|
|
17724
17782
|
if (panel) {
|
|
17725
|
-
|
|
17783
|
+
const otherPanels = AppMenuItemView.getAllPanels().filter(p => p !== panel);
|
|
17784
|
+
for (const otherPanel of otherPanels) {
|
|
17785
|
+
AppMenuItemView.deactivatePanel(otherPanel);
|
|
17786
|
+
}
|
|
17787
|
+
activatePanel(panel);
|
|
17726
17788
|
}
|
|
17727
17789
|
}
|
|
17728
17790
|
switch (type) {
|
|
17729
17791
|
case 'mouseenter':
|
|
17730
17792
|
{
|
|
17731
17793
|
const panel = AppMenuItemView.#menuItemToPanelMap.get(menuItem);
|
|
17732
|
-
const activeMenuItem = AppMenuItemView
|
|
17733
|
-
const activePanel = AppMenuItemView
|
|
17794
|
+
const activeMenuItem = AppMenuItemView.getActiveMenuItem();
|
|
17795
|
+
const activePanel = AppMenuItemView.getActivePanel();
|
|
17734
17796
|
const burgerMenuOpen = gmail_element_getter/* default */.A.isAppBurgerMenuOpen();
|
|
17735
17797
|
|
|
17736
17798
|
// hover-styled panel is displayed for collapsed burger menu
|
|
@@ -17738,19 +17800,20 @@ class AppMenuItemView extends safe_event_emitter/* default */.A {
|
|
|
17738
17800
|
|
|
17739
17801
|
// deactivate active panel
|
|
17740
17802
|
if (activePanel) {
|
|
17741
|
-
|
|
17742
|
-
activePanel.classList.remove(CollapsiblePanelView.elementCss.ACTIVE);
|
|
17743
|
-
activePanel.classList.remove(CollapsiblePanelView.elementCss.HOVER);
|
|
17803
|
+
AppMenuItemView.deactivatePanel(activePanel);
|
|
17744
17804
|
}
|
|
17745
17805
|
|
|
17746
17806
|
// activate new panel
|
|
17747
17807
|
if (panel) {
|
|
17748
17808
|
const height = window.innerHeight - panel.getBoundingClientRect().top;
|
|
17749
17809
|
panel.style.cssText = `height: ${height}px;`;
|
|
17750
|
-
panel
|
|
17751
|
-
|
|
17810
|
+
activatePanel(panel, {
|
|
17811
|
+
hover: true
|
|
17812
|
+
});
|
|
17752
17813
|
// hover menu item
|
|
17753
|
-
menuItem.classList.
|
|
17814
|
+
if (!menuItem.classList.contains(HOVER)) {
|
|
17815
|
+
menuItem.classList.add(HOVER);
|
|
17816
|
+
}
|
|
17754
17817
|
// handle burger menu collapsed
|
|
17755
17818
|
if (!burgerMenuOpen) {
|
|
17756
17819
|
for (const panel of document.querySelectorAll(CollapsiblePanelView.elementSelectors.NATIVE) ?? []) {
|
|
@@ -17760,7 +17823,9 @@ class AppMenuItemView extends safe_event_emitter/* default */.A {
|
|
|
17760
17823
|
} else {
|
|
17761
17824
|
// panel doesn't exist (i.e. Meet) so activate active menu item's panel instead (as Gmail currently does -- FEB 2023)
|
|
17762
17825
|
const panel = activeMenuItem && AppMenuItemView.#menuItemToPanelMap.get(activeMenuItem);
|
|
17763
|
-
panel
|
|
17826
|
+
if (panel) {
|
|
17827
|
+
activatePanel(panel);
|
|
17828
|
+
}
|
|
17764
17829
|
}
|
|
17765
17830
|
break;
|
|
17766
17831
|
}
|
|
@@ -17769,15 +17834,17 @@ class AppMenuItemView extends safe_event_emitter/* default */.A {
|
|
|
17769
17834
|
// Do not handle blur event when we're in one of the panel's dropdowns
|
|
17770
17835
|
const isPanelDropdownShown = AppMenuItemView.#isPanelDropdownShown();
|
|
17771
17836
|
if (isPanelDropdownShown) return;
|
|
17772
|
-
const activeMenuItem = AppMenuItemView
|
|
17773
|
-
const activePanel = AppMenuItemView
|
|
17837
|
+
const activeMenuItem = AppMenuItemView.getActiveMenuItem();
|
|
17838
|
+
const activePanel = AppMenuItemView.getActivePanel();
|
|
17774
17839
|
const activeMenuItemPanel = activeMenuItem && AppMenuItemView.#menuItemToPanelMap.get(activeMenuItem);
|
|
17775
17840
|
if (mouseEvent.relatedTarget instanceof Node && (menuItem.contains(mouseEvent.relatedTarget) || activePanel?.contains(mouseEvent.relatedTarget))) return;
|
|
17776
17841
|
const burgerMenuOpen = gmail_element_getter/* default */.A.isAppBurgerMenuOpen();
|
|
17777
17842
|
if (activePanel === activeMenuItemPanel && burgerMenuOpen) return;
|
|
17778
17843
|
|
|
17779
17844
|
// unhover menu item
|
|
17780
|
-
menuItem.classList.
|
|
17845
|
+
if (menuItem.classList.contains(HOVER)) {
|
|
17846
|
+
menuItem.classList.remove(HOVER);
|
|
17847
|
+
}
|
|
17781
17848
|
|
|
17782
17849
|
// handle burger menu collapsed
|
|
17783
17850
|
for (const panel of document.querySelectorAll(CollapsiblePanelView.elementSelectors.NATIVE) ?? []) {
|
|
@@ -17786,14 +17853,12 @@ class AppMenuItemView extends safe_event_emitter/* default */.A {
|
|
|
17786
17853
|
|
|
17787
17854
|
// deactivate active panel
|
|
17788
17855
|
if (activePanel) {
|
|
17789
|
-
|
|
17790
|
-
activePanel.classList.remove(CollapsiblePanelView.elementCss.ACTIVE);
|
|
17791
|
-
activePanel.classList.remove(CollapsiblePanelView.elementCss.HOVER);
|
|
17856
|
+
AppMenuItemView.deactivatePanel(activePanel);
|
|
17792
17857
|
}
|
|
17793
17858
|
|
|
17794
17859
|
// activate active menu item panel
|
|
17795
17860
|
if (activeMenuItemPanel) {
|
|
17796
|
-
activeMenuItemPanel
|
|
17861
|
+
activatePanel(activeMenuItemPanel);
|
|
17797
17862
|
}
|
|
17798
17863
|
break;
|
|
17799
17864
|
}
|
|
@@ -17921,12 +17986,48 @@ class AppMenuItemView extends safe_event_emitter/* default */.A {
|
|
|
17921
17986
|
AppMenuItemView.#appMenuItemViews.delete(this);
|
|
17922
17987
|
}
|
|
17923
17988
|
}
|
|
17989
|
+
function activatePanel(panel, options) {
|
|
17990
|
+
const {
|
|
17991
|
+
ACTIVE,
|
|
17992
|
+
HOVER,
|
|
17993
|
+
SDK_ACTIVE
|
|
17994
|
+
} = CollapsiblePanelView.elementCss;
|
|
17995
|
+
if (!panel.classList.contains(ACTIVE)) {
|
|
17996
|
+
panel.classList.add(ACTIVE);
|
|
17997
|
+
}
|
|
17998
|
+
if (!panel.classList.contains(SDK_ACTIVE)) {
|
|
17999
|
+
panel.classList.add(SDK_ACTIVE);
|
|
18000
|
+
}
|
|
18001
|
+
if (options?.hover) {
|
|
18002
|
+
if (!panel.classList.contains(HOVER)) {
|
|
18003
|
+
panel.classList.add(HOVER);
|
|
18004
|
+
}
|
|
18005
|
+
} else {
|
|
18006
|
+
if (panel.classList.contains(HOVER)) {
|
|
18007
|
+
panel.classList.remove(HOVER);
|
|
18008
|
+
}
|
|
18009
|
+
}
|
|
18010
|
+
}
|
|
18011
|
+
function activateMenuItem(menuItem) {
|
|
18012
|
+
const {
|
|
18013
|
+
ACTIVE,
|
|
18014
|
+
SDK_ACTIVE
|
|
18015
|
+
} = GmailAppMenuItemView.elementCss;
|
|
18016
|
+
if (!menuItem.classList.contains(ACTIVE)) {
|
|
18017
|
+
menuItem.classList.add(ACTIVE);
|
|
18018
|
+
}
|
|
18019
|
+
if (!menuItem.classList.contains(SDK_ACTIVE)) {
|
|
18020
|
+
menuItem.classList.add(SDK_ACTIVE);
|
|
18021
|
+
}
|
|
18022
|
+
}
|
|
17924
18023
|
;// CONCATENATED MODULE: ./src/platform-implementation-js/namespaces/app-menu.ts
|
|
17925
18024
|
|
|
17926
18025
|
|
|
17927
18026
|
|
|
17928
18027
|
|
|
17929
18028
|
|
|
18029
|
+
|
|
18030
|
+
|
|
17930
18031
|
/**
|
|
17931
18032
|
* In dark themes, Gmail has different colored primary buttons depending on hover or active state
|
|
17932
18033
|
*/
|
|
@@ -17977,6 +18078,7 @@ class AppMenu {
|
|
|
17977
18078
|
});
|
|
17978
18079
|
constructor(driver) {
|
|
17979
18080
|
this.#driver = driver;
|
|
18081
|
+
AppMenu.#monitorAppMenuState();
|
|
17980
18082
|
}
|
|
17981
18083
|
|
|
17982
18084
|
/**
|
|
@@ -18014,6 +18116,42 @@ class AppMenu {
|
|
|
18014
18116
|
const result = await gmail_element_getter/* default */.A.getAppMenuAsync();
|
|
18015
18117
|
return !!result;
|
|
18016
18118
|
}
|
|
18119
|
+
static #monitorInitialized = false;
|
|
18120
|
+
static async #monitorAppMenuState() {
|
|
18121
|
+
/**
|
|
18122
|
+
* Gmail could set menu item to active asynchronously, monitor changes to the menu DOM and
|
|
18123
|
+
* deactivate all other menu items that don't have the SDK specific active class name.
|
|
18124
|
+
*
|
|
18125
|
+
* Same applies to menu panel. Deactivate all other panels that don't have the SDK specific active class name.
|
|
18126
|
+
*/
|
|
18127
|
+
|
|
18128
|
+
if (this.#monitorInitialized) {
|
|
18129
|
+
return;
|
|
18130
|
+
}
|
|
18131
|
+
this.#monitorInitialized = true;
|
|
18132
|
+
kefir_esm["default"].fromPromise(gmail_element_getter/* default */.A.getAppMenuAsync()).filter(isNotNil/* default */.A).flatMap(appMenu => (0,make_mutation_observer_chunked_stream/* default */.A)(appMenu, {
|
|
18133
|
+
childList: true,
|
|
18134
|
+
subtree: true,
|
|
18135
|
+
attributes: true,
|
|
18136
|
+
attributeFilter: ['class']
|
|
18137
|
+
}).delay(0)).filter(mutations => mutations.some(m => m.target instanceof HTMLElement && AppMenuItemView.isMenuItem(m.target))).throttle(10, {
|
|
18138
|
+
leading: true,
|
|
18139
|
+
trailing: true
|
|
18140
|
+
}).map(() => {
|
|
18141
|
+
const activeMenuItem = AppMenuItemView.getActiveMenuItem();
|
|
18142
|
+
if (activeMenuItem) {
|
|
18143
|
+
const otherMenuItems = AppMenuItemView.getAllMenuItems().filter(menuItem => menuItem !== activeMenuItem);
|
|
18144
|
+
otherMenuItems.map(menuItem => AppMenuItemView.deactivateMenuItem(menuItem));
|
|
18145
|
+
}
|
|
18146
|
+
const activePanel = AppMenuItemView.getActivePanel();
|
|
18147
|
+
if (activePanel) {
|
|
18148
|
+
const otherPanels = AppMenuItemView.getAllPanels().filter(panel => panel !== activePanel);
|
|
18149
|
+
otherPanels.map(panel => AppMenuItemView.deactivatePanel(panel));
|
|
18150
|
+
}
|
|
18151
|
+
}).onValue(() => {
|
|
18152
|
+
// monitor forever
|
|
18153
|
+
});
|
|
18154
|
+
}
|
|
18017
18155
|
}
|
|
18018
18156
|
// EXTERNAL MODULE: ./node_modules/lodash/intersection.js
|
|
18019
18157
|
var intersection = __webpack_require__(4225);
|
|
@@ -19535,7 +19673,7 @@ mole_view_module_options.insert = htmlElement => {
|
|
|
19535
19673
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
19536
19674
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
19537
19675
|
///@ts-ignore
|
|
19538
|
-
"2.1.
|
|
19676
|
+
"2.1.61-1718747129530-da0f4707d79e342c");
|
|
19539
19677
|
document.head.append(htmlElement);
|
|
19540
19678
|
};
|
|
19541
19679
|
mole_view_module_options.domAPI = (styleDomAPI_default());
|