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