@inboxsdk/core 2.1.57 → 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 +271 -121
- package/inboxsdk.js.map +1 -1
- package/package.json +3 -2
- package/pageWorld.js.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());
|
|
@@ -11323,7 +11326,7 @@ if (!globalThis.__InboxSDKImpLoader) {
|
|
|
11323
11326
|
await onready;
|
|
11324
11327
|
const {
|
|
11325
11328
|
makePlatformImplementation
|
|
11326
|
-
} = await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
11329
|
+
} = await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 932));
|
|
11327
11330
|
return makePlatformImplementation(appId, opts, {
|
|
11328
11331
|
piMainStarted,
|
|
11329
11332
|
piLoadStarted,
|
|
@@ -11470,7 +11473,7 @@ class Keyboard {
|
|
|
11470
11473
|
|
|
11471
11474
|
/***/ }),
|
|
11472
11475
|
|
|
11473
|
-
/***/
|
|
11476
|
+
/***/ 932:
|
|
11474
11477
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
11475
11478
|
|
|
11476
11479
|
"use strict";
|
|
@@ -14923,7 +14926,7 @@ options.insert = htmlElement => {
|
|
|
14923
14926
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
14924
14927
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
14925
14928
|
///@ts-ignore
|
|
14926
|
-
"2.1.
|
|
14929
|
+
"2.1.58-0-1717520185507-d238ab15d8afd0c8-MODIFIED");
|
|
14927
14930
|
document.head.append(htmlElement);
|
|
14928
14931
|
};
|
|
14929
14932
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -16708,11 +16711,15 @@ const navItemTypes = Object.freeze({
|
|
|
16708
16711
|
* nav item that looks like a link
|
|
16709
16712
|
*/
|
|
16710
16713
|
LINK: 'LINK',
|
|
16711
|
-
|
|
16712
|
-
|
|
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
|
+
*/
|
|
16713
16719
|
GROUPER: 'GROUPER',
|
|
16714
|
-
|
|
16715
|
-
MANAGE: 'MANAGE'
|
|
16720
|
+
/** Old alias for LINK */
|
|
16721
|
+
MANAGE: 'MANAGE',
|
|
16722
|
+
SECTION: 'SECTION'
|
|
16716
16723
|
});
|
|
16717
16724
|
/* harmony default export */ const nav_item_types = (navItemTypes);
|
|
16718
16725
|
;// CONCATENATED MODULE: ./src/platform-implementation-js/views/nav-item-view.ts
|
|
@@ -16721,31 +16728,30 @@ const navItemTypes = Object.freeze({
|
|
|
16721
16728
|
|
|
16722
16729
|
|
|
16723
16730
|
|
|
16724
|
-
|
|
16725
|
-
const nav_item_view_memberMap = new WeakMap();
|
|
16726
16731
|
class NavItemView extends safe_event_emitter/* default */.A {
|
|
16732
|
+
#appId;
|
|
16733
|
+
#driver;
|
|
16734
|
+
#navItemDescriptorPropertyStream;
|
|
16735
|
+
#navItemViews = [];
|
|
16736
|
+
#navItemViewDriver = null;
|
|
16737
|
+
#navItemViewDriverPromise;
|
|
16727
16738
|
destroyed = false;
|
|
16728
16739
|
constructor(appId, driver, navItemDescriptorPropertyStream, navItemViewDriverPromise) {
|
|
16729
16740
|
super();
|
|
16730
|
-
|
|
16731
|
-
|
|
16732
|
-
|
|
16733
|
-
|
|
16734
|
-
navItemViews: [],
|
|
16735
|
-
navItemViewDriver: null,
|
|
16736
|
-
navItemViewDriverPromise
|
|
16737
|
-
};
|
|
16738
|
-
nav_item_view_memberMap.set(this, members);
|
|
16741
|
+
this.#appId = appId;
|
|
16742
|
+
this.#driver = driver;
|
|
16743
|
+
this.#navItemDescriptorPropertyStream = navItemDescriptorPropertyStream;
|
|
16744
|
+
this.#navItemViewDriverPromise = navItemViewDriverPromise;
|
|
16739
16745
|
driver.getStopper().onValue(this.remove.bind(this));
|
|
16740
16746
|
navItemViewDriverPromise.then(navItemViewDriver => {
|
|
16741
16747
|
if (this.destroyed || !navItemViewDriver) {
|
|
16742
16748
|
return; //we have been removed already
|
|
16743
16749
|
}
|
|
16744
16750
|
|
|
16745
|
-
const driver =
|
|
16746
|
-
|
|
16747
|
-
|
|
16748
|
-
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 => {
|
|
16749
16755
|
_handleRouteViewChange(navItemViewDriver, x);
|
|
16750
16756
|
});
|
|
16751
16757
|
this.emit('inserted');
|
|
@@ -16753,13 +16759,12 @@ class NavItemView extends safe_event_emitter/* default */.A {
|
|
|
16753
16759
|
}
|
|
16754
16760
|
addNavItem(navItemDescriptor) {
|
|
16755
16761
|
if (this.destroyed) throw new Error('this nav item view does not exist');
|
|
16756
|
-
const
|
|
16757
|
-
const
|
|
16758
|
-
const
|
|
16759
|
-
const navItemViews = members.navItemViews;
|
|
16762
|
+
const driver = this.#driver;
|
|
16763
|
+
const appId = this.#appId;
|
|
16764
|
+
const navItemViews = this.#navItemViews;
|
|
16760
16765
|
const navItemDescriptorPropertyStream = kefir_cast_default()(kefir_esm["default"], navItemDescriptor).toProperty();
|
|
16761
|
-
const childNavItemView = new NavItemView(appId, driver, navItemDescriptorPropertyStream,
|
|
16762
|
-
const childNavItemViewDriver = navItemViewDriver.addNavItem(
|
|
16766
|
+
const childNavItemView = new NavItemView(appId, driver, navItemDescriptorPropertyStream, this.#navItemViewDriverPromise.then(navItemViewDriver => {
|
|
16767
|
+
const childNavItemViewDriver = navItemViewDriver.addNavItem(this.#appId, navItemDescriptorPropertyStream);
|
|
16763
16768
|
return childNavItemViewDriver;
|
|
16764
16769
|
}));
|
|
16765
16770
|
navItemViews.push(childNavItemView);
|
|
@@ -16769,22 +16774,18 @@ class NavItemView extends safe_event_emitter/* default */.A {
|
|
|
16769
16774
|
if (this.destroyed) {
|
|
16770
16775
|
return;
|
|
16771
16776
|
}
|
|
16772
|
-
const
|
|
16773
|
-
const {
|
|
16774
|
-
navItemViews
|
|
16775
|
-
} = members;
|
|
16777
|
+
const navItemViews = this.#navItemViews;
|
|
16776
16778
|
this.destroyed = true;
|
|
16777
16779
|
this.emit('destroy');
|
|
16778
16780
|
navItemViews.forEach(function (navItemView) {
|
|
16779
16781
|
navItemView.remove();
|
|
16780
16782
|
});
|
|
16781
|
-
|
|
16783
|
+
this.#navItemViewDriverPromise.then(navItemViewDriver => {
|
|
16782
16784
|
navItemViewDriver.destroy();
|
|
16783
16785
|
});
|
|
16784
16786
|
}
|
|
16785
16787
|
isCollapsed() {
|
|
16786
|
-
const
|
|
16787
|
-
const navItemViewDriver = members.navItemViewDriver;
|
|
16788
|
+
const navItemViewDriver = this.#navItemViewDriver;
|
|
16788
16789
|
if (navItemViewDriver) {
|
|
16789
16790
|
return navItemViewDriver.isCollapsed();
|
|
16790
16791
|
} else {
|
|
@@ -16792,43 +16793,43 @@ class NavItemView extends safe_event_emitter/* default */.A {
|
|
|
16792
16793
|
}
|
|
16793
16794
|
}
|
|
16794
16795
|
setCollapsed(collapseValue) {
|
|
16795
|
-
|
|
16796
|
+
this.#navItemViewDriverPromise.then(navItemViewDriver => {
|
|
16796
16797
|
navItemViewDriver.setCollapsed(collapseValue);
|
|
16797
16798
|
});
|
|
16798
16799
|
}
|
|
16799
16800
|
getElement() {
|
|
16800
|
-
return
|
|
16801
|
+
return this.#navItemViewDriverPromise.then(navItemViewDriver => navItemViewDriver.getElement());
|
|
16801
16802
|
}
|
|
16802
|
-
|
|
16803
|
-
|
|
16804
|
-
|
|
16805
|
-
|
|
16806
|
-
|
|
16807
|
-
|
|
16808
|
-
|
|
16809
|
-
|
|
16810
|
-
|
|
16811
|
-
|
|
16812
|
-
|
|
16813
|
-
|
|
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;
|
|
16814
16820
|
}
|
|
16815
|
-
};
|
|
16816
|
-
// TODO: is this synthetic event ever used?
|
|
16817
|
-
navItemDescriptor.onClick(syntheticEvent);
|
|
16818
|
-
if (defaultPrevented) {
|
|
16819
|
-
break;
|
|
16820
16821
|
}
|
|
16821
|
-
|
|
16822
|
-
|
|
16823
|
-
|
|
16824
|
-
|
|
16825
|
-
|
|
16826
|
-
|
|
16827
|
-
|
|
16828
|
-
|
|
16829
|
-
|
|
16830
|
-
|
|
16831
|
-
|
|
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
|
+
}
|
|
16832
16833
|
}
|
|
16833
16834
|
}
|
|
16834
16835
|
function _handleRouteViewChange(navItemViewDriver, _ref2) {
|
|
@@ -16865,7 +16866,7 @@ class NativeNavItemView extends safe_event_emitter/* default */.A {
|
|
|
16865
16866
|
}
|
|
16866
16867
|
addNavItem(navItemDescriptor) {
|
|
16867
16868
|
const members = (0,get_or_fail/* default */.A)(native_nav_item_view_memberMap, this);
|
|
16868
|
-
const navItemDescriptorPropertyStream = kefir_cast_default()(kefir_esm
|
|
16869
|
+
const navItemDescriptorPropertyStream = kefir_cast_default()(kefir_esm, navItemDescriptor).toProperty();
|
|
16869
16870
|
const childNavItemView = new NavItemView(members.appId, members.driver, navItemDescriptorPropertyStream, members.navItemViewDriverPromise.then(navItemViewDriver => {
|
|
16870
16871
|
const childNavItemViewDriver = navItemViewDriver.addNavItem(members.appId, navItemDescriptorPropertyStream);
|
|
16871
16872
|
return childNavItemViewDriver;
|
|
@@ -17222,6 +17223,7 @@ class GmailAppMenuItemView extends events.EventEmitter {
|
|
|
17222
17223
|
const collapsible_panel_view_NATIVE_CLASS = 'aqn';
|
|
17223
17224
|
const collapsible_panel_view_INBOXSDK_CLASS = 'inboxsdk__collapsiblePanel';
|
|
17224
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';
|
|
17225
17227
|
const PRIMARY_BUTTON_ELEMENT_CLASS = 'T-I T-I-KE L3';
|
|
17226
17228
|
const PRIMARY_BUTTON_ELEMENT_SELECTOR = '.T-I.T-I-KE.L3';
|
|
17227
17229
|
const scrollablePanelClass = 'at9';
|
|
@@ -17229,7 +17231,7 @@ const scrollablePanelSelector = `.${scrollablePanelClass}`;
|
|
|
17229
17231
|
const loadingElementClass = 'inboxsdk__collapsiblePanel_loading_container';
|
|
17230
17232
|
const panelLoadingClass = `${loadingElementClass}--active`;
|
|
17231
17233
|
const loadingElementSelector = `.${loadingElementClass}`;
|
|
17232
|
-
const
|
|
17234
|
+
const panelNavItemsContainerSelector = `.${PANEL_NAV_ITEMS_CONTAINER_CLASS}`;
|
|
17233
17235
|
/**
|
|
17234
17236
|
* Each AppMenuItem can have a CollapsiblePanelView.
|
|
17235
17237
|
*
|
|
@@ -17254,9 +17256,9 @@ class CollapsiblePanelView extends safe_event_emitter/* default */.A {
|
|
|
17254
17256
|
#element;
|
|
17255
17257
|
#destroyed = false;
|
|
17256
17258
|
#id = Math.random().toFixed(3);
|
|
17257
|
-
#ARIA_LABELLED_BY_ID = Math.random().toFixed(3);
|
|
17258
17259
|
#driver;
|
|
17259
17260
|
#loading;
|
|
17261
|
+
#orderGroup = `collapsible-panel-${this.#id}-nav-item`;
|
|
17260
17262
|
get loading() {
|
|
17261
17263
|
return this.#loading;
|
|
17262
17264
|
}
|
|
@@ -17321,11 +17323,10 @@ class CollapsiblePanelView extends safe_event_emitter/* default */.A {
|
|
|
17321
17323
|
const {
|
|
17322
17324
|
element
|
|
17323
17325
|
} = this;
|
|
17324
|
-
const
|
|
17325
|
-
const appId = `collapsible-panel-${this.#id}`;
|
|
17326
|
+
const orderGroup = this.#orderGroup;
|
|
17326
17327
|
const navItemDescriptorPropertyStream = kefir_cast_default()(kefir_esm, navItemDescriptor).toProperty();
|
|
17327
|
-
const gmailNavItemView = this.#driver.
|
|
17328
|
-
const navItemView = new NavItemView(
|
|
17328
|
+
const gmailNavItemView = this.#driver.addNavItemToPanel(orderGroup, navItemDescriptorPropertyStream, element);
|
|
17329
|
+
const navItemView = new NavItemView(orderGroup, this.#driver, navItemDescriptorPropertyStream, gmailNavItemView);
|
|
17329
17330
|
return navItemView;
|
|
17330
17331
|
}
|
|
17331
17332
|
#extractPrimaryButtonTheme() {
|
|
@@ -17388,20 +17389,8 @@ class CollapsiblePanelView extends safe_event_emitter/* default */.A {
|
|
|
17388
17389
|
<div class="Ls77Lb aZ6">
|
|
17389
17390
|
<div class="pp" style="user-select: none;">
|
|
17390
17391
|
<div>
|
|
17391
|
-
<div class="nM">
|
|
17392
|
+
<div class="${`nM ${PANEL_NAV_ITEMS_CONTAINER_CLASS}`}">
|
|
17392
17393
|
<div class="aic"></div>
|
|
17393
|
-
<div class="yJ">
|
|
17394
|
-
<div class="ajl aib aZ6" aria-labelledby="${this.#ARIA_LABELLED_BY_ID}">
|
|
17395
|
-
<h2 class="aWk" id="${this.#ARIA_LABELLED_BY_ID}">Labels</h2>
|
|
17396
|
-
<div class="wT">
|
|
17397
|
-
<div class="n3">
|
|
17398
|
-
<div class="byl">
|
|
17399
|
-
<div class="TK"></div>
|
|
17400
|
-
</div>
|
|
17401
|
-
</div>
|
|
17402
|
-
</div>
|
|
17403
|
-
</div>
|
|
17404
|
-
</div>
|
|
17405
17394
|
</div>
|
|
17406
17395
|
</div>
|
|
17407
17396
|
</div>
|
|
@@ -19546,7 +19535,7 @@ mole_view_module_options.insert = htmlElement => {
|
|
|
19546
19535
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
19547
19536
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
19548
19537
|
///@ts-ignore
|
|
19549
|
-
"2.1.
|
|
19538
|
+
"2.1.58-0-1717520185507-d238ab15d8afd0c8-MODIFIED");
|
|
19550
19539
|
document.head.append(htmlElement);
|
|
19551
19540
|
};
|
|
19552
19541
|
mole_view_module_options.domAPI = (styleDomAPI_default());
|
|
@@ -20964,6 +20953,80 @@ function renderCustomIcon(containerElement, customIconElement, append, insertBef
|
|
|
20964
20953
|
containerElement.insertBefore(containerElement, insertBeforeEl || containerElement.firstElementChild);
|
|
20965
20954
|
}
|
|
20966
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
|
+
}
|
|
20967
21030
|
;// CONCATENATED MODULE: ./src/platform-implementation-js/dom-driver/gmail/views/gmail-nav-item-view.ts
|
|
20968
21031
|
|
|
20969
21032
|
|
|
@@ -20983,6 +21046,7 @@ function renderCustomIcon(containerElement, customIconElement, append, insertBef
|
|
|
20983
21046
|
|
|
20984
21047
|
|
|
20985
21048
|
|
|
21049
|
+
|
|
20986
21050
|
let NUMBER_OF_GMAIL_NAV_ITEM_VIEWS_CREATED = 0;
|
|
20987
21051
|
const GMAIL_V2_LEFT_INDENTATION_PADDING = 12;
|
|
20988
21052
|
// TODO could we recreate this with React? There's so much statefulness that it's
|
|
@@ -20990,6 +21054,7 @@ const GMAIL_V2_LEFT_INDENTATION_PADDING = 12;
|
|
|
20990
21054
|
class GmailNavItemView {
|
|
20991
21055
|
_accessory = null;
|
|
20992
21056
|
_accessoryViewController = null;
|
|
21057
|
+
#eventStream;
|
|
20993
21058
|
_expandoElement = null;
|
|
20994
21059
|
_iconSettings = {};
|
|
20995
21060
|
_isActive = false;
|
|
@@ -20998,44 +21063,56 @@ class GmailNavItemView {
|
|
|
20998
21063
|
_name = '';
|
|
20999
21064
|
_type = null;
|
|
21000
21065
|
_collapseKey = null;
|
|
21066
|
+
#sectionKey;
|
|
21001
21067
|
|
|
21002
21068
|
// delete after new left nav is fully launched, use this._level === 1 instead
|
|
21003
21069
|
|
|
21070
|
+
get sectionKey() {
|
|
21071
|
+
return this.#sectionKey;
|
|
21072
|
+
}
|
|
21004
21073
|
constructor(driver, orderGroup, level) {
|
|
21005
21074
|
this._driver = driver;
|
|
21006
|
-
this
|
|
21075
|
+
this.#eventStream = kefir_bus_default()();
|
|
21007
21076
|
this._level = level || 0;
|
|
21008
21077
|
this._navItemNumber = ++NUMBER_OF_GMAIL_NAV_ITEM_VIEWS_CREATED;
|
|
21009
21078
|
this._orderGroup = orderGroup;
|
|
21010
21079
|
this._isNewLeftNavParent = !gmail_element_getter/* default */.A.shouldAddNavItemsInline() && this._level === 1;
|
|
21011
|
-
|
|
21012
|
-
|
|
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();
|
|
21013
21087
|
} else {
|
|
21014
|
-
|
|
21088
|
+
return this._setupChildElement();
|
|
21015
21089
|
}
|
|
21016
21090
|
}
|
|
21017
21091
|
addNavItem(orderGroup, navItemDescriptor) {
|
|
21018
|
-
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;
|
|
21019
21093
|
const gmailNavItemView = new GmailNavItemView(this._driver, orderGroup, nestedNavItemLevel);
|
|
21020
21094
|
gmailNavItemView.getEventStream().filter(event => event.eventName === 'orderChanged').onValue(() => this._addNavItemElement(gmailNavItemView));
|
|
21021
21095
|
gmailNavItemView.setNavItemDescriptor(navItemDescriptor);
|
|
21022
|
-
if (this._isNewLeftNavParent) {
|
|
21096
|
+
if (this._isNewLeftNavParent && !gmailNavItemView.isSection()) {
|
|
21023
21097
|
this._createExpandoParent();
|
|
21024
21098
|
}
|
|
21025
21099
|
return gmailNavItemView;
|
|
21026
21100
|
}
|
|
21027
|
-
|
|
21028
|
-
this._element.remove();
|
|
21101
|
+
#cleanupDOMElements() {
|
|
21029
21102
|
if (this._accessoryViewController) this._accessoryViewController.destroy();
|
|
21030
|
-
if (this._eventStream) this._eventStream.end();
|
|
21031
21103
|
if (this._expandoElement) this._expandoElement.remove();
|
|
21032
21104
|
if (this._itemContainerElement) this._itemContainerElement.remove();
|
|
21033
21105
|
}
|
|
21106
|
+
destroy() {
|
|
21107
|
+
this._element.remove();
|
|
21108
|
+
if (this.#eventStream) this.#eventStream.end();
|
|
21109
|
+
this.#cleanupDOMElements();
|
|
21110
|
+
}
|
|
21034
21111
|
getElement() {
|
|
21035
21112
|
return this._element;
|
|
21036
21113
|
}
|
|
21037
21114
|
getEventStream() {
|
|
21038
|
-
return this
|
|
21115
|
+
return this.#eventStream;
|
|
21039
21116
|
}
|
|
21040
21117
|
getNavItemDescriptor() {
|
|
21041
21118
|
return this._navItemDescriptor;
|
|
@@ -21052,11 +21129,14 @@ class GmailNavItemView {
|
|
|
21052
21129
|
isCollapsed() {
|
|
21053
21130
|
return this._isCollapsed;
|
|
21054
21131
|
}
|
|
21132
|
+
isSection() {
|
|
21133
|
+
return this._type === nav_item_types.SECTION;
|
|
21134
|
+
}
|
|
21055
21135
|
remove() {
|
|
21056
21136
|
this.destroy();
|
|
21057
21137
|
}
|
|
21058
21138
|
setActive(value) {
|
|
21059
|
-
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()) {
|
|
21060
21140
|
return;
|
|
21061
21141
|
}
|
|
21062
21142
|
const toElement = (0,querySelectorOrFail/* default */.A)(this._element, '.TO');
|
|
@@ -21093,7 +21173,7 @@ class GmailNavItemView {
|
|
|
21093
21173
|
}
|
|
21094
21174
|
}
|
|
21095
21175
|
setNavItemDescriptor(navItemDescriptorPropertyStream) {
|
|
21096
|
-
navItemDescriptorPropertyStream.takeUntilBy(this.
|
|
21176
|
+
navItemDescriptorPropertyStream.takeUntilBy(this.#eventStream.filter(() => false).beforeEnd(() => null)).onValue(x => this.#updateValues(x));
|
|
21097
21177
|
}
|
|
21098
21178
|
toggleCollapse() {
|
|
21099
21179
|
this.setCollapsed(!this._isCollapsed);
|
|
@@ -21104,6 +21184,9 @@ class GmailNavItemView {
|
|
|
21104
21184
|
const itemContainerElement = this._getItemContainerElement();
|
|
21105
21185
|
const insertBeforeElement = getInsertBeforeElement(gmailNavItemView.getElement(), itemContainerElement.children, ['data-group-order-hint', 'data-order-hint', 'data-insertion-order-hint']);
|
|
21106
21186
|
itemContainerElement.insertBefore(gmailNavItemView.getElement(), insertBeforeElement);
|
|
21187
|
+
if (gmailNavItemView.isSection() || this.isSection()) {
|
|
21188
|
+
return;
|
|
21189
|
+
}
|
|
21107
21190
|
|
|
21108
21191
|
// If the current nav-item is of type GROUPER and we are in Gmailv2, then any nested nav-items
|
|
21109
21192
|
// should be at the same indentation as the current nav-item. Somewhat confusingly, this._level
|
|
@@ -21135,7 +21218,7 @@ class GmailNavItemView {
|
|
|
21135
21218
|
if (this._itemContainerElement) this._itemContainerElement.style.display = 'none';
|
|
21136
21219
|
this._setHeights();
|
|
21137
21220
|
}
|
|
21138
|
-
this.
|
|
21221
|
+
this.#eventStream.emit({
|
|
21139
21222
|
eventName: 'collapsed'
|
|
21140
21223
|
});
|
|
21141
21224
|
}
|
|
@@ -21372,12 +21455,14 @@ class GmailNavItemView {
|
|
|
21372
21455
|
this._setHeights();
|
|
21373
21456
|
}
|
|
21374
21457
|
this._isCollapsed = false;
|
|
21375
|
-
this.
|
|
21458
|
+
this.#eventStream.emit({
|
|
21376
21459
|
eventName: 'expanded'
|
|
21377
21460
|
});
|
|
21378
21461
|
}
|
|
21379
21462
|
_getItemContainerElement() {
|
|
21380
|
-
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) {
|
|
21381
21466
|
return (0,querySelectorOrFail/* default */.A)(this._element, '.TK');
|
|
21382
21467
|
} else {
|
|
21383
21468
|
let itemContainerElement = this._itemContainerElement;
|
|
@@ -21436,6 +21521,15 @@ class GmailNavItemView {
|
|
|
21436
21521
|
accessoryViewController.showDropdown();
|
|
21437
21522
|
});
|
|
21438
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
|
+
}
|
|
21439
21533
|
_setupChildElement() {
|
|
21440
21534
|
const element = document.createElement('div');
|
|
21441
21535
|
element.setAttribute('class', 'aim inboxsdk__navItem');
|
|
@@ -21449,7 +21543,7 @@ class GmailNavItemView {
|
|
|
21449
21543
|
kefir_esm.merge([kefir_esm.fromEvents(innerElement, 'mouseenter').map(this._makeEventMapper('mouseenter')), kefir_esm.fromEvents(innerElement, 'mouseleave').map(this._makeEventMapper('mouseleave'))]).onValue(event => {
|
|
21450
21544
|
this._updateHighlight(event);
|
|
21451
21545
|
});
|
|
21452
|
-
this.
|
|
21546
|
+
this.#eventStream.plug(kefir_esm.fromEvents(innerElement, 'click').map(this._makeEventMapper('click')));
|
|
21453
21547
|
return element;
|
|
21454
21548
|
}
|
|
21455
21549
|
_setupParentElement() {
|
|
@@ -21471,7 +21565,7 @@ class GmailNavItemView {
|
|
|
21471
21565
|
this.toggleCollapse();
|
|
21472
21566
|
});
|
|
21473
21567
|
const innerElement = (0,querySelectorOrFail/* default */.A)(element, '.V6.CL');
|
|
21474
|
-
this.
|
|
21568
|
+
this.#eventStream.plug(kefir_esm.fromEvents(innerElement, 'click').map(this._makeEventMapper('click')));
|
|
21475
21569
|
return element;
|
|
21476
21570
|
}
|
|
21477
21571
|
_setupGrouper() {
|
|
@@ -21525,6 +21619,9 @@ class GmailNavItemView {
|
|
|
21525
21619
|
}
|
|
21526
21620
|
}
|
|
21527
21621
|
_updateIcon(navItemDescriptor) {
|
|
21622
|
+
if (this.isSection()) {
|
|
21623
|
+
return;
|
|
21624
|
+
}
|
|
21528
21625
|
const iconContainerElement = this._isNewLeftNavParent ? (0,querySelectorOrFail/* default */.A)(this._element, '.Yh') : (0,querySelectorOrFail/* default */.A)(this._element, '.qj');
|
|
21529
21626
|
|
|
21530
21627
|
// render custom icon
|
|
@@ -21532,7 +21629,7 @@ class GmailNavItemView {
|
|
|
21532
21629
|
renderCustomIcon(iconContainerElement, navItemDescriptor.iconElement, navItemDescriptor.iconPosition !== 'BEFORE_NAME');
|
|
21533
21630
|
return;
|
|
21534
21631
|
}
|
|
21535
|
-
(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);
|
|
21536
21633
|
|
|
21537
21634
|
// Setting the border-color of the icon container element while in Gmailv2 will trigger an SDK
|
|
21538
21635
|
// css rule that will render a circle of border-color if the icon container element has no
|
|
@@ -21549,6 +21646,8 @@ class GmailNavItemView {
|
|
|
21549
21646
|
const navItemNameElement = (0,querySelectorOrFail/* default */.A)(this._element, '.inboxsdk__navItem_name');
|
|
21550
21647
|
navItemNameElement.textContent = name;
|
|
21551
21648
|
navItemNameElement.setAttribute('title', name);
|
|
21649
|
+
this._name = name;
|
|
21650
|
+
if (this.isSection()) return;
|
|
21552
21651
|
if (this._expandoElement) {
|
|
21553
21652
|
this._expandoElement.title = `Expand ${name}`;
|
|
21554
21653
|
}
|
|
@@ -21557,7 +21656,6 @@ class GmailNavItemView {
|
|
|
21557
21656
|
this._element.firstElementChild?.setAttribute('data-tooltip', name);
|
|
21558
21657
|
this._element.firstElementChild?.setAttribute('data-tooltip-align', align);
|
|
21559
21658
|
}
|
|
21560
|
-
this._name = name;
|
|
21561
21659
|
}
|
|
21562
21660
|
_updateOrder(navItemDescriptor) {
|
|
21563
21661
|
this._element.setAttribute('data-group-order-hint', '' + this._orderGroup);
|
|
@@ -21565,13 +21663,16 @@ class GmailNavItemView {
|
|
|
21565
21663
|
navItemDescriptor.orderHint = navItemDescriptor.orderHint || navItemDescriptor.orderHint === 0 ? navItemDescriptor.orderHint : Number.MAX_SAFE_INTEGER;
|
|
21566
21664
|
if (navItemDescriptor.orderHint !== this._orderHint) {
|
|
21567
21665
|
this._element.setAttribute('data-order-hint', '' + navItemDescriptor.orderHint);
|
|
21568
|
-
this.
|
|
21666
|
+
this.#eventStream.emit({
|
|
21569
21667
|
eventName: 'orderChanged'
|
|
21570
21668
|
});
|
|
21571
21669
|
}
|
|
21572
21670
|
this._orderHint = navItemDescriptor.orderHint;
|
|
21573
21671
|
}
|
|
21574
21672
|
_updateRole(routeID) {
|
|
21673
|
+
if (this.isSection()) {
|
|
21674
|
+
return;
|
|
21675
|
+
}
|
|
21575
21676
|
const roleElement = (0,querySelectorOrFail/* default */.A)(this._element, '.V6.CL');
|
|
21576
21677
|
if (routeID) {
|
|
21577
21678
|
roleElement.setAttribute('role', 'link');
|
|
@@ -21581,7 +21682,7 @@ class GmailNavItemView {
|
|
|
21581
21682
|
}
|
|
21582
21683
|
}
|
|
21583
21684
|
_updateSubtitle(navItemDescriptor) {
|
|
21584
|
-
if (this._isNewLeftNavParent) {
|
|
21685
|
+
if (this._isNewLeftNavParent || this.isSection()) {
|
|
21585
21686
|
return;
|
|
21586
21687
|
}
|
|
21587
21688
|
if (navItemDescriptor.accessory && !['SETTINGS_BUTTON', 'DROPDOWN_BUTTON'].includes(navItemDescriptor.accessory.type) && navItemDescriptor.type !== nav_item_types.GROUPER) {
|
|
@@ -21615,7 +21716,30 @@ class GmailNavItemView {
|
|
|
21615
21716
|
}
|
|
21616
21717
|
this._type = type;
|
|
21617
21718
|
}
|
|
21618
|
-
|
|
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
|
+
}
|
|
21619
21743
|
this._navItemDescriptor = navItemDescriptor;
|
|
21620
21744
|
if (this._collapseKey == null) {
|
|
21621
21745
|
this._collapseKey = navItemDescriptor.key || `${navItemDescriptor.name}`;
|
|
@@ -21625,6 +21749,7 @@ class GmailNavItemView {
|
|
|
21625
21749
|
this._updateName(navItemDescriptor.name);
|
|
21626
21750
|
this._updateSubtitle(navItemDescriptor);
|
|
21627
21751
|
this._updateOrder(navItemDescriptor);
|
|
21752
|
+
this.#updateSpacing(navItemDescriptor);
|
|
21628
21753
|
if (this._isNewLeftNavParent) {
|
|
21629
21754
|
this._updateRole(navItemDescriptor.routeID);
|
|
21630
21755
|
}
|
|
@@ -21635,6 +21760,7 @@ class GmailNavItemView {
|
|
|
21635
21760
|
this._updateAccessory(navItemDescriptor.accessory);
|
|
21636
21761
|
this._updateIcon(navItemDescriptor);
|
|
21637
21762
|
this._updateClickability(navItemDescriptor);
|
|
21763
|
+
this.#updateSectionTooltip(navItemDescriptor);
|
|
21638
21764
|
}
|
|
21639
21765
|
}
|
|
21640
21766
|
function getLeftIndentationPaddingValue() {
|
|
@@ -21649,17 +21775,36 @@ function getLeftIndentationPaddingValue() {
|
|
|
21649
21775
|
|
|
21650
21776
|
|
|
21651
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
|
+
}
|
|
21652
21788
|
async function addNavItem(driver, orderGroup, navItemDescriptor, navMenuInjectionContainer) {
|
|
21653
21789
|
await waitForMenuReady();
|
|
21654
21790
|
const gmailNavItemView = new GmailNavItemView(driver, orderGroup, 1);
|
|
21655
21791
|
gmailNavItemView.setNavItemDescriptor(navItemDescriptor);
|
|
21656
21792
|
if (!gmail_element_getter/* default */.A.isStandalone()) {
|
|
21657
|
-
|
|
21658
|
-
|
|
21659
|
-
|
|
21660
|
-
|
|
21661
|
-
|
|
21662
|
-
|
|
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);
|
|
21663
21808
|
}
|
|
21664
21809
|
}
|
|
21665
21810
|
return gmailNavItemView;
|
|
@@ -23115,8 +23260,10 @@ class NativeGmailNavItemView {
|
|
|
23115
23260
|
const itemContainerElement = this._getItemContainerElement();
|
|
23116
23261
|
const insertBeforeElement = getInsertBeforeElement(gmailNavItemView.getElement(), itemContainerElement.children, ['data-group-order-hint', 'data-order-hint', 'data-insertion-order-hint']);
|
|
23117
23262
|
itemContainerElement.insertBefore(gmailNavItemView.getElement(), insertBeforeElement);
|
|
23118
|
-
|
|
23119
|
-
|
|
23263
|
+
if (!gmailNavItemView.isSection()) {
|
|
23264
|
+
const element = gmailNavItemView.getElement();
|
|
23265
|
+
(0,querySelectorOrFail/* default */.A)(element, '.TN').style.marginLeft = getLeftIndentationPaddingValue() + 'px';
|
|
23266
|
+
}
|
|
23120
23267
|
this._setHeights();
|
|
23121
23268
|
}
|
|
23122
23269
|
_getItemContainerElement() {
|
|
@@ -23199,8 +23346,8 @@ class NativeGmailNavItemView {
|
|
|
23199
23346
|
return !!this._element.querySelector('.inboxsdk__expando.aih');
|
|
23200
23347
|
}
|
|
23201
23348
|
_setHeights() {
|
|
23202
|
-
const toElement = (0,querySelectorOrFail/* default */.A)(this._element, '.TO');
|
|
23203
23349
|
if (this._element.classList.contains('ain') && this._itemContainerElement) {
|
|
23350
|
+
const toElement = (0,querySelectorOrFail/* default */.A)(this._element, '.TO');
|
|
23204
23351
|
this._element.style.height = '';
|
|
23205
23352
|
const totalHeight = this._element.clientHeight;
|
|
23206
23353
|
const itemHeight = toElement.clientHeight;
|
|
@@ -24039,6 +24186,9 @@ class GmailDriver {
|
|
|
24039
24186
|
addNavItem(appId, navItemDescriptorPropertyStream, navMenuInjectionContainer) {
|
|
24040
24187
|
return addNavItem(this, appId, navItemDescriptorPropertyStream, navMenuInjectionContainer);
|
|
24041
24188
|
}
|
|
24189
|
+
addNavItemToPanel(appId, navItemDescriptorPropertyStream, panelElement) {
|
|
24190
|
+
return addNavItemToPanel(this, appId, navItemDescriptorPropertyStream, panelElement);
|
|
24191
|
+
}
|
|
24042
24192
|
addAppMenuItem(menuItemDescriptor) {
|
|
24043
24193
|
return addAppMenuItem(this, menuItemDescriptor);
|
|
24044
24194
|
}
|