@inboxsdk/core 2.1.53 → 2.1.54
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 +278 -210
- package/inboxsdk.js.map +1 -1
- package/package.json +1 -1
- package/pageWorld.js.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/primary/index.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-nav-item-view.d.ts +4 -1
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-nav-item-view.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-thread-view.d.ts +0 -44
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-thread-view.d.ts.map +1 -1
- package/src/platform-implementation-js/driver-common/sidebar/AppSidebar.d.ts +2 -1
- package/src/platform-implementation-js/driver-common/sidebar/AppSidebar.d.ts.map +1 -1
- package/src/platform-implementation-js/driver-common/sidebar/ContentPanelViewDriver.d.ts +18 -0
- package/src/platform-implementation-js/driver-common/sidebar/ContentPanelViewDriver.d.ts.map +1 -1
- package/src/platform-implementation-js/driver-interfaces/driver.d.ts +0 -2
- package/src/platform-implementation-js/driver-interfaces/driver.d.ts.map +1 -1
- package/src/platform-implementation-js/views/conversations/thread-view.d.ts +3 -2
- package/src/platform-implementation-js/views/conversations/thread-view.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-thread-view/width-manager.d.ts +0 -7
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-thread-view/width-manager.d.ts.map +0 -1
package/inboxsdk.js
CHANGED
|
@@ -371,7 +371,7 @@ function isNotNil(value) {
|
|
|
371
371
|
|
|
372
372
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- SDK_VERSION is injected by webpack
|
|
373
373
|
///@ts-ignore
|
|
374
|
-
const BUILD_VERSION = "2.1.
|
|
374
|
+
const BUILD_VERSION = "2.1.54-1714392394780-a74c7a3b2bbe3bf9";
|
|
375
375
|
if (false) {}
|
|
376
376
|
|
|
377
377
|
/***/ }),
|
|
@@ -2186,7 +2186,7 @@ function makePageParserTree(driver, root) {
|
|
|
2186
2186
|
|
|
2187
2187
|
/***/ }),
|
|
2188
2188
|
|
|
2189
|
-
/***/
|
|
2189
|
+
/***/ 2893:
|
|
2190
2190
|
/***/ ((module, __webpack_exports__, __webpack_require__) => {
|
|
2191
2191
|
|
|
2192
2192
|
"use strict";
|
|
@@ -2207,9 +2207,6 @@ var kefir_stopper_js_default = /*#__PURE__*/__webpack_require__.n(kefir_stopper_
|
|
|
2207
2207
|
// EXTERNAL MODULE: ./node_modules/lodash/findIndex.js
|
|
2208
2208
|
var findIndex = __webpack_require__(9339);
|
|
2209
2209
|
var findIndex_default = /*#__PURE__*/__webpack_require__.n(findIndex);
|
|
2210
|
-
// EXTERNAL MODULE: ./node_modules/auto-html/js/index.js
|
|
2211
|
-
var auto_html_js = __webpack_require__(1812);
|
|
2212
|
-
var auto_html_js_default = /*#__PURE__*/__webpack_require__.n(auto_html_js);
|
|
2213
2210
|
// EXTERNAL MODULE: ./node_modules/asap/browser-asap.js
|
|
2214
2211
|
var browser_asap = __webpack_require__(4622);
|
|
2215
2212
|
var browser_asap_default = /*#__PURE__*/__webpack_require__.n(browser_asap);
|
|
@@ -2517,6 +2514,7 @@ class Panel extends react.Component {
|
|
|
2517
2514
|
appName,
|
|
2518
2515
|
iconClass,
|
|
2519
2516
|
iconUrl,
|
|
2517
|
+
iconLiga,
|
|
2520
2518
|
el
|
|
2521
2519
|
},
|
|
2522
2520
|
showControls,
|
|
@@ -2550,7 +2548,7 @@ class Panel extends react.Component {
|
|
|
2550
2548
|
className: (0,idMap/* default */.A)('app_sidebar_content_panel_title_icon_container')
|
|
2551
2549
|
}, /*#__PURE__*/react.createElement("span", {
|
|
2552
2550
|
className: classnames_default()((0,idMap/* default */.A)('app_sidebar_content_panel_title_icon'), iconClass)
|
|
2553
|
-
}, iconUrl && /*#__PURE__*/react.createElement("img", {
|
|
2551
|
+
}, !!iconLiga && iconLiga, iconUrl && /*#__PURE__*/react.createElement("img", {
|
|
2554
2552
|
src: iconUrl
|
|
2555
2553
|
}))), /*#__PURE__*/react.createElement("span", {
|
|
2556
2554
|
className: (0,idMap/* default */.A)('app_sidebar_content_panel_title_text')
|
|
@@ -2608,6 +2606,59 @@ const sidebarWaitingPlatformSelector = [cssGlobal, "inboxsdk__a0oshmeH6N_2vLtc3D
|
|
|
2608
2606
|
* and the CSS local is only used for styling.
|
|
2609
2607
|
*/
|
|
2610
2608
|
const sidebarWaitingPlatformClassName = classnames_default()(cssGlobal, "inboxsdk__a0oshmeH6N_2vLtc3DNT", "inboxsdk__BV_FA4qVT4qYxs3LbEU4", (0,idMap/* legacyIdMap */.r)('app_sidebar_waiting_platform'));
|
|
2609
|
+
// EXTERNAL MODULE: ./node_modules/lodash/escape.js
|
|
2610
|
+
var lodash_escape = __webpack_require__(3131);
|
|
2611
|
+
var escape_default = /*#__PURE__*/__webpack_require__.n(lodash_escape);
|
|
2612
|
+
// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
|
|
2613
|
+
var injectStylesIntoStyleTag = __webpack_require__(6186);
|
|
2614
|
+
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
|
|
2615
|
+
// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/styleDomAPI.js
|
|
2616
|
+
var styleDomAPI = __webpack_require__(2155);
|
|
2617
|
+
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
|
|
2618
|
+
// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
|
|
2619
|
+
var setAttributesWithoutAttributes = __webpack_require__(8626);
|
|
2620
|
+
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
|
|
2621
|
+
// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/insertStyleElement.js
|
|
2622
|
+
var insertStyleElement = __webpack_require__(8990);
|
|
2623
|
+
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
|
|
2624
|
+
// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/styleTagTransform.js
|
|
2625
|
+
var styleTagTransform = __webpack_require__(9827);
|
|
2626
|
+
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
|
|
2627
|
+
// EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!./node_modules/postcss-loader/dist/cjs.js!./src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/primary/index.module.css
|
|
2628
|
+
var index_module = __webpack_require__(8855);
|
|
2629
|
+
;// CONCATENATED MODULE: ./src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/primary/index.module.css
|
|
2630
|
+
|
|
2631
|
+
|
|
2632
|
+
|
|
2633
|
+
|
|
2634
|
+
|
|
2635
|
+
|
|
2636
|
+
|
|
2637
|
+
|
|
2638
|
+
|
|
2639
|
+
|
|
2640
|
+
|
|
2641
|
+
var options = {};
|
|
2642
|
+
|
|
2643
|
+
options.styleTagTransform = (styleTagTransform_default());
|
|
2644
|
+
options.setAttributes = (setAttributesWithoutAttributes_default());
|
|
2645
|
+
options.insert = htmlElement => {
|
|
2646
|
+
htmlElement.setAttribute('data-inboxsdk-version',
|
|
2647
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
2648
|
+
///@ts-ignore
|
|
2649
|
+
"2.1.54-1714392394780-a74c7a3b2bbe3bf9");
|
|
2650
|
+
document.head.append(htmlElement);
|
|
2651
|
+
};
|
|
2652
|
+
options.domAPI = (styleDomAPI_default());
|
|
2653
|
+
options.insertStyleElement = (insertStyleElement_default());
|
|
2654
|
+
|
|
2655
|
+
var update = injectStylesIntoStyleTag_default()(index_module/* default */.A, options);
|
|
2656
|
+
|
|
2657
|
+
|
|
2658
|
+
|
|
2659
|
+
|
|
2660
|
+
/* harmony default export */ const primary_index_module = (index_module/* default */.A && index_module/* default */.A.locals ? index_module/* default */.A.locals : undefined);
|
|
2661
|
+
|
|
2611
2662
|
;// CONCATENATED MODULE: ./src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/primary/index.tsx
|
|
2612
2663
|
|
|
2613
2664
|
|
|
@@ -2629,6 +2680,7 @@ const sidebarWaitingPlatformClassName = classnames_default()(cssGlobal, "inboxsd
|
|
|
2629
2680
|
|
|
2630
2681
|
|
|
2631
2682
|
|
|
2683
|
+
|
|
2632
2684
|
|
|
2633
2685
|
|
|
2634
2686
|
const ACTIVE_ADD_ON_ICON_SELECTOR = '.aT5-aOt-I-KO';
|
|
@@ -2852,7 +2904,11 @@ class GmailAppSidebarPrimary {
|
|
|
2852
2904
|
const instanceId = event.detail.instanceId;
|
|
2853
2905
|
const iconUrl = isGlobal && event.detail.iconUrl ? event.detail.iconUrl : event.detail.appIconUrl;
|
|
2854
2906
|
const appName = event.detail.appName;
|
|
2855
|
-
const
|
|
2907
|
+
const {
|
|
2908
|
+
iconClass = '',
|
|
2909
|
+
iconLiga
|
|
2910
|
+
} = event.detail;
|
|
2911
|
+
|
|
2856
2912
|
// If there's an existing button for the app, then just increment its
|
|
2857
2913
|
// data-count attribute instead of adding a new button.
|
|
2858
2914
|
const existingButtonContainer = isGlobal ? this.#globalButtonContainers.get(appName) : this.#threadButtonContainers.get(appName);
|
|
@@ -2865,9 +2921,9 @@ class GmailAppSidebarPrimary {
|
|
|
2865
2921
|
buttonContainer = document.createElement('div');
|
|
2866
2922
|
buttonContainer.className = (0,idMap/* default */.A)('sidebar_button_container');
|
|
2867
2923
|
buttonContainer.setAttribute('data-app-name', appName);
|
|
2868
|
-
buttonContainer.innerHTML =
|
|
2869
|
-
<button class="inboxsdk__button_icon ${iconClass}" type="button" data-tooltip="${appName}">
|
|
2870
|
-
|
|
2924
|
+
buttonContainer.innerHTML = `
|
|
2925
|
+
<button class="inboxsdk__button_icon ${escape_default()(iconClass)}" type="button" data-tooltip="${escape_default()(appName)}">
|
|
2926
|
+
${iconLiga ? `<span class="${escape_default()(index_module/* iconLiga */.N)}">${escape_default()(iconLiga).trim()}</div>` : `<img class="inboxsdk__button_iconImg" src="${escape_default()(iconUrl)}">`}
|
|
2871
2927
|
</button>
|
|
2872
2928
|
<div class="inboxsdk__button_selectedIndicator"></div>
|
|
2873
2929
|
`;
|
|
@@ -3084,6 +3140,7 @@ class GmailAppSidebarPrimary {
|
|
|
3084
3140
|
instanceId: event.detail.instanceId,
|
|
3085
3141
|
title: event.detail.title,
|
|
3086
3142
|
iconClass: event.detail.iconClass,
|
|
3143
|
+
iconLiga: event.detail.iconLiga,
|
|
3087
3144
|
iconUrl: event.detail.iconUrl,
|
|
3088
3145
|
hideTitleBar: event.detail.hideTitleBar,
|
|
3089
3146
|
el: event.target
|
|
@@ -3110,6 +3167,7 @@ class GmailAppSidebarPrimary {
|
|
|
3110
3167
|
instanceId: event.detail.instanceId,
|
|
3111
3168
|
title: event.detail.title,
|
|
3112
3169
|
iconClass: event.detail.iconClass,
|
|
3170
|
+
iconLiga: event.detail.iconLiga,
|
|
3113
3171
|
iconUrl: event.detail.iconUrl,
|
|
3114
3172
|
hideTitleBar: event.detail.hideTitleBar,
|
|
3115
3173
|
el: event.target
|
|
@@ -3174,10 +3232,15 @@ class GmailAppSidebarPrimary {
|
|
|
3174
3232
|
kefir_esm.fromEvents(document.body, 'inboxsdkUpdateSidebarPanel').filter(e => e.detail.sidebarId === this.#instanceId && e.detail.isGlobal).takeUntilBy(this.#stopper).onValue(event => {
|
|
3175
3233
|
const buttonContainer = this.#globalButtonContainers.get(event.detail.appName);
|
|
3176
3234
|
if (!buttonContainer) return;
|
|
3177
|
-
const
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3235
|
+
const {
|
|
3236
|
+
iconClass = '',
|
|
3237
|
+
iconLiga,
|
|
3238
|
+
iconUrl = event.detail.appIconUrl
|
|
3239
|
+
} = event.detail;
|
|
3240
|
+
if (!iconLiga) {
|
|
3241
|
+
const imgElement = (0,querySelectorOrFail/* default */.A)(buttonContainer, 'img');
|
|
3242
|
+
imgElement.setAttribute('src', iconUrl);
|
|
3243
|
+
}
|
|
3181
3244
|
const button = (0,querySelectorOrFail/* default */.A)(buttonContainer, 'button');
|
|
3182
3245
|
button.setAttribute('class', `inboxsdk__button_icon ${iconClass}`);
|
|
3183
3246
|
});
|
|
@@ -3296,6 +3359,7 @@ class ContentPanelViewDriver {
|
|
|
3296
3359
|
const {
|
|
3297
3360
|
el,
|
|
3298
3361
|
iconUrl,
|
|
3362
|
+
iconLiga,
|
|
3299
3363
|
iconClass,
|
|
3300
3364
|
title,
|
|
3301
3365
|
orderHint,
|
|
@@ -3320,6 +3384,7 @@ class ContentPanelViewDriver {
|
|
|
3320
3384
|
appName,
|
|
3321
3385
|
hideTitleBar: Boolean(hideTitleBar),
|
|
3322
3386
|
iconClass,
|
|
3387
|
+
iconLiga,
|
|
3323
3388
|
iconUrl,
|
|
3324
3389
|
id: String(id || title),
|
|
3325
3390
|
instanceId: this.#instanceId,
|
|
@@ -10134,7 +10199,7 @@ options.insert = htmlElement => {
|
|
|
10134
10199
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
10135
10200
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
10136
10201
|
///@ts-ignore
|
|
10137
|
-
"2.1.
|
|
10202
|
+
"2.1.54-1714392394780-a74c7a3b2bbe3bf9");
|
|
10138
10203
|
document.head.append(htmlElement);
|
|
10139
10204
|
};
|
|
10140
10205
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -11260,7 +11325,7 @@ if (!globalThis.__InboxSDKImpLoader) {
|
|
|
11260
11325
|
await onready;
|
|
11261
11326
|
const {
|
|
11262
11327
|
makePlatformImplementation
|
|
11263
|
-
} = await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
11328
|
+
} = await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 7098));
|
|
11264
11329
|
return makePlatformImplementation(appId, opts, {
|
|
11265
11330
|
piMainStarted,
|
|
11266
11331
|
piLoadStarted,
|
|
@@ -11407,7 +11472,7 @@ class Keyboard {
|
|
|
11407
11472
|
|
|
11408
11473
|
/***/ }),
|
|
11409
11474
|
|
|
11410
|
-
/***/
|
|
11475
|
+
/***/ 7098:
|
|
11411
11476
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
11412
11477
|
|
|
11413
11478
|
"use strict";
|
|
@@ -13882,27 +13947,6 @@ class GmailToolbarView {
|
|
|
13882
13947
|
}
|
|
13883
13948
|
}
|
|
13884
13949
|
/* harmony default export */ const gmail_toolbar_view = (GmailToolbarView);
|
|
13885
|
-
;// CONCATENATED MODULE: ./src/platform-implementation-js/dom-driver/gmail/views/gmail-thread-view/width-manager.ts
|
|
13886
|
-
|
|
13887
|
-
class WidthManager {
|
|
13888
|
-
constructor(contentContainerEl, addonSidebarContainerEl) {
|
|
13889
|
-
this._contentContainerEl = contentContainerEl;
|
|
13890
|
-
this._addonSidebarContainerEl = addonSidebarContainerEl;
|
|
13891
|
-
}
|
|
13892
|
-
fixWidths() {
|
|
13893
|
-
// right now width manager really just cares about when
|
|
13894
|
-
// there are no icons sdk or native and adds/removes some styling
|
|
13895
|
-
// classes accordingly
|
|
13896
|
-
const tabList = this._addonSidebarContainerEl.querySelector('[role=tablist]');
|
|
13897
|
-
if (!tabList) return;
|
|
13898
|
-
if (this._addonSidebarContainerEl.classList.contains((0,idMap/* default */.A)('app_sidebar_in_use'))) {
|
|
13899
|
-
this._contentContainerEl.classList.remove((0,idMap/* default */.A)('container_app_sidebar_no_icons'));
|
|
13900
|
-
return;
|
|
13901
|
-
}
|
|
13902
|
-
const noIconsVisible = ![...tabList.children].some(child => child.style.display !== 'none');
|
|
13903
|
-
if (noIconsVisible) this._contentContainerEl.classList.add((0,idMap/* default */.A)('container_app_sidebar_no_icons'));else this._contentContainerEl.classList.remove((0,idMap/* default */.A)('container_app_sidebar_no_icons'));
|
|
13904
|
-
}
|
|
13905
|
-
}
|
|
13906
13950
|
// EXTERNAL MODULE: ./src/platform-implementation-js/lib/isStreakAppId.ts
|
|
13907
13951
|
var isStreakAppId = __webpack_require__(8579);
|
|
13908
13952
|
// EXTERNAL MODULE: ./src/common/censorHTMLstring.ts
|
|
@@ -13926,24 +13970,36 @@ var censorHTMLstring = __webpack_require__(4158);
|
|
|
13926
13970
|
|
|
13927
13971
|
|
|
13928
13972
|
|
|
13929
|
-
|
|
13930
13973
|
let hasLoggedAddonInfo = false;
|
|
13931
13974
|
class GmailThreadView {
|
|
13932
|
-
|
|
13933
|
-
|
|
13934
|
-
|
|
13935
|
-
|
|
13975
|
+
#element;
|
|
13976
|
+
#routeViewDriver;
|
|
13977
|
+
#driver;
|
|
13978
|
+
#isPreviewedThread;
|
|
13979
|
+
#eventStream;
|
|
13980
|
+
#stopper = js_default()();
|
|
13981
|
+
#toolbarView;
|
|
13982
|
+
#messageViewDrivers;
|
|
13983
|
+
#newMessageMutationObserver;
|
|
13984
|
+
#readyStream;
|
|
13985
|
+
#threadID;
|
|
13986
|
+
#syncThreadID;
|
|
13987
|
+
#customMessageViews = new Set();
|
|
13988
|
+
#hiddenCustomMessageViews = new Set();
|
|
13989
|
+
#hiddenCustomMessageNoticeProvider;
|
|
13990
|
+
#hiddenCustomMessageNoticeElement;
|
|
13991
|
+
#resolveUnmountHiddenNoticePromise;
|
|
13936
13992
|
constructor(element, routeViewDriver, driver) {
|
|
13937
13993
|
let isPreviewedThread = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
13938
|
-
this
|
|
13939
|
-
this
|
|
13940
|
-
this
|
|
13941
|
-
this
|
|
13942
|
-
this
|
|
13943
|
-
this
|
|
13944
|
-
this
|
|
13945
|
-
const waitForSidebarReady = this.
|
|
13946
|
-
this.
|
|
13994
|
+
this.#element = element;
|
|
13995
|
+
this.#routeViewDriver = routeViewDriver;
|
|
13996
|
+
this.#driver = driver;
|
|
13997
|
+
this.#isPreviewedThread = isPreviewedThread;
|
|
13998
|
+
this.#eventStream = kefir_bus_default()();
|
|
13999
|
+
this.#messageViewDrivers = [];
|
|
14000
|
+
this.#logAddonElementInfo().catch(err => this.#driver.getLogger().error(err));
|
|
14001
|
+
const waitForSidebarReady = this.#driver.waitForGlobalSidebarReady().merge(this.#driver.delayToTimeAfterReady(15 * 1000).flatMap(() => kefir_esm.constantError(new Error('15 second timeout while waiting for sidebar fired')))).take(1).takeErrors(1).flatMapErrors(err => {
|
|
14002
|
+
this.#driver.getLogger().error(err);
|
|
13947
14003
|
return kefir_esm.constant(null);
|
|
13948
14004
|
}).toProperty();
|
|
13949
14005
|
let combinedReadyStream;
|
|
@@ -13952,75 +14008,75 @@ class GmailThreadView {
|
|
|
13952
14008
|
} else {
|
|
13953
14009
|
combinedReadyStream = waitForSidebarReady;
|
|
13954
14010
|
}
|
|
13955
|
-
this
|
|
13956
|
-
this
|
|
13957
|
-
this
|
|
14011
|
+
this.#readyStream = combinedReadyStream.map(() => {
|
|
14012
|
+
this.#setupToolbarView();
|
|
14013
|
+
this.#setupMessageViewStream();
|
|
13958
14014
|
return null;
|
|
13959
|
-
}).takeUntilBy(this
|
|
13960
|
-
this
|
|
13961
|
-
this.
|
|
13962
|
-
if (this
|
|
13963
|
-
this
|
|
14015
|
+
}).takeUntilBy(this.#stopper).toProperty();
|
|
14016
|
+
this.#listenToExpandCollapseAll();
|
|
14017
|
+
this.#stopper.take(1).onValue(() => {
|
|
14018
|
+
if (this.#resolveUnmountHiddenNoticePromise) {
|
|
14019
|
+
this.#resolveUnmountHiddenNoticePromise();
|
|
13964
14020
|
}
|
|
13965
14021
|
});
|
|
13966
14022
|
}
|
|
13967
14023
|
|
|
13968
14024
|
// TODO use livesets eventually
|
|
13969
14025
|
getMessageViewDriverStream() {
|
|
13970
|
-
return kefir_esm.constant(this
|
|
14026
|
+
return kefir_esm.constant(this.#messageViewDrivers).flatten().merge(this.#eventStream.filter(event => event.type === 'internal' && event.eventName === 'messageCreated').map(event => event.view));
|
|
13971
14027
|
}
|
|
13972
14028
|
isLoadingStub() {
|
|
13973
14029
|
return false;
|
|
13974
14030
|
}
|
|
13975
14031
|
getStopper() {
|
|
13976
|
-
return this
|
|
14032
|
+
return this.#stopper;
|
|
13977
14033
|
}
|
|
13978
14034
|
getEventStream() {
|
|
13979
|
-
return this
|
|
14035
|
+
return this.#eventStream;
|
|
13980
14036
|
}
|
|
13981
14037
|
getElement() {
|
|
13982
|
-
return this
|
|
14038
|
+
return this.#element;
|
|
13983
14039
|
}
|
|
13984
14040
|
getRouteViewDriver() {
|
|
13985
|
-
return this
|
|
14041
|
+
return this.#routeViewDriver;
|
|
13986
14042
|
}
|
|
13987
14043
|
getIsPreviewedThread() {
|
|
13988
|
-
return this
|
|
14044
|
+
return this.#isPreviewedThread;
|
|
13989
14045
|
}
|
|
13990
14046
|
getToolbarView() {
|
|
13991
|
-
return this
|
|
14047
|
+
return this.#toolbarView;
|
|
13992
14048
|
}
|
|
13993
14049
|
getMessageViewDrivers() {
|
|
13994
|
-
return this
|
|
14050
|
+
return this.#messageViewDrivers;
|
|
13995
14051
|
}
|
|
13996
14052
|
destroy() {
|
|
13997
|
-
this.
|
|
13998
|
-
this.
|
|
13999
|
-
if (this
|
|
14000
|
-
this.
|
|
14053
|
+
this.#eventStream.end();
|
|
14054
|
+
this.#stopper.destroy();
|
|
14055
|
+
if (this.#toolbarView) this.#toolbarView.destroy();
|
|
14056
|
+
this.#messageViewDrivers.forEach(messageView => {
|
|
14001
14057
|
messageView.destroy();
|
|
14002
14058
|
});
|
|
14003
|
-
this.
|
|
14004
|
-
if (this
|
|
14005
|
-
this.
|
|
14059
|
+
this.#messageViewDrivers.length = 0;
|
|
14060
|
+
if (this.#newMessageMutationObserver) {
|
|
14061
|
+
this.#newMessageMutationObserver.disconnect();
|
|
14006
14062
|
}
|
|
14007
|
-
for (const customMessageView of this
|
|
14063
|
+
for (const customMessageView of this.#customMessageViews) {
|
|
14008
14064
|
customMessageView.destroy();
|
|
14009
14065
|
}
|
|
14010
14066
|
}
|
|
14011
14067
|
addSidebarContentPanel(descriptor) {
|
|
14012
|
-
const sidebar = this.
|
|
14068
|
+
const sidebar = this.#driver.getGlobalSidebar();
|
|
14013
14069
|
return sidebar.addThreadSidebarContentPanel(descriptor, this);
|
|
14014
14070
|
}
|
|
14015
|
-
|
|
14071
|
+
#subjectContainerSelectors = {
|
|
14016
14072
|
'2022_10_21': '.a98.iY > .nH',
|
|
14017
14073
|
'2022_10_12': '.PeIF1d > .nH',
|
|
14018
14074
|
[2018]: '.if > .nH'
|
|
14019
14075
|
};
|
|
14020
|
-
|
|
14076
|
+
#subjectContainerSelectorsAfterNov162023 = {
|
|
14021
14077
|
'2023_11_16': '* > .nH'
|
|
14022
14078
|
};
|
|
14023
|
-
|
|
14079
|
+
#subjectAISuggestionsContainerSelectors = {
|
|
14024
14080
|
'2024_04_26': '.nH > .einvLd'
|
|
14025
14081
|
};
|
|
14026
14082
|
addNoticeBar() {
|
|
@@ -14028,13 +14084,13 @@ class GmailThreadView {
|
|
|
14028
14084
|
el.className = (0,idMap/* default */.A)('thread_noticeBar');
|
|
14029
14085
|
let version;
|
|
14030
14086
|
let subjectContainer;
|
|
14031
|
-
let selectorsToTry = this
|
|
14032
|
-
if (this.
|
|
14087
|
+
let selectorsToTry = this.#subjectContainerSelectors;
|
|
14088
|
+
if (this.#element.matches('.a98.iY')) {
|
|
14033
14089
|
// thread view gmail update Nov 16, 2023
|
|
14034
|
-
selectorsToTry = this
|
|
14090
|
+
selectorsToTry = this.#subjectContainerSelectorsAfterNov162023;
|
|
14035
14091
|
}
|
|
14036
14092
|
for (const [currentVersion, selector] of Object.entries(selectorsToTry)) {
|
|
14037
|
-
const el = this.
|
|
14093
|
+
const el = this.#element.querySelector(selector);
|
|
14038
14094
|
if (!el) {
|
|
14039
14095
|
continue;
|
|
14040
14096
|
}
|
|
@@ -14043,18 +14099,18 @@ class GmailThreadView {
|
|
|
14043
14099
|
break;
|
|
14044
14100
|
}
|
|
14045
14101
|
if (!subjectContainer) throw new Error('Failed to find subject container');
|
|
14046
|
-
this.
|
|
14102
|
+
this.#driver.getLogger().eventSdkPassive('addNoticeBar subjectContainer', {
|
|
14047
14103
|
version
|
|
14048
14104
|
});
|
|
14049
14105
|
|
|
14050
14106
|
// AI suggestions container could be rendered after the subject container so
|
|
14051
14107
|
// if present, we need to adjust spacing when inserting the notice bar in between subject and AI suggestions
|
|
14052
|
-
for (const [currentVersion, selector] of Object.entries(this
|
|
14053
|
-
const hasAIButtonsSubjectContainer = !!this.
|
|
14108
|
+
for (const [currentVersion, selector] of Object.entries(this.#subjectAISuggestionsContainerSelectors)) {
|
|
14109
|
+
const hasAIButtonsSubjectContainer = !!this.#element.querySelector(selector);
|
|
14054
14110
|
if (!hasAIButtonsSubjectContainer) {
|
|
14055
14111
|
continue;
|
|
14056
14112
|
}
|
|
14057
|
-
this.
|
|
14113
|
+
this.#driver.getLogger().eventSdkPassive('addNoticeBar AIButtonsSubjectContainer', {
|
|
14058
14114
|
version: currentVersion
|
|
14059
14115
|
});
|
|
14060
14116
|
|
|
@@ -14064,27 +14120,27 @@ class GmailThreadView {
|
|
|
14064
14120
|
}
|
|
14065
14121
|
subjectContainer.insertAdjacentElement('afterend', el);
|
|
14066
14122
|
const view = new SimpleElementView/* default */.A(el);
|
|
14067
|
-
this.
|
|
14123
|
+
this.#stopper.takeUntilBy(kefir_esm.fromEvents(view, 'destroy')).onValue(() => view.destroy());
|
|
14068
14124
|
return view;
|
|
14069
14125
|
}
|
|
14070
14126
|
registerHiddenCustomMessageNoticeProvider(provider) {
|
|
14071
|
-
this
|
|
14127
|
+
this.#hiddenCustomMessageNoticeProvider = provider;
|
|
14072
14128
|
}
|
|
14073
14129
|
addCustomMessage(descriptorStream) {
|
|
14074
|
-
const parentElement = this.
|
|
14130
|
+
const parentElement = this.#element.parentElement;
|
|
14075
14131
|
if (!parentElement) throw new Error('missing parent element');
|
|
14076
14132
|
const customMessageView = new CustomMessageView(descriptorStream, () => {
|
|
14077
|
-
this.
|
|
14078
|
-
const messageContainer = this.
|
|
14133
|
+
this.#readyStream.onValue(async () => {
|
|
14134
|
+
const messageContainer = this.#element.querySelector('[role=list]');
|
|
14079
14135
|
if (!messageContainer) return;
|
|
14080
14136
|
let mostRecentDate = Number.MIN_SAFE_INTEGER;
|
|
14081
14137
|
let insertBeforeMessage;
|
|
14082
14138
|
let isInHidden = false;
|
|
14083
|
-
const messages = [...(await Promise.all(this.
|
|
14139
|
+
const messages = [...(await Promise.all(this.#messageViewDrivers.map(async messageView => ({
|
|
14084
14140
|
sortDatetime: (await messageView.getDate()) || 0,
|
|
14085
14141
|
isHidden: messageView.getViewState() === 'HIDDEN',
|
|
14086
14142
|
element: messageView.getElement()
|
|
14087
|
-
})))), ...Array.from(this
|
|
14143
|
+
})))), ...Array.from(this.#customMessageViews).filter(cmv => cmv !== customMessageView && cmv.getElement().parentElement
|
|
14088
14144
|
/* it has been inserted into dom */).map(cmv => {
|
|
14089
14145
|
const date = cmv.getSortDate();
|
|
14090
14146
|
const datetime = date ? date.getTime() : null;
|
|
@@ -14106,30 +14162,30 @@ class GmailThreadView {
|
|
|
14106
14162
|
}
|
|
14107
14163
|
if (insertBeforeMessage) insertBeforeMessage.insertAdjacentElement('beforebegin', customMessageView.getElement());else messageContainer.insertAdjacentElement('beforeend', customMessageView.getElement());
|
|
14108
14164
|
if (isInHidden) {
|
|
14109
|
-
this
|
|
14165
|
+
this.#setupHiddenCustomMessage(customMessageView);
|
|
14110
14166
|
}
|
|
14111
14167
|
parentElement.classList.add('inboxsdk__thread_view_with_custom_view');
|
|
14112
14168
|
});
|
|
14113
14169
|
});
|
|
14114
|
-
this.
|
|
14170
|
+
this.#customMessageViews.add(customMessageView);
|
|
14115
14171
|
customMessageView.on('destroy', () => {
|
|
14116
|
-
this.
|
|
14117
|
-
if (this.
|
|
14172
|
+
this.#customMessageViews.delete(customMessageView);
|
|
14173
|
+
if (this.#customMessageViews.size > 0) parentElement.classList.add('inboxsdk__thread_view_with_custom_view');else parentElement.classList.remove('inboxsdk__thread_view_with_custom_view');
|
|
14118
14174
|
});
|
|
14119
14175
|
return customMessageView;
|
|
14120
14176
|
}
|
|
14121
|
-
|
|
14122
|
-
this.
|
|
14177
|
+
#setupHiddenCustomMessage(customMessageView) {
|
|
14178
|
+
this.#hiddenCustomMessageViews.add(customMessageView);
|
|
14123
14179
|
|
|
14124
14180
|
// hide the element
|
|
14125
14181
|
customMessageView.getElement().classList.add('inboxsdk__custom_message_view_hidden');
|
|
14126
14182
|
|
|
14127
14183
|
// get the message element that contains the hidden messages notice
|
|
14128
|
-
let hiddenNoticeMessageElement = this.
|
|
14184
|
+
let hiddenNoticeMessageElement = this.#element.querySelector('.adv');
|
|
14129
14185
|
let nativeHiddenNoticePresent = true;
|
|
14130
14186
|
if (!hiddenNoticeMessageElement) {
|
|
14131
14187
|
nativeHiddenNoticePresent = false;
|
|
14132
|
-
const superCollapsedMessageElements = Array.from(this.
|
|
14188
|
+
const superCollapsedMessageElements = Array.from(this.#element.querySelectorAll('.kQ'));
|
|
14133
14189
|
if (superCollapsedMessageElements.length < 2) return;
|
|
14134
14190
|
hiddenNoticeMessageElement = superCollapsedMessageElements[1];
|
|
14135
14191
|
}
|
|
@@ -14138,30 +14194,30 @@ class GmailThreadView {
|
|
|
14138
14194
|
(0,make_mutation_observer_chunked_stream/* default */.A)(hiddenNoticeMessageElement, {
|
|
14139
14195
|
attributes: true,
|
|
14140
14196
|
attributeFilter: ['class']
|
|
14141
|
-
}).takeUntilBy(kefir_esm.merge([this
|
|
14197
|
+
}).takeUntilBy(kefir_esm.merge([this.#stopper, kefir_esm.fromEvents(customMessageView, 'destroy')])).filter(() => hiddenNoticeMessageElement && !hiddenNoticeMessageElement.classList.contains('kQ')) //when kQ is gone, message is visible
|
|
14142
14198
|
.onValue(() => {
|
|
14143
14199
|
customMessageView.getElement().classList.remove('inboxsdk__custom_message_view_hidden');
|
|
14144
|
-
if (this
|
|
14145
|
-
this
|
|
14200
|
+
if (this.#hiddenCustomMessageNoticeElement) this.#hiddenCustomMessageNoticeElement.remove();
|
|
14201
|
+
this.#hiddenCustomMessageNoticeElement = null;
|
|
14146
14202
|
});
|
|
14147
|
-
this
|
|
14148
|
-
kefir_esm.fromEvents(customMessageView, 'destroy').takeUntilBy(this
|
|
14149
|
-
this.
|
|
14150
|
-
if (hiddenNoticeMessageElement) this
|
|
14203
|
+
this.#updateHiddenNotice(hiddenNoticeMessageElement, nativeHiddenNoticePresent);
|
|
14204
|
+
kefir_esm.fromEvents(customMessageView, 'destroy').takeUntilBy(this.#stopper).take(1).onValue(() => {
|
|
14205
|
+
this.#hiddenCustomMessageViews.delete(customMessageView);
|
|
14206
|
+
if (hiddenNoticeMessageElement) this.#updateHiddenNotice(hiddenNoticeMessageElement, nativeHiddenNoticePresent);
|
|
14151
14207
|
});
|
|
14152
14208
|
}
|
|
14153
|
-
|
|
14154
|
-
const existingAppNoticeElement = this
|
|
14209
|
+
#updateHiddenNotice(hiddenNoticeMessageElement, nativeHiddenNoticePresent) {
|
|
14210
|
+
const existingAppNoticeElement = this.#hiddenCustomMessageNoticeElement;
|
|
14155
14211
|
if (existingAppNoticeElement) {
|
|
14156
14212
|
existingAppNoticeElement.remove();
|
|
14157
|
-
this
|
|
14158
|
-
if (this
|
|
14213
|
+
this.#hiddenCustomMessageNoticeElement = null;
|
|
14214
|
+
if (this.#resolveUnmountHiddenNoticePromise) this.#resolveUnmountHiddenNoticePromise();
|
|
14159
14215
|
}
|
|
14160
|
-
const noticeProvider = this
|
|
14216
|
+
const noticeProvider = this.#hiddenCustomMessageNoticeProvider;
|
|
14161
14217
|
if (!noticeProvider) return;
|
|
14162
|
-
const appNoticeContainerElement = this
|
|
14218
|
+
const appNoticeContainerElement = this.#hiddenCustomMessageNoticeElement = document.createElement('span');
|
|
14163
14219
|
appNoticeContainerElement.classList.add('inboxsdk__custom_message_view_app_notice_content');
|
|
14164
|
-
const numberCustomHiddenMessages = this.
|
|
14220
|
+
const numberCustomHiddenMessages = this.#hiddenCustomMessageViews.size;
|
|
14165
14221
|
let numberNativeHiddenMessages = null;
|
|
14166
14222
|
if (nativeHiddenNoticePresent) {
|
|
14167
14223
|
const nativeHiddenNoticeCountSpan = (0,querySelectorOrFail/* default */.A)(hiddenNoticeMessageElement, '.adx span');
|
|
@@ -14171,7 +14227,7 @@ class GmailThreadView {
|
|
|
14171
14227
|
}
|
|
14172
14228
|
}
|
|
14173
14229
|
const appNoticeElement = noticeProvider(numberCustomHiddenMessages, numberNativeHiddenMessages, new Promise(resolve => {
|
|
14174
|
-
this
|
|
14230
|
+
this.#resolveUnmountHiddenNoticePromise = resolve;
|
|
14175
14231
|
}));
|
|
14176
14232
|
if (!appNoticeElement) {
|
|
14177
14233
|
return;
|
|
@@ -14188,7 +14244,7 @@ class GmailThreadView {
|
|
|
14188
14244
|
hiddenNoticeElement.appendChild(appNoticeContainerElement);
|
|
14189
14245
|
}
|
|
14190
14246
|
getSubject() {
|
|
14191
|
-
var subjectElement = this.
|
|
14247
|
+
var subjectElement = this.#element.querySelector('.ha h2');
|
|
14192
14248
|
if (!subjectElement) {
|
|
14193
14249
|
return '';
|
|
14194
14250
|
}
|
|
@@ -14206,57 +14262,57 @@ class GmailThreadView {
|
|
|
14206
14262
|
return subjectElement.textContent;
|
|
14207
14263
|
}
|
|
14208
14264
|
getInternalID() {
|
|
14209
|
-
return this
|
|
14265
|
+
return this.#syncThreadID || this.getThreadID();
|
|
14210
14266
|
}
|
|
14211
14267
|
|
|
14212
14268
|
// Follows a similar structure to getThreadIDAsync, but gives up if async work is needed
|
|
14213
14269
|
getThreadID() {
|
|
14214
|
-
if (this
|
|
14270
|
+
if (this.#threadID) return this.#threadID;
|
|
14215
14271
|
let threadID;
|
|
14216
|
-
const idElement = this.
|
|
14272
|
+
const idElement = this.#element.querySelector('[data-thread-perm-id]');
|
|
14217
14273
|
if (!idElement) throw new Error('threadID element not found');
|
|
14218
|
-
const syncThreadID = this
|
|
14274
|
+
const syncThreadID = this.#syncThreadID = idElement.getAttribute('data-thread-perm-id');
|
|
14219
14275
|
if (!syncThreadID) throw new Error('syncThreadID attribute with no value');
|
|
14220
14276
|
threadID = idElement.getAttribute('data-legacy-thread-id');
|
|
14221
14277
|
if (!threadID) {
|
|
14222
14278
|
const err = new Error('Failed to get id for thread: data-legacy-thread-id attribute missing');
|
|
14223
|
-
this.
|
|
14279
|
+
this.#driver.getLogger().error(err); // throw err;
|
|
14224
14280
|
// Fall back to old behavior instead of throwing. Probably not super sensible, but
|
|
14225
14281
|
// this is a deprecated method and preserving the current behavior is
|
|
14226
14282
|
// probably an okay choice.
|
|
14227
14283
|
}
|
|
14228
14284
|
|
|
14229
14285
|
if (!threadID) {
|
|
14230
|
-
if (this
|
|
14231
|
-
threadID = this.
|
|
14286
|
+
if (this.#isPreviewedThread) {
|
|
14287
|
+
threadID = this.#driver.getPageCommunicator().getCurrentThreadID(this.#element, true);
|
|
14232
14288
|
} else {
|
|
14233
|
-
const params = this
|
|
14289
|
+
const params = this.#routeViewDriver ? this.#routeViewDriver.getParams() : null;
|
|
14234
14290
|
if (params && params.threadID) {
|
|
14235
14291
|
threadID = params.threadID;
|
|
14236
14292
|
} else {
|
|
14237
14293
|
const err = new Error('Failed to get id for thread');
|
|
14238
|
-
this.
|
|
14294
|
+
this.#driver.getLogger().error(err);
|
|
14239
14295
|
throw err;
|
|
14240
14296
|
}
|
|
14241
14297
|
}
|
|
14242
14298
|
}
|
|
14243
|
-
this
|
|
14299
|
+
this.#threadID = threadID;
|
|
14244
14300
|
return threadID;
|
|
14245
14301
|
}
|
|
14246
14302
|
async getThreadIDAsync() {
|
|
14247
14303
|
let threadID;
|
|
14248
|
-
const idElement = this.
|
|
14304
|
+
const idElement = this.#element.querySelector('[data-thread-perm-id]');
|
|
14249
14305
|
if (!idElement) throw new Error('threadID element not found');
|
|
14250
|
-
const syncThreadID = this
|
|
14306
|
+
const syncThreadID = this.#syncThreadID = idElement.getAttribute('data-thread-perm-id');
|
|
14251
14307
|
if (!syncThreadID) throw new Error('syncThreadID attribute with no value');
|
|
14252
|
-
this
|
|
14308
|
+
this.#threadID = threadID = idElement.getAttribute('data-legacy-thread-id');
|
|
14253
14309
|
if (!threadID) {
|
|
14254
|
-
this
|
|
14310
|
+
this.#threadID = threadID = await this.#driver.getOldGmailThreadIdFromSyncThreadId(syncThreadID);
|
|
14255
14311
|
}
|
|
14256
|
-
if (this
|
|
14312
|
+
if (this.#threadID) return this.#threadID;else throw new Error('Failed to get id for thread');
|
|
14257
14313
|
}
|
|
14258
14314
|
addLabel() {
|
|
14259
|
-
const labelContainer = this.
|
|
14315
|
+
const labelContainer = this.#element.querySelector('.ha .J-J5-Ji');
|
|
14260
14316
|
if (!labelContainer) {
|
|
14261
14317
|
throw new Error('Thread view label container not found');
|
|
14262
14318
|
}
|
|
@@ -14273,14 +14329,14 @@ class GmailThreadView {
|
|
|
14273
14329
|
observer.observe(labelContainer, {
|
|
14274
14330
|
childList: true
|
|
14275
14331
|
});
|
|
14276
|
-
this.
|
|
14332
|
+
this.#stopper.takeUntilBy(kefir_esm.fromEvents(view, 'destroy')).onValue(() => view.destroy());
|
|
14277
14333
|
kefir_esm.fromEvents(view, 'destroy').take(1).onValue(() => {
|
|
14278
14334
|
observer.disconnect();
|
|
14279
14335
|
});
|
|
14280
14336
|
return view;
|
|
14281
14337
|
}
|
|
14282
14338
|
addSubjectButton(button) {
|
|
14283
|
-
const subjectParent = this.
|
|
14339
|
+
const subjectParent = this.#element.querySelector('.V8djrc.byY');
|
|
14284
14340
|
if (!subjectParent) {
|
|
14285
14341
|
throw new querySelectorOrFail/* SelectorError */.a('.V8djrc.byY', {
|
|
14286
14342
|
cause: 'Subject wrapper element not found'
|
|
@@ -14312,7 +14368,7 @@ class GmailThreadView {
|
|
|
14312
14368
|
childList: true,
|
|
14313
14369
|
subtree: true
|
|
14314
14370
|
});
|
|
14315
|
-
this.
|
|
14371
|
+
this.#stopper.takeUntilBy(kefir_esm.fromEvents(buttonElement, 'destroy')).onValue(() => buttonOptions.buttonView.destroy());
|
|
14316
14372
|
kefir_esm.fromEvents(buttonElement, 'destroy').take(1).onValue(() => {
|
|
14317
14373
|
observer.disconnect();
|
|
14318
14374
|
});
|
|
@@ -14320,10 +14376,10 @@ class GmailThreadView {
|
|
|
14320
14376
|
}
|
|
14321
14377
|
addFooterButton(button) {
|
|
14322
14378
|
const messagesSelector = 'div.nH .aHU';
|
|
14323
|
-
const messagesContainer = this.
|
|
14379
|
+
const messagesContainer = this.#element.querySelector(messagesSelector);
|
|
14324
14380
|
if (!messagesContainer) {
|
|
14325
|
-
this.
|
|
14326
|
-
html: (0,censorHTMLtree/* default */.A)(this
|
|
14381
|
+
this.#driver.getLogger().eventSdkPassive('Footer button selector fail', {
|
|
14382
|
+
html: (0,censorHTMLtree/* default */.A)(this.#element)
|
|
14327
14383
|
});
|
|
14328
14384
|
throw new querySelectorOrFail/* SelectorError */.a(messagesSelector, {
|
|
14329
14385
|
cause: 'Last message footer element not found'
|
|
@@ -14343,8 +14399,8 @@ class GmailThreadView {
|
|
|
14343
14399
|
// Sometimes it is there right away
|
|
14344
14400
|
const subjectToolbarElement = this.#findBottomReplyToolbarElement();
|
|
14345
14401
|
if (subjectToolbarElement) {
|
|
14346
|
-
const reactionButton = this.
|
|
14347
|
-
if (reactionButton && !this.
|
|
14402
|
+
const reactionButton = this.#element.querySelector('.amn .wrsVRe');
|
|
14403
|
+
if (reactionButton && !this.#element.querySelector(`#${spacerID}`)) {
|
|
14348
14404
|
subjectToolbarElement.appendChild(spacer);
|
|
14349
14405
|
}
|
|
14350
14406
|
subjectToolbarElement.appendChild(buttonElement);
|
|
@@ -14355,8 +14411,8 @@ class GmailThreadView {
|
|
|
14355
14411
|
if (mutationsList.some(mutation => mutation.type === 'childList')) {
|
|
14356
14412
|
const subjectToolbarElement = this.#findBottomReplyToolbarElement();
|
|
14357
14413
|
if (subjectToolbarElement && !subjectToolbarElement.contains(buttonElement)) {
|
|
14358
|
-
const reactionButton = this.
|
|
14359
|
-
if (reactionButton && !this.
|
|
14414
|
+
const reactionButton = this.#element.querySelector('.amn .wrsVRe');
|
|
14415
|
+
if (reactionButton && !this.#element.querySelector(`#${spacerID}`)) {
|
|
14360
14416
|
subjectToolbarElement.appendChild(spacer);
|
|
14361
14417
|
}
|
|
14362
14418
|
subjectToolbarElement.appendChild(buttonElement);
|
|
@@ -14367,30 +14423,30 @@ class GmailThreadView {
|
|
|
14367
14423
|
childList: true,
|
|
14368
14424
|
subtree: true
|
|
14369
14425
|
});
|
|
14370
|
-
this.
|
|
14426
|
+
this.#stopper.takeUntilBy(kefir_esm.fromEvents(buttonElement, 'destroy')).onValue(() => buttonOptions.buttonView.destroy());
|
|
14371
14427
|
kefir_esm.fromEvents(buttonElement, 'destroy').take(1).onValue(() => {
|
|
14372
14428
|
observer.disconnect();
|
|
14373
14429
|
});
|
|
14374
14430
|
return new basic_button_view_controller/* default */.A(buttonOptions);
|
|
14375
14431
|
}
|
|
14376
|
-
|
|
14377
|
-
const toolbarElement = this
|
|
14432
|
+
#setupToolbarView() {
|
|
14433
|
+
const toolbarElement = this.#findToolbarElement();
|
|
14378
14434
|
if (!toolbarElement) {
|
|
14379
|
-
if ((0,isStreakAppId/* default */.A)(this.
|
|
14435
|
+
if ((0,isStreakAppId/* default */.A)(this.#driver.getAppId())) {
|
|
14380
14436
|
const threadViewEl = document.querySelector('.nH.bkK');
|
|
14381
14437
|
if (threadViewEl instanceof HTMLElement) {
|
|
14382
|
-
this.
|
|
14438
|
+
this.#driver.getLogger().error(new Error('Thread view toolbar cannot be found'), {
|
|
14383
14439
|
threadViewHtml: (0,censorHTMLstring/* default */.A)(threadViewEl.innerHTML)
|
|
14384
14440
|
});
|
|
14385
14441
|
} else {
|
|
14386
14442
|
const pageHtml = document.querySelector('.nH');
|
|
14387
14443
|
if (pageHtml instanceof HTMLElement) {
|
|
14388
|
-
this.
|
|
14444
|
+
this.#driver.getLogger().error(new Error('Thread view toolbar cannot be found'), {
|
|
14389
14445
|
threadViewHtml: '.nH.bkK cannot be found',
|
|
14390
14446
|
pageHtml: (0,censorHTMLstring/* default */.A)(pageHtml.innerHTML)
|
|
14391
14447
|
});
|
|
14392
14448
|
} else {
|
|
14393
|
-
this.
|
|
14449
|
+
this.#driver.getLogger().error(new Error('Thread view toolbar cannot be found'), {
|
|
14394
14450
|
threadViewHtml: '.nH.bkK cannot be found',
|
|
14395
14451
|
pageHtml: '.nH cannot be found'
|
|
14396
14452
|
});
|
|
@@ -14401,111 +14457,98 @@ class GmailThreadView {
|
|
|
14401
14457
|
}
|
|
14402
14458
|
const toolbarParent = toolbarElement.parentElement;
|
|
14403
14459
|
if (toolbarParent) toolbarParent.classList.add('inboxsdk__thread_toolbar_parent');
|
|
14404
|
-
this
|
|
14460
|
+
this.#toolbarView = new gmail_toolbar_view(toolbarElement, this.#driver, this.#routeViewDriver, this);
|
|
14405
14461
|
}
|
|
14406
|
-
|
|
14462
|
+
#findToolbarElement() {
|
|
14407
14463
|
var toolbarContainerElements = document.querySelectorAll('[gh=tm]');
|
|
14408
14464
|
for (var ii = 0; ii < toolbarContainerElements.length; ii++) {
|
|
14409
|
-
if (this
|
|
14465
|
+
if (this.#isToolbarContainerRelevant(toolbarContainerElements[ii])) {
|
|
14410
14466
|
return toolbarContainerElements[ii].querySelector('[gh=mtb]');
|
|
14411
14467
|
}
|
|
14412
14468
|
}
|
|
14413
14469
|
return null;
|
|
14414
14470
|
}
|
|
14415
14471
|
#findSubjectToolbarElement() {
|
|
14416
|
-
var toolbarContainerElement = this.
|
|
14472
|
+
var toolbarContainerElement = this.#element.querySelector('.bHJ');
|
|
14417
14473
|
return toolbarContainerElement;
|
|
14418
14474
|
}
|
|
14419
14475
|
#findBottomReplyToolbarElement() {
|
|
14420
|
-
var toolbarContainerElements = this.
|
|
14476
|
+
var toolbarContainerElements = this.#element.querySelectorAll('table .amn');
|
|
14421
14477
|
return toolbarContainerElements[0];
|
|
14422
14478
|
}
|
|
14423
|
-
|
|
14424
|
-
if (toolbarContainerElement.parentElement.parentElement === this.
|
|
14479
|
+
#isToolbarContainerRelevant(toolbarContainerElement) {
|
|
14480
|
+
if (toolbarContainerElement.parentElement.parentElement === this.#element.parentElement.parentElement) {
|
|
14425
14481
|
return true;
|
|
14426
14482
|
}
|
|
14427
|
-
if (toolbarContainerElement.parentElement.getAttribute('role') !== 'main' && this.
|
|
14483
|
+
if (toolbarContainerElement.parentElement.getAttribute('role') !== 'main' && this.#element.parentElement.getAttribute('role') !== 'main') {
|
|
14428
14484
|
return true;
|
|
14429
14485
|
}
|
|
14430
|
-
if (toolbarContainerElement.parentElement.getAttribute('role') === 'main' && toolbarContainerElement.parentElement.querySelector('.if, .PeIF1d, .a98.iY') && (toolbarContainerElement.parentElement.querySelector('.if, .PeIF1d, .a98.iY').parentElement === this
|
|
14486
|
+
if (toolbarContainerElement.parentElement.getAttribute('role') === 'main' && toolbarContainerElement.parentElement.querySelector('.if, .PeIF1d, .a98.iY') && (toolbarContainerElement.parentElement.querySelector('.if, .PeIF1d, .a98.iY').parentElement === this.#element || toolbarContainerElement.parentElement.querySelector('.a98.iY') === this.#element)) {
|
|
14431
14487
|
let version = '2018';
|
|
14432
|
-
if (this.
|
|
14488
|
+
if (this.#element.matches('.a98.iY')) {
|
|
14433
14489
|
version = '2023-11-16';
|
|
14434
14490
|
} else if (toolbarContainerElement.parentElement.querySelector('.a98.iY')) {
|
|
14435
14491
|
version = '2022-10-20';
|
|
14436
14492
|
} else if (toolbarContainerElement.parentElement.querySelector('.PeIF1d')) {
|
|
14437
14493
|
version = '2022-10-12';
|
|
14438
14494
|
}
|
|
14439
|
-
this.
|
|
14495
|
+
this.#driver.getLogger().eventSdkPassive('gmailThreadView_isToolbarContainerRelevant', {
|
|
14440
14496
|
version
|
|
14441
14497
|
});
|
|
14442
14498
|
return true;
|
|
14443
14499
|
}
|
|
14444
14500
|
return false;
|
|
14445
14501
|
}
|
|
14446
|
-
|
|
14447
|
-
var openMessage = this.
|
|
14502
|
+
#setupMessageViewStream() {
|
|
14503
|
+
var openMessage = this.#element.querySelector('.h7');
|
|
14448
14504
|
if (!openMessage) {
|
|
14449
14505
|
var self = this;
|
|
14450
14506
|
setTimeout(function () {
|
|
14451
|
-
if (self
|
|
14452
|
-
self
|
|
14507
|
+
if (self.#element) {
|
|
14508
|
+
self.#setupMessageViewStream();
|
|
14453
14509
|
}
|
|
14454
14510
|
}, 500);
|
|
14455
14511
|
return;
|
|
14456
14512
|
}
|
|
14457
14513
|
var messageContainer = openMessage.parentElement;
|
|
14458
|
-
this
|
|
14459
|
-
this
|
|
14514
|
+
this.#initializeExistingMessages(messageContainer);
|
|
14515
|
+
this.#observeNewMessages(messageContainer);
|
|
14460
14516
|
}
|
|
14461
|
-
|
|
14517
|
+
#initializeExistingMessages(messageContainer) {
|
|
14462
14518
|
var self = this;
|
|
14463
14519
|
var children = messageContainer.children;
|
|
14464
14520
|
Array.prototype.forEach.call(children, function (childElement) {
|
|
14465
|
-
self
|
|
14521
|
+
self.#createMessageView(childElement);
|
|
14466
14522
|
});
|
|
14467
14523
|
}
|
|
14468
|
-
|
|
14469
|
-
this
|
|
14470
|
-
this.
|
|
14524
|
+
#observeNewMessages(messageContainer) {
|
|
14525
|
+
this.#newMessageMutationObserver = new MutationObserver(this.#handleNewMessageMutations.bind(this));
|
|
14526
|
+
this.#newMessageMutationObserver.observe(messageContainer, {
|
|
14471
14527
|
childList: true
|
|
14472
14528
|
});
|
|
14473
14529
|
}
|
|
14474
|
-
|
|
14530
|
+
#handleNewMessageMutations(mutations) {
|
|
14475
14531
|
var self = this;
|
|
14476
14532
|
mutations.forEach(function (mutation) {
|
|
14477
14533
|
Array.prototype.forEach.call(mutation.addedNodes, function (addedNode) {
|
|
14478
|
-
if (!addedNode.classList.contains('inboxsdk__custom_message_view')) self
|
|
14534
|
+
if (!addedNode.classList.contains('inboxsdk__custom_message_view')) self.#createMessageView(addedNode);
|
|
14479
14535
|
});
|
|
14480
14536
|
});
|
|
14481
14537
|
}
|
|
14482
|
-
|
|
14483
|
-
var messageView = new gmail_message_view(messageElement, this, this
|
|
14484
|
-
this.
|
|
14485
|
-
this.
|
|
14486
|
-
this.
|
|
14538
|
+
#createMessageView(messageElement) {
|
|
14539
|
+
var messageView = new gmail_message_view(messageElement, this, this.#driver);
|
|
14540
|
+
this.#eventStream.plug(messageView.getEventStream());
|
|
14541
|
+
this.#messageViewDrivers.push(messageView);
|
|
14542
|
+
this.#eventStream.emit({
|
|
14487
14543
|
type: 'internal',
|
|
14488
14544
|
eventName: 'messageCreated',
|
|
14489
14545
|
view: messageView
|
|
14490
14546
|
});
|
|
14491
14547
|
}
|
|
14492
|
-
_setupWidthManager() {
|
|
14493
|
-
let widthManager = this._widthManager;
|
|
14494
|
-
if (!widthManager) {
|
|
14495
|
-
const addonSidebarElement = gmail_element_getter/* default */.A.getAddonSidebarContainerElement();
|
|
14496
|
-
if (!addonSidebarElement) throw new Error('addonSidebarElement not found');
|
|
14497
|
-
const mainContentBodyContainerElement = gmail_element_getter/* default */.A.getMainContentBodyContainerElement();
|
|
14498
|
-
if (!mainContentBodyContainerElement) throw new Error('mainContentBodyContainerElement not found');
|
|
14499
|
-
const contentContainer = mainContentBodyContainerElement.parentElement;
|
|
14500
|
-
if (!contentContainer) throw new Error('mainContentBodyContainerElement has no parent element');
|
|
14501
|
-
this._widthManager = widthManager = new WidthManager(contentContainer, addonSidebarElement);
|
|
14502
|
-
}
|
|
14503
|
-
return widthManager;
|
|
14504
|
-
}
|
|
14505
14548
|
getReadyStream() {
|
|
14506
|
-
return this
|
|
14549
|
+
return this.#readyStream;
|
|
14507
14550
|
}
|
|
14508
|
-
async
|
|
14551
|
+
async #logAddonElementInfo() {
|
|
14509
14552
|
if (hasLoggedAddonInfo) return;
|
|
14510
14553
|
function readInfo() {
|
|
14511
14554
|
const container = gmail_element_getter/* default */.A.getAddonSidebarContainerElement();
|
|
@@ -14531,22 +14574,22 @@ class GmailThreadView {
|
|
|
14531
14574
|
eventData.time[0] = readInfo();
|
|
14532
14575
|
await Promise.all([30, 5000].map(async time => {
|
|
14533
14576
|
await (0,pdelay_js/* default */.A)(time);
|
|
14534
|
-
if (this.
|
|
14577
|
+
if (this.#stopper.stopped) return;
|
|
14535
14578
|
eventData.time[time] = readInfo();
|
|
14536
14579
|
}));
|
|
14537
|
-
if (this.
|
|
14538
|
-
this.
|
|
14580
|
+
if (this.#stopper.stopped) return;
|
|
14581
|
+
this.#driver.getLogger().eventSdkPassive('gmailSidebarElementInfo', eventData);
|
|
14539
14582
|
hasLoggedAddonInfo = true;
|
|
14540
14583
|
}
|
|
14541
|
-
|
|
14584
|
+
#listenToExpandCollapseAll() {
|
|
14542
14585
|
//expand all
|
|
14543
|
-
const expandAllElementImg = this.
|
|
14586
|
+
const expandAllElementImg = this.#element.querySelector('img.gx');
|
|
14544
14587
|
if (expandAllElementImg) {
|
|
14545
14588
|
const expandAllElement = findParent(expandAllElementImg, el => el.getAttribute('role') === 'button');
|
|
14546
14589
|
if (expandAllElement) {
|
|
14547
14590
|
kefir_esm.merge([kefir_esm.fromEvents(expandAllElement, 'click'), kefir_esm.fromEvents(expandAllElement, 'keydown').filter(e => e.which === 13
|
|
14548
|
-
/* enter */)]).takeUntilBy(this
|
|
14549
|
-
for (const customMessageView of this
|
|
14591
|
+
/* enter */)]).takeUntilBy(this.#stopper).onValue(() => {
|
|
14592
|
+
for (const customMessageView of this.#customMessageViews) {
|
|
14550
14593
|
customMessageView.expand();
|
|
14551
14594
|
}
|
|
14552
14595
|
});
|
|
@@ -14554,13 +14597,13 @@ class GmailThreadView {
|
|
|
14554
14597
|
}
|
|
14555
14598
|
|
|
14556
14599
|
//collapse all
|
|
14557
|
-
const collapseAllElementImg = this.
|
|
14600
|
+
const collapseAllElementImg = this.#element.querySelector('img.gq');
|
|
14558
14601
|
if (collapseAllElementImg) {
|
|
14559
14602
|
const collapseAllElement = findParent(collapseAllElementImg, el => el.getAttribute('role') === 'button');
|
|
14560
14603
|
if (collapseAllElement) {
|
|
14561
14604
|
kefir_esm.merge([kefir_esm.fromEvents(collapseAllElement, 'click'), kefir_esm.fromEvents(collapseAllElement, 'keydown').filter(e => e.which === 13
|
|
14562
|
-
/* enter */)]).takeUntilBy(this
|
|
14563
|
-
for (const customMessageView of this
|
|
14605
|
+
/* enter */)]).takeUntilBy(this.#stopper).onValue(() => {
|
|
14606
|
+
for (const customMessageView of this.#customMessageViews) {
|
|
14564
14607
|
customMessageView.collapse();
|
|
14565
14608
|
}
|
|
14566
14609
|
});
|
|
@@ -14882,7 +14925,7 @@ options.insert = htmlElement => {
|
|
|
14882
14925
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
14883
14926
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
14884
14927
|
///@ts-ignore
|
|
14885
|
-
"2.1.
|
|
14928
|
+
"2.1.54-1714392394780-a74c7a3b2bbe3bf9");
|
|
14886
14929
|
document.head.append(htmlElement);
|
|
14887
14930
|
};
|
|
14888
14931
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -19505,7 +19548,7 @@ mole_view_module_options.insert = htmlElement => {
|
|
|
19505
19548
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
19506
19549
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
19507
19550
|
///@ts-ignore
|
|
19508
|
-
"2.1.
|
|
19551
|
+
"2.1.54-1714392394780-a74c7a3b2bbe3bf9");
|
|
19509
19552
|
document.head.append(htmlElement);
|
|
19510
19553
|
};
|
|
19511
19554
|
mole_view_module_options.domAPI = (styleDomAPI_default());
|
|
@@ -23318,8 +23361,8 @@ async function openComposeWindow(_gmailDriver) {
|
|
|
23318
23361
|
if (!composeButton) throw new Error('Could not find compose button');
|
|
23319
23362
|
(0,simulate_mouse_event/* simulateClick */.jp)(composeButton);
|
|
23320
23363
|
}
|
|
23321
|
-
// EXTERNAL MODULE: ./src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/index.ts +
|
|
23322
|
-
var gmail_app_sidebar_view = __webpack_require__(
|
|
23364
|
+
// EXTERNAL MODULE: ./src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/index.ts + 8 modules
|
|
23365
|
+
var gmail_app_sidebar_view = __webpack_require__(2893);
|
|
23323
23366
|
;// CONCATENATED MODULE: ./src/platform-implementation-js/dom-driver/gmail/gmail-driver/suppressAddon.ts
|
|
23324
23367
|
|
|
23325
23368
|
|
|
@@ -25290,6 +25333,31 @@ class DropdownView extends safe_event_emitter/* default */.A {
|
|
|
25290
25333
|
}
|
|
25291
25334
|
}
|
|
25292
25335
|
|
|
25336
|
+
/***/ }),
|
|
25337
|
+
|
|
25338
|
+
/***/ 8855:
|
|
25339
|
+
/***/ ((module, __webpack_exports__, __webpack_require__) => {
|
|
25340
|
+
|
|
25341
|
+
"use strict";
|
|
25342
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
25343
|
+
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__),
|
|
25344
|
+
/* harmony export */ N: () => (/* binding */ iconLiga)
|
|
25345
|
+
/* harmony export */ });
|
|
25346
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5516);
|
|
25347
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
25348
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1364);
|
|
25349
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
25350
|
+
// Imports
|
|
25351
|
+
|
|
25352
|
+
|
|
25353
|
+
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
|
|
25354
|
+
// Module
|
|
25355
|
+
___CSS_LOADER_EXPORT___.push([module.id, ".inboxsdk__GBPjAIsupt3H7foDtouM{font-size:20px;line-height:1;position:relative;z-index:1!important}", "",{"version":3,"sources":["webpack://./src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/primary/index.module.css"],"names":[],"mappings":"AAAA,gCACE,cAAe,CACf,aAAc,CACd,iBAAkB,CAClB,mBACF","sourcesContent":[".iconLiga {\n font-size: 20px;\n line-height: 1;\n position: relative;\n z-index: 1 !important;\n}\n"],"sourceRoot":""}]);
|
|
25356
|
+
// Exports
|
|
25357
|
+
var iconLiga = "inboxsdk__GBPjAIsupt3H7foDtouM";
|
|
25358
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
25359
|
+
|
|
25360
|
+
|
|
25293
25361
|
/***/ }),
|
|
25294
25362
|
|
|
25295
25363
|
/***/ 9245:
|