@inboxsdk/core 1.0.1 → 1.0.2
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 +5 -5
- package/inboxsdk.js.map +1 -1
- package/package.json +1 -1
- package/pageWorld.js.map +1 -1
- package/src/inboxsdk.d.ts +16 -1
- package/src/injected-js/gmail/modify-suggestions.d.ts +2 -0
- package/src/injected-js/gmail/modify-suggestions.d.ts.map +1 -1
- package/src/platform-implementation-js/constants/router.d.ts +5 -0
- package/src/platform-implementation-js/dom-driver/gmail/custom-style.d.ts +2 -0
- package/src/platform-implementation-js/dom-driver/gmail/custom-style.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/custom-style.js +16 -21
- package/src/platform-implementation-js/dom-driver/gmail/gmail-butter-bar-driver.d.ts +12 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-butter-bar-driver.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-butter-bar-driver.js +152 -187
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/add-app-menu-item.d.ts +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/add-app-menu-item.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/add-app-menu-item.js +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/add-toolbar-button-for-app.d.ts +5 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/add-toolbar-button-for-app.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/add-toolbar-button-for-app.js +15 -20
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/create-link.d.ts +4 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/create-link.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/create-link.js +59 -56
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/get-draft-id-for-message-id.d.ts +9 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/get-draft-id-for-message-id.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/get-draft-id-for-message-id.js +42 -54
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/get-native-nav-item.d.ts +4 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/get-native-nav-item.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/get-native-nav-item.js +31 -33
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/get-url-object.d.ts +8 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/get-url-object.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/get-url-object.js +21 -23
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/getSyncThreadForOldGmailThreadId.d.ts +4 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/getSyncThreadForOldGmailThreadId.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/getSyncThreadForOldGmailThreadId.js +19 -31
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/getSyncThreadFromSyncThreadId.d.ts +7 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/goto-view.d.ts +5 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/goto-view.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/goto-view.js +51 -60
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/keyboard-shortcut-help-modifier.d.ts +20 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/keyboard-shortcut-help-modifier.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/keyboard-shortcut-help-modifier.js +166 -130
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/open-compose-window.d.ts +3 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/open-compose-window.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/open-compose-window.js +17 -22
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/override-gmail-back-button.d.ts +4 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/override-gmail-back-button.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/override-gmail-back-button.js +44 -51
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/register-search-query-rewriter.d.ts +3 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/register-search-query-rewriter.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/register-search-query-rewriter.js +17 -22
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/register-search-suggestions-provider.d.ts +3 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/register-search-suggestions-provider.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/register-search-suggestions-provider.js +136 -129
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/setup-compose-view-driver-stream.d.ts +6 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/setup-compose-view-driver-stream.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/setup-compose-view-driver-stream.js +102 -95
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/setup-route-view-driver-stream.d.ts +6 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/setup-route-view-driver-stream.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/setup-route-view-driver-stream.js +144 -169
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-app-id-warning.d.ts +3 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-app-id-warning.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-app-id-warning.js +14 -23
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-custom-route-view.d.ts +3 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-custom-route-view.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-custom-route-view.js +41 -49
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-custom-thread-list.d.ts +5 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-custom-thread-list.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-custom-thread-list.js +286 -294
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-native-route-view.d.ts +3 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-native-route-view.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-native-route-view.js +19 -26
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/suppressAddon.d.ts +3 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/suppressAddon.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/suppressAddon.js +36 -42
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/temporary-track-download-url-validity.d.ts +3 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/temporary-track-download-url-validity.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/temporary-track-download-url-validity.js +34 -33
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/thread-row-identifier.d.ts +13 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/thread-row-identifier.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/thread-row-identifier.js +80 -81
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/track-events.d.ts +3 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/track-events.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/track-events.js +124 -81
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/user-info.d.ts +10 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/user-info.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/user-info.js +47 -54
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver.d.ts +183 -106
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver.js +712 -647
- package/src/platform-implementation-js/dom-driver/gmail/make-xhr-interceptor.d.ts +7 -0
- package/src/platform-implementation-js/dom-driver/gmail/make-xhr-interceptor.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/make-xhr-interceptor.js +93 -82
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/index.d.ts +7 -0
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-toolbar-button-view.d.ts +5 -0
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-backdrop.d.ts +11 -0
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-backdrop.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-backdrop.js +20 -32
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view.d.ts +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-message-view.d.ts +8 -0
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-route-view/gmail-route-processor.d.ts +8 -0
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-route-view/gmail-route-view.d.ts +3 -0
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-route-view/gmail-route-view.js +3 -1
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-row-list-view.d.ts +10 -0
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-thread-row-view.d.ts +5 -0
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-thread-view.d.ts +9 -0
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-toolbar-view.d.ts +12 -0
- package/src/platform-implementation-js/dom-driver/gmail/views/native-gmail-nav-item-view.d.ts +9 -0
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-modal-view-driver.d.ts +20 -0
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-modal-view-driver.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-modal-view-driver.js +107 -108
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-mole-view-driver.d.ts +16 -0
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-mole-view-driver.js +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-top-message-bar-driver.d.ts +13 -0
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-top-message-bar-driver.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-top-message-bar-driver.js +66 -66
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-drawer-view.d.ts +5 -0
- package/src/platform-implementation-js/driver-common/getGmailMessageIdForSyncMessageId.d.ts +6 -0
- package/src/platform-implementation-js/driver-common/getGmailThreadIdForRfcMessageId.d.ts +6 -0
- package/src/platform-implementation-js/driver-common/sidebar/ContentPanelViewDriver.d.ts +1 -0
- package/src/platform-implementation-js/driver-interfaces/driver.d.ts +3 -6
- package/src/platform-implementation-js/driver-interfaces/mole-view-driver.d.ts +27 -0
- package/src/platform-implementation-js/lib/copyAndValidateAutocompleteResults.d.ts +4 -0
- package/src/platform-implementation-js/lib/copyAndValidateAutocompleteResults.d.ts.map +1 -0
- package/src/platform-implementation-js/lib/copyAndValidateAutocompleteResults.js +34 -34
- package/src/platform-implementation-js/lib/dom/element-view-mapper.d.ts +10 -0
- package/src/platform-implementation-js/lib/dom/element-view-mapper.d.ts.map +1 -0
- package/src/platform-implementation-js/lib/dom/element-view-mapper.js +9 -17
- package/src/platform-implementation-js/lib/dom/on-mouse-down-and-up.d.ts +4 -0
- package/src/platform-implementation-js/lib/dom/on-mouse-down-and-up.d.ts.map +1 -0
- package/src/platform-implementation-js/lib/dom/on-mouse-down-and-up.js +7 -16
- package/src/platform-implementation-js/lib/populateRouteID.d.ts +6 -0
- package/src/platform-implementation-js/lib/rewriteCssWithIdMap.d.ts +2 -0
- package/src/platform-implementation-js/lib/rewriteCssWithIdMap.d.ts.map +1 -0
- package/src/platform-implementation-js/lib/rewriteCssWithIdMap.js +4 -11
- package/src/platform-implementation-js/lib/routeIDmatchesHash.d.ts +4 -0
- package/src/platform-implementation-js/lib/toLiveSet.d.ts +5 -0
- package/src/platform-implementation-js/lib/toLiveSet.d.ts.map +1 -0
- package/src/platform-implementation-js/lib/toLiveSet.js +22 -33
- package/src/platform-implementation-js/namespaces/router.d.ts +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/setup-route-view-driver-stream.test.js +0 -183
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-custom-thread-list.test.js +0 -218
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/user-info.test.js +0 -85
- package/src/platform-implementation-js/lib/rewriteCssWithIdMap.test.js +0 -43
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type * as Kefir from 'kefir';
|
|
2
|
+
import type {
|
|
3
|
+
MoleViewDriver,
|
|
4
|
+
MoleOptions,
|
|
5
|
+
} from '../../../driver-interfaces/mole-view-driver';
|
|
6
|
+
import GmailDriver from '../gmail-driver';
|
|
7
|
+
|
|
8
|
+
export default class GmailMoleViewDriver implements MoleViewDriver {
|
|
9
|
+
constructor(driver: GmailDriver, options: MoleOptions);
|
|
10
|
+
show(): void;
|
|
11
|
+
setTitle(title: string): void;
|
|
12
|
+
setMinimized(minimized: boolean): void;
|
|
13
|
+
getMinimized(): boolean;
|
|
14
|
+
getEventStream(): Kefir.Observable<any, unknown>;
|
|
15
|
+
destroy(): void;
|
|
16
|
+
}
|
|
@@ -15,7 +15,7 @@ var _streamWaitFor = _interopRequireDefault(require("../../../lib/stream-wait-fo
|
|
|
15
15
|
var _querySelectorOrFail = _interopRequireDefault(require("../../../lib/dom/querySelectorOrFail"));
|
|
16
16
|
var _findParent = _interopRequireDefault(require("../../../../common/find-parent"));
|
|
17
17
|
var _gmailElementGetter = _interopRequireDefault(require("../gmail-element-getter"));
|
|
18
|
-
var _isComposeTitlebarLightColor = _interopRequireDefault(require("
|
|
18
|
+
var _isComposeTitlebarLightColor = _interopRequireDefault(require("../is-compose-titlebar-light-color"));
|
|
19
19
|
class GmailMoleViewDriver {
|
|
20
20
|
constructor(driver, options) {
|
|
21
21
|
(0, _defineProperty2.default)(this, "_eventStream", (0, _kefirBus.default)());
|
package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-top-message-bar-driver.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as Kefir from 'kefir';
|
|
2
|
+
import type { Bus } from 'kefir-bus';
|
|
3
|
+
export default class GmailTopMessageBarDriver {
|
|
4
|
+
_element: HTMLElement | null | undefined;
|
|
5
|
+
_eventStream: Bus<any, unknown>;
|
|
6
|
+
_resizeObserver: ResizeObserver | null | undefined;
|
|
7
|
+
constructor(optionStream: Kefir.Observable<any, unknown>);
|
|
8
|
+
destroy(): void;
|
|
9
|
+
getEventStream(): Kefir.Observable<any, unknown>;
|
|
10
|
+
remove(): void;
|
|
11
|
+
setTopMessageBarHeight(): void;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=gmail-top-message-bar-driver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gmail-top-message-bar-driver.d.ts","sourceRoot":"","sources":["../../../../../../../src/platform-implementation-js/dom-driver/gmail/widgets/gmail-top-message-bar-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAGrC,MAAM,CAAC,OAAO,OAAO,wBAAwB;IAC3C,QAAQ,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;IACzC,YAAY,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAChC,eAAe,EAAE,cAAc,GAAG,IAAI,GAAG,SAAS,CAAC;gBAEvC,YAAY,EAAE,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC;IA+CxD,OAAO;IAoBP,cAAc,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC;IAIhD,MAAM;IAIN,sBAAsB;CAcvB"}
|
package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-top-message-bar-driver.js
CHANGED
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import kefirBus from 'kefir-bus';
|
|
2
|
+
import fakeWindowResize from '../../../lib/fake-window-resize';
|
|
3
|
+
export default class GmailTopMessageBarDriver {
|
|
4
|
+
_element;
|
|
5
|
+
_eventStream;
|
|
6
|
+
_resizeObserver;
|
|
7
|
+
constructor(optionStream) {
|
|
8
|
+
this._eventStream = kefirBus();
|
|
9
|
+
const ResizeObserver = global.ResizeObserver;
|
|
10
|
+
if (ResizeObserver) {
|
|
11
|
+
this._resizeObserver = new ResizeObserver(() => {
|
|
12
|
+
this.setTopMessageBarHeight();
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
optionStream
|
|
16
|
+
.takeUntilBy(this._eventStream.filter(() => false).beforeEnd(() => null))
|
|
17
|
+
.onValue((option) => {
|
|
18
|
+
if (!option) {
|
|
19
|
+
if (this._element) {
|
|
20
|
+
this._element.remove();
|
|
21
|
+
this._element = null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
else if (option) {
|
|
25
|
+
var element = this._element;
|
|
26
|
+
if (!element) {
|
|
27
|
+
element = this._element = document.createElement('div');
|
|
28
|
+
element.classList.add('inboxsdk__topMessageBar');
|
|
29
|
+
document.body.insertBefore(element, document.body.firstChild);
|
|
30
|
+
document.body.classList.add('inboxsdk__hasTopMessageBar');
|
|
31
|
+
fakeWindowResize();
|
|
32
|
+
}
|
|
33
|
+
if (option.el !== element.children[0]) {
|
|
34
|
+
element.innerHTML = '';
|
|
35
|
+
if (option.el) {
|
|
36
|
+
element.appendChild(option.el);
|
|
37
|
+
if (this._resizeObserver) {
|
|
38
|
+
this._resizeObserver.observe(element);
|
|
39
|
+
}
|
|
40
|
+
this.setTopMessageBarHeight();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
19
45
|
}
|
|
20
|
-
|
|
21
|
-
if (!option) {
|
|
46
|
+
destroy() {
|
|
22
47
|
if (this._element) {
|
|
23
|
-
|
|
24
|
-
|
|
48
|
+
this._element.remove();
|
|
49
|
+
this._element = null;
|
|
25
50
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
element = this._element = document.createElement('div');
|
|
30
|
-
element.classList.add('inboxsdk__topMessageBar');
|
|
31
|
-
document.body.insertBefore(element, document.body.firstChild);
|
|
32
|
-
document.body.classList.add('inboxsdk__hasTopMessageBar');
|
|
33
|
-
(0, _fakeWindowResize.default)();
|
|
51
|
+
this._eventStream.end();
|
|
52
|
+
if (this._resizeObserver) {
|
|
53
|
+
this._resizeObserver.disconnect();
|
|
34
54
|
}
|
|
35
|
-
if (
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (this._resizeObserver) {
|
|
40
|
-
this._resizeObserver.observe(element);
|
|
41
|
-
}
|
|
55
|
+
if (document.querySelectorAll('.inboxsdk__topMessageBar').length === 0) {
|
|
56
|
+
document.body.classList.remove('inboxsdk__hasTopMessageBar');
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
42
59
|
this.setTopMessageBarHeight();
|
|
43
|
-
}
|
|
44
60
|
}
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (this._element) {
|
|
50
|
-
this._element.remove();
|
|
51
|
-
this._element = null;
|
|
61
|
+
fakeWindowResize();
|
|
62
|
+
}
|
|
63
|
+
getEventStream() {
|
|
64
|
+
return this._eventStream;
|
|
52
65
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
this._resizeObserver.disconnect();
|
|
66
|
+
remove() {
|
|
67
|
+
this.destroy();
|
|
56
68
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
69
|
+
setTopMessageBarHeight() {
|
|
70
|
+
const topMessageBars = [
|
|
71
|
+
...document.querySelectorAll('.inboxsdk__topMessageBar'),
|
|
72
|
+
];
|
|
73
|
+
const height = topMessageBars.reduce((acc, currValue) => acc + currValue.offsetHeight, 0);
|
|
74
|
+
document.body.style.setProperty('--inboxsdk__topMessageBar-height', `${height}px`);
|
|
61
75
|
}
|
|
62
|
-
(0, _fakeWindowResize.default)();
|
|
63
|
-
}
|
|
64
|
-
getEventStream() {
|
|
65
|
-
return this._eventStream;
|
|
66
|
-
}
|
|
67
|
-
remove() {
|
|
68
|
-
this.destroy();
|
|
69
|
-
}
|
|
70
|
-
setTopMessageBarHeight() {
|
|
71
|
-
const topMessageBars = [...document.querySelectorAll('.inboxsdk__topMessageBar')];
|
|
72
|
-
const height = topMessageBars.reduce((acc, currValue) => acc + currValue.offsetHeight, 0);
|
|
73
|
-
document.body.style.setProperty('--inboxsdk__topMessageBar-height', `${height}px`);
|
|
74
|
-
}
|
|
75
76
|
}
|
|
76
|
-
exports.default = GmailTopMessageBarDriver;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default class ContentPanelViewDriver {}
|
|
@@ -13,10 +13,9 @@ import GmailSupportItemView, {
|
|
|
13
13
|
import { AppMenuItemDescriptor } from '../namespaces/app-menu';
|
|
14
14
|
import { GmailAppMenuItemView } from '../dom-driver/gmail/views/gmail-app-menu-item-view';
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
import GmailBackdrop from '../dom-driver/gmail/views/gmail-backdrop';
|
|
17
17
|
// import InboxBackdrop from '../dom-driver/inbox/views/inbox-backdrop';
|
|
18
|
-
|
|
19
|
-
export type Backdrop = any;
|
|
18
|
+
export type Backdrop = GmailBackdrop | any;
|
|
20
19
|
|
|
21
20
|
// import GmailThreadView from '../dom-driver/gmail/views/gmail-thread-view';
|
|
22
21
|
// import InboxThreadView from '../dom-driver/inbox/views/inbox-thread-view';
|
|
@@ -94,7 +93,7 @@ export interface Driver {
|
|
|
94
93
|
): GmailSupportItemView;
|
|
95
94
|
addAppMenuItem(
|
|
96
95
|
menuItemDescriptor: AppMenuItemDescriptor
|
|
97
|
-
): Promise<GmailAppMenuItemView>;
|
|
96
|
+
): Promise<GmailAppMenuItemView | undefined>;
|
|
98
97
|
getSentMailNativeNavItem(): Promise<any>;
|
|
99
98
|
createLink(a: any, b: any): any;
|
|
100
99
|
goto(routeID: string, params: any): Promise<void>;
|
|
@@ -125,8 +124,6 @@ export interface Driver {
|
|
|
125
124
|
|
|
126
125
|
getSelectedThreadRowViewDrivers(): ReadonlyArray<ThreadRowViewDriver>;
|
|
127
126
|
registerThreadRowViewSelectionHandler(handler: () => any): () => void;
|
|
128
|
-
|
|
129
|
-
getLoadEventDetails(): any;
|
|
130
127
|
}
|
|
131
128
|
|
|
132
129
|
export interface ButterBarDriver {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type * as Kefir from 'kefir';
|
|
2
|
+
|
|
3
|
+
export type MoleViewDriver = {
|
|
4
|
+
show(): void;
|
|
5
|
+
setTitle(title: string): void;
|
|
6
|
+
setMinimized(minimized: boolean): void;
|
|
7
|
+
getMinimized(): boolean;
|
|
8
|
+
getEventStream(): Kefir.Observable<any, unknown>;
|
|
9
|
+
destroy(): void;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type MoleButtonDescriptor = {
|
|
13
|
+
title: string;
|
|
14
|
+
iconUrl: string;
|
|
15
|
+
iconClass?: string;
|
|
16
|
+
onClick: Function;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type MoleOptions = {
|
|
20
|
+
el: HTMLElement;
|
|
21
|
+
className?: string;
|
|
22
|
+
title?: string;
|
|
23
|
+
titleEl?: HTMLElement;
|
|
24
|
+
minimizedTitleEl?: HTMLElement;
|
|
25
|
+
titleButtons?: MoleButtonDescriptor[];
|
|
26
|
+
chrome?: boolean;
|
|
27
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Driver } from '../driver-interfaces/driver';
|
|
2
|
+
import type { AutocompleteSearchResult } from '../../injected-js/gmail/modify-suggestions';
|
|
3
|
+
export default function copyAndValidateAutocompleteResults(driver: Driver, results: Array<AutocompleteSearchResult>): Array<AutocompleteSearchResult>;
|
|
4
|
+
//# sourceMappingURL=copyAndValidateAutocompleteResults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copyAndValidateAutocompleteResults.d.ts","sourceRoot":"","sources":["../../../../../src/platform-implementation-js/lib/copyAndValidateAutocompleteResults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AAE3F,MAAM,CAAC,OAAO,UAAU,kCAAkC,CACxD,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,KAAK,CAAC,wBAAwB,CAAC,GACvC,KAAK,CAAC,wBAAwB,CAAC,CA8CjC"}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = copyAndValidateAutocompleteResults;
|
|
7
|
-
function copyAndValidateAutocompleteResults(driver, results) {
|
|
8
|
-
if (!Array.isArray(results)) {
|
|
9
|
-
throw new Error('suggestions must be an array');
|
|
10
|
-
}
|
|
11
|
-
return results.map(result => {
|
|
12
|
-
const resultCopy = {
|
|
13
|
-
...result
|
|
14
|
-
};
|
|
15
|
-
if (typeof resultCopy.name !== 'string' && typeof resultCopy.nameHTML !== 'string') {
|
|
16
|
-
throw new Error('suggestion must have name or nameHTML property');
|
|
1
|
+
export default function copyAndValidateAutocompleteResults(driver, results) {
|
|
2
|
+
if (!Array.isArray(results)) {
|
|
3
|
+
throw new Error('suggestions must be an array');
|
|
17
4
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
driver.getLogger().deprecationWarning('AutocompleteSearchResult "iconURL" property', 'AutocompleteSearchResult.iconUrl');
|
|
24
|
-
if (!resultCopy.iconUrl) {
|
|
25
|
-
if (driver.getOpts().REQUESTED_API_VERSION === 1) {
|
|
26
|
-
resultCopy.iconUrl = iconURL;
|
|
27
|
-
} else {
|
|
28
|
-
// eslint-disable-next-line no-console
|
|
29
|
-
console.error('Support for iconURL property was dropped after API version 1');
|
|
5
|
+
return results.map((result) => {
|
|
6
|
+
const resultCopy = { ...result };
|
|
7
|
+
if (typeof resultCopy.name !== 'string' &&
|
|
8
|
+
typeof resultCopy.nameHTML !== 'string') {
|
|
9
|
+
throw new Error('suggestion must have name or nameHTML property');
|
|
30
10
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
11
|
+
if (typeof resultCopy.routeName !== 'string' &&
|
|
12
|
+
typeof resultCopy.externalURL !== 'string' &&
|
|
13
|
+
typeof resultCopy.searchTerm !== 'string' &&
|
|
14
|
+
typeof resultCopy.onClick !== 'function') {
|
|
15
|
+
throw new Error('suggestion must have routeName, externalURL, ' +
|
|
16
|
+
'searchTerm, or onClick property');
|
|
17
|
+
}
|
|
18
|
+
if (typeof resultCopy.iconURL === 'string') {
|
|
19
|
+
const iconURL = resultCopy.iconURL;
|
|
20
|
+
driver
|
|
21
|
+
.getLogger()
|
|
22
|
+
.deprecationWarning('AutocompleteSearchResult "iconURL" property', 'AutocompleteSearchResult.iconUrl');
|
|
23
|
+
if (!resultCopy.iconUrl) {
|
|
24
|
+
if (driver.getOpts().REQUESTED_API_VERSION === 1) {
|
|
25
|
+
resultCopy.iconUrl = iconURL;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
// eslint-disable-next-line no-console
|
|
29
|
+
console.error('Support for iconURL property was dropped after API version 1');
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
delete resultCopy.iconURL;
|
|
33
|
+
}
|
|
34
|
+
return resultCopy;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a function suitable for mapping over a stream returned from
|
|
3
|
+
* makeElementChildStream or kefirMakeElementChildStream. */
|
|
4
|
+
type View = {
|
|
5
|
+
destroy(): void;
|
|
6
|
+
};
|
|
7
|
+
import type { ElementWithLifetime } from './make-element-child-stream';
|
|
8
|
+
export default function elementViewMapper<T extends View>(viewFn: (el: HTMLElement) => T): (event: ElementWithLifetime) => T;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=element-view-mapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element-view-mapper.d.ts","sourceRoot":"","sources":["../../../../../../src/platform-implementation-js/lib/dom/element-view-mapper.ts"],"names":[],"mappings":"AAAA;;4DAE4D;AAC5D,KAAK,IAAI,GAAG;IAAE,OAAO,IAAI,IAAI,CAAA;CAAE,CAAC;AAChC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAEvE,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,CAAC,SAAS,IAAI,EACtD,MAAM,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,CAAC,GAC7B,CAAC,KAAK,EAAE,mBAAmB,KAAK,CAAC,CAQnC"}
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return event => {
|
|
11
|
-
const view = viewFn(event.el);
|
|
12
|
-
event.removalStream.take(1).onValue(() => {
|
|
13
|
-
view.destroy();
|
|
14
|
-
});
|
|
15
|
-
return view;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
1
|
+
export default function elementViewMapper(viewFn) {
|
|
2
|
+
return (event) => {
|
|
3
|
+
const view = viewFn(event.el);
|
|
4
|
+
event.removalStream.take(1).onValue(() => {
|
|
5
|
+
view.destroy();
|
|
6
|
+
});
|
|
7
|
+
return view;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"on-mouse-down-and-up.d.ts","sourceRoot":"","sources":["../../../../../../src/platform-implementation-js/lib/dom/on-mouse-down-and-up.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,QAAA,MAAM,gBAAgB,OAEU,WAAW,KAAG,MAAM,UAAU,CAAC,KAAK,EAAE,OAAO,CAM5E,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import fromEventTargetCapture from '../from-event-target-capture';
|
|
2
|
+
import { defn } from 'ud';
|
|
3
|
+
const pageMouseUps = fromEventTargetCapture(document.body, 'mouseup');
|
|
4
|
+
const onMouseDownAndUp = defn(module, function onMouseDownAndUp(el) {
|
|
5
|
+
const elMouseDowns = fromEventTargetCapture(el, 'mousedown');
|
|
6
|
+
return elMouseDowns.flatMapLatest(() => pageMouseUps.take(1).filter((event) => el.contains(event.target)));
|
|
6
7
|
});
|
|
7
|
-
|
|
8
|
-
var _fromEventTargetCapture = _interopRequireDefault(require("../from-event-target-capture"));
|
|
9
|
-
var _ud = require("ud");
|
|
10
|
-
const Kefir = require('kefir');
|
|
11
|
-
const pageMouseUps = (0, _fromEventTargetCapture.default)(document.body, 'mouseup');
|
|
12
|
-
const onMouseDownAndUp = (0, _ud.defn)(module, function onMouseDownAndUp(el) {
|
|
13
|
-
const elMouseDowns = (0, _fromEventTargetCapture.default)(el, 'mousedown');
|
|
14
|
-
return elMouseDowns.flatMapLatest(() => pageMouseUps.take(1).filter(event => el.contains(event.target)));
|
|
15
|
-
});
|
|
16
|
-
var _default = onMouseDownAndUp;
|
|
17
|
-
exports.default = _default;
|
|
8
|
+
export default onMouseDownAndUp;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rewriteCssWithIdMap.d.ts","sourceRoot":"","sources":["../../../../../src/platform-implementation-js/lib/rewriteCssWithIdMap.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAKrE"}
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = rewriteCssWithIdMap;
|
|
8
|
-
var _idMap = _interopRequireDefault(require("./idMap"));
|
|
9
|
-
function rewriteCssWithIdMap(cssSource) {
|
|
10
|
-
return cssSource.replace(/\.IDMAP_([-a-zA-Z0-9_]+)/g, (match, classname) => `.${(0, _idMap.default)(classname)}`);
|
|
11
|
-
}
|
|
1
|
+
import idMap from './idMap';
|
|
2
|
+
export default function rewriteCssWithIdMap(cssSource) {
|
|
3
|
+
return cssSource.replace(/\.IDMAP_([-a-zA-Z0-9_]+)/g, (match, classname) => `.${idMap(classname)}`);
|
|
4
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import LiveSet from 'live-set';
|
|
2
|
+
import * as Kefir from 'kefir';
|
|
3
|
+
import type { ItemWithLifetime } from './dom/make-element-child-stream';
|
|
4
|
+
export default function toLiveSet<T>(itemWithLifetimeStream: Kefir.Observable<ItemWithLifetime<T>, unknown>): LiveSet<T>;
|
|
5
|
+
//# sourceMappingURL=toLiveSet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toLiveSet.d.ts","sourceRoot":"","sources":["../../../../../src/platform-implementation-js/lib/toLiveSet.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,UAAU,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,CAAC,EACjC,sBAAsB,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,GACrE,OAAO,CAAC,CAAC,CAAC,CAsBZ"}
|
|
@@ -1,33 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
removalStream.take(1).onValue(() => {
|
|
24
|
-
controller.remove(el);
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
return () => {
|
|
29
|
-
sub.unsubscribe();
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
}
|
|
1
|
+
import LiveSet from 'live-set';
|
|
2
|
+
export default function toLiveSet(itemWithLifetimeStream) {
|
|
3
|
+
return new LiveSet({
|
|
4
|
+
read() {
|
|
5
|
+
throw new Error('should not happen; liveset was inactive');
|
|
6
|
+
},
|
|
7
|
+
listen(setValues, controller) {
|
|
8
|
+
setValues(new Set());
|
|
9
|
+
const sub = itemWithLifetimeStream.observe({
|
|
10
|
+
value({ el, removalStream }) {
|
|
11
|
+
controller.add(el);
|
|
12
|
+
removalStream.take(1).onValue(() => {
|
|
13
|
+
controller.remove(el);
|
|
14
|
+
});
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
return () => {
|
|
18
|
+
sub.unsubscribe();
|
|
19
|
+
};
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type RouteParams = { [ix: string]: string | number };
|