@inboxsdk/core 1.2.4 → 1.2.7
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 +4474 -463
- package/inboxsdk.js.map +1 -1
- package/package.json +1 -1
- package/pageWorld.js +1 -1
- package/pageWorld.js.map +1 -1
- package/src/common/load-script.d.ts +0 -6
- package/src/common/load-script.d.ts.map +1 -1
- package/src/inboxsdk-js/loading/platform-implementation-loader.d.ts.map +1 -1
- package/src/inboxsdk.d.ts +29 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/add-nav-item.d.ts +2 -2
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/add-nav-item.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/isIntegratedViewGmail.d.ts +6 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/isIntegratedViewGmail.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver.d.ts +2 -2
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-element-getter.d.ts +5 -0
- 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-attachment-card-view.d.ts +13 -5
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-attachment-card-view.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-nav-item-view.d.ts +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-nav-item-view.d.ts.map +1 -1
- package/src/platform-implementation-js/lib/inject-script-EMBEDDED.d.ts.map +1 -1
- package/src/platform-implementation-js/namespaces/conversations.d.ts +7 -0
- package/src/platform-implementation-js/namespaces/conversations.d.ts.map +1 -1
- package/src/platform-implementation-js/namespaces/nav-menu.d.ts +4 -2
- package/src/platform-implementation-js/namespaces/nav-menu.d.ts.map +1 -1
- package/src/platform-implementation-js/views/conversations/attachment-card-view.d.ts +12 -5
- package/src/platform-implementation-js/views/conversations/attachment-card-view.d.ts.map +1 -1
- package/src/platform-implementation-js/views/native-nav-item-view.d.ts +2 -1
- package/src/platform-implementation-js/views/native-nav-item-view.d.ts.map +1 -1
- package/src/build/exec.js +0 -26
- package/src/build/spawn.js +0 -17
- package/src/common/ajax.js +0 -90
- package/src/common/cachebust-url.js +0 -10
- package/src/common/censorHTMLstring.js +0 -37
- package/src/common/censorHTMLtree.js +0 -28
- package/src/common/censorJSONTree.js +0 -15
- package/src/common/connectivity-test.js +0 -21
- package/src/common/defer.js +0 -11
- package/src/common/find-parent.js +0 -10
- package/src/common/get-extension-id.js +0 -7
- package/src/common/get-or-fail.js +0 -8
- package/src/common/get-session-id.js +0 -14
- package/src/common/get-stack-trace.js +0 -6
- package/src/common/html-to-text.js +0 -7
- package/src/common/isElementVisible.js +0 -6
- package/src/common/load-script.js +0 -128
- package/src/common/log-error.js +0 -185
- package/src/common/quoted-split.js +0 -18
- package/src/common/rate-limit-queuer.js +0 -57
- package/src/common/rate-limit.js +0 -14
- package/src/common/version.js +0 -8
- package/src/inboxsdk-js/header.js +0 -19
- package/src/inboxsdk-js/inboxsdk-NONREMOTE-INTEGRATED-PAGEWORLD.js +0 -4
- package/src/inboxsdk-js/inboxsdk-NONREMOTE.js +0 -4
- package/src/inboxsdk-js/inboxsdk-REMOTE.js +0 -2
- package/src/inboxsdk-js/inboxsdk-TEST.js +0 -5
- package/src/inboxsdk-js/inboxsdk.js +0 -23
- package/src/inboxsdk-js/loading/load-platform-implementation-DEV.js +0 -14
- package/src/inboxsdk-js/loading/platform-implementation-loader.js +0 -31
- package/src/injected-js/gmail/constants.js +0 -2
- package/src/injected-js/gmail/modify-suggestions.js +0 -106
- package/src/injected-js/gmail/setup-gmail-interceptor.js +0 -936
- package/src/injected-js/gmail/setup-gmonkey-handler.js +0 -49
- package/src/injected-js/gmail/sync-compose-processor-20220909.js +0 -298
- package/src/injected-js/gmail/sync-compose-processor.js +0 -55
- package/src/injected-js/gmail/sync-compose-request-processor.js +0 -109
- package/src/injected-js/gmail/thread-identifier/click-and-get-popup-url.js +0 -71
- package/src/injected-js/gmail/thread-identifier/index.js +0 -133
- package/src/injected-js/gmail/thread-identifier/thread-row-parser.js +0 -61
- package/src/injected-js/injected-logger.js +0 -50
- package/src/injected-js/main.js +0 -49
- package/src/injected-js/message-metadata-holder.js +0 -103
- package/src/injected-js/setup-data-exposer.js +0 -135
- package/src/injected-js/setup-error-silencer.js +0 -15
- package/src/injected-js/setup-event-reemitter.js +0 -47
- package/src/injected-js/setupCustomViewEventAssassin.js +0 -90
- package/src/injected-js/setupInboxCustomViewLinkFixer.js +0 -24
- package/src/injected-js/setupPushStateListener.js +0 -14
- package/src/injected-js/xhr-helper.js +0 -43
- package/src/injected-js/xhr-proxy-factory.js +0 -537
- package/src/platform-implementation-js/constants/nav-item-types.js +0 -19
- package/src/platform-implementation-js/constants/router.js +0 -60
- package/src/platform-implementation-js/constants/toolbars.js +0 -5
- package/src/platform-implementation-js/dom-driver/gmail/gmail-butter-bar-driver.js +0 -158
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/add-app-menu-item.js +0 -20
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/add-collapsible-panel.js +0 -38
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/add-nav-item.js +0 -98
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/add-support-item.js +0 -4
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/add-toolbar-button-for-app.js +0 -14
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/create-link.js +0 -60
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/encodeDraftUrlId.js +0 -8
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/get-draft-id-for-message-id.js +0 -47
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/get-native-nav-item.js +0 -31
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/get-rfc-message-id-for-gmail-message-id.js +0 -12
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/get-rfc-message-id-for-gmail-thread-id.js +0 -33
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/get-url-object.js +0 -22
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/getSyncThreadForOldGmailThreadId.js +0 -18
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/getSyncThreadFromSyncThreadId.js +0 -57
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/gmail-load-event.js +0 -40
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/goto-view.js +0 -55
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/isIntegratedViewGmail.js +0 -14
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/keyboard-shortcut-help-modifier.js +0 -177
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/open-compose-window.js +0 -17
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/open-draft-by-message-id.js +0 -44
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/override-gmail-back-button.js +0 -49
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/register-search-query-rewriter.js +0 -18
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/register-search-suggestions-provider.js +0 -138
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/setup-compose-view-driver-stream.js +0 -112
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/setup-route-view-driver-stream.js +0 -152
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-app-id-warning.js +0 -21
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-custom-route-view.js +0 -48
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-custom-thread-list.js +0 -357
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-native-route-view.js +0 -19
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/suppressAddon.js +0 -36
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/temporary-track-download-url-validity.js +0 -36
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/thread-row-identifier.js +0 -85
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/track-events.js +0 -142
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/track-gmail-styles.js +0 -115
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/user-info.js +0 -50
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver.js +0 -723
- package/src/platform-implementation-js/dom-driver/gmail/gmail-element-getter/get-main-content-element-changed-stream.js +0 -38
- package/src/platform-implementation-js/dom-driver/gmail/gmail-element-getter/wait-for-gmail-mode-to-settle.js +0 -12
- package/src/platform-implementation-js/dom-driver/gmail/gmail-element-getter.js +0 -264
- package/src/platform-implementation-js/dom-driver/gmail/gmail-page-communicator.js +0 -201
- package/src/platform-implementation-js/dom-driver/gmail/gmail-response-processor.js +0 -532
- package/src/platform-implementation-js/dom-driver/gmail/gmail-sync-response-processor.js +0 -300
- package/src/platform-implementation-js/dom-driver/gmail/is-compose-titlebar-light-color.js +0 -21
- package/src/platform-implementation-js/dom-driver/gmail/make-xhr-interceptor.js +0 -92
- package/src/platform-implementation-js/dom-driver/gmail/makePageParserTree.js +0 -28
- package/src/platform-implementation-js/dom-driver/gmail/pageParserOptions.js +0 -19
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-menu-item-view.js +0 -129
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/index.js +0 -80
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/primary/add-companion-global-icon-area.js +0 -23
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/primary/add-companion-thread-icon-area.js +0 -26
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/primary/add-to-icon-area.js +0 -16
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/primary/index.js +0 -723
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-toolbar-button-view/monitor-top-banner-size-and-react.js +0 -24
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-toolbar-button-view.js +0 -172
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-attachment-area-view.js +0 -106
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-attachment-card-view.js +0 -328
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-backdrop.js +0 -22
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-collapsible-section-view.js +0 -720
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/add-button.js +0 -135
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/add-compose-notice.js +0 -50
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/add-recipient-row.js +0 -65
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/add-status-bar.js +0 -101
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/add-tooltip-to-button.js +0 -66
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/detectClassicRecipientsArea.js +0 -38
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/ensure-app-button-toolbars-are-closed.js +0 -10
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/ensure-grouping-is-open.js +0 -14
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/focus.js +0 -13
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/from-manager.js +0 -60
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-additional-action-toolbar.js +0 -54
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-address-changes-stream.js +0 -98
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-address-information-extractor.js +0 -28
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-body-changes-stream.js +0 -13
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-formatting-area-offset-left.js +0 -18
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-minimized-stream.js +0 -16
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-recipients.js +0 -22
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-response-type-changes-stream.js +0 -23
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/gmail-compose-button-view.js +0 -233
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/insert-link-into-body.js +0 -19
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/manage-button-grouping.js +0 -355
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/monitor-selection-range.js +0 -21
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/override-edit-subject.js +0 -63
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/page-parser.js +0 -223
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/position-formatting-toolbar.js +0 -19
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/set-recipients.js +0 -157
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/setupLinkPopovers.js +0 -109
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/size-fixer.js +0 -123
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/update-insert-more-area-left.js +0 -16
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view.js +0 -1542
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-message-view/attachment-icon.js +0 -4
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-message-view/get-updated-contact.js +0 -75
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-message-view.js +0 -737
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-nav-item-view.js +0 -763
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-route-view/gmail-route-processor.js +0 -103
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-route-view/gmail-route-view.js +0 -508
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-row-list-view.js +0 -236
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-support-item-view.js +0 -84
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-thread-row-view.js +0 -986
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-thread-view/width-manager.js +0 -26
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-thread-view.js +0 -658
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-toolbar-view.js +0 -459
- package/src/platform-implementation-js/dom-driver/gmail/views/native-gmail-nav-item-view.js +0 -265
- package/src/platform-implementation-js/dom-driver/gmail/widgets/buttons/button-color-classes.js +0 -33
- package/src/platform-implementation-js/dom-driver/gmail/widgets/buttons/button-view.js +0 -325
- package/src/platform-implementation-js/dom-driver/gmail/widgets/buttons/create-accessory-button-view.js +0 -61
- package/src/platform-implementation-js/dom-driver/gmail/widgets/buttons/create-parent-accessory-button-view.js +0 -58
- package/src/platform-implementation-js/dom-driver/gmail/widgets/buttons/inbox-dropdown-button-view.js +0 -23
- package/src/platform-implementation-js/dom-driver/gmail/widgets/buttons/modal-button-view.js +0 -101
- package/src/platform-implementation-js/dom-driver/gmail/widgets/buttons/more-dropdown-button-view.js +0 -30
- package/src/platform-implementation-js/dom-driver/gmail/widgets/buttons/more-parent-accessory-button-view.js +0 -10
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-action-button-view.js +0 -42
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-dropdown-view.js +0 -22
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-label-view.js +0 -112
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-modal-view-driver.js +0 -122
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-mole-view-driver.js +0 -194
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-tooltip-view.js +0 -352
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-top-message-bar-driver.js +0 -76
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-backdrop.js +0 -57
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-drawer-view.js +0 -291
- package/src/platform-implementation-js/driver-common/compose/getDiscardStream.js +0 -28
- package/src/platform-implementation-js/driver-common/compose/getPresendingStream.js +0 -46
- package/src/platform-implementation-js/driver-common/getAccountUrlPart.js +0 -17
- package/src/platform-implementation-js/driver-common/getGmailMessageIdForSyncMessageId.js +0 -17
- package/src/platform-implementation-js/driver-common/getGmailThreadIdForRfcMessageId.js +0 -44
- package/src/platform-implementation-js/driver-common/getOriginalMessagePage.js +0 -33
- package/src/platform-implementation-js/driver-common/getRfcMessageIdForSyncMessageId.js +0 -18
- package/src/platform-implementation-js/driver-common/getSyncThreadsForSearch.js +0 -49
- package/src/platform-implementation-js/driver-common/getThreadIdFromMessageId.js +0 -13
- package/src/platform-implementation-js/driver-common/gmailAjax.js +0 -65
- package/src/platform-implementation-js/driver-common/inboxAjax.js +0 -5
- package/src/platform-implementation-js/driver-common/render-custom-icon.js +0 -16
- package/src/platform-implementation-js/driver-common/requestGmailThread.js +0 -24
- package/src/platform-implementation-js/driver-common/sidebar/AppSidebar.js +0 -245
- package/src/platform-implementation-js/driver-common/sidebar/ContentPanelViewDriver.js +0 -144
- package/src/platform-implementation-js/driver-common/sidebar/constants.js +0 -26
- package/src/platform-implementation-js/driver-common/update-icon.js +0 -90
- package/src/platform-implementation-js/driver-interfaces/compose-view-driver.js +0 -1
- package/src/platform-implementation-js/driver-interfaces/driver.js +0 -1
- package/src/platform-implementation-js/driver-interfaces/mole-view-driver.js +0 -1
- package/src/platform-implementation-js/driver-interfaces/route-view-driver.js +0 -1
- package/src/platform-implementation-js/lib/ErrorCollector.js +0 -47
- package/src/platform-implementation-js/lib/Membrane.js +0 -22
- package/src/platform-implementation-js/lib/ScrollableContainByScreen.js +0 -30
- package/src/platform-implementation-js/lib/attemptWithRetries.js +0 -16
- package/src/platform-implementation-js/lib/common-page-communicator.js +0 -137
- package/src/platform-implementation-js/lib/copyAndValidateAutocompleteResults.js +0 -35
- package/src/platform-implementation-js/lib/css-selector-escape.js +0 -6
- package/src/platform-implementation-js/lib/delay-asap.js +0 -10
- package/src/platform-implementation-js/lib/delay-idle.js +0 -16
- package/src/platform-implementation-js/lib/dom/block-and-reemit-keyboard-events.js +0 -36
- package/src/platform-implementation-js/lib/dom/custom-events.js +0 -5
- package/src/platform-implementation-js/lib/dom/element-view-mapper.js +0 -9
- package/src/platform-implementation-js/lib/dom/generic-button-view.js +0 -39
- package/src/platform-implementation-js/lib/dom/get-insert-before-element.js +0 -39
- package/src/platform-implementation-js/lib/dom/get-selection.js +0 -30
- package/src/platform-implementation-js/lib/dom/insert-element-in-order.js +0 -38
- package/src/platform-implementation-js/lib/dom/insert-html-at-cursor.js +0 -83
- package/src/platform-implementation-js/lib/dom/is-node-in-range.js +0 -12
- package/src/platform-implementation-js/lib/dom/keyboard-shortcut-stream.js +0 -12
- package/src/platform-implementation-js/lib/dom/make-element-child-stream.js +0 -79
- package/src/platform-implementation-js/lib/dom/make-element-stream-merger.js +0 -27
- package/src/platform-implementation-js/lib/dom/make-element-view-stream.js +0 -15
- package/src/platform-implementation-js/lib/dom/make-mutation-observer-chunked-stream.js +0 -15
- package/src/platform-implementation-js/lib/dom/make-mutation-observer-stream.js +0 -5
- package/src/platform-implementation-js/lib/dom/on-mouse-down-and-up.js +0 -8
- package/src/platform-implementation-js/lib/dom/outsideClicksAndEscape.js +0 -38
- package/src/platform-implementation-js/lib/dom/parentNodes.js +0 -8
- package/src/platform-implementation-js/lib/dom/querySelectorOrFail.js +0 -6
- package/src/platform-implementation-js/lib/dom/reemitClickEventForReact.js +0 -22
- package/src/platform-implementation-js/lib/dom/set-css.js +0 -20
- package/src/platform-implementation-js/lib/dom/simulate-drag-and-drop.js +0 -88
- package/src/platform-implementation-js/lib/dom/simulate-key.js +0 -46
- package/src/platform-implementation-js/lib/dom/simulate-mouse-event.js +0 -16
- package/src/platform-implementation-js/lib/dom/trigger-relay-event.js +0 -7
- package/src/platform-implementation-js/lib/extract-contact-from-email-contact-string.js +0 -25
- package/src/platform-implementation-js/lib/fake-window-resize.js +0 -5
- package/src/platform-implementation-js/lib/from-event-target-capture.js +0 -12
- package/src/platform-implementation-js/lib/fromEventsWithOptions.js +0 -10
- package/src/platform-implementation-js/lib/handle-compose-link-chips.js +0 -124
- package/src/platform-implementation-js/lib/handler-registry.js +0 -67
- package/src/platform-implementation-js/lib/idMap.js +0 -40
- package/src/platform-implementation-js/lib/imageRequest.js +0 -8
- package/src/platform-implementation-js/lib/incrementName.js +0 -7
- package/src/platform-implementation-js/lib/inject-script-EMBEDDED.js +0 -8
- package/src/platform-implementation-js/lib/inject-script.js +0 -33
- package/src/platform-implementation-js/lib/insert-link-chip-into-body.js +0 -44
- package/src/platform-implementation-js/lib/is-valid-app-id.js +0 -27
- package/src/platform-implementation-js/lib/is-valid-email.js +0 -14
- package/src/platform-implementation-js/lib/isNotNil.js +0 -5
- package/src/platform-implementation-js/lib/isStreakAppId.js +0 -11
- package/src/platform-implementation-js/lib/logger.js +0 -439
- package/src/platform-implementation-js/lib/parseParamsFromRouteID.js +0 -10
- package/src/platform-implementation-js/lib/persistent-queue.js +0 -107
- package/src/platform-implementation-js/lib/populateRouteID.js +0 -17
- package/src/platform-implementation-js/lib/react/ElementContainer.js +0 -26
- package/src/platform-implementation-js/lib/routeIDmatchesHash.js +0 -8
- package/src/platform-implementation-js/lib/safe-event-emitter.js +0 -16
- package/src/platform-implementation-js/lib/stopper-pool.js +0 -41
- package/src/platform-implementation-js/lib/stream-wait-for.js +0 -30
- package/src/platform-implementation-js/lib/toItemWithLifetimeStream.js +0 -12
- package/src/platform-implementation-js/lib/toLiveSet.js +0 -22
- package/src/platform-implementation-js/lib/wait-for.js +0 -38
- package/src/platform-implementation-js/lib/waitForAsync.js +0 -18
- package/src/platform-implementation-js/main-INTEGRATED-PAGEWORLD.js +0 -5
- package/src/platform-implementation-js/main.js +0 -42
- package/src/platform-implementation-js/namespaces/app-menu.js +0 -81
- package/src/platform-implementation-js/namespaces/butter-bar.js +0 -163
- package/src/platform-implementation-js/namespaces/compose.js +0 -59
- package/src/platform-implementation-js/namespaces/conversations.js +0 -83
- package/src/platform-implementation-js/namespaces/global.js +0 -30
- package/src/platform-implementation-js/namespaces/keyboard.js +0 -30
- package/src/platform-implementation-js/namespaces/lists.js +0 -40
- package/src/platform-implementation-js/namespaces/modal.js +0 -43
- package/src/platform-implementation-js/namespaces/nav-menu.js +0 -33
- package/src/platform-implementation-js/namespaces/router.js +0 -139
- package/src/platform-implementation-js/namespaces/search.js +0 -29
- package/src/platform-implementation-js/namespaces/toolbars.js +0 -147
- package/src/platform-implementation-js/namespaces/user.js +0 -57
- package/src/platform-implementation-js/namespaces/widgets.js +0 -73
- package/src/platform-implementation-js/platform-implementation.js +0 -178
- package/src/platform-implementation-js/views/SimpleElementView.js +0 -16
- package/src/platform-implementation-js/views/app-menu-item-view.js +0 -442
- package/src/platform-implementation-js/views/app-toolbar-button-view.js +0 -43
- package/src/platform-implementation-js/views/collapsible-panel-view.js +0 -256
- package/src/platform-implementation-js/views/collapsible-section-view.js +0 -63
- package/src/platform-implementation-js/views/compose-button-view.js +0 -45
- package/src/platform-implementation-js/views/compose-view.js +0 -310
- package/src/platform-implementation-js/views/content-panel-view.js +0 -36
- package/src/platform-implementation-js/views/conversations/attachment-card-view.js +0 -41
- package/src/platform-implementation-js/views/conversations/custom-message-view.js +0 -117
- package/src/platform-implementation-js/views/conversations/message-view.js +0 -203
- package/src/platform-implementation-js/views/conversations/thread-view.js +0 -97
- package/src/platform-implementation-js/views/keyboard-shortcut-handle.js +0 -14
- package/src/platform-implementation-js/views/native-nav-item-view.js +0 -60
- package/src/platform-implementation-js/views/nav-item-view.js +0 -130
- package/src/platform-implementation-js/views/route-view/custom-route-view.js +0 -25
- package/src/platform-implementation-js/views/route-view/dummy-route-view-driver.js +0 -29
- package/src/platform-implementation-js/views/route-view/list-route-view.js +0 -46
- package/src/platform-implementation-js/views/route-view/route-view.js +0 -47
- package/src/platform-implementation-js/views/section-view.js +0 -60
- package/src/platform-implementation-js/views/thread-row-view.js +0 -90
- package/src/platform-implementation-js/widgets/buttons/basic-button-view-controller.js +0 -39
- package/src/platform-implementation-js/widgets/buttons/dropdown-button-view-controller.js +0 -98
- package/src/platform-implementation-js/widgets/buttons/dropdown-view.js +0 -121
- package/src/platform-implementation-js/widgets/drawer-view.js +0 -46
- package/src/platform-implementation-js/widgets/modal-view.js +0 -108
- package/src/platform-implementation-js/widgets/mole-view.js +0 -38
- package/src/platform-implementation-js/widgets/top-message-bar-view.js +0 -15
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import includes from 'lodash/includes';
|
|
2
|
-
// only used for constants
|
|
3
|
-
import { NATIVE_ROUTE_IDS, NATIVE_LIST_ROUTE_IDS, ROUTE_TYPES, } from '../../../../constants/router';
|
|
4
|
-
export default class GmailRouteProcessor {
|
|
5
|
-
_routeNameToRouteIDMap = null;
|
|
6
|
-
_routeNameToRouteIDMaps = null;
|
|
7
|
-
_compatibleRouteIDMap = null;
|
|
8
|
-
constructor() {
|
|
9
|
-
this._setupRouteNameToRouteIDMap();
|
|
10
|
-
this._setupCompatibleRouteIDMap();
|
|
11
|
-
}
|
|
12
|
-
NativeRouteIDs = NATIVE_ROUTE_IDS;
|
|
13
|
-
NativeListRouteIDs = NATIVE_LIST_ROUTE_IDS;
|
|
14
|
-
RouteTypes = ROUTE_TYPES;
|
|
15
|
-
isListRouteName(routeName) {
|
|
16
|
-
var routeID = this.getRouteID(routeName);
|
|
17
|
-
if (!routeID) {
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
return includes(Object.values(NATIVE_LIST_ROUTE_IDS), routeID);
|
|
21
|
-
}
|
|
22
|
-
isSettingsRouteName(routeName) {
|
|
23
|
-
return (this._routeNameToRouteIDMap[routeName] === this.NativeRouteIDs.SETTINGS);
|
|
24
|
-
}
|
|
25
|
-
isContactRouteName(routeName) {
|
|
26
|
-
return (this._routeNameToRouteIDMap[routeName] === this.NativeRouteIDs.CONTACTS ||
|
|
27
|
-
this._routeNameToRouteIDMap[routeName] === this.NativeRouteIDs.CONTACT);
|
|
28
|
-
}
|
|
29
|
-
getRouteID(routeName) {
|
|
30
|
-
var routeID = this._routeNameToRouteIDMap[routeName];
|
|
31
|
-
return routeID ? routeID : null;
|
|
32
|
-
}
|
|
33
|
-
getRouteName(routeID) {
|
|
34
|
-
for (var key in this._routeNameToRouteIDMaps) {
|
|
35
|
-
if (this._routeNameToRouteIDMap[key] === routeID) {
|
|
36
|
-
return key;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
isNativeRoute(routeName) {
|
|
42
|
-
return !!this._routeNameToRouteIDMap[routeName];
|
|
43
|
-
}
|
|
44
|
-
getCompatibleRouteID(routeID) {
|
|
45
|
-
return this._compatibleRouteIDMap[routeID] || routeID;
|
|
46
|
-
}
|
|
47
|
-
_setupRouteNameToRouteIDMap() {
|
|
48
|
-
this._routeNameToRouteIDMap = {
|
|
49
|
-
inbox: this.NativeRouteIDs.INBOX,
|
|
50
|
-
section_query: this.NativeRouteIDs.SEARCH,
|
|
51
|
-
all: this.NativeRouteIDs.ALL_MAIL,
|
|
52
|
-
imp: this.NativeRouteIDs.IMPORTANT,
|
|
53
|
-
contacts: this.NativeRouteIDs.CONTACTS,
|
|
54
|
-
contact: this.NativeRouteIDs.CONTACT,
|
|
55
|
-
sent: this.NativeRouteIDs.SENT,
|
|
56
|
-
starred: this.NativeRouteIDs.STARRED,
|
|
57
|
-
snoozed: this.NativeRouteIDs.SNOOZED,
|
|
58
|
-
drafts: this.NativeRouteIDs.DRAFTS,
|
|
59
|
-
label: this.NativeRouteIDs.LABEL,
|
|
60
|
-
category: this.NativeRouteIDs.LABEL,
|
|
61
|
-
search: this.NativeRouteIDs.SEARCH,
|
|
62
|
-
'advanced-search': this.NativeRouteIDs.SEARCH,
|
|
63
|
-
trash: this.NativeRouteIDs.TRASH,
|
|
64
|
-
spam: this.NativeRouteIDs.SPAM,
|
|
65
|
-
apps: this.NativeRouteIDs.SEARCH,
|
|
66
|
-
circle: this.NativeRouteIDs.LABEL,
|
|
67
|
-
settings: this.NativeRouteIDs.SETTINGS,
|
|
68
|
-
chats: this.NativeRouteIDs.CHATS,
|
|
69
|
-
// new Gmail stuff
|
|
70
|
-
scheduled: this.NativeRouteIDs.SCHEDULED,
|
|
71
|
-
// these are added as part of new gmail redesign -- FEB 2023
|
|
72
|
-
chat: this.NativeRouteIDs.CHAT_WELCOME,
|
|
73
|
-
rooms: this.NativeRouteIDs.SPACES_WELCOME,
|
|
74
|
-
calls: this.NativeRouteIDs.MEET,
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
_setupCompatibleRouteIDMap() {
|
|
78
|
-
this._compatibleRouteIDMap = {};
|
|
79
|
-
this._compatibleRouteIDMap[this.NativeRouteIDs.INBOX] = 'inbox/p:page';
|
|
80
|
-
this._compatibleRouteIDMap[this.NativeRouteIDs.ALL_MAIL] = 'all/p:page';
|
|
81
|
-
this._compatibleRouteIDMap[this.NativeRouteIDs.SENT] = 'sent/p:page';
|
|
82
|
-
this._compatibleRouteIDMap[this.NativeRouteIDs.STARRED] = 'starred/p:page';
|
|
83
|
-
this._compatibleRouteIDMap[this.NativeRouteIDs.DRAFTS] = 'drafts/p:page';
|
|
84
|
-
this._compatibleRouteIDMap[this.NativeRouteIDs.LABEL] =
|
|
85
|
-
'label/:labelName/p:page';
|
|
86
|
-
this._compatibleRouteIDMap[this.NativeRouteIDs.TRASH] = 'trash/p:page';
|
|
87
|
-
this._compatibleRouteIDMap[this.NativeRouteIDs.SPAM] = 'spam/p:page';
|
|
88
|
-
this._compatibleRouteIDMap[this.NativeRouteIDs.IMPORTANT] = 'imp/p:page';
|
|
89
|
-
this._compatibleRouteIDMap[this.NativeRouteIDs.SEARCH] =
|
|
90
|
-
'search/:query/p:page';
|
|
91
|
-
this._compatibleRouteIDMap[this.NativeRouteIDs.THREAD] =
|
|
92
|
-
this.NativeRouteIDs.THREAD;
|
|
93
|
-
this._compatibleRouteIDMap[this.NativeRouteIDs.CHATS] = 'chats/p:page';
|
|
94
|
-
this._compatibleRouteIDMap[this.NativeRouteIDs.CHAT] =
|
|
95
|
-
this.NativeRouteIDs.CHAT;
|
|
96
|
-
this._compatibleRouteIDMap[this.NativeRouteIDs.CONTACTS] =
|
|
97
|
-
'contacts/p:page';
|
|
98
|
-
this._compatibleRouteIDMap[this.NativeRouteIDs.CONTACT] =
|
|
99
|
-
this.NativeRouteIDs.CONTACT;
|
|
100
|
-
this._compatibleRouteIDMap[this.NativeRouteIDs.SETTINGS] =
|
|
101
|
-
this.NativeRouteIDs.SETTINGS;
|
|
102
|
-
}
|
|
103
|
-
}
|
package/src/platform-implementation-js/dom-driver/gmail/views/gmail-route-view/gmail-route-view.js
DELETED
|
@@ -1,508 +0,0 @@
|
|
|
1
|
-
import includes from 'lodash/includes';
|
|
2
|
-
import last from 'lodash/last';
|
|
3
|
-
import once from 'lodash/once';
|
|
4
|
-
import * as Kefir from 'kefir';
|
|
5
|
-
import kefirStopper from 'kefir-stopper';
|
|
6
|
-
import kefirBus from 'kefir-bus';
|
|
7
|
-
import { parse } from 'querystring';
|
|
8
|
-
import asap from 'asap';
|
|
9
|
-
import makeElementChildStream from '../../../../lib/dom/make-element-child-stream';
|
|
10
|
-
import makeElementViewStream from '../../../../lib/dom/make-element-view-stream';
|
|
11
|
-
import makeMutationObserverChunkedStream from '../../../../lib/dom/make-mutation-observer-chunked-stream';
|
|
12
|
-
import getInsertBeforeElement from '../../../../lib/dom/get-insert-before-element';
|
|
13
|
-
import GmailRowListView from '../gmail-row-list-view';
|
|
14
|
-
import GmailThreadView from '../gmail-thread-view';
|
|
15
|
-
import GmailCollapsibleSectionView from '../gmail-collapsible-section-view';
|
|
16
|
-
import GmailElementGetter from '../../gmail-element-getter';
|
|
17
|
-
import { simulateClick } from '../../../../lib/dom/simulate-mouse-event';
|
|
18
|
-
import querySelector from '../../../../lib/dom/querySelectorOrFail';
|
|
19
|
-
class GmailRouteView {
|
|
20
|
-
_type;
|
|
21
|
-
_hash;
|
|
22
|
-
_name;
|
|
23
|
-
_paramsArray;
|
|
24
|
-
_customRouteID;
|
|
25
|
-
_stopper = kefirStopper();
|
|
26
|
-
_rowListViews;
|
|
27
|
-
_gmailRouteProcessor;
|
|
28
|
-
_driver;
|
|
29
|
-
_eventStream;
|
|
30
|
-
_customViewElement;
|
|
31
|
-
_threadView;
|
|
32
|
-
_sectionsContainer;
|
|
33
|
-
_hasAddedCollapsibleSection;
|
|
34
|
-
_cachedRouteData;
|
|
35
|
-
constructor({ urlObject, type, routeID, cachedRouteData }, gmailRouteProcessor, driver) {
|
|
36
|
-
// Check we implement interface
|
|
37
|
-
this;
|
|
38
|
-
this._type = type;
|
|
39
|
-
this._hash = urlObject.hash;
|
|
40
|
-
this._name = urlObject.name;
|
|
41
|
-
this._paramsArray = urlObject.params;
|
|
42
|
-
this._customRouteID = routeID;
|
|
43
|
-
this._cachedRouteData = cachedRouteData;
|
|
44
|
-
this._stopper = kefirStopper();
|
|
45
|
-
this._rowListViews = [];
|
|
46
|
-
this._gmailRouteProcessor = gmailRouteProcessor;
|
|
47
|
-
this._driver = driver;
|
|
48
|
-
this._eventStream = kefirBus();
|
|
49
|
-
this._hasAddedCollapsibleSection = false;
|
|
50
|
-
if (this._type === 'CUSTOM') {
|
|
51
|
-
this._setupCustomViewElement();
|
|
52
|
-
driver
|
|
53
|
-
.getStopper()
|
|
54
|
-
.takeUntilBy(this._stopper.delay(0))
|
|
55
|
-
.onValue(() => {
|
|
56
|
-
driver.showNativeRouteView();
|
|
57
|
-
window.location.hash = '#inbox';
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
else if (includes(['NATIVE', 'CUSTOM_LIST'], this._type)) {
|
|
61
|
-
this._setupSubViews();
|
|
62
|
-
}
|
|
63
|
-
if (this._type === 'CUSTOM_LIST') {
|
|
64
|
-
Kefir.later(500, undefined)
|
|
65
|
-
.takeUntilBy(this._stopper)
|
|
66
|
-
.onValue(() => {
|
|
67
|
-
var last = driver.getLastCustomThreadListActivity();
|
|
68
|
-
if (!last ||
|
|
69
|
-
last.customRouteID !== this._customRouteID ||
|
|
70
|
-
Date.now() - last.timestamp > 5000) {
|
|
71
|
-
this.refresh();
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
destroy() {
|
|
77
|
-
this._stopper.destroy();
|
|
78
|
-
this._eventStream.end();
|
|
79
|
-
if (this._customViewElement) {
|
|
80
|
-
this._customViewElement.remove();
|
|
81
|
-
}
|
|
82
|
-
var rowListViews = this._rowListViews;
|
|
83
|
-
this._rowListViews = [];
|
|
84
|
-
rowListViews.forEach((view) => {
|
|
85
|
-
view.destroy();
|
|
86
|
-
});
|
|
87
|
-
if (this._threadView) {
|
|
88
|
-
this._threadView.destroy();
|
|
89
|
-
this._threadView = null;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
getHash() {
|
|
93
|
-
return this._hash;
|
|
94
|
-
}
|
|
95
|
-
getEventStream() {
|
|
96
|
-
return this._eventStream;
|
|
97
|
-
}
|
|
98
|
-
getStopper() {
|
|
99
|
-
return this._stopper;
|
|
100
|
-
}
|
|
101
|
-
getCustomViewElement() {
|
|
102
|
-
return this._customViewElement;
|
|
103
|
-
}
|
|
104
|
-
getRowListViews() {
|
|
105
|
-
return this._rowListViews;
|
|
106
|
-
}
|
|
107
|
-
getThreadView() {
|
|
108
|
-
return this._threadView;
|
|
109
|
-
}
|
|
110
|
-
getType() {
|
|
111
|
-
if (this._type === 'OTHER_APP_CUSTOM') {
|
|
112
|
-
return 'CUSTOM';
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
return this._type;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
isCustomRouteBelongingToApp() {
|
|
119
|
-
return this._type === 'CUSTOM';
|
|
120
|
-
}
|
|
121
|
-
getParams = once(() => {
|
|
122
|
-
let params;
|
|
123
|
-
if (this._customRouteID) {
|
|
124
|
-
params = this._getCustomParams();
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
params = this._getNativeParams();
|
|
128
|
-
const routeID = this.getRouteID();
|
|
129
|
-
if (routeID) {
|
|
130
|
-
const routeIDParams = this._extractParamKeysFromRouteID(routeID);
|
|
131
|
-
const routeParams = {};
|
|
132
|
-
routeIDParams.forEach(function (param) {
|
|
133
|
-
if (params[param]) {
|
|
134
|
-
routeParams[param] = params[param];
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
params = routeParams;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
return Object.freeze(params);
|
|
141
|
-
});
|
|
142
|
-
addCollapsibleSection(sectionDescriptorProperty, groupOrderHint) {
|
|
143
|
-
return this._addCollapsibleSection(sectionDescriptorProperty, groupOrderHint, true);
|
|
144
|
-
}
|
|
145
|
-
addSection(sectionDescriptorProperty, groupOrderHint) {
|
|
146
|
-
return this._addCollapsibleSection(sectionDescriptorProperty, groupOrderHint, false);
|
|
147
|
-
}
|
|
148
|
-
_addCollapsibleSection(collapsibleSectionDescriptorProperty, groupOrderHint, isCollapsible) {
|
|
149
|
-
this._hasAddedCollapsibleSection = true;
|
|
150
|
-
var gmailResultsSectionView = new GmailCollapsibleSectionView(this._driver, groupOrderHint, this.getRouteID() === this._gmailRouteProcessor.NativeRouteIDs.SEARCH, isCollapsible);
|
|
151
|
-
var sectionsContainer = this._getSectionsContainer();
|
|
152
|
-
gmailResultsSectionView
|
|
153
|
-
.getEventStream()
|
|
154
|
-
.filter(function (event) {
|
|
155
|
-
return event.type === 'update' && event.property === 'orderHint';
|
|
156
|
-
})
|
|
157
|
-
.onValue(function () {
|
|
158
|
-
var children = sectionsContainer.children;
|
|
159
|
-
var insertBeforeElement = getInsertBeforeElement(gmailResultsSectionView.getElement(), children, ['data-group-order-hint', 'data-order-hint']);
|
|
160
|
-
if (insertBeforeElement) {
|
|
161
|
-
sectionsContainer.insertBefore(gmailResultsSectionView.getElement(), insertBeforeElement);
|
|
162
|
-
}
|
|
163
|
-
else {
|
|
164
|
-
sectionsContainer.appendChild(gmailResultsSectionView.getElement());
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
gmailResultsSectionView.setCollapsibleSectionDescriptorProperty(collapsibleSectionDescriptorProperty);
|
|
168
|
-
return gmailResultsSectionView;
|
|
169
|
-
}
|
|
170
|
-
_setupCustomViewElement() {
|
|
171
|
-
this._customViewElement = document.createElement('div');
|
|
172
|
-
this._customViewElement.classList.add('inboxsdk__custom_view_element');
|
|
173
|
-
this._monitorLeftNavHeight();
|
|
174
|
-
this._setCustomViewElementHeight();
|
|
175
|
-
}
|
|
176
|
-
_monitorLeftNavHeight() {
|
|
177
|
-
var leftNav = GmailElementGetter.getLeftNavHeightElement();
|
|
178
|
-
if (!leftNav) {
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
makeMutationObserverChunkedStream(leftNav, {
|
|
182
|
-
attributes: true,
|
|
183
|
-
attributeFilter: ['style'],
|
|
184
|
-
})
|
|
185
|
-
.takeUntilBy(this._stopper)
|
|
186
|
-
.onValue(() => {
|
|
187
|
-
this._setCustomViewElementHeight();
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
_setCustomViewElementHeight() {
|
|
191
|
-
const leftNav = GmailElementGetter.getLeftNavHeightElement();
|
|
192
|
-
const gtalkButtons = GmailElementGetter.getGtalkButtons();
|
|
193
|
-
const customViewEl = this._customViewElement;
|
|
194
|
-
if (!leftNav || !customViewEl)
|
|
195
|
-
throw new Error('Should not happen');
|
|
196
|
-
const contentSectionElement = GmailElementGetter.getContentSectionElement();
|
|
197
|
-
const contentSectionElementBottomMargin = contentSectionElement
|
|
198
|
-
? parseInt(getComputedStyle(contentSectionElement).marginBottom, 10)
|
|
199
|
-
: 0;
|
|
200
|
-
customViewEl.style.height = `${parseInt(leftNav.style.height, 10) +
|
|
201
|
-
(gtalkButtons ? gtalkButtons.offsetHeight : 0) -
|
|
202
|
-
contentSectionElementBottomMargin}px`;
|
|
203
|
-
}
|
|
204
|
-
_setupSubViews() {
|
|
205
|
-
asap(() => {
|
|
206
|
-
if (!this._eventStream)
|
|
207
|
-
return;
|
|
208
|
-
this._setupRowListViews();
|
|
209
|
-
this._setupContentAndSidebarView();
|
|
210
|
-
this._setupScrollStream();
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
_setupRowListViews() {
|
|
214
|
-
var rowListElements = GmailElementGetter.getRowListElements();
|
|
215
|
-
Array.prototype.forEach.call(rowListElements, (rowListElement) => {
|
|
216
|
-
this._processRowListElement(rowListElement);
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
_processRowListElement(rowListElement) {
|
|
220
|
-
var rootElement = rowListElement.parentElement;
|
|
221
|
-
if (!rootElement)
|
|
222
|
-
throw new Error('no rootElement');
|
|
223
|
-
var gmailRowListView = new GmailRowListView(rootElement, this, this._driver);
|
|
224
|
-
this._rowListViews.push(gmailRowListView);
|
|
225
|
-
this._eventStream.emit({
|
|
226
|
-
eventName: 'newGmailRowListView',
|
|
227
|
-
view: gmailRowListView,
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
_setupContentAndSidebarView() {
|
|
231
|
-
const threadContainerElement = this._getThreadContainerElement();
|
|
232
|
-
if (threadContainerElement) {
|
|
233
|
-
var gmailThreadView = new GmailThreadView(threadContainerElement, this, this._driver);
|
|
234
|
-
this._threadView = gmailThreadView;
|
|
235
|
-
this._eventStream.emit({
|
|
236
|
-
eventName: 'newGmailThreadView',
|
|
237
|
-
view: gmailThreadView,
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
else {
|
|
241
|
-
// This element is always present in thread lists, but it only has contents
|
|
242
|
-
// when in preview pane mode. We want to monitor it in either case
|
|
243
|
-
// because the user could switch into preview pane mode.
|
|
244
|
-
const previewPaneContainer = document.querySelector('div[role=main] .aia');
|
|
245
|
-
if (previewPaneContainer) {
|
|
246
|
-
this._startMonitoringPreviewPaneForThread(previewPaneContainer);
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
_setupScrollStream() {
|
|
251
|
-
const SCROLL_DEBOUNCE_MS = 100;
|
|
252
|
-
const scrollContainer = GmailElementGetter.getScrollContainer();
|
|
253
|
-
const { scrollTop: cachedScrollTop } = this._cachedRouteData;
|
|
254
|
-
if (scrollContainer && this._hasAddedCollapsibleSection) {
|
|
255
|
-
if (cachedScrollTop) {
|
|
256
|
-
scrollContainer.scrollTop = cachedScrollTop;
|
|
257
|
-
}
|
|
258
|
-
Kefir.fromEvents(scrollContainer, 'scroll')
|
|
259
|
-
.throttle(SCROLL_DEBOUNCE_MS)
|
|
260
|
-
.map((e) => e.target.scrollTop)
|
|
261
|
-
.takeUntilBy(this._stopper)
|
|
262
|
-
.onValue((scrollTop) => {
|
|
263
|
-
this._cachedRouteData.scrollTop = scrollTop;
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
_startMonitoringPreviewPaneForThread(previewPaneContainer) {
|
|
268
|
-
const threadContainerTableElement = querySelector(previewPaneContainer, 'table.Bs > tr');
|
|
269
|
-
const elementStream = makeElementChildStream(threadContainerTableElement).filter((event) => !!event.el.querySelector('.if') ||
|
|
270
|
-
!!event.el.querySelector('.PeIF1d') ||
|
|
271
|
-
!!event.el.querySelector('.a98.iY'));
|
|
272
|
-
this._eventStream.plug(elementStream
|
|
273
|
-
.flatMap(makeElementViewStream((element) => new GmailThreadView(element, this, this._driver, true)))
|
|
274
|
-
.map((view) => {
|
|
275
|
-
this._threadView = view;
|
|
276
|
-
return {
|
|
277
|
-
eventName: 'newGmailThreadView',
|
|
278
|
-
view: view,
|
|
279
|
-
};
|
|
280
|
-
}));
|
|
281
|
-
}
|
|
282
|
-
_getSectionsContainer() {
|
|
283
|
-
const main = document.querySelector("div[role='main']");
|
|
284
|
-
if (!main)
|
|
285
|
-
throw new Error('should not happen');
|
|
286
|
-
let sectionsContainer = main.querySelector('.inboxsdk__custom_sections');
|
|
287
|
-
if (!sectionsContainer) {
|
|
288
|
-
sectionsContainer = this._sectionsContainer =
|
|
289
|
-
document.createElement('div');
|
|
290
|
-
sectionsContainer.classList.add('inboxsdk__custom_sections');
|
|
291
|
-
main.insertBefore(sectionsContainer, main.firstChild);
|
|
292
|
-
}
|
|
293
|
-
else if (sectionsContainer.classList.contains('Wc') &&
|
|
294
|
-
!this._isSearchRoute()) {
|
|
295
|
-
sectionsContainer.classList.remove('Wc');
|
|
296
|
-
}
|
|
297
|
-
return sectionsContainer;
|
|
298
|
-
}
|
|
299
|
-
_getCustomParams() {
|
|
300
|
-
var params = Object.create(null);
|
|
301
|
-
if (!this._customRouteID)
|
|
302
|
-
throw new Error("Should not happen, can't get custom params for non-custom view");
|
|
303
|
-
this._customRouteID
|
|
304
|
-
.split('/')
|
|
305
|
-
.slice(1)
|
|
306
|
-
.forEach((part, index) => {
|
|
307
|
-
if (part[0] !== ':') {
|
|
308
|
-
return;
|
|
309
|
-
}
|
|
310
|
-
part = part.substring(1);
|
|
311
|
-
if (this._paramsArray[index]) {
|
|
312
|
-
params[part] = this._paramsArray[index];
|
|
313
|
-
}
|
|
314
|
-
});
|
|
315
|
-
return params;
|
|
316
|
-
}
|
|
317
|
-
_getNativeParams() {
|
|
318
|
-
if (this._isSearchRoute()) {
|
|
319
|
-
return this._getSearchRouteParams();
|
|
320
|
-
}
|
|
321
|
-
else if (this._isListRoute()) {
|
|
322
|
-
return this._getListRouteParams();
|
|
323
|
-
}
|
|
324
|
-
else if (this._isThreadRoute()) {
|
|
325
|
-
return this._getThreadRouteParams();
|
|
326
|
-
}
|
|
327
|
-
else if (this._isSettingsRoute()) {
|
|
328
|
-
return this._getSettingsRouteParams();
|
|
329
|
-
}
|
|
330
|
-
return {};
|
|
331
|
-
}
|
|
332
|
-
_isSearchRoute() {
|
|
333
|
-
return (this.getRouteID() === this._gmailRouteProcessor.NativeRouteIDs.SEARCH);
|
|
334
|
-
}
|
|
335
|
-
/* FEB 2023 */
|
|
336
|
-
_isChatWelcomeRoute() {
|
|
337
|
-
return this._hash === this._gmailRouteProcessor.NativeRouteIDs.CHAT_WELCOME;
|
|
338
|
-
}
|
|
339
|
-
_isChatDmRoute() {
|
|
340
|
-
return (this._name === 'chat' &&
|
|
341
|
-
this._paramsArray?.[0] === 'dm' &&
|
|
342
|
-
!!this._paramsArray?.[1]);
|
|
343
|
-
}
|
|
344
|
-
_isSpacesWelcomeRoute() {
|
|
345
|
-
return (this._hash === this._gmailRouteProcessor.NativeRouteIDs.SPACES_WELCOME);
|
|
346
|
-
}
|
|
347
|
-
_isSpaceRoute() {
|
|
348
|
-
return (this._name === 'chat' &&
|
|
349
|
-
this._paramsArray?.[0] === 'space' &&
|
|
350
|
-
!!this._paramsArray?.[1]);
|
|
351
|
-
}
|
|
352
|
-
_isMeetRoute() {
|
|
353
|
-
return this._hash === this._gmailRouteProcessor.NativeRouteIDs.MEET;
|
|
354
|
-
}
|
|
355
|
-
/* end FEB 2023 */
|
|
356
|
-
getRouteType() {
|
|
357
|
-
if (includes(['CUSTOM', 'OTHER_APP_CUSTOM'], this._type)) {
|
|
358
|
-
return this._gmailRouteProcessor.RouteTypes.CUSTOM;
|
|
359
|
-
}
|
|
360
|
-
else if (this._isListRoute()) {
|
|
361
|
-
return this._gmailRouteProcessor.RouteTypes.LIST;
|
|
362
|
-
}
|
|
363
|
-
else if (this._isThreadRoute()) {
|
|
364
|
-
return this._gmailRouteProcessor.RouteTypes.THREAD;
|
|
365
|
-
}
|
|
366
|
-
else if (this._isSettingsRoute()) {
|
|
367
|
-
return this._gmailRouteProcessor.RouteTypes.SETTINGS;
|
|
368
|
-
}
|
|
369
|
-
else if (this._isChatWelcomeRoute() || this._isChatDmRoute()) {
|
|
370
|
-
return this._gmailRouteProcessor.RouteTypes.CHAT;
|
|
371
|
-
}
|
|
372
|
-
else if (this._isSpacesWelcomeRoute() || this._isSpaceRoute()) {
|
|
373
|
-
return this._gmailRouteProcessor.RouteTypes.SPACE;
|
|
374
|
-
}
|
|
375
|
-
else if (this._isMeetRoute()) {
|
|
376
|
-
return this._gmailRouteProcessor.RouteTypes.MEET;
|
|
377
|
-
}
|
|
378
|
-
return this._gmailRouteProcessor.RouteTypes.UNKNOWN;
|
|
379
|
-
}
|
|
380
|
-
_isThreadRoute() {
|
|
381
|
-
return !!this._getThreadContainerElement();
|
|
382
|
-
}
|
|
383
|
-
_isListRoute() {
|
|
384
|
-
var rowListElements = GmailElementGetter.getRowListElements();
|
|
385
|
-
return ((this._type === 'CUSTOM_LIST' ||
|
|
386
|
-
this._gmailRouteProcessor.isListRouteName(this._name)) &&
|
|
387
|
-
rowListElements &&
|
|
388
|
-
rowListElements.length > 0);
|
|
389
|
-
}
|
|
390
|
-
_isSettingsRoute() {
|
|
391
|
-
return this._gmailRouteProcessor.isSettingsRouteName(this._name);
|
|
392
|
-
}
|
|
393
|
-
_getSearchRouteParams() {
|
|
394
|
-
return {
|
|
395
|
-
query: this._paramsArray[0],
|
|
396
|
-
includesDriveResults: this._name === 'apps',
|
|
397
|
-
page: this._getPageParam(),
|
|
398
|
-
};
|
|
399
|
-
}
|
|
400
|
-
_getListRouteParams() {
|
|
401
|
-
var params = {
|
|
402
|
-
page: this._getPageParam(),
|
|
403
|
-
};
|
|
404
|
-
if (this.getRouteID() === this._gmailRouteProcessor.NativeRouteIDs.LABEL &&
|
|
405
|
-
this._paramsArray[0]) {
|
|
406
|
-
params.labelName = this._paramsArray[0];
|
|
407
|
-
}
|
|
408
|
-
return params;
|
|
409
|
-
}
|
|
410
|
-
_getThreadRouteParams() {
|
|
411
|
-
if (this._paramsArray && this._paramsArray.length > 0) {
|
|
412
|
-
const threadID = last(this._paramsArray);
|
|
413
|
-
if (threadID &&
|
|
414
|
-
(threadID.length === 16 || //for old hex style
|
|
415
|
-
threadID[0] === '#') //new sync style thread id
|
|
416
|
-
) {
|
|
417
|
-
return {
|
|
418
|
-
threadID: threadID.replace('#', ''),
|
|
419
|
-
};
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
const threadContainerElement = this._getThreadContainerElement();
|
|
423
|
-
let threadID;
|
|
424
|
-
if (threadContainerElement) {
|
|
425
|
-
try {
|
|
426
|
-
threadID = this._driver
|
|
427
|
-
.getPageCommunicator()
|
|
428
|
-
.getCurrentThreadID(threadContainerElement);
|
|
429
|
-
}
|
|
430
|
-
catch (err) {
|
|
431
|
-
// leave threadID null to be set below
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
if (!threadID) {
|
|
435
|
-
// Happens if gmonkey isn't available, like on a standalone thread page.
|
|
436
|
-
threadID = parse(document.location.search, null, null).th || '';
|
|
437
|
-
}
|
|
438
|
-
return {
|
|
439
|
-
threadID,
|
|
440
|
-
};
|
|
441
|
-
}
|
|
442
|
-
_getSettingsRouteParams() {
|
|
443
|
-
return {
|
|
444
|
-
tabName: this._paramsArray[0],
|
|
445
|
-
};
|
|
446
|
-
}
|
|
447
|
-
_getPageParam() {
|
|
448
|
-
for (var ii = 1; ii < this._paramsArray.length; ii++) {
|
|
449
|
-
if (this._paramsArray[ii].match(/p\d+/)) {
|
|
450
|
-
return parseInt(this._paramsArray[ii].replace(/[a-zA-Z]/, ''), 10);
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
return 1;
|
|
454
|
-
}
|
|
455
|
-
getRouteID() {
|
|
456
|
-
if (this._customRouteID) {
|
|
457
|
-
return this._customRouteID;
|
|
458
|
-
}
|
|
459
|
-
else if (this._isThreadRoute()) {
|
|
460
|
-
return this._gmailRouteProcessor.NativeRouteIDs.THREAD;
|
|
461
|
-
}
|
|
462
|
-
else if (this._isChatWelcomeRoute()) {
|
|
463
|
-
return this._gmailRouteProcessor.NativeRouteIDs.CHAT_WELCOME;
|
|
464
|
-
}
|
|
465
|
-
else if (this._isChatDmRoute()) {
|
|
466
|
-
return this._gmailRouteProcessor.NativeRouteIDs.CHAT_DM;
|
|
467
|
-
}
|
|
468
|
-
else if (this._isSpacesWelcomeRoute()) {
|
|
469
|
-
return this._gmailRouteProcessor.NativeRouteIDs.SPACES_WELCOME;
|
|
470
|
-
}
|
|
471
|
-
else if (this._isSpaceRoute()) {
|
|
472
|
-
return this._gmailRouteProcessor.NativeRouteIDs.SPACE;
|
|
473
|
-
}
|
|
474
|
-
else {
|
|
475
|
-
return this._gmailRouteProcessor.getRouteID(this._name);
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
// Used to click gmail refresh button in thread lists
|
|
479
|
-
refresh() {
|
|
480
|
-
var el = GmailElementGetter.getToolbarElement().querySelector('div.T-I.nu');
|
|
481
|
-
if (el) {
|
|
482
|
-
var prevActive = document.activeElement;
|
|
483
|
-
var prevClassName = el.className;
|
|
484
|
-
simulateClick(el);
|
|
485
|
-
el.className = prevClassName; // remove the gmail focus class
|
|
486
|
-
if (prevActive) {
|
|
487
|
-
prevActive.focus();
|
|
488
|
-
}
|
|
489
|
-
else {
|
|
490
|
-
el.blur();
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
/** @deprecated */
|
|
495
|
-
setFullWidth() {
|
|
496
|
-
// The setFullWidth method does not do anything in Gmail
|
|
497
|
-
}
|
|
498
|
-
_extractParamKeysFromRouteID(routeID) {
|
|
499
|
-
return routeID
|
|
500
|
-
.split('/')
|
|
501
|
-
.filter((part) => part[0] === ':')
|
|
502
|
-
.map((part) => part.substring(1));
|
|
503
|
-
}
|
|
504
|
-
_getThreadContainerElement = once(() => {
|
|
505
|
-
return GmailElementGetter.getThreadContainerElement();
|
|
506
|
-
});
|
|
507
|
-
}
|
|
508
|
-
export default GmailRouteView;
|