@inboxsdk/core 2.1.4 → 2.1.5
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 +540 -470
- package/inboxsdk.js.map +1 -1
- package/package.json +1 -1
- package/pageWorld.js.map +1 -1
- package/src/inboxsdk.d.ts +2 -6
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/gmail-load-event.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/isIntegratedViewGmail.d.ts +6 -6
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/isIntegratedViewGmail.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver.d.ts +12 -57
- 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-app-sidebar-view/index.d.ts +4 -7
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/index.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/primary/index.d.ts +10 -36
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/primary/index.d.ts.map +1 -1
- package/src/platform-implementation-js/driver-common/sidebar/ContentPanelViewDriver.d.ts +3 -11
- package/src/platform-implementation-js/driver-common/sidebar/ContentPanelViewDriver.d.ts.map +1 -1
- package/src/platform-implementation-js/lib/logger.d.ts +7 -2
- package/src/platform-implementation-js/lib/logger.d.ts.map +1 -1
- package/src/platform-implementation-js/views/content-panel-view.d.ts +9 -3
- package/src/platform-implementation-js/views/content-panel-view.d.ts.map +1 -1
package/inboxsdk.js
CHANGED
|
@@ -832,7 +832,7 @@ function isElementVisible(el) {
|
|
|
832
832
|
|
|
833
833
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- SDK_VERSION is injected by webpack
|
|
834
834
|
///@ts-ignore
|
|
835
|
-
const BUILD_VERSION = "2.1.
|
|
835
|
+
const BUILD_VERSION = "2.1.5-1696881387401-5c0ff20cfc735daf";
|
|
836
836
|
if (false) {}
|
|
837
837
|
|
|
838
838
|
/***/ }),
|
|
@@ -1052,23 +1052,20 @@ const gotoView = ud__WEBPACK_IMPORTED_MODULE_2__.defn(module, async function got
|
|
|
1052
1052
|
|
|
1053
1053
|
"use strict";
|
|
1054
1054
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1055
|
-
/* harmony export */ "
|
|
1056
|
-
/* harmony export */ "
|
|
1055
|
+
/* harmony export */ "Jv": () => (/* binding */ isGoogleChatEnabled),
|
|
1056
|
+
/* harmony export */ "ZP": () => (/* binding */ isIntegratedViewGmail),
|
|
1057
|
+
/* harmony export */ "ky": () => (/* binding */ isCollapsiblePanelHidden)
|
|
1057
1058
|
/* harmony export */ });
|
|
1058
1059
|
/**
|
|
1059
|
-
*
|
|
1060
|
-
- The user is in a pre-Google-Chat Hangouts-only version of Gmail (the Gmail Settings ->
|
|
1061
|
-
Chat and Meet -> Chat menu only has the options "Hangouts On" and "Hangouts Off").
|
|
1062
|
-
- The user has "Classic Hangouts" picked in Gmail Settings -> Chat and Meet -> Chat.
|
|
1063
|
-
- Integrated view gmail.
|
|
1060
|
+
* As of writing, @returns true when either Google Chat or Google Meet or both are enabled.
|
|
1064
1061
|
* @see https://support.google.com/mail/answer/11555490
|
|
1065
1062
|
*/
|
|
1066
1063
|
function isIntegratedViewGmail() {
|
|
1067
|
-
const nav = document.querySelector('div[role=navigation]');
|
|
1068
|
-
return
|
|
1064
|
+
const nav = document.querySelector('div[role=navigation] > :nth-child(1).Xa');
|
|
1065
|
+
return nav != null;
|
|
1069
1066
|
}
|
|
1070
1067
|
|
|
1071
|
-
/** @returns null if the app menu is configured off */
|
|
1068
|
+
/** @returns null if the app menu (left side menu containing Mail, Chat/Spaces, and Meet) is configured off */
|
|
1072
1069
|
function isCollapsiblePanelHidden() {
|
|
1073
1070
|
if (!isIntegratedViewGmail()) {
|
|
1074
1071
|
return null;
|
|
@@ -1076,6 +1073,13 @@ function isCollapsiblePanelHidden() {
|
|
|
1076
1073
|
return document.querySelector('div[role=navigation].aBA') != null;
|
|
1077
1074
|
}
|
|
1078
1075
|
|
|
1076
|
+
/**
|
|
1077
|
+
* @note only able to @return true when @see {isIntegratedViewGmail} returns true
|
|
1078
|
+
*/
|
|
1079
|
+
function isGoogleChatEnabled() {
|
|
1080
|
+
return document.querySelector('div[role=navigation] > .ao4') != null;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1079
1083
|
/***/ }),
|
|
1080
1084
|
|
|
1081
1085
|
/***/ 86844:
|
|
@@ -1536,7 +1540,7 @@ const GmailElementGetter = {
|
|
|
1536
1540
|
return document.querySelector('.brC-aT5-aOt-Jw');
|
|
1537
1541
|
},
|
|
1538
1542
|
getComposeButton() {
|
|
1539
|
-
if ((0,isIntegratedViewGmail/* default */.
|
|
1543
|
+
if ((0,isIntegratedViewGmail/* default */.ZP)()) {
|
|
1540
1544
|
return document.querySelector('.aIH .aic div[role=button].L3');
|
|
1541
1545
|
}
|
|
1542
1546
|
return document.querySelector('[gh=cm]');
|
|
@@ -1551,7 +1555,7 @@ const GmailElementGetter = {
|
|
|
1551
1555
|
// finds something different than the old method, so that way we can
|
|
1552
1556
|
// figure out if it's okay to swap over.
|
|
1553
1557
|
const el = document.querySelector('div.nH.bkK > .nH');
|
|
1554
|
-
if ((0,isIntegratedViewGmail/* default */.
|
|
1558
|
+
if ((0,isIntegratedViewGmail/* default */.ZP)()) {
|
|
1555
1559
|
return el;
|
|
1556
1560
|
} else {
|
|
1557
1561
|
const leftNavContainer = GmailElementGetter.getLeftNavContainerElement();
|
|
@@ -1605,7 +1609,7 @@ const GmailElementGetter = {
|
|
|
1605
1609
|
if (this.getAppMenu()) {
|
|
1606
1610
|
return this.getAppMenuContainer()?.querySelector('.aqn.aIH') ?? null;
|
|
1607
1611
|
}
|
|
1608
|
-
if ((0,isIntegratedViewGmail/* default */.
|
|
1612
|
+
if ((0,isIntegratedViewGmail/* default */.ZP)()) {
|
|
1609
1613
|
return document.querySelector('div[role=navigation] + div.aqn');
|
|
1610
1614
|
}
|
|
1611
1615
|
return document.querySelector('.aeN');
|
|
@@ -1634,7 +1638,7 @@ const GmailElementGetter = {
|
|
|
1634
1638
|
* in their own sections at the bottom of the leftnav).
|
|
1635
1639
|
*/
|
|
1636
1640
|
shouldAddNavItemsInline() {
|
|
1637
|
-
if ((0,isIntegratedViewGmail/* default */.
|
|
1641
|
+
if ((0,isIntegratedViewGmail/* default */.ZP)()) {
|
|
1638
1642
|
return true;
|
|
1639
1643
|
}
|
|
1640
1644
|
const leftNavElement = document.querySelector('.aeN[role=navigation], .aeN [role=navigation]');
|
|
@@ -1689,7 +1693,7 @@ const GmailElementGetter = {
|
|
|
1689
1693
|
return document.querySelector('.aeN');
|
|
1690
1694
|
},
|
|
1691
1695
|
getSameSectionNavItemMenuInjectionContainer() {
|
|
1692
|
-
if ((0,isIntegratedViewGmail/* default */.
|
|
1696
|
+
if ((0,isIntegratedViewGmail/* default */.ZP)()) {
|
|
1693
1697
|
return document.querySelector('.yJ .wT > .n3');
|
|
1694
1698
|
} else {
|
|
1695
1699
|
return document.querySelector('.aeN .n3');
|
|
@@ -3108,35 +3112,42 @@ const sidebarWaitingPlatformClassName = classnames_default()(cssGlobal, "inboxsd
|
|
|
3108
3112
|
|
|
3109
3113
|
|
|
3110
3114
|
const ACTIVE_ADD_ON_ICON_SELECTOR = '.aT5-aOt-I-KO';
|
|
3111
|
-
const COMPANION_SIDEBAR_CONTENT_CLOSED_SHADOW_CLASS = 'brC-brG-btc';
|
|
3112
|
-
// there are multiple InboxSDK instances and/or extensions. All other InboxSDK
|
|
3113
|
-
// instances (including from other extensions) communicate with this Primary
|
|
3114
|
-
// through DOM events.
|
|
3115
|
+
const COMPANION_SIDEBAR_CONTENT_CLOSED_SHADOW_CLASS = 'brC-brG-btc';
|
|
3115
3116
|
|
|
3117
|
+
/** Only one instance of this Primary is ever created within a page, even if
|
|
3118
|
+
* there are multiple InboxSDK instances and/or extensions. All other InboxSDK
|
|
3119
|
+
* instances (including from other extensions) communicate with this Primary
|
|
3120
|
+
* through DOM events. */
|
|
3116
3121
|
class GmailAppSidebarPrimary {
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3122
|
+
#stopper = kefir_stopper_js_default()();
|
|
3123
|
+
/**
|
|
3124
|
+
* There could be multiple InboxSDK instances (and therefore GmailDrivers)
|
|
3125
|
+
* talking to this Primary, so we shouldn't privilege the specific GmailDriver
|
|
3126
|
+
* that happened to create the Primary. Only use this GmailDriver for
|
|
3127
|
+
* logging-related functionality!
|
|
3128
|
+
*/
|
|
3129
|
+
#driver;
|
|
3130
|
+
/**
|
|
3131
|
+
* This Primary has an identifier used by the DOM events to specify they're
|
|
3132
|
+
* talking to this Primary. This leaves us some room for having multiple
|
|
3133
|
+
* Primary instances (representing different visual locations in Gmail) or
|
|
3134
|
+
* multiple classes that make use of the same DOM events, but we don't make
|
|
3135
|
+
* use of that now. Mainly I didn't want to risk baking in the singleton
|
|
3136
|
+
* nature too deeply; that always seems to bite me.
|
|
3137
|
+
*/
|
|
3138
|
+
#instanceId = `${Date.now()}-${Math.random()}`;
|
|
3139
|
+
#companionSidebarContentContainerEl;
|
|
3140
|
+
#instanceIdsToDescriptors = new Map();
|
|
3141
|
+
#threadSidebarComponent = null;
|
|
3142
|
+
#threadIconArea = null;
|
|
3143
|
+
#globalIconArea = null;
|
|
3144
|
+
#globalButtonContainers = new Map();
|
|
3145
|
+
#threadButtonContainers = new Map();
|
|
3146
|
+
#contentContainers = new Map();
|
|
3147
|
+
#threadSidebarContainerEl = null;
|
|
3148
|
+
#companionSidebarOuterWrapper;
|
|
3149
|
+
#currentIds = new Set();
|
|
3150
|
+
#orderManager = new (order_manager_js_default())({
|
|
3140
3151
|
get() {
|
|
3141
3152
|
try {
|
|
3142
3153
|
return JSON.parse(__webpack_require__.g.localStorage.getItem('inboxsdk__sidebar_ordering') || 'null');
|
|
@@ -3152,53 +3163,58 @@ class GmailAppSidebarPrimary {
|
|
|
3152
3163
|
}
|
|
3153
3164
|
}
|
|
3154
3165
|
});
|
|
3155
|
-
|
|
3166
|
+
#containerProp;
|
|
3167
|
+
#updateHighlightedAppThreadIconBus = kefir_bus_default()();
|
|
3156
3168
|
constructor(driver, companionSidebarContentContainerElement) {
|
|
3157
|
-
this
|
|
3158
|
-
this
|
|
3159
|
-
this
|
|
3169
|
+
this.#driver = driver;
|
|
3170
|
+
this.#companionSidebarContentContainerEl = companionSidebarContentContainerElement;
|
|
3171
|
+
this.#setupElement();
|
|
3160
3172
|
}
|
|
3161
3173
|
getInstanceId() {
|
|
3162
|
-
return this
|
|
3174
|
+
return this.#instanceId;
|
|
3163
3175
|
}
|
|
3164
3176
|
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3177
|
+
/**
|
|
3178
|
+
* Only use this if a different Primary needs to take over this one's elements.
|
|
3179
|
+
* Currently this is only done when hot-reloading in dev. Don't use this when
|
|
3180
|
+
* a threadview exits, the sdk.destroy() is called, etc.
|
|
3181
|
+
*/
|
|
3168
3182
|
destroy() {
|
|
3169
|
-
this.
|
|
3183
|
+
this.#stopper.destroy();
|
|
3170
3184
|
}
|
|
3171
3185
|
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3186
|
+
/**
|
|
3187
|
+
* This value controls whether the app sidebar should automatically open
|
|
3188
|
+
* itself when available when the chat sidebar isn't present. It's only set
|
|
3189
|
+
* if the user interacts with the app sidebar button.
|
|
3190
|
+
*/
|
|
3191
|
+
#getShouldGlobalAppSidebarOpen() {
|
|
3176
3192
|
return __webpack_require__.g.localStorage.getItem('inboxsdk__global_app_sidebar_should_open') === 'true';
|
|
3177
3193
|
}
|
|
3178
|
-
|
|
3194
|
+
#setShouldGlobalAppSidebarOpen(open) {
|
|
3179
3195
|
try {
|
|
3180
3196
|
__webpack_require__.g.localStorage.setItem('inboxsdk__global_app_sidebar_should_open', String(open));
|
|
3181
3197
|
} catch (err) {
|
|
3182
3198
|
console.error('error saving', err);
|
|
3183
3199
|
}
|
|
3184
3200
|
}
|
|
3185
|
-
|
|
3201
|
+
#getShouldThreadAppSidebarOpen() {
|
|
3186
3202
|
return __webpack_require__.g.localStorage.getItem('inboxsdk__thread_app_sidebar_should_open') !== 'false';
|
|
3187
3203
|
}
|
|
3188
|
-
|
|
3204
|
+
#setShouldThreadAppSidebarOpen(open) {
|
|
3189
3205
|
try {
|
|
3190
3206
|
__webpack_require__.g.localStorage.setItem('inboxsdk__thread_app_sidebar_should_open', String(open));
|
|
3191
3207
|
} catch (err) {
|
|
3192
3208
|
console.error('error saving', err);
|
|
3193
3209
|
}
|
|
3194
3210
|
}
|
|
3195
|
-
|
|
3196
|
-
if (this
|
|
3197
|
-
const threadSidebarContainerEl = this
|
|
3211
|
+
#createThreadSidebarIfNeeded() {
|
|
3212
|
+
if (this.#threadSidebarContainerEl) return this.#threadSidebarContainerEl;
|
|
3213
|
+
const threadSidebarContainerEl = this.#threadSidebarContainerEl = document.createElement('div');
|
|
3198
3214
|
threadSidebarContainerEl.classList.add('thread_app_sidebar', (0,idMap/* default */.Z)('app_sidebar_container'), 'addon_sidebar');
|
|
3199
|
-
this.
|
|
3200
|
-
this
|
|
3201
|
-
this.
|
|
3215
|
+
this.#companionSidebarContentContainerEl.insertBefore(threadSidebarContainerEl, this.#companionSidebarContentContainerEl.firstElementChild);
|
|
3216
|
+
this.#containerProp = () => threadSidebarContainerEl;
|
|
3217
|
+
this.#updateHighlightedAppThreadIconBus.bufferWithTimeOrCount(150, 100).filter(events => events.length > 0).takeUntilBy(this.#stopper).onValue(() => {
|
|
3202
3218
|
// Before touching this code, make sure you understand the meaning of the clientRect
|
|
3203
3219
|
// values and of scrollTop. In particular, make sure you understand the distinction of
|
|
3204
3220
|
// absolute (the scroll[Top|Bottom|Height] values) vs relative (the BoundingRect top
|
|
@@ -3240,9 +3256,9 @@ class GmailAppSidebarPrimary {
|
|
|
3240
3256
|
const instanceId = titleBar.getAttribute('data-instance-id');
|
|
3241
3257
|
const appName = titleBar.getAttribute('data-app-name');
|
|
3242
3258
|
if (!appName) return;
|
|
3243
|
-
const appButton = this.
|
|
3244
|
-
if (!appButton || !this
|
|
3245
|
-
const activeButtonContainer = this.
|
|
3259
|
+
const appButton = this.#threadButtonContainers.get(appName);
|
|
3260
|
+
if (!appButton || !this.#threadIconArea) return;
|
|
3261
|
+
const activeButtonContainer = this.#threadIconArea.querySelector('.sidebar_button_container_active');
|
|
3246
3262
|
if (activeButtonContainer) {
|
|
3247
3263
|
activeButtonContainer.classList.remove('sidebar_button_container_active');
|
|
3248
3264
|
}
|
|
@@ -3251,61 +3267,61 @@ class GmailAppSidebarPrimary {
|
|
|
3251
3267
|
});
|
|
3252
3268
|
|
|
3253
3269
|
//listen for scroll and update active icon if needed
|
|
3254
|
-
this.
|
|
3270
|
+
this.#updateHighlightedAppThreadIconBus.plug(kefir_esm.fromEvents(threadSidebarContainerEl, 'scroll').map(() => null));
|
|
3255
3271
|
|
|
3256
3272
|
// handle rendering thread sidebar contents
|
|
3257
|
-
this
|
|
3273
|
+
this.#renderThreadSidebar();
|
|
3258
3274
|
return threadSidebarContainerEl;
|
|
3259
3275
|
}
|
|
3260
|
-
|
|
3261
|
-
if (!this
|
|
3276
|
+
#renderThreadSidebarIfPresent() {
|
|
3277
|
+
if (!this.#threadSidebarContainerEl) {
|
|
3262
3278
|
return;
|
|
3263
3279
|
}
|
|
3264
|
-
this
|
|
3280
|
+
this.#renderThreadSidebar();
|
|
3265
3281
|
}
|
|
3266
|
-
|
|
3282
|
+
#appSidebarRefSetter = threadSidebarComponent => {
|
|
3267
3283
|
if (threadSidebarComponent) {
|
|
3268
|
-
this
|
|
3284
|
+
this.#threadSidebarComponent = threadSidebarComponent;
|
|
3269
3285
|
}
|
|
3270
3286
|
};
|
|
3271
|
-
|
|
3272
|
-
const threadSidebarContainerEl = this
|
|
3287
|
+
#renderThreadSidebar() {
|
|
3288
|
+
const threadSidebarContainerEl = this.#threadSidebarContainerEl;
|
|
3273
3289
|
if (!threadSidebarContainerEl) {
|
|
3274
3290
|
throw new Error('_renderThreadSidebar should not be called when _threadSidebarContainerEl is unset');
|
|
3275
3291
|
}
|
|
3276
3292
|
return new Promise(resolve => {
|
|
3277
3293
|
react_dom.render( /*#__PURE__*/react.createElement(AppSidebar, {
|
|
3278
|
-
ref: this
|
|
3279
|
-
panels: this.
|
|
3294
|
+
ref: this.#appSidebarRefSetter,
|
|
3295
|
+
panels: this.#orderManager.getOrderedItems().map(x => x.value),
|
|
3280
3296
|
onMoveEnd: (newList, movedItem, oldIndex, newIndex) => {
|
|
3281
|
-
this.
|
|
3282
|
-
this
|
|
3297
|
+
this.#orderManager.moveItem(oldIndex, newIndex);
|
|
3298
|
+
this.#renderThreadSidebar();
|
|
3283
3299
|
},
|
|
3284
3300
|
onExpandedToggle: () => {
|
|
3285
|
-
this.
|
|
3301
|
+
this.#updateHighlightedAppThreadIconBus.emit(null);
|
|
3286
3302
|
},
|
|
3287
|
-
container: this
|
|
3303
|
+
container: this.#containerProp
|
|
3288
3304
|
}), threadSidebarContainerEl, () => {
|
|
3289
|
-
if (!this
|
|
3305
|
+
if (!this.#threadSidebarComponent) {
|
|
3290
3306
|
throw new Error('Should not happen');
|
|
3291
3307
|
}
|
|
3292
|
-
resolve(this
|
|
3293
|
-
this.
|
|
3308
|
+
resolve(this.#threadSidebarComponent);
|
|
3309
|
+
this.#updateHighlightedAppThreadIconBus.emit(null);
|
|
3294
3310
|
});
|
|
3295
3311
|
});
|
|
3296
3312
|
}
|
|
3297
|
-
|
|
3313
|
+
#getActiveButtonContainer() {
|
|
3298
3314
|
let activeButtonContainer;
|
|
3299
|
-
if (this
|
|
3300
|
-
activeButtonContainer = this.
|
|
3315
|
+
if (this.#globalIconArea) {
|
|
3316
|
+
activeButtonContainer = this.#globalIconArea.querySelector('.sidebar_button_container_active');
|
|
3301
3317
|
}
|
|
3302
|
-
if (!activeButtonContainer && this
|
|
3303
|
-
activeButtonContainer = this.
|
|
3318
|
+
if (!activeButtonContainer && this.#threadIconArea) {
|
|
3319
|
+
activeButtonContainer = this.#threadIconArea.querySelector('.sidebar_button_container_active');
|
|
3304
3320
|
}
|
|
3305
3321
|
return activeButtonContainer;
|
|
3306
3322
|
}
|
|
3307
|
-
|
|
3308
|
-
|
|
3323
|
+
#closeButton = null;
|
|
3324
|
+
#addButton(iconArea, event, isGlobal) {
|
|
3309
3325
|
var _this = this;
|
|
3310
3326
|
// we put adding the content panel icon in the iconArea in an asap so that we
|
|
3311
3327
|
// get consistent ordering. The ordering of the icons is based on the position of the FIRST
|
|
@@ -3319,7 +3335,7 @@ class GmailAppSidebarPrimary {
|
|
|
3319
3335
|
const iconClass = event.detail.iconClass || '';
|
|
3320
3336
|
// If there's an existing button for the app, then just increment its
|
|
3321
3337
|
// data-count attribute instead of adding a new button.
|
|
3322
|
-
const existingButtonContainer = isGlobal ? this.
|
|
3338
|
+
const existingButtonContainer = isGlobal ? this.#globalButtonContainers.get(appName) : this.#threadButtonContainers.get(appName);
|
|
3323
3339
|
let buttonContainer;
|
|
3324
3340
|
if (existingButtonContainer) {
|
|
3325
3341
|
const currentCount = Number(existingButtonContainer.getAttribute('data-count')) || 1;
|
|
@@ -3339,28 +3355,28 @@ class GmailAppSidebarPrimary {
|
|
|
3339
3355
|
(0,querySelectorOrFail/* default */.Z)(buttonContainer, '.inboxsdk__button_selectedIndicator').style.backgroundColor = event.detail.primaryColor;
|
|
3340
3356
|
}
|
|
3341
3357
|
if (isGlobal) {
|
|
3342
|
-
this.
|
|
3358
|
+
this.#globalButtonContainers.set(appName, buttonContainer);
|
|
3343
3359
|
} else {
|
|
3344
|
-
this.
|
|
3360
|
+
this.#threadButtonContainers.set(appName, buttonContainer);
|
|
3345
3361
|
}
|
|
3346
3362
|
const activate = function () {
|
|
3347
3363
|
let dontScrollIntoView = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
3348
|
-
const activeButtonContainer = _this
|
|
3364
|
+
const activeButtonContainer = _this.#getActiveButtonContainer();
|
|
3349
3365
|
if (activeButtonContainer === buttonContainer) {
|
|
3350
3366
|
// button was clicked while its panel was open, so close it.
|
|
3351
|
-
if (!_this
|
|
3352
|
-
_this
|
|
3367
|
+
if (!_this.#closeButton) throw new Error();
|
|
3368
|
+
_this.#closeButton(true);
|
|
3353
3369
|
} else {
|
|
3354
3370
|
// button was clicked while its own panel wasn't open, so open it.
|
|
3355
|
-
if (_this
|
|
3356
|
-
_this
|
|
3371
|
+
if (_this.#closeButton) {
|
|
3372
|
+
_this.#closeButton(true);
|
|
3357
3373
|
}
|
|
3358
|
-
if (isGlobal) _this
|
|
3359
|
-
_this
|
|
3374
|
+
if (isGlobal) _this.#setShouldGlobalAppSidebarOpen(true);else _this.#setShouldThreadAppSidebarOpen(true);
|
|
3375
|
+
_this.#openSidebarAndActivateButton(buttonContainer, isGlobal);
|
|
3360
3376
|
if (isGlobal) {
|
|
3361
|
-
const contentEl = _this.
|
|
3377
|
+
const contentEl = _this.#contentContainers.get(appName);
|
|
3362
3378
|
if (contentEl) contentEl.style.display = '';
|
|
3363
|
-
_this.
|
|
3379
|
+
_this.#companionSidebarContentContainerEl.classList.add('companion_global_app_sidebar_visible');
|
|
3364
3380
|
|
|
3365
3381
|
// let app listen for activate event
|
|
3366
3382
|
document.body.dispatchEvent(new CustomEvent('inboxsdkSidebarPanelActivated', {
|
|
@@ -3371,7 +3387,7 @@ class GmailAppSidebarPrimary {
|
|
|
3371
3387
|
}
|
|
3372
3388
|
}));
|
|
3373
3389
|
} else {
|
|
3374
|
-
const threadSidebarComponent = _this
|
|
3390
|
+
const threadSidebarComponent = _this.#threadSidebarComponent;
|
|
3375
3391
|
if (!threadSidebarComponent) {
|
|
3376
3392
|
throw new Error('sidebar not mounted');
|
|
3377
3393
|
}
|
|
@@ -3380,20 +3396,20 @@ class GmailAppSidebarPrimary {
|
|
|
3380
3396
|
threadSidebarComponent.scrollPanelIntoView(instanceId, true);
|
|
3381
3397
|
}
|
|
3382
3398
|
}
|
|
3383
|
-
_this
|
|
3384
|
-
_this
|
|
3385
|
-
const activeButtonContainer = _this
|
|
3399
|
+
_this.#closeButton = userClick => {
|
|
3400
|
+
_this.#closeButton = null;
|
|
3401
|
+
const activeButtonContainer = _this.#getActiveButtonContainer();
|
|
3386
3402
|
if (!activeButtonContainer) {
|
|
3387
3403
|
throw new Error('Expected activeButtonContainer');
|
|
3388
3404
|
}
|
|
3389
|
-
_this
|
|
3405
|
+
_this.#closeSidebarAndDeactivateButton(activeButtonContainer);
|
|
3390
3406
|
if (isGlobal) {
|
|
3391
|
-
if (userClick) _this
|
|
3392
|
-
const contentEl = _this.
|
|
3407
|
+
if (userClick) _this.#setShouldGlobalAppSidebarOpen(false);
|
|
3408
|
+
const contentEl = _this.#contentContainers.get(appName);
|
|
3393
3409
|
if (contentEl) {
|
|
3394
3410
|
contentEl.style.display = 'none';
|
|
3395
3411
|
} else {
|
|
3396
|
-
_this.
|
|
3412
|
+
_this.#driver.getLogger().error(new Error('Unexpected: contentEl not set'));
|
|
3397
3413
|
}
|
|
3398
3414
|
document.body.dispatchEvent(new CustomEvent('inboxsdkSidebarPanelDeactivated', {
|
|
3399
3415
|
bubbles: true,
|
|
@@ -3403,7 +3419,7 @@ class GmailAppSidebarPrimary {
|
|
|
3403
3419
|
}
|
|
3404
3420
|
}));
|
|
3405
3421
|
} else {
|
|
3406
|
-
if (userClick) _this
|
|
3422
|
+
if (userClick) _this.#setShouldThreadAppSidebarOpen(false);
|
|
3407
3423
|
}
|
|
3408
3424
|
|
|
3409
3425
|
//fake a window resize after closing so gmail fixes any heights that are messed up
|
|
@@ -3419,23 +3435,23 @@ class GmailAppSidebarPrimary {
|
|
|
3419
3435
|
activate();
|
|
3420
3436
|
}, true);
|
|
3421
3437
|
if (iconArea) {
|
|
3422
|
-
(0,add_to_icon_area/* default */.Z)(this
|
|
3438
|
+
(0,add_to_icon_area/* default */.Z)(this.#orderManager, appName, buttonContainer, iconArea);
|
|
3423
3439
|
}
|
|
3424
3440
|
|
|
3425
3441
|
// if we last had an SDK sidebar open then bring up the SDK sidebar when the first
|
|
3426
3442
|
// panel gets added
|
|
3427
3443
|
{
|
|
3428
|
-
const activeButtonContainer = this
|
|
3444
|
+
const activeButtonContainer = this.#getActiveButtonContainer();
|
|
3429
3445
|
if (isGlobal) {
|
|
3430
|
-
if (this
|
|
3431
|
-
const activeButtonContainerPresentAndIsForGlobal = this
|
|
3446
|
+
if (this.#getShouldGlobalAppSidebarOpen()) {
|
|
3447
|
+
const activeButtonContainerPresentAndIsForGlobal = this.#globalIconArea && activeButtonContainer && this.#globalIconArea.contains(activeButtonContainer);
|
|
3432
3448
|
if (!activeButtonContainerPresentAndIsForGlobal) {
|
|
3433
3449
|
activate(true);
|
|
3434
3450
|
}
|
|
3435
3451
|
}
|
|
3436
3452
|
} else {
|
|
3437
|
-
if (this
|
|
3438
|
-
const activeButtonContainerPresentAndIsForThread = this
|
|
3453
|
+
if (this.#getShouldThreadAppSidebarOpen()) {
|
|
3454
|
+
const activeButtonContainerPresentAndIsForThread = this.#threadIconArea && activeButtonContainer && this.#threadIconArea.contains(activeButtonContainer);
|
|
3439
3455
|
if (!activeButtonContainerPresentAndIsForThread) {
|
|
3440
3456
|
activate(true);
|
|
3441
3457
|
}
|
|
@@ -3445,7 +3461,7 @@ class GmailAppSidebarPrimary {
|
|
|
3445
3461
|
}
|
|
3446
3462
|
});
|
|
3447
3463
|
}
|
|
3448
|
-
|
|
3464
|
+
#removeButton(event, buttonContainers, iconArea) {
|
|
3449
3465
|
const appName = event.detail.appName;
|
|
3450
3466
|
const container = buttonContainers.get(appName);
|
|
3451
3467
|
if (!iconArea || !container) {
|
|
@@ -3455,11 +3471,11 @@ class GmailAppSidebarPrimary {
|
|
|
3455
3471
|
if (currentCount <= 1) {
|
|
3456
3472
|
const activeButtonContainer = iconArea.querySelector('.sidebar_button_container_active');
|
|
3457
3473
|
if (container === activeButtonContainer) {
|
|
3458
|
-
if (!this
|
|
3459
|
-
this
|
|
3460
|
-
this.
|
|
3461
|
-
this.
|
|
3462
|
-
const contentContainer = this.
|
|
3474
|
+
if (!this.#closeButton) throw new Error();
|
|
3475
|
+
this.#closeButton(false);
|
|
3476
|
+
this.#companionSidebarOuterWrapper.classList.remove('companion_app_sidebar_wrapper_visible');
|
|
3477
|
+
this.#companionSidebarContentContainerEl.classList.remove('companion_app_sidebar_visible');
|
|
3478
|
+
const contentContainer = this.#companionSidebarOuterWrapper.previousElementSibling;
|
|
3463
3479
|
if (contentContainer) contentContainer.classList.remove('companion_container_app_sidebar_visible');
|
|
3464
3480
|
}
|
|
3465
3481
|
container.remove();
|
|
@@ -3470,18 +3486,18 @@ class GmailAppSidebarPrimary {
|
|
|
3470
3486
|
container.setAttribute('data-count', String(currentCount - 1));
|
|
3471
3487
|
}
|
|
3472
3488
|
}
|
|
3473
|
-
|
|
3489
|
+
#closeSidebarAndDeactivateButton(activeButtonContainer) {
|
|
3474
3490
|
activeButtonContainer.classList.remove('sidebar_button_container_active');
|
|
3475
|
-
this.
|
|
3476
|
-
this.
|
|
3477
|
-
this.
|
|
3478
|
-
const contentContainer = this.
|
|
3491
|
+
this.#companionSidebarOuterWrapper.classList.remove('companion_app_sidebar_wrapper_visible');
|
|
3492
|
+
this.#companionSidebarContentContainerEl.classList.add(COMPANION_SIDEBAR_CONTENT_CLOSED_SHADOW_CLASS);
|
|
3493
|
+
this.#companionSidebarContentContainerEl.classList.remove('companion_app_sidebar_visible', 'companion_global_app_sidebar_visible');
|
|
3494
|
+
const contentContainer = this.#companionSidebarOuterWrapper.previousElementSibling;
|
|
3479
3495
|
if (contentContainer) contentContainer.classList.remove('companion_container_app_sidebar_visible');
|
|
3480
3496
|
}
|
|
3481
|
-
|
|
3497
|
+
#openSidebarAndActivateButton(buttonContainer, isGlobal) {
|
|
3482
3498
|
const companionSidebarIconContainerEl = gmail_element_getter/* default.getCompanionSidebarIconContainerElement */.Z.getCompanionSidebarIconContainerElement();
|
|
3483
3499
|
if (!companionSidebarIconContainerEl) throw new Error('Could not find companion sidebar icon container element');
|
|
3484
|
-
const activeButtonContainer = this
|
|
3500
|
+
const activeButtonContainer = this.#getActiveButtonContainer();
|
|
3485
3501
|
if (activeButtonContainer) {
|
|
3486
3502
|
throw new Error('activeButtonContainer should not be true'); // this._closeSidebarAndDeactivateButton(activeButtonContainer);
|
|
3487
3503
|
}
|
|
@@ -3494,29 +3510,29 @@ class GmailAppSidebarPrimary {
|
|
|
3494
3510
|
}
|
|
3495
3511
|
}
|
|
3496
3512
|
buttonContainer.classList.add('sidebar_button_container_active');
|
|
3497
|
-
this.
|
|
3498
|
-
this.
|
|
3499
|
-
this.
|
|
3500
|
-
const contentContainer = this.
|
|
3513
|
+
this.#companionSidebarOuterWrapper.classList.add('companion_app_sidebar_wrapper_visible');
|
|
3514
|
+
this.#companionSidebarContentContainerEl.classList.add('companion_app_sidebar_visible');
|
|
3515
|
+
this.#companionSidebarContentContainerEl.classList.remove(COMPANION_SIDEBAR_CONTENT_CLOSED_SHADOW_CLASS);
|
|
3516
|
+
const contentContainer = this.#companionSidebarOuterWrapper.previousElementSibling;
|
|
3501
3517
|
if (contentContainer) contentContainer.classList.add('companion_container_app_sidebar_visible');
|
|
3502
|
-
if (isGlobal) this.
|
|
3518
|
+
if (isGlobal) this.#companionSidebarContentContainerEl.classList.add('companion_global_app_sidebar_visible');
|
|
3503
3519
|
}
|
|
3504
|
-
|
|
3520
|
+
#setupElement() {
|
|
3505
3521
|
const companionSidebarIconContainerEl = gmail_element_getter/* default.getCompanionSidebarIconContainerElement */.Z.getCompanionSidebarIconContainerElement();
|
|
3506
3522
|
if (!companionSidebarIconContainerEl) throw new Error('Could not find companion sidebar icon container element');
|
|
3507
|
-
this.
|
|
3523
|
+
this.#companionSidebarContentContainerEl.setAttribute('data-sdk-sidebar-instance-id', this.#instanceId);
|
|
3508
3524
|
|
|
3509
3525
|
// TODO: Once the changes to the GMail DOM have been entirely ramped, drop the ternary here and
|
|
3510
3526
|
// always get the parentElement. (Jun 20, 2018)
|
|
3511
|
-
this
|
|
3512
|
-
if (!this
|
|
3527
|
+
this.#companionSidebarOuterWrapper = this.#companionSidebarContentContainerEl.classList.contains('bq9') ? this.#companionSidebarContentContainerEl : this.#companionSidebarContentContainerEl.parentElement;
|
|
3528
|
+
if (!this.#companionSidebarOuterWrapper) {
|
|
3513
3529
|
throw new Error('should not happen: failed to find companionSidebarOuterWrapper');
|
|
3514
3530
|
}
|
|
3515
|
-
const contentContainer = this.
|
|
3531
|
+
const contentContainer = this.#companionSidebarOuterWrapper.previousElementSibling;
|
|
3516
3532
|
if (contentContainer) {
|
|
3517
3533
|
contentContainer.classList.add((0,idMap/* default */.Z)('companion_container_app_sidebar_in_use'));
|
|
3518
3534
|
}
|
|
3519
|
-
this.
|
|
3535
|
+
this.#companionSidebarContentContainerEl.classList.add((0,idMap/* default */.Z)('app_sidebar_in_use'));
|
|
3520
3536
|
if (!document.body.querySelector(sidebarWaitingPlatformSelector)) {
|
|
3521
3537
|
const waitingPlatform = document.createElement('div');
|
|
3522
3538
|
waitingPlatform.className = classnames_default()(sidebarWaitingPlatformClassName, (0,idMap/* default */.Z)('app_sidebar_waiting_platform'));
|
|
@@ -3525,19 +3541,19 @@ class GmailAppSidebarPrimary {
|
|
|
3525
3541
|
|
|
3526
3542
|
// thread sidebar content panels
|
|
3527
3543
|
{
|
|
3528
|
-
kefir_esm.fromEvents(window, 'storage').filter(e => e.key === 'inboxsdk__sidebar_ordering').takeUntilBy(this
|
|
3529
|
-
this.
|
|
3530
|
-
this
|
|
3544
|
+
kefir_esm.fromEvents(window, 'storage').filter(e => e.key === 'inboxsdk__sidebar_ordering').takeUntilBy(this.#stopper).onValue(() => {
|
|
3545
|
+
this.#orderManager.reload();
|
|
3546
|
+
this.#renderThreadSidebarIfPresent();
|
|
3531
3547
|
});
|
|
3532
|
-
kefir_esm.fromEvents(document.body, 'inboxsdkNewSidebarPanel').filter(e => e.detail.sidebarId === this
|
|
3533
|
-
this
|
|
3548
|
+
kefir_esm.fromEvents(document.body, 'inboxsdkNewSidebarPanel').filter(e => e.detail.sidebarId === this.#instanceId && !e.detail.isGlobal).takeUntilBy(this.#stopper).onValue(event => {
|
|
3549
|
+
this.#createThreadSidebarIfNeeded();
|
|
3534
3550
|
let id = event.detail.id;
|
|
3535
|
-
while (this.
|
|
3551
|
+
while (this.#currentIds.has(id)) {
|
|
3536
3552
|
id = incrementName(id);
|
|
3537
3553
|
}
|
|
3538
|
-
this.
|
|
3554
|
+
this.#currentIds.add(id);
|
|
3539
3555
|
const appName = event.detail.appName;
|
|
3540
|
-
this.
|
|
3556
|
+
this.#orderManager.addItem({
|
|
3541
3557
|
groupId: event.detail.appId,
|
|
3542
3558
|
id,
|
|
3543
3559
|
orderHint: event.detail.orderHint,
|
|
@@ -3553,21 +3569,21 @@ class GmailAppSidebarPrimary {
|
|
|
3553
3569
|
el: event.target
|
|
3554
3570
|
}
|
|
3555
3571
|
});
|
|
3556
|
-
this
|
|
3557
|
-
let threadIconArea = this
|
|
3572
|
+
this.#renderThreadSidebar();
|
|
3573
|
+
let threadIconArea = this.#threadIconArea = companionSidebarIconContainerEl.querySelector('.sidebar_thread_iconArea');
|
|
3558
3574
|
if (!threadIconArea) {
|
|
3559
|
-
threadIconArea = this
|
|
3575
|
+
threadIconArea = this.#threadIconArea = document.createElement('div');
|
|
3560
3576
|
threadIconArea.className = (0,idMap/* default */.Z)('sidebar_iconArea');
|
|
3561
3577
|
threadIconArea.classList.add('sidebar_thread_iconArea');
|
|
3562
|
-
(0,add_companion_thread_icon_area/* default */.Z)(this.
|
|
3578
|
+
(0,add_companion_thread_icon_area/* default */.Z)(this.#driver.getLogger(), threadIconArea, companionSidebarIconContainerEl);
|
|
3563
3579
|
}
|
|
3564
|
-
this
|
|
3580
|
+
this.#addButton(threadIconArea, event, false);
|
|
3565
3581
|
});
|
|
3566
|
-
kefir_esm.fromEvents(document.body, 'inboxsdkUpdateSidebarPanel').filter(e => e.detail.sidebarId === this
|
|
3567
|
-
const orderedItems = this.
|
|
3582
|
+
kefir_esm.fromEvents(document.body, 'inboxsdkUpdateSidebarPanel').filter(e => e.detail.sidebarId === this.#instanceId && !e.detail.isGlobal).takeUntilBy(this.#stopper).onValue(event => {
|
|
3583
|
+
const orderedItems = this.#orderManager.getOrderedItems();
|
|
3568
3584
|
const index = findIndex_default()(orderedItems, x => x.value.instanceId === event.detail.instanceId);
|
|
3569
3585
|
if (index === -1) throw new Error('should not happen: failed to find orderItem');
|
|
3570
|
-
this.
|
|
3586
|
+
this.#orderManager.updateItemValueByIndex(index, {
|
|
3571
3587
|
id: orderedItems[index].value.id,
|
|
3572
3588
|
appId: event.detail.appId,
|
|
3573
3589
|
appName: event.detail.appName || event.detail.title,
|
|
@@ -3578,33 +3594,33 @@ class GmailAppSidebarPrimary {
|
|
|
3578
3594
|
hideTitleBar: event.detail.hideTitleBar,
|
|
3579
3595
|
el: event.target
|
|
3580
3596
|
});
|
|
3581
|
-
this
|
|
3597
|
+
this.#renderThreadSidebar();
|
|
3582
3598
|
});
|
|
3583
|
-
kefir_esm.fromEvents(document.body, 'inboxsdkRemoveSidebarPanel').filter(e => e.detail.sidebarId === this
|
|
3584
|
-
const orderedItems = this.
|
|
3599
|
+
kefir_esm.fromEvents(document.body, 'inboxsdkRemoveSidebarPanel').filter(e => e.detail.sidebarId === this.#instanceId && !e.detail.isGlobal).takeUntilBy(this.#stopper).onValue(event => {
|
|
3600
|
+
const orderedItems = this.#orderManager.getOrderedItems();
|
|
3585
3601
|
const index = findIndex_default()(orderedItems, x => x.value.instanceId === event.detail.instanceId);
|
|
3586
3602
|
if (index === -1) throw new Error('should not happen: failed to find orderItem');
|
|
3587
|
-
this.
|
|
3588
|
-
this.
|
|
3589
|
-
this
|
|
3590
|
-
this
|
|
3603
|
+
this.#currentIds.delete(orderedItems[index].id);
|
|
3604
|
+
this.#orderManager.removeItemByIndex(index);
|
|
3605
|
+
this.#renderThreadSidebar();
|
|
3606
|
+
this.#removeButton(event, this.#threadButtonContainers, this.#threadIconArea);
|
|
3591
3607
|
});
|
|
3592
|
-
kefir_esm.fromEvents(document.body, 'inboxsdkSidebarPanelScrollIntoView').filter(e => e.detail.sidebarId === this
|
|
3593
|
-
if (this
|
|
3608
|
+
kefir_esm.fromEvents(document.body, 'inboxsdkSidebarPanelScrollIntoView').filter(e => e.detail.sidebarId === this.#instanceId && !e.detail.isGlobal).takeUntilBy(this.#stopper).onValue(event => {
|
|
3609
|
+
if (this.#threadSidebarComponent) this.#threadSidebarComponent.scrollPanelIntoView(event.detail.instanceId);
|
|
3594
3610
|
});
|
|
3595
|
-
kefir_esm.fromEvents(document.body, 'inboxsdkSidebarPanelClose').filter(e => e.detail.sidebarId === this
|
|
3596
|
-
if (this
|
|
3611
|
+
kefir_esm.fromEvents(document.body, 'inboxsdkSidebarPanelClose').filter(e => e.detail.sidebarId === this.#instanceId && !e.detail.isGlobal).takeUntilBy(this.#stopper).onValue(event => {
|
|
3612
|
+
if (this.#threadSidebarComponent) this.#threadSidebarComponent.closePanel(event.detail.instanceId);
|
|
3597
3613
|
});
|
|
3598
|
-
kefir_esm.fromEvents(document.body, 'inboxsdkSidebarPanelOpen').filter(e => e.detail.sidebarId === this
|
|
3614
|
+
kefir_esm.fromEvents(document.body, 'inboxsdkSidebarPanelOpen').filter(e => e.detail.sidebarId === this.#instanceId && !e.detail.isGlobal).takeUntilBy(this.#stopper).onValue(e => {
|
|
3599
3615
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3600
|
-
this
|
|
3601
|
-
const descriptor = this.
|
|
3616
|
+
this.#renderThreadSidebar().then(threadSidebarComponent => {
|
|
3617
|
+
const descriptor = this.#instanceIdsToDescriptors.get(e.detail.instanceId);
|
|
3602
3618
|
if (!descriptor) return;
|
|
3603
|
-
const buttonContainer = this.
|
|
3619
|
+
const buttonContainer = this.#threadButtonContainers.get(descriptor.appName);
|
|
3604
3620
|
if (!buttonContainer) {
|
|
3605
3621
|
throw new Error('missing button container');
|
|
3606
3622
|
}
|
|
3607
|
-
const activeButtonContainer = this
|
|
3623
|
+
const activeButtonContainer = this.#getActiveButtonContainer();
|
|
3608
3624
|
if (activeButtonContainer !== buttonContainer) {
|
|
3609
3625
|
(0,querySelectorOrFail/* default */.Z)(buttonContainer, 'button').click();
|
|
3610
3626
|
}
|
|
@@ -3613,30 +3629,30 @@ class GmailAppSidebarPrimary {
|
|
|
3613
3629
|
}
|
|
3614
3630
|
// global sidebar content panels
|
|
3615
3631
|
{
|
|
3616
|
-
kefir_esm.fromEvents(document.body, 'inboxsdkNewSidebarPanel').filter(e => e.detail.sidebarId === this
|
|
3632
|
+
kefir_esm.fromEvents(document.body, 'inboxsdkNewSidebarPanel').filter(e => e.detail.sidebarId === this.#instanceId && e.detail.isGlobal).takeUntilBy(this.#stopper).onValue(event => {
|
|
3617
3633
|
let id = event.detail.id;
|
|
3618
|
-
while (this.
|
|
3634
|
+
while (this.#currentIds.has(id)) {
|
|
3619
3635
|
id = incrementName(id);
|
|
3620
3636
|
}
|
|
3621
|
-
this.
|
|
3637
|
+
this.#currentIds.add(id);
|
|
3622
3638
|
const appName = event.detail.appName;
|
|
3623
|
-
let globalIconArea = this
|
|
3639
|
+
let globalIconArea = this.#globalIconArea = companionSidebarIconContainerEl.querySelector('.sidebar_global_iconArea');
|
|
3624
3640
|
if (!globalIconArea) {
|
|
3625
|
-
globalIconArea = this
|
|
3641
|
+
globalIconArea = this.#globalIconArea = document.createElement('div');
|
|
3626
3642
|
globalIconArea.className = (0,idMap/* default */.Z)('sidebar_iconArea');
|
|
3627
3643
|
globalIconArea.classList.add('sidebar_global_iconArea');
|
|
3628
|
-
(0,add_companion_global_icon_area/* default */.Z)(this.
|
|
3644
|
+
(0,add_companion_global_icon_area/* default */.Z)(this.#driver.getLogger(), globalIconArea, companionSidebarIconContainerEl);
|
|
3629
3645
|
}
|
|
3630
3646
|
const sdkContentContainerEl = document.createElement('div');
|
|
3631
3647
|
sdkContentContainerEl.classList.add('addon_sidebar', (0,idMap/* default */.Z)('app_sidebar_container'), 'global_app_sidebar');
|
|
3632
|
-
this.
|
|
3633
|
-
this.
|
|
3648
|
+
this.#companionSidebarContentContainerEl.insertAdjacentElement('afterbegin', sdkContentContainerEl);
|
|
3649
|
+
this.#contentContainers.set(appName, sdkContentContainerEl);
|
|
3634
3650
|
sdkContentContainerEl.appendChild(event.target);
|
|
3635
3651
|
sdkContentContainerEl.style.display = 'none';
|
|
3636
|
-
this
|
|
3652
|
+
this.#addButton(globalIconArea, event, true);
|
|
3637
3653
|
});
|
|
3638
|
-
kefir_esm.fromEvents(document.body, 'inboxsdkUpdateSidebarPanel').filter(e => e.detail.sidebarId === this
|
|
3639
|
-
const buttonContainer = this.
|
|
3654
|
+
kefir_esm.fromEvents(document.body, 'inboxsdkUpdateSidebarPanel').filter(e => e.detail.sidebarId === this.#instanceId && e.detail.isGlobal).takeUntilBy(this.#stopper).onValue(event => {
|
|
3655
|
+
const buttonContainer = this.#globalButtonContainers.get(event.detail.appName);
|
|
3640
3656
|
if (!buttonContainer) return;
|
|
3641
3657
|
const iconClass = event.detail.iconClass || '';
|
|
3642
3658
|
const iconUrl = event.detail.iconUrl || event.detail.appIconUrl;
|
|
@@ -3645,29 +3661,29 @@ class GmailAppSidebarPrimary {
|
|
|
3645
3661
|
const button = (0,querySelectorOrFail/* default */.Z)(buttonContainer, 'button');
|
|
3646
3662
|
button.setAttribute('class', `inboxsdk__button_icon ${iconClass}`);
|
|
3647
3663
|
});
|
|
3648
|
-
kefir_esm.fromEvents(document.body, 'inboxsdkRemoveSidebarPanel').filter(e => e.detail.sidebarId === this
|
|
3649
|
-
this.
|
|
3650
|
-
this
|
|
3664
|
+
kefir_esm.fromEvents(document.body, 'inboxsdkRemoveSidebarPanel').filter(e => e.detail.sidebarId === this.#instanceId && e.detail.isGlobal).takeUntilBy(this.#stopper).onValue(event => {
|
|
3665
|
+
this.#currentIds.delete(event.detail.id);
|
|
3666
|
+
this.#removeButton(event, this.#globalButtonContainers, this.#globalIconArea);
|
|
3651
3667
|
});
|
|
3652
|
-
kefir_esm.fromEvents(document.body, 'inboxsdkSidebarPanelClose').filter(e => e.detail.sidebarId === this
|
|
3653
|
-
const descriptor = this.
|
|
3668
|
+
kefir_esm.fromEvents(document.body, 'inboxsdkSidebarPanelClose').filter(e => e.detail.sidebarId === this.#instanceId && e.detail.isGlobal).takeUntilBy(this.#stopper).onValue(event => {
|
|
3669
|
+
const descriptor = this.#instanceIdsToDescriptors.get(event.detail.instanceId);
|
|
3654
3670
|
if (!descriptor) return;
|
|
3655
|
-
const buttonContainer = this.
|
|
3671
|
+
const buttonContainer = this.#globalButtonContainers.get(descriptor.appName);
|
|
3656
3672
|
if (!buttonContainer) return;
|
|
3657
|
-
const activeButtonContainer = this
|
|
3673
|
+
const activeButtonContainer = this.#getActiveButtonContainer();
|
|
3658
3674
|
if (activeButtonContainer === buttonContainer) {
|
|
3659
|
-
if (!this
|
|
3675
|
+
if (!this.#closeButton) {
|
|
3660
3676
|
throw new Error('Expected this._closeButton');
|
|
3661
3677
|
}
|
|
3662
|
-
this
|
|
3678
|
+
this.#closeButton(true);
|
|
3663
3679
|
}
|
|
3664
3680
|
});
|
|
3665
|
-
kefir_esm.fromEvents(document.body, 'inboxsdkSidebarPanelOpen').filter(e => e.detail.sidebarId === this
|
|
3666
|
-
const descriptor = this.
|
|
3681
|
+
kefir_esm.fromEvents(document.body, 'inboxsdkSidebarPanelOpen').filter(e => e.detail.sidebarId === this.#instanceId && e.detail.isGlobal).takeUntilBy(this.#stopper).onValue(event => {
|
|
3682
|
+
const descriptor = this.#instanceIdsToDescriptors.get(event.detail.instanceId);
|
|
3667
3683
|
if (!descriptor) return;
|
|
3668
|
-
const buttonContainer = this.
|
|
3684
|
+
const buttonContainer = this.#globalButtonContainers.get(descriptor.appName);
|
|
3669
3685
|
if (!buttonContainer) return;
|
|
3670
|
-
const activeButtonContainer = this
|
|
3686
|
+
const activeButtonContainer = this.#getActiveButtonContainer();
|
|
3671
3687
|
if (activeButtonContainer !== buttonContainer) {
|
|
3672
3688
|
(0,querySelectorOrFail/* default */.Z)(buttonContainer, 'button').click();
|
|
3673
3689
|
}
|
|
@@ -3675,14 +3691,14 @@ class GmailAppSidebarPrimary {
|
|
|
3675
3691
|
}
|
|
3676
3692
|
// instance id to descriptor management
|
|
3677
3693
|
{
|
|
3678
|
-
kefir_esm.fromEvents(document.body, 'inboxsdkNewSidebarPanel').filter(e => e.detail.sidebarId === this
|
|
3679
|
-
this.
|
|
3694
|
+
kefir_esm.fromEvents(document.body, 'inboxsdkNewSidebarPanel').filter(e => e.detail.sidebarId === this.#instanceId).takeUntilBy(this.#stopper).onValue(event => {
|
|
3695
|
+
this.#instanceIdsToDescriptors.set(event.detail.instanceId, event.detail);
|
|
3680
3696
|
});
|
|
3681
|
-
kefir_esm.fromEvents(document.body, 'inboxsdkRemoveSidebarPanel').filter(e => e.detail.sidebarId === this
|
|
3682
|
-
this.
|
|
3697
|
+
kefir_esm.fromEvents(document.body, 'inboxsdkRemoveSidebarPanel').filter(e => e.detail.sidebarId === this.#instanceId).takeUntilBy(this.#stopper).onValue(event => {
|
|
3698
|
+
this.#instanceIdsToDescriptors.delete(event.detail.instanceId);
|
|
3683
3699
|
});
|
|
3684
|
-
kefir_esm.fromEvents(document.body, 'inboxsdkUpdateSidebarPanel').filter(e => e.detail.sidebarId === this
|
|
3685
|
-
this.
|
|
3700
|
+
kefir_esm.fromEvents(document.body, 'inboxsdkUpdateSidebarPanel').filter(e => e.detail.sidebarId === this.#instanceId).takeUntilBy(this.#stopper).onValue(event => {
|
|
3701
|
+
this.#instanceIdsToDescriptors.set(event.detail.instanceId, event.detail);
|
|
3686
3702
|
});
|
|
3687
3703
|
}
|
|
3688
3704
|
// at this point the companionSidebar has 2 children
|
|
@@ -3693,15 +3709,15 @@ class GmailAppSidebarPrimary {
|
|
|
3693
3709
|
// or the thread add-on content element are visible
|
|
3694
3710
|
// if they are both display: '' or display: none then the native sidebar
|
|
3695
3711
|
// contents are not visible
|
|
3696
|
-
const globalAddOnContentContainer = this.
|
|
3697
|
-
const threadAddOnContentContainer = this.
|
|
3712
|
+
const globalAddOnContentContainer = this.#companionSidebarContentContainerEl.children[0];
|
|
3713
|
+
const threadAddOnContentContainer = this.#companionSidebarContentContainerEl.children[1];
|
|
3698
3714
|
kefir_esm.merge([globalAddOnContentContainer, threadAddOnContentContainer].map(addonContentEl => (0,make_mutation_observer_chunked_stream/* default */.Z)(addonContentEl, {
|
|
3699
3715
|
attributes: true,
|
|
3700
3716
|
attributeFilter: ['style']
|
|
3701
|
-
}))).filter(() => globalAddOnContentContainer.style.display !== threadAddOnContentContainer.style.display).takeUntilBy(this
|
|
3717
|
+
}))).filter(() => globalAddOnContentContainer.style.display !== threadAddOnContentContainer.style.display).takeUntilBy(this.#stopper).onValue(() => {
|
|
3702
3718
|
// TODO What is this block for? It closes the current section whenever
|
|
3703
3719
|
// one of the Gmail addons bar elements changes?
|
|
3704
|
-
const activeButtonContainer = this
|
|
3720
|
+
const activeButtonContainer = this.#getActiveButtonContainer();
|
|
3705
3721
|
if (activeButtonContainer) {
|
|
3706
3722
|
(0,querySelectorOrFail/* default */.Z)(activeButtonContainer, 'button').click();
|
|
3707
3723
|
}
|
|
@@ -3718,26 +3734,30 @@ var delay_asap = __webpack_require__(75610);
|
|
|
3718
3734
|
|
|
3719
3735
|
|
|
3720
3736
|
class ContentPanelViewDriver {
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3737
|
+
#driver;
|
|
3738
|
+
#stopper;
|
|
3739
|
+
#eventStream = kefir_bus_default()();
|
|
3740
|
+
#isActive = false;
|
|
3741
|
+
/**
|
|
3742
|
+
* This is not the `id` property passed by the application, but a random
|
|
3743
|
+
* unique identifier used to manage a specific instance.
|
|
3744
|
+
* */
|
|
3745
|
+
#instanceId = `${Date.now()}-${Math.random()}`;
|
|
3746
|
+
#sidebarId;
|
|
3747
|
+
#isGlobal;
|
|
3726
3748
|
constructor(driver, descriptor, sidebarId, isGlobal) {
|
|
3727
|
-
this
|
|
3728
|
-
this
|
|
3729
|
-
this
|
|
3730
|
-
this
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
this._eventStream.plug(kefir_esm.fromEvents(document.body, 'inboxsdkSidebarPanelActivated').filter(e => e.detail.instanceId === this._instanceId).map(() => {
|
|
3734
|
-
this._isActive = true;
|
|
3749
|
+
this.#driver = driver;
|
|
3750
|
+
this.#sidebarId = sidebarId;
|
|
3751
|
+
this.#isGlobal = Boolean(isGlobal);
|
|
3752
|
+
this.#stopper = this.#eventStream.ignoreValues().beforeEnd(() => null).toProperty();
|
|
3753
|
+
this.#eventStream.plug(kefir_esm.fromEvents(document.body, 'inboxsdkSidebarPanelActivated').filter(e => e.detail.instanceId === this.#instanceId).map(() => {
|
|
3754
|
+
this.#isActive = true;
|
|
3735
3755
|
return {
|
|
3736
3756
|
eventName: 'activate'
|
|
3737
3757
|
};
|
|
3738
3758
|
}));
|
|
3739
|
-
this.
|
|
3740
|
-
this
|
|
3759
|
+
this.#eventStream.plug(kefir_esm.fromEvents(document.body, 'inboxsdkSidebarPanelDeactivated').filter(e => e.detail.instanceId === this.#instanceId).map(() => {
|
|
3760
|
+
this.#isActive = false;
|
|
3741
3761
|
return {
|
|
3742
3762
|
eventName: 'deactivate'
|
|
3743
3763
|
};
|
|
@@ -3752,7 +3772,7 @@ class ContentPanelViewDriver {
|
|
|
3752
3772
|
let hasPlacedAlready = false;
|
|
3753
3773
|
let appName;
|
|
3754
3774
|
const waitingPlatform = (0,querySelectorOrFail/* default */.Z)(document.body, sidebarWaitingPlatformSelector);
|
|
3755
|
-
descriptor.flatMap(x => afterAsap.map(() => x)).takeUntilBy(this
|
|
3775
|
+
descriptor.flatMap(x => afterAsap.map(() => x)).takeUntilBy(this.#stopper).onValue(descriptor => {
|
|
3756
3776
|
const {
|
|
3757
3777
|
el,
|
|
3758
3778
|
iconUrl,
|
|
@@ -3775,49 +3795,51 @@ class ContentPanelViewDriver {
|
|
|
3775
3795
|
bubbles: true,
|
|
3776
3796
|
cancelable: false,
|
|
3777
3797
|
detail: {
|
|
3778
|
-
appIconUrl: appIconUrl || this.
|
|
3779
|
-
appId: this.
|
|
3798
|
+
appIconUrl: appIconUrl || this.#driver.getOpts().appIconUrl || iconUrl,
|
|
3799
|
+
appId: this.#driver.getAppId(),
|
|
3780
3800
|
appName,
|
|
3781
3801
|
hideTitleBar: Boolean(hideTitleBar),
|
|
3782
3802
|
iconClass,
|
|
3783
3803
|
iconUrl,
|
|
3784
3804
|
id: String(id || title),
|
|
3785
|
-
instanceId: this
|
|
3805
|
+
instanceId: this.#instanceId,
|
|
3786
3806
|
isGlobal,
|
|
3787
3807
|
orderHint: typeof orderHint === 'number' ? orderHint : 0,
|
|
3788
|
-
primaryColor: primaryColor || this.
|
|
3789
|
-
secondaryColor: secondaryColor || this.
|
|
3790
|
-
sidebarId: this
|
|
3808
|
+
primaryColor: primaryColor || this.#driver.getOpts().primaryColor,
|
|
3809
|
+
secondaryColor: secondaryColor || this.#driver.getOpts().secondaryColor,
|
|
3810
|
+
sidebarId: this.#sidebarId,
|
|
3791
3811
|
title
|
|
3792
3812
|
}
|
|
3793
3813
|
}));
|
|
3794
3814
|
});
|
|
3795
|
-
this.
|
|
3815
|
+
this.#stopper.onValue(() => {
|
|
3796
3816
|
if (!hasPlacedAlready) return;
|
|
3797
3817
|
document.body.dispatchEvent(new CustomEvent('inboxsdkRemoveSidebarPanel', {
|
|
3798
3818
|
bubbles: true,
|
|
3799
3819
|
cancelable: false,
|
|
3800
3820
|
detail: {
|
|
3801
3821
|
appName,
|
|
3802
|
-
sidebarId: this
|
|
3803
|
-
instanceId: this
|
|
3822
|
+
sidebarId: this.#sidebarId,
|
|
3823
|
+
instanceId: this.#instanceId
|
|
3804
3824
|
}
|
|
3805
3825
|
}));
|
|
3806
3826
|
});
|
|
3807
3827
|
}
|
|
3808
3828
|
getStopper() {
|
|
3809
|
-
return this
|
|
3829
|
+
return this.#stopper;
|
|
3810
3830
|
}
|
|
3811
3831
|
getEventStream() {
|
|
3812
|
-
return this
|
|
3832
|
+
return this.#eventStream;
|
|
3813
3833
|
}
|
|
3834
|
+
|
|
3835
|
+
// TODO: is this used?
|
|
3814
3836
|
scrollIntoView() {
|
|
3815
3837
|
document.body.dispatchEvent(new CustomEvent('inboxsdkSidebarPanelScrollIntoView', {
|
|
3816
3838
|
bubbles: true,
|
|
3817
3839
|
cancelable: false,
|
|
3818
3840
|
detail: {
|
|
3819
|
-
instanceId: this
|
|
3820
|
-
sidebarId: this
|
|
3841
|
+
instanceId: this.#instanceId,
|
|
3842
|
+
sidebarId: this.#sidebarId
|
|
3821
3843
|
}
|
|
3822
3844
|
}));
|
|
3823
3845
|
}
|
|
@@ -3826,9 +3848,9 @@ class ContentPanelViewDriver {
|
|
|
3826
3848
|
bubbles: true,
|
|
3827
3849
|
cancelable: false,
|
|
3828
3850
|
detail: {
|
|
3829
|
-
instanceId: this
|
|
3830
|
-
isGlobal: this
|
|
3831
|
-
sidebarId: this
|
|
3851
|
+
instanceId: this.#instanceId,
|
|
3852
|
+
isGlobal: this.#isGlobal,
|
|
3853
|
+
sidebarId: this.#sidebarId
|
|
3832
3854
|
}
|
|
3833
3855
|
}));
|
|
3834
3856
|
}
|
|
@@ -3837,17 +3859,17 @@ class ContentPanelViewDriver {
|
|
|
3837
3859
|
bubbles: true,
|
|
3838
3860
|
cancelable: false,
|
|
3839
3861
|
detail: {
|
|
3840
|
-
instanceId: this
|
|
3841
|
-
isGlobal: this
|
|
3842
|
-
sidebarId: this
|
|
3862
|
+
instanceId: this.#instanceId,
|
|
3863
|
+
isGlobal: this.#isGlobal,
|
|
3864
|
+
sidebarId: this.#sidebarId
|
|
3843
3865
|
}
|
|
3844
3866
|
}));
|
|
3845
3867
|
}
|
|
3846
3868
|
isActive() {
|
|
3847
|
-
return this
|
|
3869
|
+
return this.#isActive;
|
|
3848
3870
|
}
|
|
3849
3871
|
remove() {
|
|
3850
|
-
this.
|
|
3872
|
+
this.#eventStream.end();
|
|
3851
3873
|
}
|
|
3852
3874
|
}
|
|
3853
3875
|
/* harmony default export */ const sidebar_ContentPanelViewDriver = (ContentPanelViewDriver);
|
|
@@ -3859,69 +3881,53 @@ class ContentPanelViewDriver {
|
|
|
3859
3881
|
|
|
3860
3882
|
|
|
3861
3883
|
const updates = js_default()(module, null);
|
|
3884
|
+
|
|
3885
|
+
/**
|
|
3886
|
+
* @internal
|
|
3887
|
+
*/
|
|
3862
3888
|
class GmailAppSidebarView {
|
|
3863
|
-
|
|
3889
|
+
#stopper = kefir_stopper_js_default()();
|
|
3890
|
+
#driver;
|
|
3891
|
+
#instanceId;
|
|
3864
3892
|
constructor(driver, companionSidebarContentContainerElement) {
|
|
3865
|
-
this
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3893
|
+
this.#driver = driver;
|
|
3894
|
+
/**
|
|
3895
|
+
* We need to be able to cooperate with other apps/extensions that are
|
|
3896
|
+
* sharing the app sidebar. We store some properties as attributes in the
|
|
3897
|
+
* shared DOM instead of as class properties; class properties are mostly
|
|
3898
|
+
* restricted to being used for references to DOM nodes. When
|
|
3899
|
+
* GmailAppSidebarView is instantiated, we check the element for an
|
|
3900
|
+
* attribute to see whether a previous extension's GmailAppSidebarView has
|
|
3901
|
+
* already set up the sidebar or not.
|
|
3902
|
+
*/
|
|
3873
3903
|
const instanceId = companionSidebarContentContainerElement.getAttribute('data-sdk-sidebar-instance-id');
|
|
3874
3904
|
if (instanceId != null) {
|
|
3875
|
-
this
|
|
3905
|
+
this.#instanceId = instanceId;
|
|
3876
3906
|
} else {
|
|
3877
3907
|
let primary = new gmail_app_sidebar_view_primary(driver, companionSidebarContentContainerElement);
|
|
3878
|
-
this
|
|
3908
|
+
this.#instanceId = primary.getInstanceId();
|
|
3879
3909
|
// hot reloading support. Not perfect; this will break any existing panels.
|
|
3880
3910
|
updates.changes().onValue(() => {
|
|
3881
3911
|
primary.destroy();
|
|
3882
3912
|
primary = new gmail_app_sidebar_view_primary(driver, companionSidebarContentContainerElement);
|
|
3883
|
-
this
|
|
3913
|
+
this.#instanceId = primary.getInstanceId();
|
|
3884
3914
|
});
|
|
3885
3915
|
}
|
|
3886
3916
|
}
|
|
3887
3917
|
destroy() {
|
|
3888
|
-
this.
|
|
3918
|
+
this.#stopper.destroy();
|
|
3889
3919
|
}
|
|
3890
3920
|
getStopper() {
|
|
3891
|
-
return this
|
|
3892
|
-
}
|
|
3893
|
-
_getShouldThreadAppSidebarOpen() {
|
|
3894
|
-
return __webpack_require__.g.localStorage.getItem('inboxsdk__thread_app_sidebar_should_open') !== 'false';
|
|
3895
|
-
}
|
|
3896
|
-
_setShouldThreadAppSidebarOpen(open) {
|
|
3897
|
-
try {
|
|
3898
|
-
__webpack_require__.g.localStorage.setItem('inboxsdk__thread_app_sidebar_should_open', String(open));
|
|
3899
|
-
} catch (err) {
|
|
3900
|
-
console.error('error saving', err);
|
|
3901
|
-
}
|
|
3902
|
-
}
|
|
3903
|
-
|
|
3904
|
-
// This value controls whether the app sidebar should automatically open
|
|
3905
|
-
// itself when available when the chat sidebar isn't present. It's only set
|
|
3906
|
-
// if the user interacts with the app sidebar button.
|
|
3907
|
-
_getShouldGlobalAppSidebarOpen() {
|
|
3908
|
-
return __webpack_require__.g.localStorage.getItem('inboxsdk__global_app_sidebar_should_open') === 'true';
|
|
3909
|
-
}
|
|
3910
|
-
_setShouldGlobalAppSidebarOpen(open) {
|
|
3911
|
-
try {
|
|
3912
|
-
__webpack_require__.g.localStorage.setItem('inboxsdk__global_app_sidebar_should_open', String(open));
|
|
3913
|
-
} catch (err) {
|
|
3914
|
-
console.error('error saving', err);
|
|
3915
|
-
}
|
|
3921
|
+
return this.#stopper;
|
|
3916
3922
|
}
|
|
3917
3923
|
addThreadSidebarContentPanel(descriptor, threadView) {
|
|
3918
|
-
const panel = new sidebar_ContentPanelViewDriver(this
|
|
3919
|
-
kefir_esm.merge([threadView.getStopper(), this
|
|
3924
|
+
const panel = new sidebar_ContentPanelViewDriver(this.#driver, descriptor, this.#instanceId);
|
|
3925
|
+
kefir_esm.merge([threadView.getStopper(), this.#stopper]).take(1).takeUntilBy(panel.getStopper()).onValue(() => panel.remove());
|
|
3920
3926
|
return panel;
|
|
3921
3927
|
}
|
|
3922
3928
|
addGlobalSidebarContentPanel(descriptor) {
|
|
3923
|
-
const panel = new sidebar_ContentPanelViewDriver(this
|
|
3924
|
-
this.
|
|
3929
|
+
const panel = new sidebar_ContentPanelViewDriver(this.#driver, descriptor, this.#instanceId, true);
|
|
3930
|
+
this.#stopper.takeUntilBy(panel.getStopper()).onValue(() => panel.remove());
|
|
3925
3931
|
return panel;
|
|
3926
3932
|
}
|
|
3927
3933
|
}
|
|
@@ -10833,7 +10839,7 @@ options.insert = htmlElement => {
|
|
|
10833
10839
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
10834
10840
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
10835
10841
|
///@ts-ignore
|
|
10836
|
-
"2.1.
|
|
10842
|
+
"2.1.5-1696881387401-5c0ff20cfc735daf");
|
|
10837
10843
|
document.head.append(htmlElement);
|
|
10838
10844
|
};
|
|
10839
10845
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -11388,10 +11394,12 @@ function getAllAppIds() {
|
|
|
11388
11394
|
const _trackedEventsQueue = new PersistentQueue('events');
|
|
11389
11395
|
const FIRST_LOADED_TIME = Date.now();
|
|
11390
11396
|
class Logger {
|
|
11397
|
+
#appId;
|
|
11398
|
+
#isMaster;
|
|
11391
11399
|
constructor(appId, opts, loaderVersion, implVersion) {
|
|
11392
11400
|
_extensionLoggerSetup(appId, opts, loaderVersion, implVersion);
|
|
11393
|
-
this
|
|
11394
|
-
this
|
|
11401
|
+
this.#appId = appId;
|
|
11402
|
+
this.#isMaster = (() => {
|
|
11395
11403
|
if (!_extensionUseEventTracking || typeof document !== 'undefined' && document.documentElement.hasAttribute('data-inboxsdk-app-logger-master-chosen')) {
|
|
11396
11404
|
return false;
|
|
11397
11405
|
} else {
|
|
@@ -11399,7 +11407,7 @@ class Logger {
|
|
|
11399
11407
|
return true;
|
|
11400
11408
|
}
|
|
11401
11409
|
})();
|
|
11402
|
-
if (this
|
|
11410
|
+
if (this.#isMaster && typeof document !== 'undefined') {
|
|
11403
11411
|
document.addEventListener('inboxSDKinjectedError', event => {
|
|
11404
11412
|
if (!(event instanceof CustomEvent && event?.detail)) {
|
|
11405
11413
|
this.error(new Error('Invalid inboxSDKinjectedError event'), event);
|
|
@@ -11445,51 +11453,54 @@ class Logger {
|
|
|
11445
11453
|
_logError(err, details, undefined, false);
|
|
11446
11454
|
}
|
|
11447
11455
|
error(err, details) {
|
|
11448
|
-
_logError(err, details, this
|
|
11456
|
+
_logError(err, details, this.#appId, false);
|
|
11449
11457
|
}
|
|
11450
11458
|
errorApp(err, details) {
|
|
11451
|
-
_logError(err, details, this
|
|
11459
|
+
_logError(err, details, this.#appId, true);
|
|
11452
11460
|
}
|
|
11461
|
+
|
|
11462
|
+
/** Only the first logger instance reports Site errors. */
|
|
11453
11463
|
errorSite(err, details) {
|
|
11454
|
-
|
|
11455
|
-
if (!this._isMaster) {
|
|
11464
|
+
if (!this.#isMaster) {
|
|
11456
11465
|
return;
|
|
11457
11466
|
}
|
|
11458
11467
|
this.error(err, details);
|
|
11459
11468
|
}
|
|
11460
11469
|
|
|
11461
|
-
|
|
11470
|
+
/** Should only be used by the InboxSDK users for their own app events. */
|
|
11462
11471
|
eventApp(name, details) {
|
|
11463
|
-
_trackEvent(this
|
|
11472
|
+
_trackEvent(this.#appId, 'app', name, details);
|
|
11464
11473
|
}
|
|
11465
11474
|
|
|
11466
|
-
|
|
11467
|
-
|
|
11475
|
+
/**
|
|
11476
|
+
* For tracking app events that are possibly triggered by the user. Extensions
|
|
11477
|
+
* can opt out of this with a flag passed to InboxSDK.load().
|
|
11478
|
+
*/
|
|
11468
11479
|
eventSdkActive(name, details) {
|
|
11469
11480
|
if (!_extensionUseEventTracking) {
|
|
11470
11481
|
return;
|
|
11471
11482
|
}
|
|
11472
|
-
_trackEvent(this
|
|
11483
|
+
_trackEvent(this.#appId, 'sdkActive', name, details);
|
|
11473
11484
|
}
|
|
11474
11485
|
|
|
11475
11486
|
// Track events unrelated to user activity about how the app uses the SDK.
|
|
11476
11487
|
// Examples include the app being initialized, and calls to any of the
|
|
11477
11488
|
// register___ViewHandler functions.
|
|
11478
11489
|
eventSdkPassive(name, details, sensitive) {
|
|
11479
|
-
if (sensitive && !(0,isStreakAppId/* default */.Z)(this
|
|
11490
|
+
if (sensitive && !(0,isStreakAppId/* default */.Z)(this.#appId)) {
|
|
11480
11491
|
// do not log events if they were marked as sensitive
|
|
11481
11492
|
return;
|
|
11482
11493
|
}
|
|
11483
|
-
_trackEvent(this
|
|
11494
|
+
_trackEvent(this.#appId, 'sdkPassive', name, details);
|
|
11484
11495
|
}
|
|
11485
11496
|
|
|
11486
11497
|
// Track Site events.
|
|
11487
11498
|
eventSite(name, details) {
|
|
11488
11499
|
// Only the first logger instance reports Site events.
|
|
11489
|
-
if (!this
|
|
11500
|
+
if (!this.#isMaster) {
|
|
11490
11501
|
return;
|
|
11491
11502
|
}
|
|
11492
|
-
_trackEvent(this
|
|
11503
|
+
_trackEvent(this.#appId, 'gmail', name, details);
|
|
11493
11504
|
}
|
|
11494
11505
|
deprecationWarning(name, suggestion) {
|
|
11495
11506
|
console.warn(`InboxSDK: ${name} is deprecated.` + (suggestion ? ` Please use ${suggestion} instead.` : ''));
|
|
@@ -11506,7 +11517,7 @@ class Logger {
|
|
|
11506
11517
|
};
|
|
11507
11518
|
}
|
|
11508
11519
|
trackFunctionPerformance(fn, sampleRate, details) {
|
|
11509
|
-
if (Math.random() < sampleRate && document.visibilityState === 'visible' && this
|
|
11520
|
+
if (Math.random() < sampleRate && document.visibilityState === 'visible' && this.#isMaster) {
|
|
11510
11521
|
const start = Date.now();
|
|
11511
11522
|
fn();
|
|
11512
11523
|
setTimeout(() => {
|
|
@@ -19331,7 +19342,7 @@ options.insert = htmlElement => {
|
|
|
19331
19342
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
19332
19343
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
19333
19344
|
///@ts-ignore
|
|
19334
|
-
"2.1.
|
|
19345
|
+
"2.1.5-1696881387401-5c0ff20cfc735daf");
|
|
19335
19346
|
document.head.append(htmlElement);
|
|
19336
19347
|
};
|
|
19337
19348
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -22164,14 +22175,42 @@ var isIntegratedViewGmail = __webpack_require__(98884);
|
|
|
22164
22175
|
|
|
22165
22176
|
|
|
22166
22177
|
|
|
22178
|
+
|
|
22179
|
+
async function isSidePanelCollapsed() {
|
|
22180
|
+
const sidePanelSelector = '.brC-aT5-aOt-Jw[role=complementary]';
|
|
22181
|
+
try {
|
|
22182
|
+
await (0,wait_for/* default */.Z)(() => document.querySelector(sidePanelSelector), 10_000);
|
|
22183
|
+
// Wait for the collapse button to appear too. Otherwise, the side panel will initially appear without a display style set for collapsed.
|
|
22184
|
+
await (0,wait_for/* default */.Z)(() => document.querySelector('.aT5-aOt-I[role=button]'));
|
|
22185
|
+
} catch (e) {
|
|
22186
|
+
if (e instanceof wait_for/* WaitForError */.p) {
|
|
22187
|
+
return null;
|
|
22188
|
+
}
|
|
22189
|
+
throw e;
|
|
22190
|
+
}
|
|
22191
|
+
const maybeCollapsedSidePanel = document.querySelector(`${sidePanelSelector}[style*="display: none;"]`);
|
|
22192
|
+
|
|
22193
|
+
// If the sidePanel is collapsed, it will have a style attribute with display: none
|
|
22194
|
+
return maybeCollapsedSidePanel != null;
|
|
22195
|
+
}
|
|
22167
22196
|
async function gmailLoadEvent(driver) {
|
|
22168
22197
|
const pageCommunicator = driver.getPageCommunicator();
|
|
22169
22198
|
const isConversationViewDisabled = await pageCommunicator.isConversationViewDisabled();
|
|
22170
22199
|
await waitForMenuReady();
|
|
22171
22200
|
const isUsingDarkTheme = await checkForDarkThemeSafe();
|
|
22172
|
-
|
|
22173
|
-
|
|
22174
|
-
|
|
22201
|
+
const sidePanelCollapsed = await isSidePanelCollapsed();
|
|
22202
|
+
const timing = performance?.timing;
|
|
22203
|
+
driver.logger.eventSite('gmailSettings', {
|
|
22204
|
+
isGmailIntegratedView: (0,isIntegratedViewGmail/* default */.ZP)(),
|
|
22205
|
+
/**
|
|
22206
|
+
* This is the panel on the left side of the screen. If the top left burger of Gmail is collapsed, then this is true.
|
|
22207
|
+
*/
|
|
22208
|
+
isCollapsiblePanelHidden: (0,isIntegratedViewGmail/* isCollapsiblePanelHidden */.ky)(),
|
|
22209
|
+
isGoogleChatEnabled: (0,isIntegratedViewGmail/* isGoogleChatEnabled */.Jv)(),
|
|
22210
|
+
/**
|
|
22211
|
+
* This is the sidePanel on the right side of the screen. The collapse button is at the bottom right corner of the screen.
|
|
22212
|
+
*/
|
|
22213
|
+
isSidePanelCollapsed: sidePanelCollapsed,
|
|
22175
22214
|
isDarkTheme: isUsingDarkTheme,
|
|
22176
22215
|
screenWidth: window.screen?.width,
|
|
22177
22216
|
screenHeight: window.screen?.height,
|
|
@@ -22183,20 +22222,20 @@ async function gmailLoadEvent(driver) {
|
|
|
22183
22222
|
isConversationViewDisabled,
|
|
22184
22223
|
wasAccountSwitcherReadyAtStart: driver.getEnvData().wasAccountSwitcherReadyAtStart,
|
|
22185
22224
|
timings: {
|
|
22186
|
-
responseStart:
|
|
22187
|
-
responseEnd:
|
|
22188
|
-
domLoading:
|
|
22189
|
-
domInteractive:
|
|
22190
|
-
domComplete:
|
|
22191
|
-
domContentLoadedEventStart:
|
|
22192
|
-
domContentLoadedEventEnd:
|
|
22193
|
-
domainLookupEnd:
|
|
22194
|
-
domainLookupStart:
|
|
22195
|
-
fetchStart:
|
|
22196
|
-
loadEventStart:
|
|
22197
|
-
loadEventEnd:
|
|
22198
|
-
navigationStart:
|
|
22199
|
-
requestStart:
|
|
22225
|
+
responseStart: timing?.responseStart,
|
|
22226
|
+
responseEnd: timing?.responseEnd,
|
|
22227
|
+
domLoading: timing?.domLoading,
|
|
22228
|
+
domInteractive: timing?.domInteractive,
|
|
22229
|
+
domComplete: timing?.domComplete,
|
|
22230
|
+
domContentLoadedEventStart: timing?.domContentLoadedEventStart,
|
|
22231
|
+
domContentLoadedEventEnd: timing?.domContentLoadedEventEnd,
|
|
22232
|
+
domainLookupEnd: timing?.domainLookupEnd,
|
|
22233
|
+
domainLookupStart: timing?.domainLookupStart,
|
|
22234
|
+
fetchStart: timing?.fetchStart,
|
|
22235
|
+
loadEventStart: timing?.loadEventStart,
|
|
22236
|
+
loadEventEnd: timing?.loadEventEnd,
|
|
22237
|
+
navigationStart: timing?.navigationStart,
|
|
22238
|
+
requestStart: timing?.requestStart,
|
|
22200
22239
|
...driver.getTimings()
|
|
22201
22240
|
}
|
|
22202
22241
|
});
|
|
@@ -23290,22 +23329,51 @@ function parseListPeopleByKnownIdResponse(data) {
|
|
|
23290
23329
|
|
|
23291
23330
|
|
|
23292
23331
|
|
|
23332
|
+
/**
|
|
23333
|
+
* @internal
|
|
23334
|
+
*/
|
|
23293
23335
|
class GmailDriver {
|
|
23294
|
-
|
|
23295
|
-
|
|
23296
|
-
|
|
23297
|
-
|
|
23298
|
-
|
|
23299
|
-
|
|
23300
|
-
|
|
23301
|
-
|
|
23336
|
+
#appId;
|
|
23337
|
+
#logger;
|
|
23338
|
+
#opts;
|
|
23339
|
+
#envData;
|
|
23340
|
+
#customRouteIDs = new Set();
|
|
23341
|
+
#customListRouteIDs = new Map();
|
|
23342
|
+
#customListSearchStringsToRouteIds = new Map();
|
|
23343
|
+
#messageIDsToThreadIDs = new Map();
|
|
23344
|
+
#threadRowIdentifier;
|
|
23345
|
+
#gmailRouteProcessor;
|
|
23346
|
+
#keyboardShortcutHelpModifier;
|
|
23347
|
+
#page;
|
|
23348
|
+
#pageCommunicator;
|
|
23349
|
+
#pageCommunicatorPromise;
|
|
23350
|
+
#butterBar;
|
|
23351
|
+
#butterBarDriver;
|
|
23352
|
+
#routeViewDriverStream;
|
|
23353
|
+
#rowListViewDriverStream;
|
|
23354
|
+
#threadRowViewDriverKefirStream;
|
|
23355
|
+
#threadViewDriverLiveSet;
|
|
23356
|
+
#toolbarViewDriverLiveSet;
|
|
23357
|
+
#composeViewDriverStream;
|
|
23358
|
+
#xhrInterceptorStream;
|
|
23359
|
+
#messageViewDriverStream;
|
|
23360
|
+
#stopper = js_default()();
|
|
23361
|
+
#navMarkerHiddenChanged = kefir_bus_default()();
|
|
23362
|
+
#addonSidebarHiddenChanged = kefir_bus_default()();
|
|
23363
|
+
#userInfo;
|
|
23364
|
+
#timestampAccountSwitcherReady;
|
|
23365
|
+
#timestampGlobalsFound;
|
|
23366
|
+
#timestampOnready;
|
|
23367
|
+
#lastCustomThreadListActivity;
|
|
23368
|
+
#currentRouteViewDriver;
|
|
23369
|
+
#appSidebarView = null;
|
|
23302
23370
|
constructor(appId, LOADER_VERSION, IMPL_VERSION, logger, opts, envData) {
|
|
23303
|
-
this
|
|
23304
|
-
this
|
|
23305
|
-
this
|
|
23306
|
-
this
|
|
23307
|
-
this
|
|
23308
|
-
this.
|
|
23371
|
+
this.#appId = appId;
|
|
23372
|
+
this.#logger = logger;
|
|
23373
|
+
this.#opts = opts;
|
|
23374
|
+
this.#envData = envData;
|
|
23375
|
+
this.#page = (0,makePageParserTree/* default */.Z)(this, document);
|
|
23376
|
+
this.#stopper.onValue(() => this.#page.dump());
|
|
23309
23377
|
|
|
23310
23378
|
// Manages the mapping between RFC Message Ids and Gmail Message Ids. Caches to
|
|
23311
23379
|
// localStorage. Used for custom thread lists.
|
|
@@ -23366,85 +23434,88 @@ class GmailDriver {
|
|
|
23366
23434
|
// sent. It doesn't really need to be cached so it's not here.
|
|
23367
23435
|
this.getGmailMessageIdForSyncDraftId = syncDraftId => (0,getGmailMessageIdForSyncMessageId/* default */.Z)(this, syncDraftId);
|
|
23368
23436
|
}
|
|
23369
|
-
this
|
|
23370
|
-
this
|
|
23371
|
-
this
|
|
23372
|
-
kefir_esm.later(45 * 1000, undefined).takeUntilBy((0,toItemWithLifetimeStream/* default */.Z)(this.
|
|
23373
|
-
this.
|
|
23437
|
+
this.#gmailRouteProcessor = new GmailRouteProcessor();
|
|
23438
|
+
this.#keyboardShortcutHelpModifier = new KeyboardShortcutHelpModifier();
|
|
23439
|
+
this.#butterBarDriver = new GmailButterBarDriver();
|
|
23440
|
+
kefir_esm.later(45 * 1000, undefined).takeUntilBy((0,toItemWithLifetimeStream/* default */.Z)(this.#page.tree.getAllByTag('supportMenu'))).onValue(() => {
|
|
23441
|
+
this.#logger.errorSite(new Error('Failed to find gmail supportMenu'));
|
|
23374
23442
|
});
|
|
23375
|
-
this
|
|
23443
|
+
this.#setupEventStreams();
|
|
23376
23444
|
this.onready.then(() => {
|
|
23377
23445
|
trackEvents(this);
|
|
23378
23446
|
gmailLoadEvent(this);
|
|
23379
|
-
(0,override_gmail_back_button/* default */.Z)(this, this
|
|
23447
|
+
(0,override_gmail_back_button/* default */.Z)(this, this.#gmailRouteProcessor);
|
|
23380
23448
|
trackGmailStyles();
|
|
23381
23449
|
temporaryTrackDownloadUrlValidity(this);
|
|
23382
23450
|
if (opts.suppressAddonTitle != null) {
|
|
23383
23451
|
suppressAddon(this, opts.suppressAddonTitle);
|
|
23384
23452
|
}
|
|
23385
23453
|
}).catch(err => {
|
|
23386
|
-
this.
|
|
23454
|
+
this.#logger.error(err);
|
|
23387
23455
|
});
|
|
23388
23456
|
}
|
|
23389
23457
|
destroy() {
|
|
23390
|
-
this.
|
|
23391
|
-
this.
|
|
23392
|
-
this.
|
|
23458
|
+
this.#threadRowViewSelectionChanges.end();
|
|
23459
|
+
this.#keyboardShortcutHelpModifier.destroy();
|
|
23460
|
+
this.#stopper.destroy();
|
|
23393
23461
|
(0,gmail_thread_row_view/* removeAllThreadRowUnclaimedModifications */.c)();
|
|
23394
23462
|
}
|
|
23395
23463
|
getAppId() {
|
|
23396
|
-
return this
|
|
23464
|
+
return this.#appId;
|
|
23397
23465
|
}
|
|
23398
23466
|
getOpts() {
|
|
23399
|
-
return this
|
|
23467
|
+
return this.#opts;
|
|
23400
23468
|
}
|
|
23401
23469
|
getPageCommunicator() {
|
|
23402
|
-
return this
|
|
23470
|
+
return this.#pageCommunicator;
|
|
23403
23471
|
}
|
|
23404
23472
|
getPageCommunicatorPromise() {
|
|
23405
|
-
return this
|
|
23473
|
+
return this.#pageCommunicatorPromise;
|
|
23474
|
+
}
|
|
23475
|
+
get logger() {
|
|
23476
|
+
return this.#logger;
|
|
23406
23477
|
}
|
|
23407
23478
|
getLogger() {
|
|
23408
|
-
return this
|
|
23479
|
+
return this.#logger;
|
|
23409
23480
|
}
|
|
23410
23481
|
getTagTree() {
|
|
23411
|
-
return this.
|
|
23482
|
+
return this.#page.tree;
|
|
23412
23483
|
}
|
|
23413
23484
|
getCustomListSearchStringsToRouteIds() {
|
|
23414
|
-
return this
|
|
23485
|
+
return this.#customListSearchStringsToRouteIds;
|
|
23415
23486
|
}
|
|
23416
23487
|
getThreadRowIdentifier() {
|
|
23417
|
-
return this
|
|
23488
|
+
return this.#threadRowIdentifier;
|
|
23418
23489
|
}
|
|
23419
23490
|
getButterBarDriver() {
|
|
23420
|
-
return this
|
|
23491
|
+
return this.#butterBarDriver;
|
|
23421
23492
|
}
|
|
23422
23493
|
getButterBar() {
|
|
23423
|
-
return this
|
|
23494
|
+
return this.#butterBar;
|
|
23424
23495
|
}
|
|
23425
23496
|
setButterBar(bb) {
|
|
23426
|
-
this
|
|
23497
|
+
this.#butterBar = bb;
|
|
23427
23498
|
}
|
|
23428
23499
|
getCustomRouteIDs() {
|
|
23429
|
-
return this
|
|
23500
|
+
return this.#customRouteIDs;
|
|
23430
23501
|
}
|
|
23431
23502
|
getCustomListRouteIDs() {
|
|
23432
|
-
return this
|
|
23503
|
+
return this.#customListRouteIDs;
|
|
23433
23504
|
}
|
|
23434
23505
|
getKeyboardShortcutHelpModifier() {
|
|
23435
|
-
return this
|
|
23506
|
+
return this.#keyboardShortcutHelpModifier;
|
|
23436
23507
|
}
|
|
23437
23508
|
getRouteViewDriverStream() {
|
|
23438
|
-
return this
|
|
23509
|
+
return this.#routeViewDriverStream;
|
|
23439
23510
|
}
|
|
23440
23511
|
getRowListViewDriverStream() {
|
|
23441
|
-
return this
|
|
23512
|
+
return this.#rowListViewDriverStream;
|
|
23442
23513
|
}
|
|
23443
23514
|
getThreadRowViewDriverStream() {
|
|
23444
|
-
return this
|
|
23515
|
+
return this.#threadRowViewDriverKefirStream;
|
|
23445
23516
|
}
|
|
23446
23517
|
getThreadViewDriverStream() {
|
|
23447
|
-
return (0,toItemWithLifetimeStream/* default */.Z)(this
|
|
23518
|
+
return (0,toItemWithLifetimeStream/* default */.Z)(this.#threadViewDriverLiveSet).map(_ref2 => {
|
|
23448
23519
|
let {
|
|
23449
23520
|
el
|
|
23450
23521
|
} = _ref2;
|
|
@@ -23452,29 +23523,29 @@ class GmailDriver {
|
|
|
23452
23523
|
});
|
|
23453
23524
|
}
|
|
23454
23525
|
getAttachmentCardViewDriverStream() {
|
|
23455
|
-
return this.
|
|
23526
|
+
return this.#messageViewDriverStream.flatMap(messageViewDriver => messageViewDriver.isLoaded() ? kefir_esm.constant(messageViewDriver) : messageViewDriver.getEventStream().filter(event => event.eventName === 'messageLoad').map(() => messageViewDriver).take(1)).map(messageView => messageView.getAttachmentCardViewDrivers()).flatten();
|
|
23456
23527
|
}
|
|
23457
23528
|
getComposeViewDriverStream() {
|
|
23458
|
-
return this
|
|
23529
|
+
return this.#composeViewDriverStream;
|
|
23459
23530
|
}
|
|
23460
23531
|
getXhrInterceptorStream() {
|
|
23461
|
-
return this
|
|
23532
|
+
return this.#xhrInterceptorStream;
|
|
23462
23533
|
}
|
|
23463
23534
|
getMessageViewDriverStream() {
|
|
23464
|
-
return this
|
|
23535
|
+
return this.#messageViewDriverStream;
|
|
23465
23536
|
}
|
|
23466
23537
|
getStopper() {
|
|
23467
|
-
return this
|
|
23538
|
+
return this.#stopper;
|
|
23468
23539
|
}
|
|
23469
23540
|
getEnvData() {
|
|
23470
|
-
return this
|
|
23541
|
+
return this.#envData;
|
|
23471
23542
|
}
|
|
23472
23543
|
getTimestampOnReady() {
|
|
23473
|
-
if (this
|
|
23474
|
-
this.
|
|
23544
|
+
if (this.#timestampOnready == null) {
|
|
23545
|
+
this.#logger.error(new Error('getTimestampOnReady called before ready'));
|
|
23475
23546
|
return Date.now();
|
|
23476
23547
|
}
|
|
23477
|
-
return this
|
|
23548
|
+
return this.#timestampOnready;
|
|
23478
23549
|
}
|
|
23479
23550
|
|
|
23480
23551
|
// Returns a stream that emits an event once at least `time` milliseconds has
|
|
@@ -23486,11 +23557,11 @@ class GmailDriver {
|
|
|
23486
23557
|
}
|
|
23487
23558
|
getTimings() {
|
|
23488
23559
|
return {
|
|
23489
|
-
piMainStarted: this.
|
|
23490
|
-
piLoadStarted: this.
|
|
23491
|
-
globalsFound: this
|
|
23492
|
-
accountSwitcherReady: this
|
|
23493
|
-
onready: this
|
|
23560
|
+
piMainStarted: this.#envData.piMainStarted,
|
|
23561
|
+
piLoadStarted: this.#envData.piLoadStarted,
|
|
23562
|
+
globalsFound: this.#timestampGlobalsFound,
|
|
23563
|
+
accountSwitcherReady: this.#timestampAccountSwitcherReady,
|
|
23564
|
+
onready: this.#timestampOnready
|
|
23494
23565
|
};
|
|
23495
23566
|
}
|
|
23496
23567
|
registerThreadButton(options) {
|
|
@@ -23500,7 +23571,7 @@ class GmailDriver {
|
|
|
23500
23571
|
button.destroy();
|
|
23501
23572
|
});
|
|
23502
23573
|
};
|
|
23503
|
-
const toolbarViewSub = toValueObservable_default()(this
|
|
23574
|
+
const toolbarViewSub = toValueObservable_default()(this.#toolbarViewDriverLiveSet).subscribe(_ref3 => {
|
|
23504
23575
|
let {
|
|
23505
23576
|
value: gmailToolbarView
|
|
23506
23577
|
} = _ref3;
|
|
@@ -23559,12 +23630,12 @@ class GmailDriver {
|
|
|
23559
23630
|
}
|
|
23560
23631
|
}).merge(unregister));
|
|
23561
23632
|
};
|
|
23562
|
-
if (this
|
|
23563
|
-
this.
|
|
23633
|
+
if (this.#currentRouteViewDriver) {
|
|
23634
|
+
this.#currentRouteViewDriver.getRowListViews().forEach(gmailRowListView => {
|
|
23564
23635
|
gmailRowListView.getThreadRowViewDrivers().forEach(perThreadRow);
|
|
23565
23636
|
});
|
|
23566
23637
|
}
|
|
23567
|
-
const threadRowViewSub = this.
|
|
23638
|
+
const threadRowViewSub = this.#threadRowViewDriverKefirStream.observe({
|
|
23568
23639
|
value: perThreadRow
|
|
23569
23640
|
});
|
|
23570
23641
|
unregister.onValue(() => {
|
|
@@ -23587,21 +23658,21 @@ class GmailDriver {
|
|
|
23587
23658
|
window.dispatchEvent(hce);
|
|
23588
23659
|
}
|
|
23589
23660
|
addCustomRouteID(routeID) {
|
|
23590
|
-
this.
|
|
23591
|
-
this.
|
|
23661
|
+
this.#customRouteIDs.add(routeID);
|
|
23662
|
+
this.#pageCommunicator.registerAllowedHashLinkStartTerm(routeID.split('/')[0]);
|
|
23592
23663
|
return () => {
|
|
23593
|
-
this.
|
|
23664
|
+
this.#customRouteIDs.delete(routeID);
|
|
23594
23665
|
};
|
|
23595
23666
|
}
|
|
23596
23667
|
addCustomListRouteID(routeID, handler) {
|
|
23597
|
-
this.
|
|
23598
|
-
this.
|
|
23668
|
+
this.#customListRouteIDs.set(routeID, handler);
|
|
23669
|
+
this.#pageCommunicator.registerAllowedHashLinkStartTerm(routeID.split('/')[0]);
|
|
23599
23670
|
return () => {
|
|
23600
|
-
this.
|
|
23671
|
+
this.#customListRouteIDs.delete(routeID);
|
|
23601
23672
|
};
|
|
23602
23673
|
}
|
|
23603
23674
|
signalCustomThreadListActivity(customRouteID) {
|
|
23604
|
-
this
|
|
23675
|
+
this.#lastCustomThreadListActivity = {
|
|
23605
23676
|
customRouteID,
|
|
23606
23677
|
timestamp: new Date()
|
|
23607
23678
|
};
|
|
@@ -23610,7 +23681,7 @@ class GmailDriver {
|
|
|
23610
23681
|
// Returns the last time a request for a custom thread list search has gone
|
|
23611
23682
|
// out or we got a response, and the customRouteID for that.
|
|
23612
23683
|
getLastCustomThreadListActivity() {
|
|
23613
|
-
return this
|
|
23684
|
+
return this.#lastCustomThreadListActivity;
|
|
23614
23685
|
}
|
|
23615
23686
|
showCustomThreadList(customRouteID, onActivate, params) {
|
|
23616
23687
|
showCustomThreadList(this, customRouteID, onActivate, params);
|
|
@@ -23622,19 +23693,19 @@ class GmailDriver {
|
|
|
23622
23693
|
showNativeRouteView(this);
|
|
23623
23694
|
}
|
|
23624
23695
|
createLink(routeID, params) {
|
|
23625
|
-
return createLink(this
|
|
23696
|
+
return createLink(this.#gmailRouteProcessor, routeID, params);
|
|
23626
23697
|
}
|
|
23627
23698
|
goto(routeID, params) {
|
|
23628
23699
|
return (0,goto_view/* default */.Z)(this, routeID, params);
|
|
23629
23700
|
}
|
|
23630
23701
|
resolveUrlRedirects(url) {
|
|
23631
|
-
return this.
|
|
23702
|
+
return this.#pageCommunicatorPromise.then(pageCommunicator => pageCommunicator.resolveUrlRedirects(url));
|
|
23632
23703
|
}
|
|
23633
23704
|
registerSearchSuggestionsProvider(handler) {
|
|
23634
23705
|
registerSearchSuggestionsProvider(this, handler);
|
|
23635
23706
|
}
|
|
23636
23707
|
registerSearchQueryRewriter(obj) {
|
|
23637
|
-
registerSearchQueryRewriter(this
|
|
23708
|
+
registerSearchQueryRewriter(this.#pageCommunicator, obj);
|
|
23638
23709
|
}
|
|
23639
23710
|
addToolbarButtonForApp(buttonDescriptor) {
|
|
23640
23711
|
return addToolbarButtonForApp(this, buttonDescriptor);
|
|
@@ -23646,13 +23717,13 @@ class GmailDriver {
|
|
|
23646
23717
|
const composeViewDriver = await composeViewDriverPromise;
|
|
23647
23718
|
return composeViewDriver;
|
|
23648
23719
|
} catch (err) {
|
|
23649
|
-
this.
|
|
23720
|
+
this.#logger.error(err);
|
|
23650
23721
|
throw err;
|
|
23651
23722
|
}
|
|
23652
23723
|
}
|
|
23653
23724
|
getNextComposeViewDriver() {
|
|
23654
23725
|
let timeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10 * 1000;
|
|
23655
|
-
return this.
|
|
23726
|
+
return this.#composeViewDriverStream.merge(kefir_esm.later(timeout, new Error('Reached timeout while waiting for getNextComposeViewDriver'))).beforeEnd(() => new Error('Driver was shut down before a new compose was found')).flatMap(x => x instanceof Error ? kefir_esm.constantError(x) : kefir_esm.constant(x)).take(1).takeErrors(1).toPromise();
|
|
23656
23727
|
}
|
|
23657
23728
|
openDraftByMessageID(messageID) {
|
|
23658
23729
|
return openDraftByMessageID(this, messageID);
|
|
@@ -23680,25 +23751,25 @@ class GmailDriver {
|
|
|
23680
23751
|
}
|
|
23681
23752
|
getSentMailNativeNavItem() {
|
|
23682
23753
|
const p = getNativeNavItem(this, 'sent');
|
|
23683
|
-
p.catch(err => this.
|
|
23754
|
+
p.catch(err => this.#logger.error(err));
|
|
23684
23755
|
return p;
|
|
23685
23756
|
}
|
|
23686
23757
|
setShowNativeNavMarker(isNative) {
|
|
23687
|
-
this.
|
|
23758
|
+
this.#navMarkerHiddenChanged.emit(null);
|
|
23688
23759
|
const leftNavContainerElement = gmail_element_getter/* default.getLeftNavContainerElement */.Z.getLeftNavContainerElement();
|
|
23689
23760
|
if (leftNavContainerElement) {
|
|
23690
23761
|
if (isNative) {
|
|
23691
23762
|
leftNavContainerElement.classList.remove('inboxsdk__hide_native_marker');
|
|
23692
23763
|
} else {
|
|
23693
23764
|
leftNavContainerElement.classList.add('inboxsdk__hide_native_marker');
|
|
23694
|
-
this.
|
|
23765
|
+
this.#stopper.takeUntilBy(this.#navMarkerHiddenChanged).onValue(() => {
|
|
23695
23766
|
leftNavContainerElement.classList.remove('inboxsdk__hide_native_marker');
|
|
23696
23767
|
});
|
|
23697
23768
|
}
|
|
23698
23769
|
}
|
|
23699
23770
|
}
|
|
23700
23771
|
setShowNativeAddonSidebar(isNative) {
|
|
23701
|
-
this.
|
|
23772
|
+
this.#addonSidebarHiddenChanged.emit(null);
|
|
23702
23773
|
const addonContainerElement = gmail_element_getter/* default.getAddonSidebarContainerElement */.Z.getAddonSidebarContainerElement();
|
|
23703
23774
|
const mainContentBodyContainerElement = gmail_element_getter/* default.getMainContentBodyContainerElement */.Z.getMainContentBodyContainerElement();
|
|
23704
23775
|
if (addonContainerElement && mainContentBodyContainerElement) {
|
|
@@ -23708,90 +23779,90 @@ class GmailDriver {
|
|
|
23708
23779
|
parent.classList.remove('inboxsdk__hide_addon_container');
|
|
23709
23780
|
} else {
|
|
23710
23781
|
parent.classList.add('inboxsdk__hide_addon_container');
|
|
23711
|
-
this.
|
|
23782
|
+
this.#stopper.takeUntilBy(this.#addonSidebarHiddenChanged).onValue(() => {
|
|
23712
23783
|
parent.classList.remove('inboxsdk__hide_addon_container');
|
|
23713
23784
|
});
|
|
23714
23785
|
}
|
|
23715
23786
|
}
|
|
23716
23787
|
}
|
|
23717
23788
|
async getGmailActionToken() {
|
|
23718
|
-
return this.
|
|
23789
|
+
return this.#pageCommunicator.getActionTokenValue();
|
|
23719
23790
|
}
|
|
23720
23791
|
getUserEmailAddress() {
|
|
23721
|
-
return this.
|
|
23792
|
+
return this.#pageCommunicator.getUserEmailAddress();
|
|
23722
23793
|
}
|
|
23723
23794
|
isConversationViewDisabled() {
|
|
23724
|
-
return this.
|
|
23795
|
+
return this.#pageCommunicator.isConversationViewDisabled();
|
|
23725
23796
|
}
|
|
23726
23797
|
getUserLanguage() {
|
|
23727
|
-
return this.
|
|
23798
|
+
return this.#pageCommunicator.getUserLanguage();
|
|
23728
23799
|
}
|
|
23729
23800
|
getUserContact() {
|
|
23730
23801
|
return {
|
|
23731
23802
|
emailAddress: this.getUserEmailAddress(),
|
|
23732
|
-
name: this.
|
|
23803
|
+
name: this.#userInfo.getUserName()
|
|
23733
23804
|
};
|
|
23734
23805
|
}
|
|
23735
23806
|
getAccountSwitcherContactList() {
|
|
23736
|
-
return this.
|
|
23807
|
+
return this.#userInfo.getAccountSwitcherContactList();
|
|
23737
23808
|
}
|
|
23738
23809
|
activateShortcut(keyboardShortcutHandle, appName, appIconUrl) {
|
|
23739
|
-
this.getKeyboardShortcutHelpModifier().set(keyboardShortcutHandle, this
|
|
23810
|
+
this.getKeyboardShortcutHelpModifier().set(keyboardShortcutHandle, this.#appId, appName, appIconUrl);
|
|
23740
23811
|
keyboardShortcutHandle.once('destroy', () => {
|
|
23741
23812
|
this.getKeyboardShortcutHelpModifier().delete(keyboardShortcutHandle);
|
|
23742
23813
|
});
|
|
23743
23814
|
}
|
|
23744
|
-
|
|
23815
|
+
#setupEventStreams() {
|
|
23745
23816
|
var result = makeXhrInterceptor();
|
|
23746
|
-
this
|
|
23747
|
-
this
|
|
23748
|
-
this.onready = this.
|
|
23749
|
-
this
|
|
23750
|
-
this
|
|
23751
|
-
this.
|
|
23752
|
-
this.
|
|
23753
|
-
this
|
|
23754
|
-
this
|
|
23755
|
-
this
|
|
23756
|
-
this.
|
|
23757
|
-
this
|
|
23817
|
+
this.#xhrInterceptorStream = result.xhrInterceptStream.takeUntilBy(this.#stopper);
|
|
23818
|
+
this.#pageCommunicatorPromise = result.pageCommunicatorPromise;
|
|
23819
|
+
this.onready = this.#pageCommunicatorPromise.then(pageCommunicator => {
|
|
23820
|
+
this.#timestampGlobalsFound = Date.now();
|
|
23821
|
+
this.#pageCommunicator = pageCommunicator;
|
|
23822
|
+
this.#logger.setUserEmailAddress(this.getUserEmailAddress());
|
|
23823
|
+
this.#logger.setIsUsingSyncAPI(pageCommunicator.isUsingSyncAPI());
|
|
23824
|
+
this.#userInfo = new UserInfo(this);
|
|
23825
|
+
this.#timestampAccountSwitcherReady = Date.now();
|
|
23826
|
+
this.#routeViewDriverStream = setupRouteViewDriverStream(this.#gmailRouteProcessor, this).takeUntilBy(this.#stopper).toProperty();
|
|
23827
|
+
this.#routeViewDriverStream.onValue(gmailRouteView => {
|
|
23828
|
+
this.#currentRouteViewDriver = gmailRouteView;
|
|
23758
23829
|
});
|
|
23759
|
-
this
|
|
23760
|
-
this
|
|
23761
|
-
this
|
|
23830
|
+
this.#rowListViewDriverStream = this.#setupRouteSubViewDriver('newGmailRowListView').takeUntilBy(this.#stopper);
|
|
23831
|
+
this.#setupThreadRowViewDriverKefirStream();
|
|
23832
|
+
this.#threadViewDriverLiveSet = toLiveSet(this.#setupRouteSubViewDriver('newGmailThreadView').takeUntilBy(this.#stopper).flatMap(gmailThreadView => gmailThreadView.getReadyStream().map(() => gmailThreadView)).map(gmailThreadView => ({
|
|
23762
23833
|
el: gmailThreadView,
|
|
23763
23834
|
removalStream: gmailThreadView.getStopper()
|
|
23764
23835
|
})));
|
|
23765
|
-
this
|
|
23766
|
-
this
|
|
23767
|
-
this
|
|
23768
|
-
this
|
|
23769
|
-
this
|
|
23836
|
+
this.#setupToolbarViewDriverStream();
|
|
23837
|
+
this.#setupMessageViewDriverStream();
|
|
23838
|
+
this.#setupComposeViewDriverStream();
|
|
23839
|
+
this.#threadRowIdentifier = new thread_row_identifier(this);
|
|
23840
|
+
this.#timestampOnready = Date.now();
|
|
23770
23841
|
});
|
|
23771
23842
|
}
|
|
23772
|
-
|
|
23773
|
-
this
|
|
23843
|
+
#setupComposeViewDriverStream() {
|
|
23844
|
+
this.#composeViewDriverStream = (0,setup_compose_view_driver_stream/* default */.Z)(this, this.#messageViewDriverStream, this.#xhrInterceptorStream).takeUntilBy(this.#stopper);
|
|
23774
23845
|
}
|
|
23775
|
-
|
|
23776
|
-
return this.
|
|
23846
|
+
#setupRouteSubViewDriver(viewName) {
|
|
23847
|
+
return this.#routeViewDriverStream.flatMap(gmailRouteView => {
|
|
23777
23848
|
return gmailRouteView.getEventStream().filter(event => event.eventName === viewName).map(event => event.view);
|
|
23778
23849
|
});
|
|
23779
23850
|
}
|
|
23780
|
-
|
|
23781
|
-
this
|
|
23851
|
+
#setupThreadRowViewDriverKefirStream() {
|
|
23852
|
+
this.#threadRowViewDriverKefirStream = this.#rowListViewDriverStream.flatMap(rowListViewDriver => rowListViewDriver.getRowViewDriverStream()).takeUntilBy(this.#stopper);
|
|
23782
23853
|
}
|
|
23783
|
-
|
|
23784
|
-
this
|
|
23854
|
+
#setupToolbarViewDriverStream() {
|
|
23855
|
+
this.#toolbarViewDriverLiveSet = toLiveSet(kefir_esm.merge([this.#rowListViewDriverStream.map(gmailRowListView => gmailRowListView.getToolbarView()), this.getThreadViewDriverStream().map(gmailThreadView => gmailThreadView.getToolbarView())]).filter(Boolean).flatMap(gmailToolbarView => gmailToolbarView.waitForReady()).map(gmailToolbarView => ({
|
|
23785
23856
|
el: gmailToolbarView,
|
|
23786
23857
|
removalStream: gmailToolbarView.getStopper()
|
|
23787
|
-
})).takeUntilBy(this
|
|
23788
|
-
this.
|
|
23858
|
+
})).takeUntilBy(this.#stopper));
|
|
23859
|
+
this.#toolbarViewDriverLiveSet.subscribe({});
|
|
23789
23860
|
}
|
|
23790
|
-
|
|
23791
|
-
this
|
|
23861
|
+
#setupMessageViewDriverStream() {
|
|
23862
|
+
this.#messageViewDriverStream = this.getThreadViewDriverStream().flatMap(gmailThreadView => gmailThreadView.getMessageViewDriverStream()).takeUntilBy(this.#stopper);
|
|
23792
23863
|
}
|
|
23793
23864
|
async addGlobalSidebarContentPanel(descriptor) {
|
|
23794
|
-
await this.waitForGlobalSidebarReady().merge(this.
|
|
23865
|
+
await this.waitForGlobalSidebarReady().merge(this.#stopper.flatMap(() => kefir_esm.constantError(new Error('Driver instance was destroyed early')))).take(1).takeErrors(1).toPromise();
|
|
23795
23866
|
const appSidebar = this.getGlobalSidebar();
|
|
23796
23867
|
return appSidebar.addGlobalSidebarContentPanel(descriptor);
|
|
23797
23868
|
}
|
|
@@ -23803,11 +23874,11 @@ class GmailDriver {
|
|
|
23803
23874
|
return (0,stream_wait_for/* default */.Z)(condition).map(() => undefined);
|
|
23804
23875
|
}
|
|
23805
23876
|
getGlobalSidebar() {
|
|
23806
|
-
let appSidebarView = this
|
|
23877
|
+
let appSidebarView = this.#appSidebarView;
|
|
23807
23878
|
if (!appSidebarView) {
|
|
23808
23879
|
const companionSidebarContentContainerEl = gmail_element_getter/* default.getCompanionSidebarContentContainerElement */.Z.getCompanionSidebarContentContainerElement();
|
|
23809
23880
|
if (!companionSidebarContentContainerEl) throw new Error('did not find companionSidebarContentContainerEl');
|
|
23810
|
-
appSidebarView = this
|
|
23881
|
+
appSidebarView = this.#appSidebarView = new gmail_app_sidebar_view/* default */.Z(this, companionSidebarContentContainerEl);
|
|
23811
23882
|
}
|
|
23812
23883
|
return appSidebarView;
|
|
23813
23884
|
}
|
|
@@ -23815,7 +23886,7 @@ class GmailDriver {
|
|
|
23815
23886
|
return !!(__webpack_require__.g.GLOBALS && __webpack_require__.g._GM_main);
|
|
23816
23887
|
}
|
|
23817
23888
|
isUsingSyncAPI() {
|
|
23818
|
-
return this.
|
|
23889
|
+
return this.#pageCommunicator.isUsingSyncAPI();
|
|
23819
23890
|
}
|
|
23820
23891
|
showAppIdWarning() {
|
|
23821
23892
|
showAppIdWarning(this);
|
|
@@ -23824,58 +23895,58 @@ class GmailDriver {
|
|
|
23824
23895
|
return new GmailTopMessageBarDriver(optionStream);
|
|
23825
23896
|
}
|
|
23826
23897
|
associateThreadAndMessageIDs(threadID, messageID) {
|
|
23827
|
-
this.
|
|
23898
|
+
this.#messageIDsToThreadIDs.set(messageID, threadID);
|
|
23828
23899
|
}
|
|
23829
23900
|
getThreadIDForMessageID(messageID) {
|
|
23830
|
-
return (0,get_or_fail/* default */.Z)(this
|
|
23901
|
+
return (0,get_or_fail/* default */.Z)(this.#messageIDsToThreadIDs, messageID);
|
|
23831
23902
|
}
|
|
23832
23903
|
getDraftIDForMessageID(messageID) {
|
|
23833
23904
|
let skipCache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
23834
23905
|
return (0,get_draft_id_for_message_id/* default */.Z)(this, messageID, skipCache);
|
|
23835
23906
|
}
|
|
23836
|
-
|
|
23907
|
+
#recentSyncDraftIds = new Map();
|
|
23837
23908
|
reportRecentSyncDraftId(syncDraftId) {
|
|
23838
|
-
const count = this.
|
|
23909
|
+
const count = this.#recentSyncDraftIds.get(syncDraftId);
|
|
23839
23910
|
const newCount = (count ?? 0) + 1;
|
|
23840
|
-
this.
|
|
23911
|
+
this.#recentSyncDraftIds.set(syncDraftId, newCount);
|
|
23841
23912
|
}
|
|
23842
23913
|
reportDraftClosed(syncDraftId) {
|
|
23843
|
-
kefir_esm.later(30 * 1000, undefined).takeUntilBy(this
|
|
23844
|
-
const count = this.
|
|
23914
|
+
kefir_esm.later(30 * 1000, undefined).takeUntilBy(this.#stopper).onValue(() => {
|
|
23915
|
+
const count = this.#recentSyncDraftIds.get(syncDraftId);
|
|
23845
23916
|
let newCount;
|
|
23846
23917
|
if (count == null || count < 1) {
|
|
23847
23918
|
newCount = 0;
|
|
23848
|
-
this.
|
|
23919
|
+
this.#logger.error(new Error('_recentSyncDraftIds count had unexpected value'), {
|
|
23849
23920
|
count
|
|
23850
23921
|
});
|
|
23851
23922
|
} else {
|
|
23852
23923
|
newCount = count - 1;
|
|
23853
23924
|
}
|
|
23854
23925
|
if (newCount === 0) {
|
|
23855
|
-
this.
|
|
23926
|
+
this.#recentSyncDraftIds.delete(syncDraftId);
|
|
23856
23927
|
} else {
|
|
23857
|
-
this.
|
|
23928
|
+
this.#recentSyncDraftIds.set(syncDraftId, newCount);
|
|
23858
23929
|
}
|
|
23859
23930
|
});
|
|
23860
23931
|
}
|
|
23861
23932
|
isRecentSyncDraftId(syncMessageId) {
|
|
23862
|
-
return this.
|
|
23933
|
+
return this.#recentSyncDraftIds.has(syncMessageId);
|
|
23863
23934
|
}
|
|
23864
|
-
|
|
23935
|
+
#selectedThreadRows = transducers_default().mapcat(gmailRowListView => gmailRowListView.getSelectedThreadRowViewDrivers());
|
|
23865
23936
|
getSelectedThreadRowViewDrivers() {
|
|
23866
|
-
if (!this
|
|
23937
|
+
if (!this.#currentRouteViewDriver) {
|
|
23867
23938
|
return [];
|
|
23868
23939
|
}
|
|
23869
|
-
return transducers_default().toArray(this.
|
|
23940
|
+
return transducers_default().toArray(this.#currentRouteViewDriver.getRowListViews(), this.#selectedThreadRows);
|
|
23870
23941
|
}
|
|
23871
|
-
|
|
23942
|
+
#threadRowViewSelectionChanges = kefir_bus_default()();
|
|
23872
23943
|
signalThreadRowViewSelectionChange() {
|
|
23873
|
-
this.
|
|
23944
|
+
this.#threadRowViewSelectionChanges.value(undefined);
|
|
23874
23945
|
}
|
|
23875
23946
|
registerThreadRowViewSelectionHandler(handler) {
|
|
23876
|
-
this.
|
|
23947
|
+
this.#threadRowViewSelectionChanges.onValue(handler);
|
|
23877
23948
|
return () => {
|
|
23878
|
-
this.
|
|
23949
|
+
this.#threadRowViewSelectionChanges.offValue(handler);
|
|
23879
23950
|
};
|
|
23880
23951
|
}
|
|
23881
23952
|
getPersonDetails(emailAddress) {
|
|
@@ -24501,8 +24572,7 @@ class ComposeView extends safe_event_emitter/* default */.Z {
|
|
|
24501
24572
|
/* harmony import */ var _common_get_or_fail__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7791);
|
|
24502
24573
|
|
|
24503
24574
|
|
|
24504
|
-
const membersMap = new WeakMap();
|
|
24505
|
-
|
|
24575
|
+
const membersMap = new WeakMap();
|
|
24506
24576
|
class ContentPanelView extends _lib_safe_event_emitter__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
24507
24577
|
destroyed = false;
|
|
24508
24578
|
constructor(contentPanelViewImplementation) {
|
|
@@ -24511,7 +24581,7 @@ class ContentPanelView extends _lib_safe_event_emitter__WEBPACK_IMPORTED_MODULE_
|
|
|
24511
24581
|
contentPanelViewImplementation
|
|
24512
24582
|
};
|
|
24513
24583
|
membersMap.set(this, members);
|
|
24514
|
-
this
|
|
24584
|
+
this.#bindToStreamEvents();
|
|
24515
24585
|
}
|
|
24516
24586
|
remove() {
|
|
24517
24587
|
(0,_common_get_or_fail__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(membersMap, this).contentPanelViewImplementation.remove();
|
|
@@ -24525,7 +24595,7 @@ class ContentPanelView extends _lib_safe_event_emitter__WEBPACK_IMPORTED_MODULE_
|
|
|
24525
24595
|
isActive() {
|
|
24526
24596
|
return (0,_common_get_or_fail__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(membersMap, this).contentPanelViewImplementation.isActive();
|
|
24527
24597
|
}
|
|
24528
|
-
|
|
24598
|
+
#bindToStreamEvents() {
|
|
24529
24599
|
const stream = (0,_common_get_or_fail__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(membersMap, this).contentPanelViewImplementation.getEventStream();
|
|
24530
24600
|
stream.onValue(_ref => {
|
|
24531
24601
|
let {
|