@inboxsdk/core 2.1.56 → 2.1.58-0
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 +275 -122
- package/inboxsdk.js.map +1 -1
- package/package.json +3 -2
- package/pageWorld.js.map +1 -1
- package/src/common/get-extension-id.d.ts.map +1 -1
- package/src/inboxsdk.d.ts +2 -12
- package/src/platform-implementation-js/constants/nav-item-types.d.ts +7 -0
- package/src/platform-implementation-js/constants/nav-item-types.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/add-nav-item.d.ts +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/add-nav-item.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/nav-item-section.d.ts +6 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/nav-item-section.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver.d.ts +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/views/gmail-nav-item-view.d.ts +19 -6
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-nav-item-view.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/views/native-gmail-nav-item-view.d.ts.map +1 -1
- package/src/platform-implementation-js/driver-common/update-icon.d.ts +1 -1
- package/src/platform-implementation-js/driver-common/update-icon.d.ts.map +1 -1
- package/src/platform-implementation-js/namespaces/nav-menu.d.ts +5 -4
- package/src/platform-implementation-js/namespaces/nav-menu.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/src/platform-implementation-js/views/nav-item-view.d.ts +13 -4
- package/src/platform-implementation-js/views/nav-item-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.58-0-1717520185507-d238ab15d8afd0c8-MODIFIED";
|
|
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.58-0-1717520185507-d238ab15d8afd0c8-MODIFIED");
|
|
2650
2650
|
document.head.append(htmlElement);
|
|
2651
2651
|
};
|
|
2652
2652
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -9292,7 +9292,7 @@ function createIconImgElement(iconUrl, containerElement, append, insertBeforeEl)
|
|
|
9292
9292
|
// TODO make this return a class instead of taking the iconSettings state object
|
|
9293
9293
|
function updateIcon(iconSettings, containerElement, append, newIconClass, newIconUrl, insertBeforeEl,
|
|
9294
9294
|
// Should not be used with append: true — the append flag will override
|
|
9295
|
-
newIconHtml) {
|
|
9295
|
+
newIconHtml, iconLiga) {
|
|
9296
9296
|
if (append && insertBeforeEl) throw new Error('append and insertBeforeEl should not be used together');
|
|
9297
9297
|
|
|
9298
9298
|
// if iconHtml exists, class or url presents just throw error
|
|
@@ -9331,6 +9331,9 @@ newIconHtml) {
|
|
|
9331
9331
|
if (!iconSettings.iconElement) {
|
|
9332
9332
|
iconSettings.iconElement = createIconElement(containerElement, append, insertBeforeEl);
|
|
9333
9333
|
}
|
|
9334
|
+
if (iconLiga) {
|
|
9335
|
+
iconSettings.iconElement.innerText = iconLiga;
|
|
9336
|
+
}
|
|
9334
9337
|
iconSettings.iconElement.setAttribute('class', 'inboxsdk__button_icon ' + newIconClass);
|
|
9335
9338
|
if (iconSettings.iconHtmlElement) {
|
|
9336
9339
|
iconSettings.iconHtmlElement.remove();
|
|
@@ -10194,7 +10197,7 @@ options.insert = htmlElement => {
|
|
|
10194
10197
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
10195
10198
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
10196
10199
|
///@ts-ignore
|
|
10197
|
-
"2.1.
|
|
10200
|
+
"2.1.58-0-1717520185507-d238ab15d8afd0c8-MODIFIED");
|
|
10198
10201
|
document.head.append(htmlElement);
|
|
10199
10202
|
};
|
|
10200
10203
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -10347,7 +10350,10 @@ var ajax = __webpack_require__(8587);
|
|
|
10347
10350
|
;// CONCATENATED MODULE: ./src/common/get-extension-id.ts
|
|
10348
10351
|
function getExtensionId() {
|
|
10349
10352
|
const chrome = __webpack_require__.g.chrome;
|
|
10350
|
-
if (chrome
|
|
10353
|
+
if (chrome?.runtime?.getURL) {
|
|
10354
|
+
return chrome.runtime.getURL('');
|
|
10355
|
+
}
|
|
10356
|
+
if (chrome?.extension?.getURL) {
|
|
10351
10357
|
return chrome.extension.getURL('');
|
|
10352
10358
|
}
|
|
10353
10359
|
return null;
|
|
@@ -11320,7 +11326,7 @@ if (!globalThis.__InboxSDKImpLoader) {
|
|
|
11320
11326
|
await onready;
|
|
11321
11327
|
const {
|
|
11322
11328
|
makePlatformImplementation
|
|
11323
|
-
} = await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
11329
|
+
} = await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 932));
|
|
11324
11330
|
return makePlatformImplementation(appId, opts, {
|
|
11325
11331
|
piMainStarted,
|
|
11326
11332
|
piLoadStarted,
|
|
@@ -11467,7 +11473,7 @@ class Keyboard {
|
|
|
11467
11473
|
|
|
11468
11474
|
/***/ }),
|
|
11469
11475
|
|
|
11470
|
-
/***/
|
|
11476
|
+
/***/ 932:
|
|
11471
11477
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
11472
11478
|
|
|
11473
11479
|
"use strict";
|
|
@@ -14920,7 +14926,7 @@ options.insert = htmlElement => {
|
|
|
14920
14926
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
14921
14927
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
14922
14928
|
///@ts-ignore
|
|
14923
|
-
"2.1.
|
|
14929
|
+
"2.1.58-0-1717520185507-d238ab15d8afd0c8-MODIFIED");
|
|
14924
14930
|
document.head.append(htmlElement);
|
|
14925
14931
|
};
|
|
14926
14932
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -16705,11 +16711,15 @@ const navItemTypes = Object.freeze({
|
|
|
16705
16711
|
* nav item that looks like a link
|
|
16706
16712
|
*/
|
|
16707
16713
|
LINK: 'LINK',
|
|
16708
|
-
|
|
16709
|
-
|
|
16714
|
+
/**
|
|
16715
|
+
* nav item for logical grouping. In Gmailv2, the entire nav item can be clicked to expand/collapse its children
|
|
16716
|
+
* and it ignores all NavItemDescriptor options other than `name` and `subtitle`.
|
|
16717
|
+
* Behaves identically to NAVIGATION when in Gmailv1.
|
|
16718
|
+
*/
|
|
16710
16719
|
GROUPER: 'GROUPER',
|
|
16711
|
-
|
|
16712
|
-
MANAGE: 'MANAGE'
|
|
16720
|
+
/** Old alias for LINK */
|
|
16721
|
+
MANAGE: 'MANAGE',
|
|
16722
|
+
SECTION: 'SECTION'
|
|
16713
16723
|
});
|
|
16714
16724
|
/* harmony default export */ const nav_item_types = (navItemTypes);
|
|
16715
16725
|
;// CONCATENATED MODULE: ./src/platform-implementation-js/views/nav-item-view.ts
|
|
@@ -16718,31 +16728,30 @@ const navItemTypes = Object.freeze({
|
|
|
16718
16728
|
|
|
16719
16729
|
|
|
16720
16730
|
|
|
16721
|
-
|
|
16722
|
-
const nav_item_view_memberMap = new WeakMap();
|
|
16723
16731
|
class NavItemView extends safe_event_emitter/* default */.A {
|
|
16732
|
+
#appId;
|
|
16733
|
+
#driver;
|
|
16734
|
+
#navItemDescriptorPropertyStream;
|
|
16735
|
+
#navItemViews = [];
|
|
16736
|
+
#navItemViewDriver = null;
|
|
16737
|
+
#navItemViewDriverPromise;
|
|
16724
16738
|
destroyed = false;
|
|
16725
16739
|
constructor(appId, driver, navItemDescriptorPropertyStream, navItemViewDriverPromise) {
|
|
16726
16740
|
super();
|
|
16727
|
-
|
|
16728
|
-
|
|
16729
|
-
|
|
16730
|
-
|
|
16731
|
-
navItemViews: [],
|
|
16732
|
-
navItemViewDriver: null,
|
|
16733
|
-
navItemViewDriverPromise
|
|
16734
|
-
};
|
|
16735
|
-
nav_item_view_memberMap.set(this, members);
|
|
16741
|
+
this.#appId = appId;
|
|
16742
|
+
this.#driver = driver;
|
|
16743
|
+
this.#navItemDescriptorPropertyStream = navItemDescriptorPropertyStream;
|
|
16744
|
+
this.#navItemViewDriverPromise = navItemViewDriverPromise;
|
|
16736
16745
|
driver.getStopper().onValue(this.remove.bind(this));
|
|
16737
16746
|
navItemViewDriverPromise.then(navItemViewDriver => {
|
|
16738
16747
|
if (this.destroyed || !navItemViewDriver) {
|
|
16739
16748
|
return; //we have been removed already
|
|
16740
16749
|
}
|
|
16741
16750
|
|
|
16742
|
-
const driver =
|
|
16743
|
-
|
|
16744
|
-
|
|
16745
|
-
kefir_esm["default"].combine([
|
|
16751
|
+
const driver = this.#driver;
|
|
16752
|
+
this.#navItemViewDriver = navItemViewDriver;
|
|
16753
|
+
this.#navItemDescriptorPropertyStream.sampledBy(navItemViewDriver.getEventStream(), (a, b) => [a, b]).onValue(navItemDescriptor => this.#handleViewDriverStreamEvent(navItemViewDriver, navItemDescriptor));
|
|
16754
|
+
kefir_esm["default"].combine([this.#navItemDescriptorPropertyStream, driver.getRouteViewDriverStream()]).takeUntilBy(navItemViewDriver.getEventStream().filter(() => false).beforeEnd(() => null)).onValue(x => {
|
|
16746
16755
|
_handleRouteViewChange(navItemViewDriver, x);
|
|
16747
16756
|
});
|
|
16748
16757
|
this.emit('inserted');
|
|
@@ -16750,13 +16759,12 @@ class NavItemView extends safe_event_emitter/* default */.A {
|
|
|
16750
16759
|
}
|
|
16751
16760
|
addNavItem(navItemDescriptor) {
|
|
16752
16761
|
if (this.destroyed) throw new Error('this nav item view does not exist');
|
|
16753
|
-
const
|
|
16754
|
-
const
|
|
16755
|
-
const
|
|
16756
|
-
const navItemViews = members.navItemViews;
|
|
16762
|
+
const driver = this.#driver;
|
|
16763
|
+
const appId = this.#appId;
|
|
16764
|
+
const navItemViews = this.#navItemViews;
|
|
16757
16765
|
const navItemDescriptorPropertyStream = kefir_cast_default()(kefir_esm["default"], navItemDescriptor).toProperty();
|
|
16758
|
-
const childNavItemView = new NavItemView(appId, driver, navItemDescriptorPropertyStream,
|
|
16759
|
-
const childNavItemViewDriver = navItemViewDriver.addNavItem(
|
|
16766
|
+
const childNavItemView = new NavItemView(appId, driver, navItemDescriptorPropertyStream, this.#navItemViewDriverPromise.then(navItemViewDriver => {
|
|
16767
|
+
const childNavItemViewDriver = navItemViewDriver.addNavItem(this.#appId, navItemDescriptorPropertyStream);
|
|
16760
16768
|
return childNavItemViewDriver;
|
|
16761
16769
|
}));
|
|
16762
16770
|
navItemViews.push(childNavItemView);
|
|
@@ -16766,22 +16774,18 @@ class NavItemView extends safe_event_emitter/* default */.A {
|
|
|
16766
16774
|
if (this.destroyed) {
|
|
16767
16775
|
return;
|
|
16768
16776
|
}
|
|
16769
|
-
const
|
|
16770
|
-
const {
|
|
16771
|
-
navItemViews
|
|
16772
|
-
} = members;
|
|
16777
|
+
const navItemViews = this.#navItemViews;
|
|
16773
16778
|
this.destroyed = true;
|
|
16774
16779
|
this.emit('destroy');
|
|
16775
16780
|
navItemViews.forEach(function (navItemView) {
|
|
16776
16781
|
navItemView.remove();
|
|
16777
16782
|
});
|
|
16778
|
-
|
|
16783
|
+
this.#navItemViewDriverPromise.then(navItemViewDriver => {
|
|
16779
16784
|
navItemViewDriver.destroy();
|
|
16780
16785
|
});
|
|
16781
16786
|
}
|
|
16782
16787
|
isCollapsed() {
|
|
16783
|
-
const
|
|
16784
|
-
const navItemViewDriver = members.navItemViewDriver;
|
|
16788
|
+
const navItemViewDriver = this.#navItemViewDriver;
|
|
16785
16789
|
if (navItemViewDriver) {
|
|
16786
16790
|
return navItemViewDriver.isCollapsed();
|
|
16787
16791
|
} else {
|
|
@@ -16789,43 +16793,43 @@ class NavItemView extends safe_event_emitter/* default */.A {
|
|
|
16789
16793
|
}
|
|
16790
16794
|
}
|
|
16791
16795
|
setCollapsed(collapseValue) {
|
|
16792
|
-
|
|
16796
|
+
this.#navItemViewDriverPromise.then(navItemViewDriver => {
|
|
16793
16797
|
navItemViewDriver.setCollapsed(collapseValue);
|
|
16794
16798
|
});
|
|
16795
16799
|
}
|
|
16796
16800
|
getElement() {
|
|
16797
|
-
return
|
|
16801
|
+
return this.#navItemViewDriverPromise.then(navItemViewDriver => navItemViewDriver.getElement());
|
|
16798
16802
|
}
|
|
16799
|
-
|
|
16800
|
-
|
|
16801
|
-
|
|
16802
|
-
|
|
16803
|
-
|
|
16804
|
-
|
|
16805
|
-
|
|
16806
|
-
|
|
16807
|
-
|
|
16808
|
-
|
|
16809
|
-
|
|
16810
|
-
|
|
16803
|
+
#handleViewDriverStreamEvent(navItemViewDriver, _ref) {
|
|
16804
|
+
let [navItemDescriptor, event] = _ref;
|
|
16805
|
+
switch (event.eventName) {
|
|
16806
|
+
case 'click':
|
|
16807
|
+
// When in Gmailv2, we ignore the onClick, routeID, and routeParams options on GROUPER nav-items
|
|
16808
|
+
if (navItemDescriptor.type === nav_item_types.GROUPER) return;
|
|
16809
|
+
if (typeof navItemDescriptor.onClick === 'function') {
|
|
16810
|
+
let defaultPrevented = false;
|
|
16811
|
+
const syntheticEvent = {
|
|
16812
|
+
preventDefault() {
|
|
16813
|
+
defaultPrevented = true;
|
|
16814
|
+
}
|
|
16815
|
+
};
|
|
16816
|
+
// TODO: is this synthetic event ever used?
|
|
16817
|
+
navItemDescriptor.onClick(syntheticEvent);
|
|
16818
|
+
if (defaultPrevented) {
|
|
16819
|
+
break;
|
|
16811
16820
|
}
|
|
16812
|
-
};
|
|
16813
|
-
// TODO: is this synthetic event ever used?
|
|
16814
|
-
navItemDescriptor.onClick(syntheticEvent);
|
|
16815
|
-
if (defaultPrevented) {
|
|
16816
|
-
break;
|
|
16817
16821
|
}
|
|
16818
|
-
|
|
16819
|
-
|
|
16820
|
-
|
|
16821
|
-
|
|
16822
|
-
|
|
16823
|
-
|
|
16824
|
-
|
|
16825
|
-
|
|
16826
|
-
|
|
16827
|
-
|
|
16828
|
-
|
|
16822
|
+
if (navItemDescriptor.routeID) {
|
|
16823
|
+
this.#driver.goto(navItemDescriptor.routeID, navItemDescriptor.routeParams);
|
|
16824
|
+
} else {
|
|
16825
|
+
navItemViewDriver.toggleCollapse();
|
|
16826
|
+
}
|
|
16827
|
+
break;
|
|
16828
|
+
case 'expanded':
|
|
16829
|
+
case 'collapsed':
|
|
16830
|
+
this.emit(event.eventName);
|
|
16831
|
+
break;
|
|
16832
|
+
}
|
|
16829
16833
|
}
|
|
16830
16834
|
}
|
|
16831
16835
|
function _handleRouteViewChange(navItemViewDriver, _ref2) {
|
|
@@ -16862,7 +16866,7 @@ class NativeNavItemView extends safe_event_emitter/* default */.A {
|
|
|
16862
16866
|
}
|
|
16863
16867
|
addNavItem(navItemDescriptor) {
|
|
16864
16868
|
const members = (0,get_or_fail/* default */.A)(native_nav_item_view_memberMap, this);
|
|
16865
|
-
const navItemDescriptorPropertyStream = kefir_cast_default()(kefir_esm
|
|
16869
|
+
const navItemDescriptorPropertyStream = kefir_cast_default()(kefir_esm, navItemDescriptor).toProperty();
|
|
16866
16870
|
const childNavItemView = new NavItemView(members.appId, members.driver, navItemDescriptorPropertyStream, members.navItemViewDriverPromise.then(navItemViewDriver => {
|
|
16867
16871
|
const childNavItemViewDriver = navItemViewDriver.addNavItem(members.appId, navItemDescriptorPropertyStream);
|
|
16868
16872
|
return childNavItemViewDriver;
|
|
@@ -17219,6 +17223,7 @@ class GmailAppMenuItemView extends events.EventEmitter {
|
|
|
17219
17223
|
const collapsible_panel_view_NATIVE_CLASS = 'aqn';
|
|
17220
17224
|
const collapsible_panel_view_INBOXSDK_CLASS = 'inboxsdk__collapsiblePanel';
|
|
17221
17225
|
const collapsible_panel_view_ELEMENT_CLASS = `${collapsible_panel_view_NATIVE_CLASS} ${collapsible_panel_view_INBOXSDK_CLASS} oy8Mbf`;
|
|
17226
|
+
const PANEL_NAV_ITEMS_CONTAINER_CLASS = 'inboxsdk__collapsiblePanel_navItems';
|
|
17222
17227
|
const PRIMARY_BUTTON_ELEMENT_CLASS = 'T-I T-I-KE L3';
|
|
17223
17228
|
const PRIMARY_BUTTON_ELEMENT_SELECTOR = '.T-I.T-I-KE.L3';
|
|
17224
17229
|
const scrollablePanelClass = 'at9';
|
|
@@ -17226,7 +17231,7 @@ const scrollablePanelSelector = `.${scrollablePanelClass}`;
|
|
|
17226
17231
|
const loadingElementClass = 'inboxsdk__collapsiblePanel_loading_container';
|
|
17227
17232
|
const panelLoadingClass = `${loadingElementClass}--active`;
|
|
17228
17233
|
const loadingElementSelector = `.${loadingElementClass}`;
|
|
17229
|
-
const
|
|
17234
|
+
const panelNavItemsContainerSelector = `.${PANEL_NAV_ITEMS_CONTAINER_CLASS}`;
|
|
17230
17235
|
/**
|
|
17231
17236
|
* Each AppMenuItem can have a CollapsiblePanelView.
|
|
17232
17237
|
*
|
|
@@ -17251,9 +17256,9 @@ class CollapsiblePanelView extends safe_event_emitter/* default */.A {
|
|
|
17251
17256
|
#element;
|
|
17252
17257
|
#destroyed = false;
|
|
17253
17258
|
#id = Math.random().toFixed(3);
|
|
17254
|
-
#ARIA_LABELLED_BY_ID = Math.random().toFixed(3);
|
|
17255
17259
|
#driver;
|
|
17256
17260
|
#loading;
|
|
17261
|
+
#orderGroup = `collapsible-panel-${this.#id}-nav-item`;
|
|
17257
17262
|
get loading() {
|
|
17258
17263
|
return this.#loading;
|
|
17259
17264
|
}
|
|
@@ -17318,11 +17323,10 @@ class CollapsiblePanelView extends safe_event_emitter/* default */.A {
|
|
|
17318
17323
|
const {
|
|
17319
17324
|
element
|
|
17320
17325
|
} = this;
|
|
17321
|
-
const
|
|
17322
|
-
const appId = `collapsible-panel-${this.#id}`;
|
|
17326
|
+
const orderGroup = this.#orderGroup;
|
|
17323
17327
|
const navItemDescriptorPropertyStream = kefir_cast_default()(kefir_esm, navItemDescriptor).toProperty();
|
|
17324
|
-
const gmailNavItemView = this.#driver.
|
|
17325
|
-
const navItemView = new NavItemView(
|
|
17328
|
+
const gmailNavItemView = this.#driver.addNavItemToPanel(orderGroup, navItemDescriptorPropertyStream, element);
|
|
17329
|
+
const navItemView = new NavItemView(orderGroup, this.#driver, navItemDescriptorPropertyStream, gmailNavItemView);
|
|
17326
17330
|
return navItemView;
|
|
17327
17331
|
}
|
|
17328
17332
|
#extractPrimaryButtonTheme() {
|
|
@@ -17385,20 +17389,8 @@ class CollapsiblePanelView extends safe_event_emitter/* default */.A {
|
|
|
17385
17389
|
<div class="Ls77Lb aZ6">
|
|
17386
17390
|
<div class="pp" style="user-select: none;">
|
|
17387
17391
|
<div>
|
|
17388
|
-
<div class="nM">
|
|
17392
|
+
<div class="${`nM ${PANEL_NAV_ITEMS_CONTAINER_CLASS}`}">
|
|
17389
17393
|
<div class="aic"></div>
|
|
17390
|
-
<div class="yJ">
|
|
17391
|
-
<div class="ajl aib aZ6" aria-labelledby="${this.#ARIA_LABELLED_BY_ID}">
|
|
17392
|
-
<h2 class="aWk" id="${this.#ARIA_LABELLED_BY_ID}">Labels</h2>
|
|
17393
|
-
<div class="wT">
|
|
17394
|
-
<div class="n3">
|
|
17395
|
-
<div class="byl">
|
|
17396
|
-
<div class="TK"></div>
|
|
17397
|
-
</div>
|
|
17398
|
-
</div>
|
|
17399
|
-
</div>
|
|
17400
|
-
</div>
|
|
17401
|
-
</div>
|
|
17402
17394
|
</div>
|
|
17403
17395
|
</div>
|
|
17404
17396
|
</div>
|
|
@@ -19543,7 +19535,7 @@ mole_view_module_options.insert = htmlElement => {
|
|
|
19543
19535
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
19544
19536
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
19545
19537
|
///@ts-ignore
|
|
19546
|
-
"2.1.
|
|
19538
|
+
"2.1.58-0-1717520185507-d238ab15d8afd0c8-MODIFIED");
|
|
19547
19539
|
document.head.append(htmlElement);
|
|
19548
19540
|
};
|
|
19549
19541
|
mole_view_module_options.domAPI = (styleDomAPI_default());
|
|
@@ -20961,6 +20953,80 @@ function renderCustomIcon(containerElement, customIconElement, append, insertBef
|
|
|
20961
20953
|
containerElement.insertBefore(containerElement, insertBeforeEl || containerElement.firstElementChild);
|
|
20962
20954
|
}
|
|
20963
20955
|
}
|
|
20956
|
+
;// CONCATENATED MODULE: ./src/platform-implementation-js/dom-driver/gmail/gmail-driver/nav-item-section.ts
|
|
20957
|
+
|
|
20958
|
+
|
|
20959
|
+
|
|
20960
|
+
|
|
20961
|
+
const NAV_ITEM_SECTION_CLASS_NAME = 'inboxsdk__navItem_section';
|
|
20962
|
+
const SECTION_LIST_CLASS_NAME = 'inboxsdk__navItem_section_list';
|
|
20963
|
+
const getSectionListSelector = sectionKey => `.${SECTION_LIST_CLASS_NAME}[data-section-key="${sectionKey}"]`;
|
|
20964
|
+
const SECTION_ITEMS_CLASS_NAME = 'inboxsdk__navItem_section_list_items';
|
|
20965
|
+
const getSectionItemsSelector = sectionKey => `.${SECTION_ITEMS_CLASS_NAME}[data-section-key="${sectionKey}"]`;
|
|
20966
|
+
function createSectionNavItemsContainer() {
|
|
20967
|
+
let sectionKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
|
|
20968
|
+
let orderGroup = arguments.length > 1 ? arguments[1] : undefined;
|
|
20969
|
+
let orderHint = arguments.length > 2 ? arguments[2] : undefined;
|
|
20970
|
+
let insertionOrderHint = arguments.length > 3 ? arguments[3] : undefined;
|
|
20971
|
+
const element = document.createElement('div');
|
|
20972
|
+
element.classList.add('yJ', SECTION_LIST_CLASS_NAME);
|
|
20973
|
+
element.dataset.sectionKey = sectionKey;
|
|
20974
|
+
if (orderGroup) {
|
|
20975
|
+
element.setAttribute('data-group-order-hint', orderGroup);
|
|
20976
|
+
}
|
|
20977
|
+
if (orderHint) {
|
|
20978
|
+
element.setAttribute('data-order-hint', orderHint.toString());
|
|
20979
|
+
}
|
|
20980
|
+
if (insertionOrderHint) {
|
|
20981
|
+
element.setAttribute('data-insertion-order-hint', insertionOrderHint.toString());
|
|
20982
|
+
}
|
|
20983
|
+
const ARIA_LABELLED_BY_ID = Math.random().toFixed(3);
|
|
20984
|
+
element.innerHTML = auto_html_js_default()`
|
|
20985
|
+
<div class="ajl aib aZ6" aria-labelledby="${ARIA_LABELLED_BY_ID}">
|
|
20986
|
+
<h2 class="aWk" id="${ARIA_LABELLED_BY_ID}">Labels</h2>
|
|
20987
|
+
<div class="wT">
|
|
20988
|
+
<div class="n3">
|
|
20989
|
+
<div class="byl">
|
|
20990
|
+
<div class="TK ${SECTION_ITEMS_CLASS_NAME}" data-section-key="${sectionKey}"></div>
|
|
20991
|
+
</div>
|
|
20992
|
+
</div>
|
|
20993
|
+
</div>
|
|
20994
|
+
</div>
|
|
20995
|
+
`;
|
|
20996
|
+
return element;
|
|
20997
|
+
}
|
|
20998
|
+
function getPanelSectionNavItemContainerElement(panelElement) {
|
|
20999
|
+
return (0,querySelectorOrFail/* default */.A)(panelElement, panelNavItemsContainerSelector);
|
|
21000
|
+
}
|
|
21001
|
+
function getPanelNavItemContainerElement(panelElement) {
|
|
21002
|
+
let sectionKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
|
|
21003
|
+
let orderGroup = arguments.length > 2 ? arguments[2] : undefined;
|
|
21004
|
+
let orderHint = arguments.length > 3 ? arguments[3] : undefined;
|
|
21005
|
+
let insertionOrderHint = arguments.length > 4 ? arguments[4] : undefined;
|
|
21006
|
+
const sectionNavItemsContainer = panelElement.querySelector(getSectionListSelector(sectionKey));
|
|
21007
|
+
if (!sectionNavItemsContainer) {
|
|
21008
|
+
const container = createSectionNavItemsContainer(sectionKey, orderGroup, orderHint, insertionOrderHint);
|
|
21009
|
+
const panelNavItemsContainer = panelElement.querySelector(panelNavItemsContainerSelector);
|
|
21010
|
+
if (!panelNavItemsContainer) {
|
|
21011
|
+
return panelElement;
|
|
21012
|
+
}
|
|
21013
|
+
(0,insert_element_in_order/* default */.A)(panelNavItemsContainer, container);
|
|
21014
|
+
}
|
|
21015
|
+
return (0,querySelectorOrFail/* default */.A)(panelElement, getSectionItemsSelector(sectionKey));
|
|
21016
|
+
}
|
|
21017
|
+
function getSectionNavItemsContainerElement(sectionElement) {
|
|
21018
|
+
let sectionKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
|
|
21019
|
+
let orderGroup = arguments.length > 2 ? arguments[2] : undefined;
|
|
21020
|
+
let orderHint = arguments.length > 3 ? arguments[3] : undefined;
|
|
21021
|
+
let insertionOrderHint = arguments.length > 4 ? arguments[4] : undefined;
|
|
21022
|
+
const parent = sectionElement.parentElement;
|
|
21023
|
+
const sectionNavItemsContainer = parent.querySelector(getSectionListSelector(sectionKey));
|
|
21024
|
+
if (!sectionNavItemsContainer) {
|
|
21025
|
+
const container = createSectionNavItemsContainer(sectionKey, orderGroup, orderHint, insertionOrderHint);
|
|
21026
|
+
(0,insert_element_in_order/* default */.A)(parent, container);
|
|
21027
|
+
}
|
|
21028
|
+
return (0,querySelectorOrFail/* default */.A)(parent, getSectionItemsSelector(sectionKey));
|
|
21029
|
+
}
|
|
20964
21030
|
;// CONCATENATED MODULE: ./src/platform-implementation-js/dom-driver/gmail/views/gmail-nav-item-view.ts
|
|
20965
21031
|
|
|
20966
21032
|
|
|
@@ -20980,6 +21046,7 @@ function renderCustomIcon(containerElement, customIconElement, append, insertBef
|
|
|
20980
21046
|
|
|
20981
21047
|
|
|
20982
21048
|
|
|
21049
|
+
|
|
20983
21050
|
let NUMBER_OF_GMAIL_NAV_ITEM_VIEWS_CREATED = 0;
|
|
20984
21051
|
const GMAIL_V2_LEFT_INDENTATION_PADDING = 12;
|
|
20985
21052
|
// TODO could we recreate this with React? There's so much statefulness that it's
|
|
@@ -20987,6 +21054,7 @@ const GMAIL_V2_LEFT_INDENTATION_PADDING = 12;
|
|
|
20987
21054
|
class GmailNavItemView {
|
|
20988
21055
|
_accessory = null;
|
|
20989
21056
|
_accessoryViewController = null;
|
|
21057
|
+
#eventStream;
|
|
20990
21058
|
_expandoElement = null;
|
|
20991
21059
|
_iconSettings = {};
|
|
20992
21060
|
_isActive = false;
|
|
@@ -20995,44 +21063,56 @@ class GmailNavItemView {
|
|
|
20995
21063
|
_name = '';
|
|
20996
21064
|
_type = null;
|
|
20997
21065
|
_collapseKey = null;
|
|
21066
|
+
#sectionKey;
|
|
20998
21067
|
|
|
20999
21068
|
// delete after new left nav is fully launched, use this._level === 1 instead
|
|
21000
21069
|
|
|
21070
|
+
get sectionKey() {
|
|
21071
|
+
return this.#sectionKey;
|
|
21072
|
+
}
|
|
21001
21073
|
constructor(driver, orderGroup, level) {
|
|
21002
21074
|
this._driver = driver;
|
|
21003
|
-
this
|
|
21075
|
+
this.#eventStream = kefir_bus_default()();
|
|
21004
21076
|
this._level = level || 0;
|
|
21005
21077
|
this._navItemNumber = ++NUMBER_OF_GMAIL_NAV_ITEM_VIEWS_CREATED;
|
|
21006
21078
|
this._orderGroup = orderGroup;
|
|
21007
21079
|
this._isNewLeftNavParent = !gmail_element_getter/* default */.A.shouldAddNavItemsInline() && this._level === 1;
|
|
21008
|
-
|
|
21009
|
-
|
|
21080
|
+
this._element = this.#setupElement();
|
|
21081
|
+
}
|
|
21082
|
+
#setupElement(navItemDescriptor) {
|
|
21083
|
+
if (this._isNewLeftNavParent && navItemDescriptor?.type !== nav_item_types.SECTION) {
|
|
21084
|
+
return this._setupParentElement();
|
|
21085
|
+
} else if (navItemDescriptor?.type === nav_item_types.SECTION) {
|
|
21086
|
+
return this.#setupSectionElement();
|
|
21010
21087
|
} else {
|
|
21011
|
-
|
|
21088
|
+
return this._setupChildElement();
|
|
21012
21089
|
}
|
|
21013
21090
|
}
|
|
21014
21091
|
addNavItem(orderGroup, navItemDescriptor) {
|
|
21015
|
-
const nestedNavItemLevel = this._type === nav_item_types.GROUPER ? this._level : this._level + 1;
|
|
21092
|
+
const nestedNavItemLevel = this._type === nav_item_types.GROUPER || this.isSection() ? this._level : this._level + 1;
|
|
21016
21093
|
const gmailNavItemView = new GmailNavItemView(this._driver, orderGroup, nestedNavItemLevel);
|
|
21017
21094
|
gmailNavItemView.getEventStream().filter(event => event.eventName === 'orderChanged').onValue(() => this._addNavItemElement(gmailNavItemView));
|
|
21018
21095
|
gmailNavItemView.setNavItemDescriptor(navItemDescriptor);
|
|
21019
|
-
if (this._isNewLeftNavParent) {
|
|
21096
|
+
if (this._isNewLeftNavParent && !gmailNavItemView.isSection()) {
|
|
21020
21097
|
this._createExpandoParent();
|
|
21021
21098
|
}
|
|
21022
21099
|
return gmailNavItemView;
|
|
21023
21100
|
}
|
|
21024
|
-
|
|
21025
|
-
this._element.remove();
|
|
21101
|
+
#cleanupDOMElements() {
|
|
21026
21102
|
if (this._accessoryViewController) this._accessoryViewController.destroy();
|
|
21027
|
-
if (this._eventStream) this._eventStream.end();
|
|
21028
21103
|
if (this._expandoElement) this._expandoElement.remove();
|
|
21029
21104
|
if (this._itemContainerElement) this._itemContainerElement.remove();
|
|
21030
21105
|
}
|
|
21106
|
+
destroy() {
|
|
21107
|
+
this._element.remove();
|
|
21108
|
+
if (this.#eventStream) this.#eventStream.end();
|
|
21109
|
+
this.#cleanupDOMElements();
|
|
21110
|
+
}
|
|
21031
21111
|
getElement() {
|
|
21032
21112
|
return this._element;
|
|
21033
21113
|
}
|
|
21034
21114
|
getEventStream() {
|
|
21035
|
-
return this
|
|
21115
|
+
return this.#eventStream;
|
|
21036
21116
|
}
|
|
21037
21117
|
getNavItemDescriptor() {
|
|
21038
21118
|
return this._navItemDescriptor;
|
|
@@ -21049,11 +21129,14 @@ class GmailNavItemView {
|
|
|
21049
21129
|
isCollapsed() {
|
|
21050
21130
|
return this._isCollapsed;
|
|
21051
21131
|
}
|
|
21132
|
+
isSection() {
|
|
21133
|
+
return this._type === nav_item_types.SECTION;
|
|
21134
|
+
}
|
|
21052
21135
|
remove() {
|
|
21053
21136
|
this.destroy();
|
|
21054
21137
|
}
|
|
21055
21138
|
setActive(value) {
|
|
21056
|
-
if (!this._element || this._type === nav_item_types.LINK || this._type === nav_item_types.MANAGE || this._isActive === value || this._isNewLeftNavParent) {
|
|
21139
|
+
if (!this._element || this._type === nav_item_types.LINK || this._type === nav_item_types.MANAGE || this._isActive === value || this._isNewLeftNavParent || this.isSection()) {
|
|
21057
21140
|
return;
|
|
21058
21141
|
}
|
|
21059
21142
|
const toElement = (0,querySelectorOrFail/* default */.A)(this._element, '.TO');
|
|
@@ -21090,7 +21173,7 @@ class GmailNavItemView {
|
|
|
21090
21173
|
}
|
|
21091
21174
|
}
|
|
21092
21175
|
setNavItemDescriptor(navItemDescriptorPropertyStream) {
|
|
21093
|
-
navItemDescriptorPropertyStream.takeUntilBy(this.
|
|
21176
|
+
navItemDescriptorPropertyStream.takeUntilBy(this.#eventStream.filter(() => false).beforeEnd(() => null)).onValue(x => this.#updateValues(x));
|
|
21094
21177
|
}
|
|
21095
21178
|
toggleCollapse() {
|
|
21096
21179
|
this.setCollapsed(!this._isCollapsed);
|
|
@@ -21101,6 +21184,9 @@ class GmailNavItemView {
|
|
|
21101
21184
|
const itemContainerElement = this._getItemContainerElement();
|
|
21102
21185
|
const insertBeforeElement = getInsertBeforeElement(gmailNavItemView.getElement(), itemContainerElement.children, ['data-group-order-hint', 'data-order-hint', 'data-insertion-order-hint']);
|
|
21103
21186
|
itemContainerElement.insertBefore(gmailNavItemView.getElement(), insertBeforeElement);
|
|
21187
|
+
if (gmailNavItemView.isSection() || this.isSection()) {
|
|
21188
|
+
return;
|
|
21189
|
+
}
|
|
21104
21190
|
|
|
21105
21191
|
// If the current nav-item is of type GROUPER and we are in Gmailv2, then any nested nav-items
|
|
21106
21192
|
// should be at the same indentation as the current nav-item. Somewhat confusingly, this._level
|
|
@@ -21132,7 +21218,7 @@ class GmailNavItemView {
|
|
|
21132
21218
|
if (this._itemContainerElement) this._itemContainerElement.style.display = 'none';
|
|
21133
21219
|
this._setHeights();
|
|
21134
21220
|
}
|
|
21135
|
-
this.
|
|
21221
|
+
this.#eventStream.emit({
|
|
21136
21222
|
eventName: 'collapsed'
|
|
21137
21223
|
});
|
|
21138
21224
|
}
|
|
@@ -21369,12 +21455,14 @@ class GmailNavItemView {
|
|
|
21369
21455
|
this._setHeights();
|
|
21370
21456
|
}
|
|
21371
21457
|
this._isCollapsed = false;
|
|
21372
|
-
this.
|
|
21458
|
+
this.#eventStream.emit({
|
|
21373
21459
|
eventName: 'expanded'
|
|
21374
21460
|
});
|
|
21375
21461
|
}
|
|
21376
21462
|
_getItemContainerElement() {
|
|
21377
|
-
if (this.
|
|
21463
|
+
if (this.isSection()) {
|
|
21464
|
+
return getSectionNavItemsContainerElement(this._element, this.#sectionKey, this._orderGroup.toString(), this._orderHint.toString(), this._navItemNumber.toString());
|
|
21465
|
+
} else if (this._isNewLeftNavParent) {
|
|
21378
21466
|
return (0,querySelectorOrFail/* default */.A)(this._element, '.TK');
|
|
21379
21467
|
} else {
|
|
21380
21468
|
let itemContainerElement = this._itemContainerElement;
|
|
@@ -21433,6 +21521,15 @@ class GmailNavItemView {
|
|
|
21433
21521
|
accessoryViewController.showDropdown();
|
|
21434
21522
|
});
|
|
21435
21523
|
}
|
|
21524
|
+
#setupSectionElement() {
|
|
21525
|
+
const element = document.createElement('div');
|
|
21526
|
+
element.classList.add('aAw', 'FgKVne', NAV_ITEM_SECTION_CLASS_NAME);
|
|
21527
|
+
element.dataset.sectionKey = this.#sectionKey;
|
|
21528
|
+
element.innerHTML = ['<span class="aAv inboxsdk__navItem_name" role="heading">', 'Labels', '</span>', '<div class="aAu arN" aria-label="" data-tooltip="" role="button" tabindex="0" type="button">', '</div>'].join('');
|
|
21529
|
+
const innerElement = (0,querySelectorOrFail/* default */.A)(element, '.aAu');
|
|
21530
|
+
this.#eventStream.plug(kefir_esm.fromEvents(innerElement, 'click').map(this._makeEventMapper('click')));
|
|
21531
|
+
return element;
|
|
21532
|
+
}
|
|
21436
21533
|
_setupChildElement() {
|
|
21437
21534
|
const element = document.createElement('div');
|
|
21438
21535
|
element.setAttribute('class', 'aim inboxsdk__navItem');
|
|
@@ -21446,7 +21543,7 @@ class GmailNavItemView {
|
|
|
21446
21543
|
kefir_esm.merge([kefir_esm.fromEvents(innerElement, 'mouseenter').map(this._makeEventMapper('mouseenter')), kefir_esm.fromEvents(innerElement, 'mouseleave').map(this._makeEventMapper('mouseleave'))]).onValue(event => {
|
|
21447
21544
|
this._updateHighlight(event);
|
|
21448
21545
|
});
|
|
21449
|
-
this.
|
|
21546
|
+
this.#eventStream.plug(kefir_esm.fromEvents(innerElement, 'click').map(this._makeEventMapper('click')));
|
|
21450
21547
|
return element;
|
|
21451
21548
|
}
|
|
21452
21549
|
_setupParentElement() {
|
|
@@ -21468,7 +21565,7 @@ class GmailNavItemView {
|
|
|
21468
21565
|
this.toggleCollapse();
|
|
21469
21566
|
});
|
|
21470
21567
|
const innerElement = (0,querySelectorOrFail/* default */.A)(element, '.V6.CL');
|
|
21471
|
-
this.
|
|
21568
|
+
this.#eventStream.plug(kefir_esm.fromEvents(innerElement, 'click').map(this._makeEventMapper('click')));
|
|
21472
21569
|
return element;
|
|
21473
21570
|
}
|
|
21474
21571
|
_setupGrouper() {
|
|
@@ -21522,6 +21619,9 @@ class GmailNavItemView {
|
|
|
21522
21619
|
}
|
|
21523
21620
|
}
|
|
21524
21621
|
_updateIcon(navItemDescriptor) {
|
|
21622
|
+
if (this.isSection()) {
|
|
21623
|
+
return;
|
|
21624
|
+
}
|
|
21525
21625
|
const iconContainerElement = this._isNewLeftNavParent ? (0,querySelectorOrFail/* default */.A)(this._element, '.Yh') : (0,querySelectorOrFail/* default */.A)(this._element, '.qj');
|
|
21526
21626
|
|
|
21527
21627
|
// render custom icon
|
|
@@ -21529,7 +21629,7 @@ class GmailNavItemView {
|
|
|
21529
21629
|
renderCustomIcon(iconContainerElement, navItemDescriptor.iconElement, navItemDescriptor.iconPosition !== 'BEFORE_NAME');
|
|
21530
21630
|
return;
|
|
21531
21631
|
}
|
|
21532
|
-
(0,update_icon/* default */.A)(this._iconSettings, iconContainerElement, navItemDescriptor.iconPosition !== 'BEFORE_NAME', navItemDescriptor.iconClass, navItemDescriptor.iconUrl);
|
|
21632
|
+
(0,update_icon/* default */.A)(this._iconSettings, iconContainerElement, navItemDescriptor.iconPosition !== 'BEFORE_NAME', navItemDescriptor.iconClass, navItemDescriptor.iconUrl, undefined, undefined, navItemDescriptor.iconLiga);
|
|
21533
21633
|
|
|
21534
21634
|
// Setting the border-color of the icon container element while in Gmailv2 will trigger an SDK
|
|
21535
21635
|
// css rule that will render a circle of border-color if the icon container element has no
|
|
@@ -21546,6 +21646,8 @@ class GmailNavItemView {
|
|
|
21546
21646
|
const navItemNameElement = (0,querySelectorOrFail/* default */.A)(this._element, '.inboxsdk__navItem_name');
|
|
21547
21647
|
navItemNameElement.textContent = name;
|
|
21548
21648
|
navItemNameElement.setAttribute('title', name);
|
|
21649
|
+
this._name = name;
|
|
21650
|
+
if (this.isSection()) return;
|
|
21549
21651
|
if (this._expandoElement) {
|
|
21550
21652
|
this._expandoElement.title = `Expand ${name}`;
|
|
21551
21653
|
}
|
|
@@ -21554,7 +21656,6 @@ class GmailNavItemView {
|
|
|
21554
21656
|
this._element.firstElementChild?.setAttribute('data-tooltip', name);
|
|
21555
21657
|
this._element.firstElementChild?.setAttribute('data-tooltip-align', align);
|
|
21556
21658
|
}
|
|
21557
|
-
this._name = name;
|
|
21558
21659
|
}
|
|
21559
21660
|
_updateOrder(navItemDescriptor) {
|
|
21560
21661
|
this._element.setAttribute('data-group-order-hint', '' + this._orderGroup);
|
|
@@ -21562,13 +21663,16 @@ class GmailNavItemView {
|
|
|
21562
21663
|
navItemDescriptor.orderHint = navItemDescriptor.orderHint || navItemDescriptor.orderHint === 0 ? navItemDescriptor.orderHint : Number.MAX_SAFE_INTEGER;
|
|
21563
21664
|
if (navItemDescriptor.orderHint !== this._orderHint) {
|
|
21564
21665
|
this._element.setAttribute('data-order-hint', '' + navItemDescriptor.orderHint);
|
|
21565
|
-
this.
|
|
21666
|
+
this.#eventStream.emit({
|
|
21566
21667
|
eventName: 'orderChanged'
|
|
21567
21668
|
});
|
|
21568
21669
|
}
|
|
21569
21670
|
this._orderHint = navItemDescriptor.orderHint;
|
|
21570
21671
|
}
|
|
21571
21672
|
_updateRole(routeID) {
|
|
21673
|
+
if (this.isSection()) {
|
|
21674
|
+
return;
|
|
21675
|
+
}
|
|
21572
21676
|
const roleElement = (0,querySelectorOrFail/* default */.A)(this._element, '.V6.CL');
|
|
21573
21677
|
if (routeID) {
|
|
21574
21678
|
roleElement.setAttribute('role', 'link');
|
|
@@ -21578,7 +21682,7 @@ class GmailNavItemView {
|
|
|
21578
21682
|
}
|
|
21579
21683
|
}
|
|
21580
21684
|
_updateSubtitle(navItemDescriptor) {
|
|
21581
|
-
if (this._isNewLeftNavParent) {
|
|
21685
|
+
if (this._isNewLeftNavParent || this.isSection()) {
|
|
21582
21686
|
return;
|
|
21583
21687
|
}
|
|
21584
21688
|
if (navItemDescriptor.accessory && !['SETTINGS_BUTTON', 'DROPDOWN_BUTTON'].includes(navItemDescriptor.accessory.type) && navItemDescriptor.type !== nav_item_types.GROUPER) {
|
|
@@ -21612,7 +21716,30 @@ class GmailNavItemView {
|
|
|
21612
21716
|
}
|
|
21613
21717
|
this._type = type;
|
|
21614
21718
|
}
|
|
21615
|
-
|
|
21719
|
+
#updateSpacing(navItemDescriptor) {
|
|
21720
|
+
if (this._isNewLeftNavParent) {
|
|
21721
|
+
return;
|
|
21722
|
+
}
|
|
21723
|
+
this._element.classList.toggle('yJ', !!navItemDescriptor.spacingAfter);
|
|
21724
|
+
}
|
|
21725
|
+
#updateSectionTooltip(navItemDescriptor) {
|
|
21726
|
+
if (!this.isSection()) return;
|
|
21727
|
+
const tooltip = navItemDescriptor.sectionTooltip;
|
|
21728
|
+
if (tooltip) {
|
|
21729
|
+
this._element.querySelector('.aAu')?.setAttribute('data-tooltip', tooltip);
|
|
21730
|
+
this._element.querySelector('.aAu')?.setAttribute('aria-label', tooltip);
|
|
21731
|
+
}
|
|
21732
|
+
}
|
|
21733
|
+
#updateValues(navItemDescriptor) {
|
|
21734
|
+
if (navItemDescriptor.type === nav_item_types.SECTION && !this.#sectionKey) {
|
|
21735
|
+
// Set up section key for the first time for the Section NavItems
|
|
21736
|
+
this.#sectionKey = (Math.random() * 10000).toFixed(0);
|
|
21737
|
+
}
|
|
21738
|
+
if (this._navItemDescriptor?.type !== navItemDescriptor.type) {
|
|
21739
|
+
this._element.remove();
|
|
21740
|
+
this.#cleanupDOMElements();
|
|
21741
|
+
this._element = this.#setupElement(navItemDescriptor);
|
|
21742
|
+
}
|
|
21616
21743
|
this._navItemDescriptor = navItemDescriptor;
|
|
21617
21744
|
if (this._collapseKey == null) {
|
|
21618
21745
|
this._collapseKey = navItemDescriptor.key || `${navItemDescriptor.name}`;
|
|
@@ -21622,6 +21749,7 @@ class GmailNavItemView {
|
|
|
21622
21749
|
this._updateName(navItemDescriptor.name);
|
|
21623
21750
|
this._updateSubtitle(navItemDescriptor);
|
|
21624
21751
|
this._updateOrder(navItemDescriptor);
|
|
21752
|
+
this.#updateSpacing(navItemDescriptor);
|
|
21625
21753
|
if (this._isNewLeftNavParent) {
|
|
21626
21754
|
this._updateRole(navItemDescriptor.routeID);
|
|
21627
21755
|
}
|
|
@@ -21632,6 +21760,7 @@ class GmailNavItemView {
|
|
|
21632
21760
|
this._updateAccessory(navItemDescriptor.accessory);
|
|
21633
21761
|
this._updateIcon(navItemDescriptor);
|
|
21634
21762
|
this._updateClickability(navItemDescriptor);
|
|
21763
|
+
this.#updateSectionTooltip(navItemDescriptor);
|
|
21635
21764
|
}
|
|
21636
21765
|
}
|
|
21637
21766
|
function getLeftIndentationPaddingValue() {
|
|
@@ -21646,17 +21775,36 @@ function getLeftIndentationPaddingValue() {
|
|
|
21646
21775
|
|
|
21647
21776
|
|
|
21648
21777
|
|
|
21778
|
+
|
|
21779
|
+
function attachGmailNavItemView(gmailNavItemView, injectionContainer) {
|
|
21780
|
+
try {
|
|
21781
|
+
const attacher = _attachNavItemView(gmailNavItemView, injectionContainer);
|
|
21782
|
+
attacher();
|
|
21783
|
+
gmailNavItemView.getEventStream().filter(event => event.eventName === 'orderChanged').onValue(attacher);
|
|
21784
|
+
} catch (err) {
|
|
21785
|
+
lib_logger/* default */.A.error(err);
|
|
21786
|
+
}
|
|
21787
|
+
}
|
|
21649
21788
|
async function addNavItem(driver, orderGroup, navItemDescriptor, navMenuInjectionContainer) {
|
|
21650
21789
|
await waitForMenuReady();
|
|
21651
21790
|
const gmailNavItemView = new GmailNavItemView(driver, orderGroup, 1);
|
|
21652
21791
|
gmailNavItemView.setNavItemDescriptor(navItemDescriptor);
|
|
21653
21792
|
if (!gmail_element_getter/* default */.A.isStandalone()) {
|
|
21654
|
-
|
|
21655
|
-
|
|
21656
|
-
|
|
21657
|
-
|
|
21658
|
-
|
|
21659
|
-
|
|
21793
|
+
attachGmailNavItemView(gmailNavItemView, navMenuInjectionContainer);
|
|
21794
|
+
}
|
|
21795
|
+
return gmailNavItemView;
|
|
21796
|
+
}
|
|
21797
|
+
async function addNavItemToPanel(driver, orderGroup, navItemDescriptor, panelElement) {
|
|
21798
|
+
await waitForMenuReady();
|
|
21799
|
+
const gmailNavItemView = new GmailNavItemView(driver, orderGroup, 1);
|
|
21800
|
+
gmailNavItemView.setNavItemDescriptor(navItemDescriptor);
|
|
21801
|
+
if (!gmail_element_getter/* default */.A.isStandalone()) {
|
|
21802
|
+
if (gmailNavItemView.isSection()) {
|
|
21803
|
+
const container = getPanelSectionNavItemContainerElement(panelElement);
|
|
21804
|
+
attachGmailNavItemView(gmailNavItemView, container);
|
|
21805
|
+
} else {
|
|
21806
|
+
const container = getPanelNavItemContainerElement(panelElement, gmailNavItemView.sectionKey);
|
|
21807
|
+
attachGmailNavItemView(gmailNavItemView, container);
|
|
21660
21808
|
}
|
|
21661
21809
|
}
|
|
21662
21810
|
return gmailNavItemView;
|
|
@@ -23112,8 +23260,10 @@ class NativeGmailNavItemView {
|
|
|
23112
23260
|
const itemContainerElement = this._getItemContainerElement();
|
|
23113
23261
|
const insertBeforeElement = getInsertBeforeElement(gmailNavItemView.getElement(), itemContainerElement.children, ['data-group-order-hint', 'data-order-hint', 'data-insertion-order-hint']);
|
|
23114
23262
|
itemContainerElement.insertBefore(gmailNavItemView.getElement(), insertBeforeElement);
|
|
23115
|
-
|
|
23116
|
-
|
|
23263
|
+
if (!gmailNavItemView.isSection()) {
|
|
23264
|
+
const element = gmailNavItemView.getElement();
|
|
23265
|
+
(0,querySelectorOrFail/* default */.A)(element, '.TN').style.marginLeft = getLeftIndentationPaddingValue() + 'px';
|
|
23266
|
+
}
|
|
23117
23267
|
this._setHeights();
|
|
23118
23268
|
}
|
|
23119
23269
|
_getItemContainerElement() {
|
|
@@ -23196,8 +23346,8 @@ class NativeGmailNavItemView {
|
|
|
23196
23346
|
return !!this._element.querySelector('.inboxsdk__expando.aih');
|
|
23197
23347
|
}
|
|
23198
23348
|
_setHeights() {
|
|
23199
|
-
const toElement = (0,querySelectorOrFail/* default */.A)(this._element, '.TO');
|
|
23200
23349
|
if (this._element.classList.contains('ain') && this._itemContainerElement) {
|
|
23350
|
+
const toElement = (0,querySelectorOrFail/* default */.A)(this._element, '.TO');
|
|
23201
23351
|
this._element.style.height = '';
|
|
23202
23352
|
const totalHeight = this._element.clientHeight;
|
|
23203
23353
|
const itemHeight = toElement.clientHeight;
|
|
@@ -24036,6 +24186,9 @@ class GmailDriver {
|
|
|
24036
24186
|
addNavItem(appId, navItemDescriptorPropertyStream, navMenuInjectionContainer) {
|
|
24037
24187
|
return addNavItem(this, appId, navItemDescriptorPropertyStream, navMenuInjectionContainer);
|
|
24038
24188
|
}
|
|
24189
|
+
addNavItemToPanel(appId, navItemDescriptorPropertyStream, panelElement) {
|
|
24190
|
+
return addNavItemToPanel(this, appId, navItemDescriptorPropertyStream, panelElement);
|
|
24191
|
+
}
|
|
24039
24192
|
addAppMenuItem(menuItemDescriptor) {
|
|
24040
24193
|
return addAppMenuItem(this, menuItemDescriptor);
|
|
24041
24194
|
}
|