@inboxsdk/core 0.2.28-alpha.4 → 0.2.28-alpha.6
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 +1 -1
- package/package.json +5 -1
- package/src/inboxsdk-js/check-requirements.js +7 -3
- package/src/inboxsdk-js/header.js +1 -0
- package/src/inboxsdk-js/inboxsdk-NONREMOTE-INTEGRATED-PAGEWORLD.js +5 -6
- package/src/inboxsdk-js/inboxsdk-NONREMOTE.js +4 -3
- package/src/inboxsdk-js/inboxsdk-REMOTE.js +3 -1
- package/src/inboxsdk-js/inboxsdk-TEST.js +4 -3
- package/src/inboxsdk-js/inboxsdk.js +33 -39
- package/src/inboxsdk-js/loading/load-platform-implementation-DEV.js +15 -18
- package/src/inboxsdk.d.ts +2 -0
- package/src/injected-js/gmail/modify-suggestions.test.js +8 -9
- package/src/injected-js/gmail/setup-gmail-interceptor.js +340 -579
- package/src/injected-js/gmail/sync-compose-request-processor.test.js +39 -49
- package/src/injected-js/gmail/thread-identifier/click-and-get-popup-url.js +20 -33
- package/src/injected-js/gmail/thread-identifier/index.js +57 -93
- package/src/injected-js/gmail/thread-identifier/thread-row-parser.js +22 -31
- package/src/injected-js/gmail/thread-identifier/thread-row-parser.test.js +12 -28
- package/src/injected-js/inbox/setupAjaxInterceptor.js +64 -121
- package/src/injected-js/inbox/setupClickAndGetNewIframeSrc.js +53 -66
- package/src/injected-js/inbox/setupComposeViewDraftIDFinder.js +20 -36
- package/src/injected-js/inbox/setupInboxFakeWindowResizeListener.js +13 -13
- package/src/injected-js/main.js +11 -24
- package/src/injected-js/message-metadata-holder.js +52 -82
- package/src/injected-js/setup-data-exposer.js +89 -148
- package/src/injected-js/setup-error-silencer.js +21 -21
- package/src/injected-js/setup-event-reemitter.js +30 -22
- package/src/injected-js/setupInboxCustomViewLinkFixer.js +24 -29
- package/src/injected-js/setupPushStateListener.js +18 -11
- package/src/injected-js/xhr-helper.js +62 -65
- package/src/injected-js/xhr-proxy-factory.js +195 -445
- package/src/injected-js/xhr-proxy-factory.test.js +824 -991
- package/src/platform-implementation-js/constants/router.js +14 -9
- package/src/platform-implementation-js/constants/toolbars.js +8 -3
- package/src/platform-implementation-js/dom-driver/gmail/custom-style.js +13 -13
- package/src/platform-implementation-js/dom-driver/gmail/gmail-butter-bar-driver.js +115 -136
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/add-toolbar-button-for-app.js +13 -14
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/create-link.js +27 -48
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/get-draft-id-for-message-id.js +31 -42
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/get-native-nav-item.js +30 -40
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/get-url-object.js +10 -18
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/getSyncThreadForOldGmailThreadId.js +21 -28
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/getSyncThreadFromSyncThreadId.js +33 -45
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/gmail-load-event.js +31 -49
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/goto-view.js +58 -65
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/keyboard-shortcut-help-modifier.js +40 -124
- 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/open-draft-by-message-id.test.js +10 -11
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/override-gmail-back-button.js +44 -80
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/register-search-query-rewriter.js +19 -26
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/register-search-suggestions-provider.js +71 -147
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/setup-compose-view-driver-stream.js +91 -148
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/setup-route-view-driver-stream.js +150 -166
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/setup-route-view-driver-stream.test.js +70 -120
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-app-id-warning.js +15 -15
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-custom-route-view.js +44 -67
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-custom-thread-list.js +230 -379
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-custom-thread-list.test.js +121 -307
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/show-native-route-view.js +17 -24
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/suppressAddon.js +41 -49
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/temporary-track-download-url-validity.js +30 -40
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/thread-row-identifier.js +28 -60
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/track-events.js +61 -133
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/user-info.js +30 -42
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/user-info.test.js +52 -46
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver.js +354 -694
- package/src/platform-implementation-js/dom-driver/gmail/make-xhr-interceptor.js +77 -93
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/index.js +35 -82
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/index.test.js +44 -94
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/primary/add-companion-global-icon-area.js +12 -19
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/primary/add-companion-thread-icon-area.js +17 -29
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/primary/add-to-icon-area.js +26 -26
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-sidebar-view/primary/index.js +391 -797
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-toolbar-button-view/monitor-top-banner-size-and-react.js +7 -9
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-app-toolbar-button-view.js +60 -109
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-attachment-area-view.js +95 -135
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-attachment-card-view.js +103 -211
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-attachment-card-view.test.js +61 -61
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-backdrop.js +17 -17
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-collapsible-section-view.js +188 -541
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/add-button.js +67 -135
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/add-compose-notice.js +27 -49
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/add-inner-sidebar.js +7 -13
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/add-outer-sidebar.js +9 -22
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/add-recipient-row.js +36 -63
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/add-tooltip-to-button.js +38 -113
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/ensure-app-button-toolbars-are-closed.js +11 -16
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/ensure-grouping-is-open.js +11 -17
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/focus.js +8 -11
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/from-manager.js +27 -47
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-additional-action-toolbar.js +11 -24
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-address-changes-stream.js +59 -111
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-body-changes-stream.js +15 -14
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-formatting-area-offset-left.js +11 -17
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-minimized-stream.js +18 -24
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/get-response-type-changes-stream.js +19 -23
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/insert-link-into-body.js +11 -19
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/manage-button-grouping.js +141 -376
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/monitor-selection-range.js +17 -28
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/override-edit-subject.js +34 -70
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/position-formatting-toolbar.js +10 -17
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/size-fixer.js +83 -137
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view/update-insert-more-area-left.js +10 -19
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-compose-view.js +632 -1190
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-message-view/get-updated-contact.js +29 -38
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-message-view.js +327 -617
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-route-view/gmail-route-processor.js +26 -49
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-route-view/gmail-route-view.js +188 -380
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-row-list-view.js +104 -194
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-thread-row-view.js +382 -811
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-thread-sidebar-view/add-icon-area.js +34 -58
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-thread-sidebar-view.js +330 -581
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-thread-sidebar-view.test.js +123 -277
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-thread-view/width-manager.js +15 -35
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-thread-view.js +216 -571
- package/src/platform-implementation-js/dom-driver/gmail/views/gmail-toolbar-view.js +152 -336
- package/src/platform-implementation-js/dom-driver/gmail/views/native-gmail-nav-item-view.js +87 -211
- package/src/platform-implementation-js/dom-driver/gmail/widgets/buttons/inbox-dropdown-button-view.js +10 -11
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-action-button-view.js +20 -29
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-label-view.js +41 -76
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-modal-view-driver.js +45 -99
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-mole-view-driver.js +76 -128
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-tooltip-view.js +128 -319
- package/src/platform-implementation-js/dom-driver/gmail/widgets/gmail-top-message-bar-driver.js +45 -78
- package/src/platform-implementation-js/dom-driver/inbox/__mocks__/getSidebarClassnames.js +8 -4
- package/src/platform-implementation-js/dom-driver/inbox/addNavItem.js +36 -54
- package/src/platform-implementation-js/dom-driver/inbox/addRecipientRow.js +35 -53
- package/src/platform-implementation-js/dom-driver/inbox/createLink.js +13 -15
- package/src/platform-implementation-js/dom-driver/inbox/createLink.test.js +15 -18
- package/src/platform-implementation-js/dom-driver/inbox/custom-style.js +14 -13
- package/src/platform-implementation-js/dom-driver/inbox/detection/appToolbarLocation/parser.js +14 -20
- package/src/platform-implementation-js/dom-driver/inbox/detection/attachmentCard/parser.js +14 -13
- package/src/platform-implementation-js/dom-driver/inbox/detection/attachmentOverlay/parser.js +35 -67
- package/src/platform-implementation-js/dom-driver/inbox/detection/chatSidebar/parser.js +16 -18
- package/src/platform-implementation-js/dom-driver/inbox/detection/compose/parser.js +68 -185
- package/src/platform-implementation-js/dom-driver/inbox/detection/message/parser.js +28 -56
- package/src/platform-implementation-js/dom-driver/inbox/detection/nativeDrawer/parser.js +12 -10
- package/src/platform-implementation-js/dom-driver/inbox/detection/searchBar/parser.js +16 -16
- package/src/platform-implementation-js/dom-driver/inbox/detection/thread/parser.js +24 -35
- package/src/platform-implementation-js/dom-driver/inbox/detection/thread-row/parser.js +37 -89
- package/src/platform-implementation-js/dom-driver/inbox/getComposeViewDriverLiveSet.js +56 -78
- package/src/platform-implementation-js/dom-driver/inbox/getInboxMessageIdForInboxThreadId.js +26 -32
- package/src/platform-implementation-js/dom-driver/inbox/getSidebarClassnames.js +52 -109
- package/src/platform-implementation-js/dom-driver/inbox/getSidebarClassnames.test.js +7 -8
- package/src/platform-implementation-js/dom-driver/inbox/gotoView.js +16 -20
- package/src/platform-implementation-js/dom-driver/inbox/gotoView.test.js +15 -16
- package/src/platform-implementation-js/dom-driver/inbox/inbox-butter-bar-driver.js +75 -83
- package/src/platform-implementation-js/dom-driver/inbox/inbox-driver.js +530 -822
- package/src/platform-implementation-js/dom-driver/inbox/inbox-page-communicator.js +48 -61
- package/src/platform-implementation-js/dom-driver/inbox/inboxResponseProcessor.js +9 -12
- package/src/platform-implementation-js/dom-driver/inbox/inboxResponseProcessor.test.js +12 -19
- package/src/platform-implementation-js/dom-driver/inbox/makePageParserTree.js +24 -33
- package/src/platform-implementation-js/dom-driver/inbox/pageParserOptions.js +201 -388
- package/src/platform-implementation-js/dom-driver/inbox/registerSearchSuggestionsProvider.js +249 -265
- package/src/platform-implementation-js/dom-driver/inbox/setupCustomAutocompleteSelectionHandling.js +84 -152
- package/src/platform-implementation-js/dom-driver/inbox/setupRouteViewDriverStream.js +55 -67
- package/src/platform-implementation-js/dom-driver/inbox/setupRouteViewDriverStream.test.js +43 -65
- package/src/platform-implementation-js/dom-driver/inbox/views/InboxLabelView.js +31 -56
- package/src/platform-implementation-js/dom-driver/inbox/views/InboxMoleViewDriver.js +191 -294
- package/src/platform-implementation-js/dom-driver/inbox/views/InboxToolbarButtonView.js +32 -45
- package/src/platform-implementation-js/dom-driver/inbox/views/InboxToolbarView.js +21 -39
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-app-sidebar-view.js +153 -240
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-app-toolbar-button-view.js +75 -150
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-app-toolbar-tooltip-view.js +20 -37
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-attachment-card-view.js +60 -114
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-attachment-overlay-view.js +47 -65
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-backdrop.js +41 -52
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-chat-sidebar-view.js +27 -36
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-compose-button-view.js +52 -80
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-compose-view.js +465 -649
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-custom-route-view.js +37 -58
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-custom-route-view.test.js +14 -26
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-drawer-view.js +118 -235
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-dropdown-view.js +10 -11
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-dummy-route-view.js +28 -46
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-message-view.js +131 -202
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-modal-view.js +40 -80
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-route-view.js +35 -61
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-thread-row-view.js +124 -221
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-thread-view.js +125 -213
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-thread-view.test.js +104 -126
- package/src/platform-implementation-js/dom-driver/inbox/views/inbox-tooltip-view.js +36 -51
- package/src/platform-implementation-js/dom-driver/inbox/views/inboxNavItemView.js +158 -297
- package/src/platform-implementation-js/dom-driver/inbox/waitForAnimationClickBlockerGone.js +21 -35
- package/src/platform-implementation-js/driver-common/compose/getDiscardStream.js +24 -43
- package/src/platform-implementation-js/driver-common/compose/getPresendingStream.js +39 -68
- package/src/platform-implementation-js/driver-common/getGmailMessageIdForSyncMessageId.js +14 -19
- package/src/platform-implementation-js/driver-common/getGmailThreadIdForRfcMessageId.js +27 -35
- package/src/platform-implementation-js/driver-common/getRfcMessageIdForSyncMessageId.js +16 -22
- package/src/platform-implementation-js/driver-common/getThreadIdFromMessageId.js +14 -14
- package/src/platform-implementation-js/driver-common/inboxAjax.js +12 -7
- package/src/platform-implementation-js/driver-common/requestGmailThread.js +19 -20
- package/src/platform-implementation-js/driver-common/sidebar/AppSidebar.js +197 -306
- package/src/platform-implementation-js/driver-common/sidebar/ContentPanelViewDriver.js +113 -161
- package/src/platform-implementation-js/driver-interfaces/compose-view-driver.js +1 -114
- package/src/platform-implementation-js/driver-interfaces/driver.js +1 -131
- package/src/platform-implementation-js/driver-interfaces/message-view-driver.js +4 -48
- package/src/platform-implementation-js/driver-interfaces/mole-view-driver.js +1 -29
- package/src/platform-implementation-js/driver-interfaces/route-view-driver.js +1 -32
- package/src/platform-implementation-js/driver-interfaces/thread-row-view-driver.js +1 -11
- package/src/platform-implementation-js/lib/array-to-lifetimes.js +43 -41
- package/src/platform-implementation-js/lib/array-to-lifetimes.test.js +139 -155
- package/src/platform-implementation-js/lib/copyAndValidateAutocompleteResults.js +19 -38
- package/src/platform-implementation-js/lib/css-selector-escape.js +7 -3
- package/src/platform-implementation-js/lib/dom/element-view-mapper.js +8 -11
- package/src/platform-implementation-js/lib/dom/get-selection.js +23 -52
- package/src/platform-implementation-js/lib/dom/insert-html-at-cursor.js +69 -101
- package/src/platform-implementation-js/lib/dom/is-node-in-range.js +8 -10
- package/src/platform-implementation-js/lib/dom/on-mouse-down-and-up.js +15 -17
- package/src/platform-implementation-js/lib/dom/querySelectorOne.js +8 -11
- package/src/platform-implementation-js/lib/dom/set-css.js +7 -3
- package/src/platform-implementation-js/lib/dom/set-value-and-dispatch-event.js +9 -11
- package/src/platform-implementation-js/lib/dom/simulate-drag-and-drop.js +32 -33
- package/src/platform-implementation-js/lib/extract-contact-from-email-contact-string.test.js +23 -26
- package/src/platform-implementation-js/lib/handle-compose-link-chips.js +86 -149
- package/src/platform-implementation-js/lib/insert-link-chip-into-body.js +42 -57
- package/src/platform-implementation-js/lib/make-revocable-function.js +19 -21
- package/src/platform-implementation-js/lib/make-revocable-function.test.js +20 -22
- package/src/platform-implementation-js/lib/parseParamsFromRouteID.js +15 -17
- package/src/platform-implementation-js/lib/parseParamsFromRouteID.test.js +9 -18
- package/src/platform-implementation-js/lib/populateRouteID.js +8 -9
- package/src/platform-implementation-js/lib/populateRouteID.test.js +20 -19
- package/src/platform-implementation-js/lib/react/ElementContainer.js +23 -20
- package/src/platform-implementation-js/lib/rewriteCssWithIdMap.js +10 -9
- package/src/platform-implementation-js/lib/rewriteCssWithIdMap.test.js +13 -20
- package/src/platform-implementation-js/lib/routeIDmatchesHash.js +13 -18
- package/src/platform-implementation-js/lib/routeIDmatchesHash.test.js +11 -17
- package/src/platform-implementation-js/lib/shared-style.js +14 -13
- package/src/platform-implementation-js/lib/toItemWithLifetimeStream.js +18 -17
- package/src/platform-implementation-js/lib/toLiveSet.js +17 -15
- package/src/platform-implementation-js/main-INTEGRATED-PAGEWORLD.js +6 -5
- package/src/platform-implementation-js/main.js +9 -24
- package/src/platform-implementation-js/namespaces/compose.js +37 -60
- package/src/platform-implementation-js/namespaces/conversations.js +52 -124
- package/src/platform-implementation-js/namespaces/global.js +27 -39
- package/src/platform-implementation-js/namespaces/keyboard.js +29 -33
- package/src/platform-implementation-js/namespaces/lists.js +25 -31
- package/src/platform-implementation-js/namespaces/modal.js +34 -28
- package/src/platform-implementation-js/namespaces/nav-menu.js +30 -45
- package/src/platform-implementation-js/namespaces/router.js +70 -137
- package/src/platform-implementation-js/namespaces/search.js +19 -17
- package/src/platform-implementation-js/namespaces/toolbars.js +71 -117
- package/src/platform-implementation-js/namespaces/user.js +36 -37
- package/src/platform-implementation-js/namespaces/widgets.js +54 -61
- package/src/platform-implementation-js/platform-implementation.js +98 -229
- package/src/platform-implementation-js/views/app-toolbar-button-view.js +26 -47
- package/src/platform-implementation-js/views/collapsible-section-view.js +66 -63
- package/src/platform-implementation-js/views/content-panel-view.js +28 -30
- package/src/platform-implementation-js/views/conversations/attachment-card-view.js +21 -44
- package/src/platform-implementation-js/views/conversations/custom-message-view.js +44 -104
- package/src/platform-implementation-js/views/conversations/message-view.js +131 -202
- package/src/platform-implementation-js/views/conversations/thread-view.js +75 -127
- package/src/platform-implementation-js/views/native-nav-item-view.js +32 -65
- package/src/platform-implementation-js/views/nav-item-view.js +51 -115
- package/src/platform-implementation-js/views/route-view/custom-route-view.js +25 -20
- package/src/platform-implementation-js/views/route-view/dummy-route-view-driver.js +18 -18
- package/src/platform-implementation-js/views/route-view/list-route-view.js +30 -52
- package/src/platform-implementation-js/views/route-view/route-view.js +24 -35
- package/src/platform-implementation-js/views/section-view.js +60 -52
- package/src/platform-implementation-js/views/thread-row-view.js +49 -74
- package/src/platform-implementation-js/widgets/drawer-view.js +29 -36
- package/src/platform-implementation-js/widgets/modal-view.js +39 -68
- package/src/platform-implementation-js/widgets/mole-view.js +22 -22
- package/src/platform-implementation-js/widgets/top-message-bar-view.js +13 -10
package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/get-draft-id-for-message-id.js
CHANGED
|
@@ -1,24 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
async function uncachedGetDraftIDForMessageID(
|
|
16
|
-
driver: GmailDriver,
|
|
17
|
-
messageID: string
|
|
18
|
-
): Promise<GetDraftIdResult> {
|
|
19
|
-
const response = await gmailAjax({
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _memoize = _interopRequireDefault(require("lodash/memoize"));
|
|
9
|
+
var _ud = require("ud");
|
|
10
|
+
var _gmailAjax = _interopRequireDefault(require("../../../driver-common/gmailAjax"));
|
|
11
|
+
var _gmailResponseProcessor = require("../gmail-response-processor");
|
|
12
|
+
var _isStreakAppId = _interopRequireDefault(require("../../../lib/isStreakAppId"));
|
|
13
|
+
async function uncachedGetDraftIDForMessageID(driver, messageID) {
|
|
14
|
+
const response = await (0, _gmailAjax.default)({
|
|
20
15
|
method: 'GET',
|
|
21
|
-
url:
|
|
16
|
+
url: document.location.origin + document.location.pathname,
|
|
22
17
|
data: {
|
|
23
18
|
ui: '2',
|
|
24
19
|
ik: driver.getPageCommunicator().getIkValue(),
|
|
@@ -28,43 +23,37 @@ async function uncachedGetDraftIDForMessageID(
|
|
|
28
23
|
nsc: '1',
|
|
29
24
|
mb: '0',
|
|
30
25
|
rt: 'j',
|
|
31
|
-
search: 'drafts'
|
|
32
|
-
}
|
|
26
|
+
search: 'drafts'
|
|
27
|
+
}
|
|
33
28
|
});
|
|
34
29
|
try {
|
|
35
|
-
const draftID = readDraftId(response.text, messageID);
|
|
36
|
-
const debugData = {
|
|
37
|
-
|
|
30
|
+
const draftID = (0, _gmailResponseProcessor.readDraftId)(response.text, messageID);
|
|
31
|
+
const debugData = {
|
|
32
|
+
responseText: response.text
|
|
33
|
+
};
|
|
34
|
+
return {
|
|
35
|
+
draftID,
|
|
36
|
+
debugData
|
|
37
|
+
};
|
|
38
38
|
} catch (err) {
|
|
39
|
-
if (
|
|
39
|
+
if ((0, _isStreakAppId.default)(driver.getAppId())) {
|
|
40
40
|
driver.getLogger().error(err, {
|
|
41
41
|
message: 'failed to read draft ID',
|
|
42
42
|
messageID,
|
|
43
|
-
text: response.text
|
|
43
|
+
text: response.text
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
throw err;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
messageID: string
|
|
53
|
-
) => Promise<GetDraftIdResult> = memoize(
|
|
54
|
-
uncachedGetDraftIDForMessageID,
|
|
55
|
-
(driver, messageID) => messageID
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
function getDraftIDForMessageID(
|
|
59
|
-
driver: GmailDriver,
|
|
60
|
-
messageID: string,
|
|
61
|
-
skipCache: boolean = false
|
|
62
|
-
): Promise<GetDraftIdResult> {
|
|
49
|
+
const cachedGetDraftIDForMessageID = (0, _memoize.default)(uncachedGetDraftIDForMessageID, (driver, messageID) => messageID);
|
|
50
|
+
function getDraftIDForMessageID(driver, messageID) {
|
|
51
|
+
let skipCache = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
63
52
|
if (skipCache) {
|
|
64
53
|
return uncachedGetDraftIDForMessageID(driver, messageID);
|
|
65
54
|
} else {
|
|
66
55
|
return cachedGetDraftIDForMessageID(driver, messageID);
|
|
67
56
|
}
|
|
68
57
|
}
|
|
69
|
-
|
|
70
|
-
|
|
58
|
+
var _default = (0, _ud.defn)(module, getDraftIDForMessageID);
|
|
59
|
+
exports.default = _default;
|
|
@@ -1,43 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
)
|
|
14
|
-
|
|
15
|
-
const navContainer = GmailElementGetter.getLeftNavContainerElement();
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = getNativeNavItem;
|
|
8
|
+
var _nativeGmailNavItemView = _interopRequireDefault(require("../views/native-gmail-nav-item-view"));
|
|
9
|
+
var _gmailElementGetter = _interopRequireDefault(require("../gmail-element-getter"));
|
|
10
|
+
var _findParent = _interopRequireDefault(require("../../../../common/find-parent"));
|
|
11
|
+
var _waitFor = _interopRequireDefault(require("../../../lib/wait-for"));
|
|
12
|
+
function getNativeNavItem(driver, label) {
|
|
13
|
+
return (0, _waitFor.default)(() => {
|
|
14
|
+
const navContainer = _gmailElementGetter.default.getLeftNavContainerElement();
|
|
16
15
|
if (!navContainer) return null;
|
|
17
16
|
return navContainer.querySelector(`.aim a[href*="#${label}"]`);
|
|
18
|
-
}, 300 * 1000)
|
|
19
|
-
.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
.catch((err) => {
|
|
36
|
-
if (GmailElementGetter.isStandalone()) {
|
|
37
|
-
// never resolve
|
|
38
|
-
return new Promise((resolve, reject) => {});
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
throw err;
|
|
42
|
-
});
|
|
43
|
-
}
|
|
17
|
+
}, 300 * 1000).then(labelLinkElement => {
|
|
18
|
+
const labelElement = (0, _findParent.default)(labelLinkElement, el => el.classList.contains('aim'));
|
|
19
|
+
if (!labelElement) {
|
|
20
|
+
throw new Error('native nav item structured weird');
|
|
21
|
+
}
|
|
22
|
+
if (!labelElement.__nativeGmailNavItemView) {
|
|
23
|
+
labelElement.__nativeGmailNavItemView = new _nativeGmailNavItemView.default(driver, labelElement, label);
|
|
24
|
+
}
|
|
25
|
+
return labelElement.__nativeGmailNavItemView;
|
|
26
|
+
}).catch(err => {
|
|
27
|
+
if (_gmailElementGetter.default.isStandalone()) {
|
|
28
|
+
// never resolve
|
|
29
|
+
return new Promise((resolve, reject) => {});
|
|
30
|
+
}
|
|
31
|
+
throw err;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
@@ -1,33 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export default function getURLObject(url: string): URLObject {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = getURLObject;
|
|
7
|
+
function getURLObject(url) {
|
|
11
8
|
const m = url.match(/#([^?]*)(?:\?(.*))?/);
|
|
12
9
|
if (!m) {
|
|
13
10
|
return {
|
|
14
11
|
name: 'inbox',
|
|
15
12
|
params: [],
|
|
16
13
|
hash: '',
|
|
17
|
-
query: undefined
|
|
14
|
+
query: undefined
|
|
18
15
|
};
|
|
19
16
|
}
|
|
20
|
-
|
|
21
17
|
const hash = m[1];
|
|
22
18
|
const hashParts = hash.split('/');
|
|
23
|
-
|
|
24
19
|
return {
|
|
25
20
|
name: decodeURIComponent(hashParts[0]),
|
|
26
|
-
params: hashParts
|
|
27
|
-
.slice(1)
|
|
28
|
-
.map((part) => part.replace(/\+/g, ' '))
|
|
29
|
-
.map(decodeURIComponent),
|
|
21
|
+
params: hashParts.slice(1).map(part => part.replace(/\+/g, ' ')).map(decodeURIComponent),
|
|
30
22
|
query: m[2],
|
|
31
|
-
hash
|
|
23
|
+
hash
|
|
32
24
|
};
|
|
33
|
-
}
|
|
25
|
+
}
|
|
@@ -1,38 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
): Promise<SyncThread> {
|
|
20
|
-
const { threads: threadDescriptors, _text } = await getSyncThreadsForSearch(
|
|
21
|
-
driver,
|
|
22
|
-
'threadid:' + new BigNumber(oldGmailThreadId, 16).toString(10)
|
|
23
|
-
);
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = getSyncThreadForOldGmailThreadId;
|
|
8
|
+
var _ud = require("ud");
|
|
9
|
+
var _bignumber = _interopRequireDefault(require("bignumber.js"));
|
|
10
|
+
var _getSyncThreadsForSearch = _interopRequireDefault(require("../../../driver-common/getSyncThreadsForSearch"));
|
|
11
|
+
var _gmailAjax = _interopRequireDefault(require("../../../driver-common/gmailAjax"));
|
|
12
|
+
var _isStreakAppId = _interopRequireDefault(require("../../../lib/isStreakAppId"));
|
|
13
|
+
var _gmailSyncResponseProcessor = require("../gmail-sync-response-processor");
|
|
14
|
+
async function getSyncThreadForOldGmailThreadId(driver, oldGmailThreadId) {
|
|
15
|
+
const {
|
|
16
|
+
threads: threadDescriptors,
|
|
17
|
+
_text
|
|
18
|
+
} = await (0, _getSyncThreadsForSearch.default)(driver, 'threadid:' + new _bignumber.default(oldGmailThreadId, 16).toString(10));
|
|
24
19
|
const firstThread = threadDescriptors[0];
|
|
25
20
|
if (firstThread == null) {
|
|
26
21
|
console.error(`Thread with ID ${oldGmailThreadId} not found by Gmail`); //eslint-disable-line
|
|
27
|
-
const isStreak =
|
|
28
|
-
const err = new Error(
|
|
29
|
-
'Thread not found by getSyncThreadForOldGmailThreadId'
|
|
30
|
-
);
|
|
22
|
+
const isStreak = (0, _isStreakAppId.default)(driver.getAppId());
|
|
23
|
+
const err = new Error('Thread not found by getSyncThreadForOldGmailThreadId');
|
|
31
24
|
driver.getLogger().error(err, {
|
|
32
25
|
oldGmailThreadId: isStreak ? oldGmailThreadId : null,
|
|
33
|
-
responseText: isStreak ? _text : null
|
|
26
|
+
responseText: isStreak ? _text : null
|
|
34
27
|
});
|
|
35
28
|
throw err;
|
|
36
29
|
}
|
|
37
30
|
return firstThread;
|
|
38
|
-
}
|
|
31
|
+
}
|
|
@@ -1,76 +1,64 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
)
|
|
14
|
-
const [btaiHeader, xsrfToken] = await Promise.all([
|
|
15
|
-
|
|
16
|
-
driver.getPageCommunicator().getXsrfToken(),
|
|
17
|
-
]);
|
|
18
|
-
return getThreadFromSyncThreadIdUsingHeaders(
|
|
19
|
-
syncThreadId,
|
|
20
|
-
btaiHeader,
|
|
21
|
-
xsrfToken
|
|
22
|
-
);
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = getThreadFromSyncThreadId;
|
|
8
|
+
exports.getThreadFromSyncThreadIdUsingHeaders = getThreadFromSyncThreadIdUsingHeaders;
|
|
9
|
+
var _ud = require("ud");
|
|
10
|
+
var _gmailAjax = _interopRequireDefault(require("../../../driver-common/gmailAjax"));
|
|
11
|
+
var _gmailSyncResponseProcessor = require("../gmail-sync-response-processor");
|
|
12
|
+
var _getAccountUrlPart = _interopRequireDefault(require("../../../driver-common/getAccountUrlPart"));
|
|
13
|
+
async function getThreadFromSyncThreadId(driver, syncThreadId) {
|
|
14
|
+
const [btaiHeader, xsrfToken] = await Promise.all([driver.getPageCommunicator().getBtaiHeader(), driver.getPageCommunicator().getXsrfToken()]);
|
|
15
|
+
return getThreadFromSyncThreadIdUsingHeaders(syncThreadId, btaiHeader, xsrfToken);
|
|
23
16
|
}
|
|
24
|
-
|
|
25
|
-
export async function getThreadFromSyncThreadIdUsingHeaders(
|
|
26
|
-
syncThreadId: string,
|
|
27
|
-
btaiHeader: string,
|
|
28
|
-
xsrfToken: string
|
|
29
|
-
): Promise<?SyncThread> {
|
|
17
|
+
async function getThreadFromSyncThreadIdUsingHeaders(syncThreadId, btaiHeader, xsrfToken) {
|
|
30
18
|
let responseText = null;
|
|
31
19
|
try {
|
|
32
|
-
let {
|
|
20
|
+
let {
|
|
21
|
+
text
|
|
22
|
+
} = await (0, _gmailAjax.default)({
|
|
33
23
|
method: 'POST',
|
|
34
|
-
url: `https://mail.google.com/sync${
|
|
24
|
+
url: `https://mail.google.com/sync${(0, _getAccountUrlPart.default)()}/i/fd`,
|
|
35
25
|
headers: {
|
|
36
26
|
'Content-Type': 'application/json',
|
|
37
27
|
'X-Framework-Xsrf-Token': xsrfToken,
|
|
38
28
|
'X-Gmail-BTAI': btaiHeader,
|
|
39
|
-
'X-Google-BTD': '1'
|
|
29
|
+
'X-Google-BTD': '1'
|
|
40
30
|
},
|
|
41
31
|
data: JSON.stringify({
|
|
42
|
-
'1': [
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
],
|
|
48
|
-
}),
|
|
32
|
+
'1': [{
|
|
33
|
+
'1': syncThreadId,
|
|
34
|
+
'2': 1
|
|
35
|
+
}]
|
|
36
|
+
})
|
|
49
37
|
});
|
|
50
38
|
responseText = text;
|
|
51
39
|
} catch (err) {
|
|
52
40
|
// try sending request with new format 2022_09_09
|
|
53
|
-
let {
|
|
41
|
+
let {
|
|
42
|
+
text
|
|
43
|
+
} = await (0, _gmailAjax.default)({
|
|
54
44
|
method: 'POST',
|
|
55
|
-
url: `https://mail.google.com/sync${
|
|
45
|
+
url: `https://mail.google.com/sync${(0, _getAccountUrlPart.default)()}/i/fd?rt=r&pt=ji`,
|
|
56
46
|
headers: {
|
|
57
47
|
'Content-Type': 'application/json',
|
|
58
48
|
'X-Framework-Xsrf-Token': xsrfToken,
|
|
59
49
|
'X-Gmail-BTAI': btaiHeader,
|
|
60
|
-
'X-Google-BTD': '1'
|
|
50
|
+
'X-Google-BTD': '1'
|
|
61
51
|
},
|
|
62
|
-
data: JSON.stringify([[[syncThreadId, 1]], 2])
|
|
52
|
+
data: JSON.stringify([[[syncThreadId, 1]], 2])
|
|
63
53
|
});
|
|
64
54
|
responseText = text;
|
|
65
55
|
}
|
|
66
|
-
|
|
67
|
-
const threadDescriptors = extractThreadsFromThreadResponse(responseText);
|
|
56
|
+
const threadDescriptors = (0, _gmailSyncResponseProcessor.extractThreadsFromThreadResponse)(responseText);
|
|
68
57
|
if (threadDescriptors.length > 0) {
|
|
69
58
|
const thread = threadDescriptors[0];
|
|
70
59
|
if (thread.oldGmailThreadID) {
|
|
71
60
|
return thread;
|
|
72
61
|
}
|
|
73
62
|
}
|
|
74
|
-
|
|
75
63
|
return null;
|
|
76
|
-
}
|
|
64
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = gmailLoadEvent;
|
|
8
|
+
var _gmailElementGetter = _interopRequireDefault(require("../gmail-element-getter"));
|
|
9
|
+
var _isIntegratedViewGmail = _interopRequireDefault(require("./isIntegratedViewGmail"));
|
|
10
|
+
var _addNavItem = require("./add-nav-item");
|
|
11
|
+
async function gmailLoadEvent(driver) {
|
|
9
12
|
const pageCommunicator = driver.getPageCommunicator();
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
await pageCommunicator.isConversationViewDisabled();
|
|
13
|
-
await waitForMenuReady();
|
|
14
|
-
|
|
13
|
+
const isConversationViewDisabled = await pageCommunicator.isConversationViewDisabled();
|
|
14
|
+
await (0, _addNavItem.waitForMenuReady)();
|
|
15
15
|
driver.getLogger().eventSite('gmailSettings', {
|
|
16
|
-
isGmailIntegratedView:
|
|
16
|
+
isGmailIntegratedView: (0, _isIntegratedViewGmail.default)(),
|
|
17
17
|
screenWidth: window.screen && window.screen.width,
|
|
18
18
|
screenHeight: window.screen && window.screen.height,
|
|
19
19
|
windowWidth: window.innerWidth,
|
|
@@ -22,40 +22,22 @@ export default async function gmailLoadEvent(driver: GmailDriver) {
|
|
|
22
22
|
isUsingSyncAPI: pageCommunicator.isUsingSyncAPI(),
|
|
23
23
|
previewPane: pageCommunicator.getUserOriginalPreviewPaneMode(),
|
|
24
24
|
isConversationViewDisabled,
|
|
25
|
-
wasAccountSwitcherReadyAtStart:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
global.performance &&
|
|
43
|
-
global.performance.timing.domContentLoadedEventEnd,
|
|
44
|
-
domainLookupEnd:
|
|
45
|
-
global.performance && global.performance.timing.domainLookupEnd,
|
|
46
|
-
domainLookupStart:
|
|
47
|
-
global.performance && global.performance.timing.domainLookupStart,
|
|
48
|
-
fetchStart: global.performance && global.performance.timing.fetchStart,
|
|
49
|
-
loadEventStart:
|
|
50
|
-
global.performance && global.performance.timing.loadEventStart,
|
|
51
|
-
loadEventEnd:
|
|
52
|
-
global.performance && global.performance.timing.loadEventEnd,
|
|
53
|
-
navigationStart:
|
|
54
|
-
global.performance && global.performance.timing.navigationStart,
|
|
55
|
-
requestStart:
|
|
56
|
-
global.performance && global.performance.timing.requestStart,
|
|
57
|
-
}: any),
|
|
58
|
-
driver.getTimings()
|
|
59
|
-
),
|
|
25
|
+
wasAccountSwitcherReadyAtStart: driver.getEnvData().wasAccountSwitcherReadyAtStart,
|
|
26
|
+
timings: Object.assign({
|
|
27
|
+
responseStart: global.performance && global.performance.timing.responseStart,
|
|
28
|
+
responseEnd: global.performance && global.performance.timing.responseEnd,
|
|
29
|
+
domLoading: global.performance && global.performance.timing.domLoading,
|
|
30
|
+
domInteractive: global.performance && global.performance.timing.domInteractive,
|
|
31
|
+
domComplete: global.performance && global.performance.timing.domComplete,
|
|
32
|
+
domContentLoadedEventStart: global.performance && global.performance.timing.domContentLoadedEventStart,
|
|
33
|
+
domContentLoadedEventEnd: global.performance && global.performance.timing.domContentLoadedEventEnd,
|
|
34
|
+
domainLookupEnd: global.performance && global.performance.timing.domainLookupEnd,
|
|
35
|
+
domainLookupStart: global.performance && global.performance.timing.domainLookupStart,
|
|
36
|
+
fetchStart: global.performance && global.performance.timing.fetchStart,
|
|
37
|
+
loadEventStart: global.performance && global.performance.timing.loadEventStart,
|
|
38
|
+
loadEventEnd: global.performance && global.performance.timing.loadEventEnd,
|
|
39
|
+
navigationStart: global.performance && global.performance.timing.navigationStart,
|
|
40
|
+
requestStart: global.performance && global.performance.timing.requestStart
|
|
41
|
+
}, driver.getTimings())
|
|
60
42
|
});
|
|
61
|
-
}
|
|
43
|
+
}
|
|
@@ -1,72 +1,65 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
params
|
|
18
|
-
|
|
19
|
-
if (viewName[0] === '#') {
|
|
20
|
-
if (params) {
|
|
21
|
-
throw new Error("params parameter can't be passed with resolved URL");
|
|
22
|
-
}
|
|
23
|
-
viewName = viewName.slice(1);
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _includes = _interopRequireDefault(require("lodash/includes"));
|
|
9
|
+
var ud = _interopRequireWildcard(require("ud"));
|
|
10
|
+
var _router = require("../../../constants/router");
|
|
11
|
+
var _simulateMouseEvent = require("../../../lib/dom/simulate-mouse-event");
|
|
12
|
+
var _getUrlObject = _interopRequireDefault(require("./get-url-object"));
|
|
13
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
+
const gotoView = ud.defn(module, async function gotoView(gmailDriver, viewName, params) {
|
|
16
|
+
if (viewName[0] === '#') {
|
|
17
|
+
if (params) {
|
|
18
|
+
throw new Error("params parameter can't be passed with resolved URL");
|
|
24
19
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
20
|
+
viewName = viewName.slice(1);
|
|
21
|
+
}
|
|
22
|
+
if ((0, _includes.default)(_router.NATIVE_ROUTE_IDS, viewName)) {
|
|
23
|
+
if (gmailDriver.isUsingSyncAPI()) {
|
|
24
|
+
// need to go to the new url
|
|
25
|
+
if (params && typeof params !== 'string') {
|
|
26
|
+
const threadID = params.threadID;
|
|
27
|
+
if (threadID && typeof threadID === 'string') {
|
|
28
|
+
const int = parseInt(threadID, 16);
|
|
29
|
+
if (!isNaN(int)) {
|
|
30
|
+
//we got an old id
|
|
31
|
+
const syncThreadId = await gmailDriver.getSyncThreadIdForOldGmailThreadId(threadID);
|
|
32
|
+
params = {
|
|
33
|
+
...params,
|
|
34
|
+
threadID: '#' + syncThreadId
|
|
35
|
+
};
|
|
42
36
|
}
|
|
43
37
|
}
|
|
44
38
|
}
|
|
45
|
-
|
|
46
|
-
const newHash = gmailDriver.createLink(viewName, params);
|
|
47
|
-
// Create a fake link and simulate a click event on it to let Gmail handle
|
|
48
|
-
// the view change. If we just set window.location.hash ourselves to the
|
|
49
|
-
// newHash, it's a Gmail hash, and any composes are open, then Gmail will
|
|
50
|
-
// redirect the user to the hash with ?compose=... appended to the end and
|
|
51
|
-
// break the back button. If we try to pre-empt Gmail and add the
|
|
52
|
-
// ?compose=... part ourselves, then sometimes Gmail thinks it's new and
|
|
53
|
-
// actually triggers now composes to open. This fake link method avoids the
|
|
54
|
-
// issue.
|
|
55
|
-
const link = document.createElement('a');
|
|
56
|
-
link.style.display = 'none';
|
|
57
|
-
link.href = newHash;
|
|
58
|
-
((document.body: any): HTMLElement).appendChild(link);
|
|
59
|
-
simulateClick(link);
|
|
60
|
-
link.remove();
|
|
61
|
-
} else {
|
|
62
|
-
const newHash = gmailDriver.createLink(viewName, params);
|
|
63
|
-
// If it's not a gmail view name, then it's probably a hash for a custom
|
|
64
|
-
// view. We need to set the hash ourselves. Gmail won't react at all to a
|
|
65
|
-
// hashchange event for a hash it doesn't recognize, so we don't have to
|
|
66
|
-
// worry about the above issue.
|
|
67
|
-
window.location.hash = newHash;
|
|
68
39
|
}
|
|
40
|
+
const newHash = gmailDriver.createLink(viewName, params);
|
|
41
|
+
// Create a fake link and simulate a click event on it to let Gmail handle
|
|
42
|
+
// the view change. If we just set window.location.hash ourselves to the
|
|
43
|
+
// newHash, it's a Gmail hash, and any composes are open, then Gmail will
|
|
44
|
+
// redirect the user to the hash with ?compose=... appended to the end and
|
|
45
|
+
// break the back button. If we try to pre-empt Gmail and add the
|
|
46
|
+
// ?compose=... part ourselves, then sometimes Gmail thinks it's new and
|
|
47
|
+
// actually triggers now composes to open. This fake link method avoids the
|
|
48
|
+
// issue.
|
|
49
|
+
const link = document.createElement('a');
|
|
50
|
+
link.style.display = 'none';
|
|
51
|
+
link.href = newHash;
|
|
52
|
+
document.body.appendChild(link);
|
|
53
|
+
(0, _simulateMouseEvent.simulateClick)(link);
|
|
54
|
+
link.remove();
|
|
55
|
+
} else {
|
|
56
|
+
const newHash = gmailDriver.createLink(viewName, params);
|
|
57
|
+
// If it's not a gmail view name, then it's probably a hash for a custom
|
|
58
|
+
// view. We need to set the hash ourselves. Gmail won't react at all to a
|
|
59
|
+
// hashchange event for a hash it doesn't recognize, so we don't have to
|
|
60
|
+
// worry about the above issue.
|
|
61
|
+
window.location.hash = newHash;
|
|
69
62
|
}
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
|
|
63
|
+
});
|
|
64
|
+
var _default = gotoView;
|
|
65
|
+
exports.default = _default;
|