@inboxsdk/core 2.1.2 → 2.1.4
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 +43 -40
- package/inboxsdk.js.map +1 -1
- package/package.json +1 -1
- package/pageWorld.js.map +1 -1
- package/src/inboxsdk.d.ts +3 -1
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-mole-view-driver.d.ts +1 -8
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-mole-view-driver.d.ts.map +1 -1
- package/src/platform-implementation-js/driver-common/sidebar/ContentPanelViewDriver.d.ts +1 -1
- package/src/platform-implementation-js/driver-common/sidebar/ContentPanelViewDriver.d.ts.map +1 -1
- package/src/platform-implementation-js/namespaces/global.d.ts +1 -1
- package/src/platform-implementation-js/namespaces/global.d.ts.map +1 -1
- package/src/platform-implementation-js/views/conversations/thread-view.d.ts +2 -1
- package/src/platform-implementation-js/views/conversations/thread-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.4-1696333881671-51beebc6dc154afc";
|
|
836
836
|
if (false) {}
|
|
837
837
|
|
|
838
838
|
/***/ }),
|
|
@@ -10833,7 +10833,7 @@ options.insert = htmlElement => {
|
|
|
10833
10833
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
10834
10834
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
10835
10835
|
///@ts-ignore
|
|
10836
|
-
"2.1.
|
|
10836
|
+
"2.1.4-1696333881671-51beebc6dc154afc");
|
|
10837
10837
|
document.head.append(htmlElement);
|
|
10838
10838
|
};
|
|
10839
10839
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -18472,6 +18472,7 @@ class Global {
|
|
|
18472
18472
|
this.#piOpts = piOpts;
|
|
18473
18473
|
}
|
|
18474
18474
|
async addSidebarContentPanel(descriptor) {
|
|
18475
|
+
// kefirCast casts to Observable<any, any> which is not what we want
|
|
18475
18476
|
const descriptorPropertyStream = kefir_cast_default()(kefir_esm["default"], descriptor).toProperty();
|
|
18476
18477
|
this.#driver.getLogger().eventSdkPassive('global.addSidebarContentPanel');
|
|
18477
18478
|
const contentPanelImplementation = await this.#driver.addGlobalSidebarContentPanel(descriptorPropertyStream);
|
|
@@ -19330,7 +19331,7 @@ options.insert = htmlElement => {
|
|
|
19330
19331
|
htmlElement.setAttribute('data-inboxsdk-version',
|
|
19331
19332
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- this is injected by webpack
|
|
19332
19333
|
///@ts-ignore
|
|
19333
|
-
"2.1.
|
|
19334
|
+
"2.1.4-1696333881671-51beebc6dc154afc");
|
|
19334
19335
|
document.head.append(htmlElement);
|
|
19335
19336
|
};
|
|
19336
19337
|
options.domAPI = (styleDomAPI_default());
|
|
@@ -19355,51 +19356,53 @@ var update = injectStylesIntoStyleTag_default()(mole_view_module/* default */.Z,
|
|
|
19355
19356
|
|
|
19356
19357
|
|
|
19357
19358
|
class GmailMoleViewDriver {
|
|
19358
|
-
|
|
19359
|
-
|
|
19359
|
+
#driver;
|
|
19360
|
+
#eventStream = kefir_bus_default()();
|
|
19361
|
+
#stopper = js_default()();
|
|
19362
|
+
#element;
|
|
19360
19363
|
constructor(driver, options) {
|
|
19361
|
-
this
|
|
19362
|
-
this
|
|
19364
|
+
this.#driver = driver;
|
|
19365
|
+
this.#element = Object.assign(document.createElement('div'), {
|
|
19363
19366
|
className: 'inboxsdk__mole_view ' + (options.className || ''),
|
|
19364
19367
|
innerHTML: getHTMLString(options)
|
|
19365
19368
|
});
|
|
19366
19369
|
if (options.chrome === false) {
|
|
19367
|
-
this.
|
|
19370
|
+
this.#element.classList.add('inboxsdk__mole_view_chromeless');
|
|
19368
19371
|
} else {
|
|
19369
|
-
(0,querySelectorOrFail/* default */.Z)(this
|
|
19372
|
+
(0,querySelectorOrFail/* default */.Z)(this.#element, '.inboxsdk__mole_view_titlebar').addEventListener('click', e => {
|
|
19370
19373
|
this.setMinimized(!this.getMinimized());
|
|
19371
19374
|
e.preventDefault();
|
|
19372
19375
|
e.stopPropagation();
|
|
19373
19376
|
});
|
|
19374
|
-
const minimizeBtn = (0,querySelectorOrFail/* default */.Z)(this
|
|
19377
|
+
const minimizeBtn = (0,querySelectorOrFail/* default */.Z)(this.#element, '.Hl');
|
|
19375
19378
|
minimizeBtn.addEventListener('click', e => {
|
|
19376
19379
|
this.setMinimized(true);
|
|
19377
19380
|
e.preventDefault();
|
|
19378
19381
|
e.stopPropagation();
|
|
19379
19382
|
});
|
|
19380
|
-
const maximizeBtn = (0,querySelectorOrFail/* default */.Z)(this
|
|
19383
|
+
const maximizeBtn = (0,querySelectorOrFail/* default */.Z)(this.#element, '.Hk');
|
|
19381
19384
|
maximizeBtn.addEventListener('click', e => {
|
|
19382
19385
|
this.setMinimized(false);
|
|
19383
19386
|
e.preventDefault();
|
|
19384
19387
|
e.stopPropagation();
|
|
19385
19388
|
});
|
|
19386
|
-
const closeBtn = (0,querySelectorOrFail/* default */.Z)(this
|
|
19389
|
+
const closeBtn = (0,querySelectorOrFail/* default */.Z)(this.#element, '.Ha');
|
|
19387
19390
|
closeBtn.addEventListener('click', e => {
|
|
19388
19391
|
this.destroy();
|
|
19389
19392
|
e.preventDefault();
|
|
19390
19393
|
e.stopPropagation();
|
|
19391
19394
|
});
|
|
19392
19395
|
if (options.titleEl) {
|
|
19393
|
-
this
|
|
19396
|
+
this.#setTitleEl(options.titleEl);
|
|
19394
19397
|
} else {
|
|
19395
19398
|
this.setTitle(options.title || '');
|
|
19396
19399
|
}
|
|
19397
19400
|
if (options.minimizedTitleEl) {
|
|
19398
|
-
this
|
|
19401
|
+
this.#setMinimizedTitleEl(options.minimizedTitleEl);
|
|
19399
19402
|
}
|
|
19400
19403
|
const titleButtons = options.titleButtons;
|
|
19401
19404
|
if (titleButtons) {
|
|
19402
|
-
const titleButtonContainer = (0,querySelectorOrFail/* default */.Z)(this
|
|
19405
|
+
const titleButtonContainer = (0,querySelectorOrFail/* default */.Z)(this.#element, '.inboxsdk__mole_title_buttons');
|
|
19403
19406
|
const lastChild = titleButtonContainer.lastElementChild;
|
|
19404
19407
|
titleButtons.forEach(titleButton => {
|
|
19405
19408
|
const img = document.createElement('img');
|
|
@@ -19417,11 +19420,11 @@ class GmailMoleViewDriver {
|
|
|
19417
19420
|
});
|
|
19418
19421
|
}
|
|
19419
19422
|
}
|
|
19420
|
-
(0,querySelectorOrFail/* default */.Z)(this
|
|
19423
|
+
(0,querySelectorOrFail/* default */.Z)(this.#element, '.inboxsdk__mole_view_content').appendChild(options.el);
|
|
19421
19424
|
}
|
|
19422
19425
|
show() {
|
|
19423
19426
|
const doShow = moleParent => {
|
|
19424
|
-
moleParent.insertBefore(this
|
|
19427
|
+
moleParent.insertBefore(this.#element, last_default()(moleParent.children));
|
|
19425
19428
|
const dw = findParent(moleParent, el => el.nodeName === 'DIV' && el.classList.contains('dw'));
|
|
19426
19429
|
if (dw) {
|
|
19427
19430
|
dw.classList.add('inboxsdk__moles_in_use', mole_view_module/* inboxsdkMolesInUse */.Y);
|
|
@@ -19431,7 +19434,7 @@ class GmailMoleViewDriver {
|
|
|
19431
19434
|
if (moleParent) {
|
|
19432
19435
|
doShow(moleParent);
|
|
19433
19436
|
} else {
|
|
19434
|
-
const moleParentReadyEvent = (0,stream_wait_for/* default */.Z)(() => gmail_element_getter/* default.getMoleParent */.Z.getMoleParent()).takeUntilBy(this
|
|
19437
|
+
const moleParentReadyEvent = (0,stream_wait_for/* default */.Z)(() => gmail_element_getter/* default.getMoleParent */.Z.getMoleParent()).takeUntilBy(this.#stopper).onValue(doShow);
|
|
19435
19438
|
// For some users, the mole parent element seems to be lazily loaded by
|
|
19436
19439
|
// Gmail only once the user has used a compose view or a thread view.
|
|
19437
19440
|
// If the gmail mode has settled, we've been loaded for 10 seconds, and
|
|
@@ -19439,10 +19442,10 @@ class GmailMoleViewDriver {
|
|
|
19439
19442
|
// by opening a compose view and then closing it.
|
|
19440
19443
|
kefir_esm.fromPromise(gmail_element_getter/* default.waitForGmailModeToSettle */.Z.waitForGmailModeToSettle()).flatMap(() => {
|
|
19441
19444
|
// delay until we've passed TimestampOnReady + 10 seconds
|
|
19442
|
-
return this.
|
|
19443
|
-
}).takeUntilBy(moleParentReadyEvent).takeUntilBy(this
|
|
19444
|
-
this.
|
|
19445
|
-
this.
|
|
19445
|
+
return this.#driver.delayToTimeAfterReady(10 * 1000);
|
|
19446
|
+
}).takeUntilBy(moleParentReadyEvent).takeUntilBy(this.#stopper).onValue(() => {
|
|
19447
|
+
this.#driver.getLogger().eventSdkActive('mole parent force load');
|
|
19448
|
+
this.#driver.openNewComposeViewDriver().then(gmailComposeView => {
|
|
19446
19449
|
gmailComposeView.close();
|
|
19447
19450
|
});
|
|
19448
19451
|
});
|
|
@@ -19450,55 +19453,55 @@ class GmailMoleViewDriver {
|
|
|
19450
19453
|
}
|
|
19451
19454
|
setMinimized(minimized) {
|
|
19452
19455
|
if (minimized) {
|
|
19453
|
-
this.
|
|
19454
|
-
this.
|
|
19456
|
+
this.#element.classList.add('inboxsdk__minimized');
|
|
19457
|
+
this.#eventStream.emit({
|
|
19455
19458
|
eventName: 'minimize'
|
|
19456
19459
|
});
|
|
19457
19460
|
} else {
|
|
19458
|
-
this.
|
|
19461
|
+
this.#element.classList.remove('inboxsdk__minimized');
|
|
19459
19462
|
|
|
19460
19463
|
// If the mole is off the left edge of the screen, then move it to the
|
|
19461
19464
|
// right.
|
|
19462
|
-
const moleParent = this.
|
|
19463
|
-
if (moleParent && this.
|
|
19464
|
-
moleParent.insertBefore(this
|
|
19465
|
+
const moleParent = this.#element.parentElement;
|
|
19466
|
+
if (moleParent && this.#element.getBoundingClientRect().left < 0) {
|
|
19467
|
+
moleParent.insertBefore(this.#element, last_default()(moleParent.children));
|
|
19465
19468
|
}
|
|
19466
|
-
this.
|
|
19469
|
+
this.#eventStream.emit({
|
|
19467
19470
|
eventName: 'restore'
|
|
19468
19471
|
});
|
|
19469
19472
|
}
|
|
19470
19473
|
}
|
|
19471
19474
|
getMinimized() {
|
|
19472
|
-
return this.
|
|
19475
|
+
return this.#element.classList.contains('inboxsdk__minimized');
|
|
19473
19476
|
}
|
|
19474
19477
|
setTitle(text) {
|
|
19475
|
-
const titleElement = this.
|
|
19478
|
+
const titleElement = this.#element.querySelector('.inboxsdk__mole_view_titlebar h2.inboxsdk__mole_default');
|
|
19476
19479
|
if (titleElement) {
|
|
19477
19480
|
titleElement.textContent = text;
|
|
19478
19481
|
}
|
|
19479
19482
|
}
|
|
19480
|
-
|
|
19481
|
-
const container = this.
|
|
19483
|
+
#setTitleEl(el) {
|
|
19484
|
+
const container = this.#element.querySelector('.inboxsdk__mole_view_titlebar h2.inboxsdk__mole_default');
|
|
19482
19485
|
if (container) {
|
|
19483
19486
|
container.textContent = '';
|
|
19484
19487
|
container.appendChild(el);
|
|
19485
19488
|
}
|
|
19486
19489
|
}
|
|
19487
|
-
|
|
19488
|
-
const container = this.
|
|
19490
|
+
#setMinimizedTitleEl(el) {
|
|
19491
|
+
const container = this.#element.querySelector('.inboxsdk__mole_view_titlebar h2.inboxsdk__mole_minimized');
|
|
19489
19492
|
if (container) {
|
|
19490
|
-
this.
|
|
19493
|
+
this.#element.classList.add('inboxsdk__mole_use_minimize_title');
|
|
19491
19494
|
container.textContent = '';
|
|
19492
19495
|
container.appendChild(el);
|
|
19493
19496
|
}
|
|
19494
19497
|
}
|
|
19495
19498
|
getEventStream() {
|
|
19496
|
-
return this
|
|
19499
|
+
return this.#eventStream;
|
|
19497
19500
|
}
|
|
19498
19501
|
destroy() {
|
|
19499
|
-
this.
|
|
19500
|
-
this.
|
|
19501
|
-
this.
|
|
19502
|
+
this.#element.remove();
|
|
19503
|
+
this.#eventStream.end();
|
|
19504
|
+
this.#stopper.destroy();
|
|
19502
19505
|
}
|
|
19503
19506
|
}
|
|
19504
19507
|
/* harmony default export */ const gmail_mole_view_driver = (GmailMoleViewDriver);
|