@inboxsdk/core 2.1.6 → 2.1.8
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 +99 -35
- 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/gmail-element-getter.d.ts +2 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-element-getter.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-route-view/gmail-route-view.d.ts +1 -4
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-route-view/gmail-route-view.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-route-view/page-parser.d.ts +4 -0
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-route-view/page-parser.d.ts.map +1 -0
package/inboxsdk.js
CHANGED
|
@@ -831,7 +831,7 @@ function isElementVisible(el) {
|
|
|
831
831
|
|
|
832
832
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- SDK_VERSION is injected by webpack
|
|
833
833
|
///@ts-ignore
|
|
834
|
-
const BUILD_VERSION = "2.1.
|
|
834
|
+
const BUILD_VERSION = "2.1.8-1697045653546-3f2c1ddd76535c28";
|
|
835
835
|
if (false) {}
|
|
836
836
|
|
|
837
837
|
/***/ }),
|
|
@@ -1698,8 +1698,17 @@ const GmailElementGetter = {
|
|
|
1698
1698
|
return document.querySelector('.aeN .n3');
|
|
1699
1699
|
}
|
|
1700
1700
|
},
|
|
1701
|
+
getRowListElementsContainer() {
|
|
1702
|
+
// This selector can find multiple elements but they should all be siblings
|
|
1703
|
+
// so it's fine because we get the common parent.
|
|
1704
|
+
return document.querySelector('.bGI.nH')?.parentElement ?? null;
|
|
1705
|
+
},
|
|
1701
1706
|
getRowListElements() {
|
|
1702
|
-
|
|
1707
|
+
const rowListElements = document.querySelectorAll('[gh=tl]');
|
|
1708
|
+
if (rowListElements.length === 0) {
|
|
1709
|
+
return null;
|
|
1710
|
+
}
|
|
1711
|
+
return Array.from(rowListElements);
|
|
1703
1712
|
},
|
|
1704
1713
|
getScrollContainer() {
|
|
1705
1714
|
return document.querySelector('div.Tm.aeJ');
|
|
@@ -10837,7 +10846,7 @@ options.insert = htmlElement => {
|
|
|
10837
10846
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
10838
10847
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
10839
10848
|
///@ts-ignore
|
|
10840
|
-
"2.1.
|
|
10849
|
+
"2.1.8-1697045653546-3f2c1ddd76535c28");
|
|
10841
10850
|
document.head.append(htmlElement);
|
|
10842
10851
|
};
|
|
10843
10852
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -11984,7 +11993,7 @@ if (!__webpack_require__.g.__InboxSDKImpLoader) {
|
|
|
11984
11993
|
await onready;
|
|
11985
11994
|
const {
|
|
11986
11995
|
makePlatformImplementation
|
|
11987
|
-
} = await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
11996
|
+
} = await Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2180));
|
|
11988
11997
|
return makePlatformImplementation(appId, opts, {
|
|
11989
11998
|
piMainStarted,
|
|
11990
11999
|
piLoadStarted,
|
|
@@ -12672,7 +12681,7 @@ function _updateNavMenu(members, newRouteViewDriver) {
|
|
|
12672
12681
|
|
|
12673
12682
|
/***/ }),
|
|
12674
12683
|
|
|
12675
|
-
/***/
|
|
12684
|
+
/***/ 2180:
|
|
12676
12685
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
12677
12686
|
|
|
12678
12687
|
"use strict";
|
|
@@ -16055,6 +16064,50 @@ function _getLabelHTML(label) {
|
|
|
16055
16064
|
return retArray.join('');
|
|
16056
16065
|
}
|
|
16057
16066
|
/* harmony default export */ const gmail_collapsible_section_view = (GmailCollapsibleSectionView);
|
|
16067
|
+
// EXTERNAL MODULE: ./node_modules/page-parser-tree/js/index.js
|
|
16068
|
+
var page_parser_tree_js = __webpack_require__(66330);
|
|
16069
|
+
var page_parser_tree_js_default = /*#__PURE__*/__webpack_require__.n(page_parser_tree_js);
|
|
16070
|
+
// EXTERNAL MODULE: ./src/platform-implementation-js/lib/isNotNil.ts
|
|
16071
|
+
var isNotNil = __webpack_require__(98727);
|
|
16072
|
+
;// CONCATENATED MODULE: ./src/platform-implementation-js/dom-driver/gmail/views/gmail-route-view/page-parser.ts
|
|
16073
|
+
|
|
16074
|
+
|
|
16075
|
+
|
|
16076
|
+
function makePageParser(element, logger) {
|
|
16077
|
+
return new (page_parser_tree_js_default())(element, {
|
|
16078
|
+
logError(err, el) {
|
|
16079
|
+
const details = {
|
|
16080
|
+
el,
|
|
16081
|
+
html: el ? (0,censorHTMLtree/* default */.Z)(el) : null
|
|
16082
|
+
};
|
|
16083
|
+
logger.errorSite(err, details);
|
|
16084
|
+
},
|
|
16085
|
+
tags: {},
|
|
16086
|
+
watchers: [{
|
|
16087
|
+
sources: [null],
|
|
16088
|
+
tag: 'rowListElementContainer',
|
|
16089
|
+
selectors: [{
|
|
16090
|
+
$map: () => document.querySelector('.bGI.nH')?.parentElement
|
|
16091
|
+
}]
|
|
16092
|
+
}, {
|
|
16093
|
+
sources: ['rowListElementContainer'],
|
|
16094
|
+
tag: 'rowListElement',
|
|
16095
|
+
selectors: [{
|
|
16096
|
+
$or: [[], ['.bGI.nH', '.bf5', '.bv9', '.bGC']]
|
|
16097
|
+
}, '.bGI[role=main]', '[gh=tl]']
|
|
16098
|
+
}],
|
|
16099
|
+
finders: {
|
|
16100
|
+
rowListElementContainer: {
|
|
16101
|
+
fn: root => [root.querySelector('.bGI.nH')?.parentElement].filter(isNotNil/* default */.Z)
|
|
16102
|
+
},
|
|
16103
|
+
rowListElement: {
|
|
16104
|
+
fn: root => root.querySelectorAll('[gh=tl]')
|
|
16105
|
+
}
|
|
16106
|
+
}
|
|
16107
|
+
});
|
|
16108
|
+
}
|
|
16109
|
+
// EXTERNAL MODULE: ./src/platform-implementation-js/lib/toItemWithLifetimeStream.ts
|
|
16110
|
+
var toItemWithLifetimeStream = __webpack_require__(30462);
|
|
16058
16111
|
;// CONCATENATED MODULE: ./src/platform-implementation-js/dom-driver/gmail/views/gmail-route-view/gmail-route-view.ts
|
|
16059
16112
|
|
|
16060
16113
|
|
|
@@ -16074,8 +16127,11 @@ function _getLabelHTML(label) {
|
|
|
16074
16127
|
|
|
16075
16128
|
|
|
16076
16129
|
|
|
16130
|
+
|
|
16131
|
+
|
|
16077
16132
|
class GmailRouteView {
|
|
16078
16133
|
_stopper = js_default()();
|
|
16134
|
+
#page;
|
|
16079
16135
|
constructor(_ref, gmailRouteProcessor, driver) {
|
|
16080
16136
|
let {
|
|
16081
16137
|
urlObject,
|
|
@@ -16097,6 +16153,7 @@ class GmailRouteView {
|
|
|
16097
16153
|
this._driver = driver;
|
|
16098
16154
|
this._eventStream = kefir_bus_default()();
|
|
16099
16155
|
this._hasAddedCollapsibleSection = false;
|
|
16156
|
+
this.#page = makePageParser(document.body, driver.getLogger());
|
|
16100
16157
|
if (this._type === 'CUSTOM') {
|
|
16101
16158
|
this._setupCustomViewElement();
|
|
16102
16159
|
driver.getStopper().takeUntilBy(this._stopper.delay(0)).onValue(() => {
|
|
@@ -16118,6 +16175,7 @@ class GmailRouteView {
|
|
|
16118
16175
|
destroy() {
|
|
16119
16176
|
this._stopper.destroy();
|
|
16120
16177
|
this._eventStream.end();
|
|
16178
|
+
this.#page.dump();
|
|
16121
16179
|
if (this._customViewElement) {
|
|
16122
16180
|
this._customViewElement.remove();
|
|
16123
16181
|
}
|
|
@@ -16180,20 +16238,20 @@ class GmailRouteView {
|
|
|
16180
16238
|
return Object.freeze(params);
|
|
16181
16239
|
});
|
|
16182
16240
|
addCollapsibleSection(sectionDescriptorProperty, groupOrderHint) {
|
|
16183
|
-
return this
|
|
16241
|
+
return this.#addCollapsibleSection(sectionDescriptorProperty, groupOrderHint, true);
|
|
16184
16242
|
}
|
|
16185
16243
|
addSection(sectionDescriptorProperty, groupOrderHint) {
|
|
16186
|
-
return this
|
|
16244
|
+
return this.#addCollapsibleSection(sectionDescriptorProperty, groupOrderHint, false);
|
|
16187
16245
|
}
|
|
16188
|
-
|
|
16246
|
+
#addCollapsibleSection(collapsibleSectionDescriptorProperty, groupOrderHint, isCollapsible) {
|
|
16189
16247
|
this._hasAddedCollapsibleSection = true;
|
|
16190
16248
|
var gmailResultsSectionView = new gmail_collapsible_section_view(this._driver, groupOrderHint, this.getRouteID() === this._gmailRouteProcessor.NativeRouteIDs.SEARCH, isCollapsible);
|
|
16191
|
-
|
|
16192
|
-
gmailResultsSectionView.getEventStream().filter(function (event) {
|
|
16249
|
+
kefir_esm.combine([this.#getSectionsContainer(), gmailResultsSectionView.getEventStream().filter(event => {
|
|
16193
16250
|
return event.type === 'update' && event.property === 'orderHint';
|
|
16194
|
-
}).onValue(
|
|
16195
|
-
|
|
16196
|
-
|
|
16251
|
+
})]).onValue(_ref2 => {
|
|
16252
|
+
let [sectionsContainer] = _ref2;
|
|
16253
|
+
const children = sectionsContainer.children;
|
|
16254
|
+
const insertBeforeElement = getInsertBeforeElement(gmailResultsSectionView.getElement(), children, ['data-group-order-hint', 'data-order-hint']);
|
|
16197
16255
|
if (insertBeforeElement) {
|
|
16198
16256
|
sectionsContainer.insertBefore(gmailResultsSectionView.getElement(), insertBeforeElement);
|
|
16199
16257
|
} else {
|
|
@@ -16233,15 +16291,17 @@ class GmailRouteView {
|
|
|
16233
16291
|
_setupSubViews() {
|
|
16234
16292
|
browser_asap_default()(() => {
|
|
16235
16293
|
if (!this._eventStream) return;
|
|
16236
|
-
this
|
|
16294
|
+
this.#monitorRowListElements();
|
|
16237
16295
|
this._setupContentAndSidebarView();
|
|
16238
16296
|
this._setupScrollStream();
|
|
16239
16297
|
});
|
|
16240
16298
|
}
|
|
16241
|
-
|
|
16242
|
-
|
|
16243
|
-
|
|
16244
|
-
|
|
16299
|
+
#monitorRowListElements() {
|
|
16300
|
+
(0,toItemWithLifetimeStream/* default */.Z)(this.#page.tree.getAllByTag('rowListElement')).takeUntilBy(this._stopper).onValue(_ref3 => {
|
|
16301
|
+
let {
|
|
16302
|
+
el
|
|
16303
|
+
} = _ref3;
|
|
16304
|
+
this._processRowListElement(el.getValue());
|
|
16245
16305
|
});
|
|
16246
16306
|
}
|
|
16247
16307
|
_processRowListElement(rowListElement) {
|
|
@@ -16299,18 +16359,22 @@ class GmailRouteView {
|
|
|
16299
16359
|
};
|
|
16300
16360
|
}));
|
|
16301
16361
|
}
|
|
16302
|
-
|
|
16303
|
-
|
|
16304
|
-
|
|
16305
|
-
|
|
16306
|
-
|
|
16307
|
-
|
|
16308
|
-
sectionsContainer.
|
|
16309
|
-
|
|
16310
|
-
|
|
16311
|
-
|
|
16312
|
-
|
|
16313
|
-
|
|
16362
|
+
#getSectionsContainer() {
|
|
16363
|
+
return (0,toItemWithLifetimeStream/* default */.Z)(this.#page.tree.getAllByTag('rowListElementContainer')).takeUntilBy(this._stopper).take(1).map(_ref4 => {
|
|
16364
|
+
let {
|
|
16365
|
+
el
|
|
16366
|
+
} = _ref4;
|
|
16367
|
+
const main = el.getValue();
|
|
16368
|
+
let sectionsContainer = main.querySelector('.inboxsdk__custom_sections');
|
|
16369
|
+
if (!sectionsContainer) {
|
|
16370
|
+
sectionsContainer = document.createElement('div');
|
|
16371
|
+
sectionsContainer.classList.add('inboxsdk__custom_sections');
|
|
16372
|
+
main.insertBefore(sectionsContainer, main.firstChild);
|
|
16373
|
+
} else if (sectionsContainer.classList.contains('Wc') && !this._isSearchRoute()) {
|
|
16374
|
+
sectionsContainer.classList.remove('Wc');
|
|
16375
|
+
}
|
|
16376
|
+
return sectionsContainer;
|
|
16377
|
+
}).toProperty();
|
|
16314
16378
|
}
|
|
16315
16379
|
_getCustomParams() {
|
|
16316
16380
|
var params = Object.create(null);
|
|
@@ -16382,8 +16446,10 @@ class GmailRouteView {
|
|
|
16382
16446
|
return !!this._getThreadContainerElement();
|
|
16383
16447
|
}
|
|
16384
16448
|
_isListRoute() {
|
|
16385
|
-
|
|
16386
|
-
return (this._type === 'CUSTOM_LIST' || this._gmailRouteProcessor.isListRouteName(this._name)) &&
|
|
16449
|
+
const rowListElements = gmail_element_getter/* default.getRowListElements */.Z.getRowListElements();
|
|
16450
|
+
return (this._type === 'CUSTOM_LIST' || this._gmailRouteProcessor.isListRouteName(this._name)) &&
|
|
16451
|
+
// this case is for when you're on a THREAD route, but the thread renders a list like our thread breaker does
|
|
16452
|
+
rowListElements != null && rowListElements.length > 0;
|
|
16387
16453
|
}
|
|
16388
16454
|
_isSettingsRoute() {
|
|
16389
16455
|
return this._gmailRouteProcessor.isSettingsRouteName(this._name);
|
|
@@ -19354,7 +19420,7 @@ options.insert = htmlElement => {
|
|
|
19354
19420
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
19355
19421
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
19356
19422
|
///@ts-ignore
|
|
19357
|
-
"2.1.
|
|
19423
|
+
"2.1.8-1697045653546-3f2c1ddd76535c28");
|
|
19358
19424
|
document.head.append(htmlElement);
|
|
19359
19425
|
};
|
|
19360
19426
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -23222,8 +23288,6 @@ async function getSyncThreadForOldGmailThreadId(driver, oldGmailThreadId) {
|
|
|
23222
23288
|
}
|
|
23223
23289
|
return firstThread;
|
|
23224
23290
|
}
|
|
23225
|
-
// EXTERNAL MODULE: ./src/platform-implementation-js/lib/toItemWithLifetimeStream.ts
|
|
23226
|
-
var toItemWithLifetimeStream = __webpack_require__(30462);
|
|
23227
23291
|
// EXTERNAL MODULE: ./node_modules/live-set/index.js
|
|
23228
23292
|
var live_set = __webpack_require__(40716);
|
|
23229
23293
|
var live_set_default = /*#__PURE__*/__webpack_require__.n(live_set);
|