@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
|
@@ -1,52 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _includes = _interopRequireDefault(require("lodash/includes"));
|
|
10
|
+
var _kefir = _interopRequireDefault(require("kefir"));
|
|
11
|
+
var _kefirStopper = _interopRequireDefault(require("kefir-stopper"));
|
|
12
|
+
var _kefirBus = _interopRequireDefault(require("kefir-bus"));
|
|
13
|
+
var _router = require("../../../constants/router");
|
|
12
14
|
function getRouteID(path) {
|
|
13
15
|
if (path === '') {
|
|
14
|
-
return NATIVE_ROUTE_IDS.INBOX;
|
|
16
|
+
return _router.NATIVE_ROUTE_IDS.INBOX;
|
|
15
17
|
}
|
|
16
|
-
if (
|
|
17
|
-
return NATIVE_ROUTE_IDS[path.toUpperCase()];
|
|
18
|
+
if ((0, _includes.default)(['snoozed', 'reminders', 'done', 'spam', 'trash'], path)) {
|
|
19
|
+
return _router.NATIVE_ROUTE_IDS[path.toUpperCase()];
|
|
18
20
|
}
|
|
19
21
|
if (/search\//.test(path)) {
|
|
20
|
-
return NATIVE_ROUTE_IDS.SEARCH;
|
|
22
|
+
return _router.NATIVE_ROUTE_IDS.SEARCH;
|
|
21
23
|
}
|
|
22
24
|
return 'UNKNOWN';
|
|
23
25
|
}
|
|
24
|
-
|
|
25
26
|
function getParams(path) {
|
|
26
27
|
const parts = path.split('/');
|
|
27
28
|
if (parts.length < 2) {
|
|
28
29
|
return {};
|
|
29
30
|
}
|
|
30
31
|
return {
|
|
31
|
-
query: decodeURIComponent(parts[1])
|
|
32
|
+
query: decodeURIComponent(parts[1])
|
|
32
33
|
};
|
|
33
34
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
_routeType: string;
|
|
39
|
-
_routeID: string;
|
|
40
|
-
_params: Object;
|
|
41
|
-
_eventStream = kefirBus();
|
|
42
|
-
_stopper = kefirStopper();
|
|
43
|
-
|
|
44
|
-
constructor(el: HTMLElement, type: string) {
|
|
35
|
+
class InboxRouteView {
|
|
36
|
+
constructor(el, type) {
|
|
37
|
+
(0, _defineProperty2.default)(this, "_eventStream", (0, _kefirBus.default)());
|
|
38
|
+
(0, _defineProperty2.default)(this, "_stopper", (0, _kefirStopper.default)());
|
|
45
39
|
// Check we implement interface
|
|
46
|
-
|
|
47
|
-
|
|
40
|
+
this;
|
|
48
41
|
this._element = el;
|
|
49
|
-
|
|
50
42
|
this._type = type;
|
|
51
43
|
const path = document.location.pathname.slice(1);
|
|
52
44
|
this._routeID = getRouteID(path);
|
|
@@ -61,63 +53,45 @@ export default class InboxRouteView {
|
|
|
61
53
|
getStopper() {
|
|
62
54
|
return this._stopper;
|
|
63
55
|
}
|
|
64
|
-
|
|
65
56
|
destroy() {
|
|
66
57
|
this._eventStream.end();
|
|
67
58
|
this._stopper.destroy();
|
|
68
59
|
}
|
|
69
|
-
|
|
70
|
-
getElement(): HTMLElement {
|
|
60
|
+
getElement() {
|
|
71
61
|
return this._element;
|
|
72
62
|
}
|
|
73
|
-
|
|
74
|
-
getType(): string {
|
|
63
|
+
getType() {
|
|
75
64
|
return this._type;
|
|
76
65
|
}
|
|
77
|
-
|
|
78
|
-
getRouteType(): string {
|
|
66
|
+
getRouteType() {
|
|
79
67
|
return this._routeType;
|
|
80
68
|
}
|
|
81
|
-
|
|
82
|
-
getRouteID(): string {
|
|
69
|
+
getRouteID() {
|
|
83
70
|
return this._routeID;
|
|
84
71
|
}
|
|
85
|
-
|
|
86
|
-
getParams(): Object {
|
|
72
|
+
getParams() {
|
|
87
73
|
return this._params;
|
|
88
74
|
}
|
|
89
|
-
|
|
90
|
-
getEventStream(): Kefir.Observable<Object> {
|
|
75
|
+
getEventStream() {
|
|
91
76
|
return this._eventStream;
|
|
92
77
|
}
|
|
93
|
-
|
|
94
78
|
refresh() {
|
|
95
79
|
// stub
|
|
96
80
|
}
|
|
97
|
-
|
|
98
|
-
getHash(): string {
|
|
81
|
+
getHash() {
|
|
99
82
|
throw new Error('should not happen');
|
|
100
83
|
}
|
|
101
|
-
|
|
102
|
-
getCustomViewElement(): ?HTMLElement {
|
|
84
|
+
getCustomViewElement() {
|
|
103
85
|
throw new Error('should not happen');
|
|
104
86
|
}
|
|
105
|
-
|
|
106
|
-
addCollapsibleSection(
|
|
107
|
-
sectionDescriptorProperty: Kefir.Observable<?Object>,
|
|
108
|
-
groupOrderHint: any
|
|
109
|
-
) {
|
|
87
|
+
addCollapsibleSection(sectionDescriptorProperty, groupOrderHint) {
|
|
110
88
|
throw new Error('not implemented yet');
|
|
111
89
|
}
|
|
112
|
-
|
|
113
|
-
addSection(
|
|
114
|
-
sectionDescriptorProperty: Kefir.Observable<?Object>,
|
|
115
|
-
groupOrderHint: any
|
|
116
|
-
) {
|
|
90
|
+
addSection(sectionDescriptorProperty, groupOrderHint) {
|
|
117
91
|
throw new Error('not implemented yet');
|
|
118
92
|
}
|
|
119
|
-
|
|
120
|
-
setFullWidth(fullWidth: boolean) {
|
|
93
|
+
setFullWidth(fullWidth) {
|
|
121
94
|
throw new Error('should not happen');
|
|
122
95
|
}
|
|
123
96
|
}
|
|
97
|
+
exports.default = InboxRouteView;
|
|
@@ -1,120 +1,95 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _ud = require("ud");
|
|
10
|
+
var _updateIcon = _interopRequireDefault(require("../../../driver-common/update-icon"));
|
|
11
|
+
var _autoHtml = _interopRequireDefault(require("auto-html"));
|
|
12
|
+
var _kefir = _interopRequireDefault(require("kefir"));
|
|
13
|
+
var _kefirBus = _interopRequireDefault(require("kefir-bus"));
|
|
14
|
+
var _kefirStopper = _interopRequireDefault(require("kefir-stopper"));
|
|
15
|
+
var _kefirCast = _interopRequireDefault(require("kefir-cast"));
|
|
16
|
+
var _bignumber = _interopRequireDefault(require("bignumber.js"));
|
|
17
|
+
var _InboxLabelView = _interopRequireDefault(require("./InboxLabelView"));
|
|
18
|
+
var _InboxToolbarButtonView = _interopRequireDefault(require("./InboxToolbarButtonView"));
|
|
18
19
|
class InboxThreadRowView {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
_userView: ?Object;
|
|
23
|
-
_eventStream: Bus<any> = kefirBus();
|
|
24
|
-
_stopper: Kefir.Observable<null>;
|
|
25
|
-
_isDestroyed: boolean = false;
|
|
26
|
-
|
|
27
|
-
constructor(element: HTMLElement, driver: InboxDriver, parsed: Parsed) {
|
|
20
|
+
constructor(element, driver, parsed) {
|
|
21
|
+
(0, _defineProperty2.default)(this, "_eventStream", (0, _kefirBus.default)());
|
|
22
|
+
(0, _defineProperty2.default)(this, "_isDestroyed", false);
|
|
28
23
|
this._element = element;
|
|
29
24
|
this._driver = driver;
|
|
30
25
|
this._p = parsed;
|
|
31
|
-
|
|
32
|
-
this._stopper = this._eventStream
|
|
33
|
-
.ignoreValues()
|
|
34
|
-
.beforeEnd(() => null)
|
|
35
|
-
.toProperty();
|
|
26
|
+
this._stopper = this._eventStream.ignoreValues().beforeEnd(() => null).toProperty();
|
|
36
27
|
}
|
|
37
|
-
|
|
38
|
-
getEventStream(): Kefir.Observable<any> {
|
|
28
|
+
getEventStream() {
|
|
39
29
|
return this._eventStream;
|
|
40
30
|
}
|
|
41
|
-
|
|
42
|
-
getStopper(): Kefir.Observable<null> {
|
|
31
|
+
getStopper() {
|
|
43
32
|
return this._stopper;
|
|
44
33
|
}
|
|
45
34
|
|
|
46
35
|
// keeping this here for now since the rest of the system expects it.
|
|
47
36
|
// in Gmail it's used to pass a ThreadRowView interface to addButton()
|
|
48
37
|
// onClick callbacks, but not sure if it will be needed in the end.
|
|
49
|
-
setUserView(userView
|
|
38
|
+
setUserView(userView) {
|
|
50
39
|
this._userView = userView;
|
|
51
40
|
}
|
|
52
|
-
|
|
53
|
-
isSelected(): boolean {
|
|
41
|
+
isSelected() {
|
|
54
42
|
if (!this._p.elements.checkbox) {
|
|
55
43
|
throw new Error('Did not find checkbox element');
|
|
56
44
|
}
|
|
57
45
|
return this._p.elements.checkbox.getAttribute('aria-checked') === 'true';
|
|
58
46
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
47
|
+
addToolbarButton(options) {
|
|
48
|
+
const {
|
|
49
|
+
toolbar
|
|
50
|
+
} = this._p.elements;
|
|
62
51
|
if (!toolbar) {
|
|
63
52
|
throw new Error('could not find toolbar element');
|
|
64
53
|
}
|
|
65
54
|
toolbar.classList.add('inboxsdk__list_toolbar');
|
|
66
|
-
const button = new
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
if (options.onClick) options.onClick(event);
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
this._driver.getAppId(),
|
|
82
|
-
toolbar
|
|
83
|
-
);
|
|
55
|
+
const button = new _InboxToolbarButtonView.default({
|
|
56
|
+
...options,
|
|
57
|
+
onClick: event => {
|
|
58
|
+
if (event.dropdown) {
|
|
59
|
+
toolbar.classList.add('inboxsdk__thread_row_force_toolbar_visible');
|
|
60
|
+
event.dropdown.once('destroy', () => {
|
|
61
|
+
toolbar.classList.remove('inboxsdk__thread_row_force_toolbar_visible');
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
if (options.onClick) options.onClick(event);
|
|
65
|
+
}
|
|
66
|
+
}, this._driver.getAppId(), toolbar);
|
|
84
67
|
this._stopper.takeUntilBy(button.getStopper()).onValue(() => {
|
|
85
68
|
button.destroy();
|
|
86
69
|
});
|
|
87
70
|
return button;
|
|
88
71
|
}
|
|
89
|
-
|
|
90
|
-
addAttachmentIcon(options: Object) {
|
|
72
|
+
addAttachmentIcon(options) {
|
|
91
73
|
throw new Error('Not supported in Inbox');
|
|
92
74
|
}
|
|
93
|
-
|
|
94
|
-
addButton(options: Object) {
|
|
75
|
+
addButton(options) {
|
|
95
76
|
throw new Error('Not supported in Inbox');
|
|
96
77
|
}
|
|
97
|
-
|
|
98
|
-
addActionButton(options: Object) {
|
|
78
|
+
addActionButton(options) {
|
|
99
79
|
throw new Error('not yet implemented');
|
|
100
80
|
}
|
|
101
|
-
|
|
102
|
-
addImage(icon: Object) {
|
|
81
|
+
addImage(icon) {
|
|
103
82
|
if (this._isDestroyed) {
|
|
104
83
|
console.warn('addImage called on destroyed thread row'); //eslint-disable-line no-console
|
|
105
84
|
return;
|
|
106
85
|
}
|
|
107
|
-
|
|
108
|
-
|
|
86
|
+
const {
|
|
87
|
+
labelParent
|
|
88
|
+
} = this._p.elements;
|
|
109
89
|
if (!labelParent) throw new Error('Could not find label parent element');
|
|
110
|
-
|
|
111
|
-
const prop = kefirCast((Kefir: any), icon)
|
|
112
|
-
.takeUntilBy(this._stopper)
|
|
113
|
-
.toProperty();
|
|
114
|
-
|
|
90
|
+
const prop = (0, _kefirCast.default)(_kefir.default, icon).takeUntilBy(this._stopper).toProperty();
|
|
115
91
|
let imageMod = null;
|
|
116
|
-
|
|
117
|
-
prop.onValue((iconDescriptor) => {
|
|
92
|
+
prop.onValue(iconDescriptor => {
|
|
118
93
|
if (!iconDescriptor) {
|
|
119
94
|
if (imageMod) {
|
|
120
95
|
imageMod.remove();
|
|
@@ -127,60 +102,41 @@ class InboxThreadRowView {
|
|
|
127
102
|
iconWrapper: document.createElement('div'),
|
|
128
103
|
remove() {
|
|
129
104
|
this.iconWrapper.remove();
|
|
130
|
-
}
|
|
105
|
+
}
|
|
131
106
|
};
|
|
132
107
|
imageMod.iconWrapper.className = 'inboxsdk__thread_row_icon_wrapper';
|
|
133
108
|
}
|
|
134
|
-
const {
|
|
135
|
-
|
|
136
|
-
updateIcon(
|
|
109
|
+
const {
|
|
137
110
|
iconSettings,
|
|
138
|
-
iconWrapper
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
iconDescriptor.imageUrl
|
|
142
|
-
);
|
|
143
|
-
|
|
111
|
+
iconWrapper
|
|
112
|
+
} = imageMod;
|
|
113
|
+
(0, _updateIcon.default)(iconSettings, iconWrapper, false, iconDescriptor.imageClass, iconDescriptor.imageUrl);
|
|
144
114
|
if (iconDescriptor.tooltip) {
|
|
145
115
|
iconWrapper.setAttribute('title', iconDescriptor.tooltip);
|
|
146
116
|
}
|
|
147
|
-
|
|
148
117
|
if (labelParent !== iconWrapper.parentElement) {
|
|
149
|
-
const threadLabels = labelParent.querySelectorAll(
|
|
150
|
-
|
|
151
|
-
);
|
|
152
|
-
const insertionPoint =
|
|
153
|
-
threadLabels.length > 0
|
|
154
|
-
? threadLabels[threadLabels.length - 1].nextElementSibling
|
|
155
|
-
: labelParent.firstChild;
|
|
156
|
-
|
|
118
|
+
const threadLabels = labelParent.querySelectorAll('.inboxsdk__inbox_thread_row_label');
|
|
119
|
+
const insertionPoint = threadLabels.length > 0 ? threadLabels[threadLabels.length - 1].nextElementSibling : labelParent.firstChild;
|
|
157
120
|
labelParent.insertBefore(iconWrapper, insertionPoint);
|
|
158
121
|
}
|
|
159
122
|
}
|
|
160
123
|
});
|
|
161
|
-
|
|
162
124
|
this._stopper.onEnd(() => {
|
|
163
125
|
if (imageMod) {
|
|
164
126
|
imageMod.remove();
|
|
165
127
|
}
|
|
166
128
|
});
|
|
167
129
|
}
|
|
168
|
-
|
|
169
|
-
addLabel(label: Object) {
|
|
130
|
+
addLabel(label) {
|
|
170
131
|
if (this._isDestroyed) {
|
|
171
132
|
console.warn('addLabel called on destroyed thread row'); //eslint-disable-line no-console
|
|
172
133
|
return;
|
|
173
134
|
}
|
|
174
|
-
|
|
175
135
|
const labelParentDiv = this._p.elements.labelParent;
|
|
176
136
|
if (!labelParentDiv) throw new Error('Could not find label parent element');
|
|
177
|
-
|
|
178
|
-
const prop: Kefir.Observable<?Object> = kefirCast(Kefir, label)
|
|
179
|
-
.takeUntilBy(this._stopper)
|
|
180
|
-
.toProperty();
|
|
137
|
+
const prop = (0, _kefirCast.default)(_kefir.default, label).takeUntilBy(this._stopper).toProperty();
|
|
181
138
|
let labelMod = null;
|
|
182
|
-
|
|
183
|
-
prop.onValue((labelDescriptor) => {
|
|
139
|
+
prop.onValue(labelDescriptor => {
|
|
184
140
|
if (!labelDescriptor) {
|
|
185
141
|
if (labelMod) {
|
|
186
142
|
labelMod.remove();
|
|
@@ -188,61 +144,43 @@ class InboxThreadRowView {
|
|
|
188
144
|
}
|
|
189
145
|
} else {
|
|
190
146
|
if (!labelMod) {
|
|
191
|
-
const inboxLabelView = new
|
|
147
|
+
const inboxLabelView = new _InboxLabelView.default();
|
|
192
148
|
const el = inboxLabelView.getElement();
|
|
193
149
|
labelMod = {
|
|
194
150
|
inboxLabelView,
|
|
195
|
-
remove: el.remove.bind(el)
|
|
151
|
+
remove: el.remove.bind(el)
|
|
196
152
|
};
|
|
197
153
|
}
|
|
198
|
-
|
|
199
154
|
labelMod.inboxLabelView.updateLabelDescriptor(labelDescriptor);
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
const threadLabels = labelParentDiv.querySelectorAll(
|
|
205
|
-
'.inboxsdk__inbox_thread_row_label'
|
|
206
|
-
);
|
|
207
|
-
const insertionPoint =
|
|
208
|
-
threadLabels.length > 0
|
|
209
|
-
? threadLabels[threadLabels.length - 1].nextElementSibling
|
|
210
|
-
: labelParentDiv.firstChild;
|
|
211
|
-
|
|
212
|
-
labelParentDiv.insertBefore(
|
|
213
|
-
labelMod.inboxLabelView.getElement(),
|
|
214
|
-
insertionPoint
|
|
215
|
-
);
|
|
155
|
+
if (labelParentDiv !== labelMod.inboxLabelView.getElement().parentElement) {
|
|
156
|
+
const threadLabels = labelParentDiv.querySelectorAll('.inboxsdk__inbox_thread_row_label');
|
|
157
|
+
const insertionPoint = threadLabels.length > 0 ? threadLabels[threadLabels.length - 1].nextElementSibling : labelParentDiv.firstChild;
|
|
158
|
+
labelParentDiv.insertBefore(labelMod.inboxLabelView.getElement(), insertionPoint);
|
|
216
159
|
}
|
|
217
160
|
}
|
|
218
161
|
});
|
|
219
|
-
|
|
220
162
|
this._stopper.onEnd(() => {
|
|
221
163
|
if (labelMod) {
|
|
222
164
|
labelMod.remove();
|
|
223
165
|
}
|
|
224
166
|
});
|
|
225
167
|
}
|
|
226
|
-
|
|
227
168
|
getDateString() {
|
|
228
169
|
throw new Error('Not supported in Inbox');
|
|
229
170
|
}
|
|
230
|
-
|
|
231
|
-
getSubject(): string {
|
|
171
|
+
getSubject() {
|
|
232
172
|
if (!this._p.elements.subject) {
|
|
233
173
|
throw new Error('Failed to find subject');
|
|
234
174
|
}
|
|
235
175
|
return this._p.elements.subject.textContent;
|
|
236
176
|
}
|
|
237
|
-
|
|
238
177
|
getThreadID() {
|
|
239
|
-
throw new Error(
|
|
240
|
-
'Not supported in Inbox. Please use getThreadIDAsync() instead'
|
|
241
|
-
);
|
|
178
|
+
throw new Error('Not supported in Inbox. Please use getThreadIDAsync() instead');
|
|
242
179
|
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
180
|
+
async getThreadIDAsync() {
|
|
181
|
+
const {
|
|
182
|
+
inboxThreadId
|
|
183
|
+
} = this._p.attributes;
|
|
246
184
|
if (!inboxThreadId) {
|
|
247
185
|
throw new Error('Failed to find thread id');
|
|
248
186
|
}
|
|
@@ -251,23 +189,21 @@ class InboxThreadRowView {
|
|
|
251
189
|
// Get the inbox message id of any message in the thread, convert it to
|
|
252
190
|
// a gmail message id, and then use that id in a request
|
|
253
191
|
// to a gmail endpoint to get the id of the thread that message is in.
|
|
254
|
-
const inboxMessageId =
|
|
255
|
-
|
|
256
|
-
const gmailMessageId =
|
|
257
|
-
await this._driver.getGmailMessageIdForSyncMessageId(inboxMessageId);
|
|
258
|
-
|
|
192
|
+
const inboxMessageId = await this._driver.getInboxMessageIdForInboxThreadId(inboxThreadId);
|
|
193
|
+
const gmailMessageId = await this._driver.getGmailMessageIdForSyncMessageId(inboxMessageId);
|
|
259
194
|
return await this._driver.getThreadIdFromMessageId(gmailMessageId);
|
|
260
195
|
} else {
|
|
261
196
|
this._driver.trackThreadRowIdCall(true, inboxThreadId);
|
|
262
197
|
const m = /\d+$/.exec(inboxThreadId);
|
|
263
198
|
if (!m) throw new Error('Should not happen');
|
|
264
|
-
return new
|
|
199
|
+
return new _bignumber.default(m[0]).toString(16);
|
|
265
200
|
}
|
|
266
201
|
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
202
|
+
async getDraftID() {
|
|
203
|
+
const {
|
|
204
|
+
isOnlyDraft,
|
|
205
|
+
inboxThreadId
|
|
206
|
+
} = this._p.attributes;
|
|
271
207
|
if (isOnlyDraft && inboxThreadId) {
|
|
272
208
|
const m = /\d+$/.exec(inboxThreadId);
|
|
273
209
|
if (!m) throw new Error('Should not happen');
|
|
@@ -276,32 +212,31 @@ class InboxThreadRowView {
|
|
|
276
212
|
return null;
|
|
277
213
|
}
|
|
278
214
|
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
215
|
+
getVisibleDraftCount() {
|
|
216
|
+
const {
|
|
217
|
+
visibleDraftCount
|
|
218
|
+
} = this._p.attributes;
|
|
219
|
+
if (typeof visibleDraftCount !== 'number') throw new Error('Failed to find visible draft count');
|
|
284
220
|
return visibleDraftCount;
|
|
285
221
|
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
222
|
+
getVisibleMessageCount() {
|
|
223
|
+
const {
|
|
224
|
+
visibleMessageCount
|
|
225
|
+
} = this._p.attributes;
|
|
226
|
+
if (typeof visibleMessageCount !== 'number') throw new Error('Failed to find visible message count');
|
|
291
227
|
return visibleMessageCount;
|
|
292
228
|
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
229
|
+
getContacts() {
|
|
230
|
+
const {
|
|
231
|
+
contacts
|
|
232
|
+
} = this._p.attributes;
|
|
296
233
|
if (!Array.isArray(contacts)) throw new Error('Failed to find contacts');
|
|
297
234
|
return contacts;
|
|
298
235
|
}
|
|
299
|
-
|
|
300
|
-
replaceDate(options: Object) {
|
|
236
|
+
replaceDate(options) {
|
|
301
237
|
throw new Error('Not supported in Inbox');
|
|
302
238
|
}
|
|
303
|
-
|
|
304
|
-
replaceDraftLabel(label: Object) {
|
|
239
|
+
replaceDraftLabel(label) {
|
|
305
240
|
if (this._isDestroyed) {
|
|
306
241
|
console.warn('addLabel called on destroyed thread row'); //eslint-disable-line no-console
|
|
307
242
|
return;
|
|
@@ -309,24 +244,24 @@ class InboxThreadRowView {
|
|
|
309
244
|
|
|
310
245
|
// We don't want to replace draft labels on messages without drafts
|
|
311
246
|
if (this._p.attributes.visibleDraftCount === 0) return;
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
const prop
|
|
318
|
-
.takeUntilBy(this._stopper)
|
|
319
|
-
.toProperty();
|
|
247
|
+
const {
|
|
248
|
+
recipientParent,
|
|
249
|
+
messageCountParent
|
|
250
|
+
} = this._p.elements;
|
|
251
|
+
if (!recipientParent || !messageCountParent) throw new Error('Could not find necessary parent elements');
|
|
252
|
+
const prop = (0, _kefirCast.default)(_kefir.default, label).takeUntilBy(this._stopper).toProperty();
|
|
320
253
|
let labelMod = null;
|
|
321
|
-
|
|
322
|
-
prop.onValue((labelDescriptor) => {
|
|
254
|
+
prop.onValue(labelDescriptor => {
|
|
323
255
|
if (!labelDescriptor) {
|
|
324
256
|
if (labelMod) {
|
|
325
257
|
labelMod.remove();
|
|
326
258
|
labelMod = null;
|
|
327
259
|
}
|
|
328
260
|
} else {
|
|
329
|
-
const {
|
|
261
|
+
const {
|
|
262
|
+
text,
|
|
263
|
+
count
|
|
264
|
+
} = labelDescriptor;
|
|
330
265
|
if (!labelMod) {
|
|
331
266
|
labelMod = {
|
|
332
267
|
countEl: document.createElement('span'),
|
|
@@ -334,68 +269,37 @@ class InboxThreadRowView {
|
|
|
334
269
|
remove() {
|
|
335
270
|
this.countEl.remove();
|
|
336
271
|
this.draftEl.remove();
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
messageCountParent.classList.remove(
|
|
342
|
-
'inboxsdk__thread_row_draft_count_replaced'
|
|
343
|
-
);
|
|
344
|
-
|
|
345
|
-
if (
|
|
346
|
-
!messageCountParent.querySelector(
|
|
347
|
-
'span:not(.inboxsdk__thread_row_custom_draft_count)'
|
|
348
|
-
)
|
|
349
|
-
) {
|
|
350
|
-
((messageCountParent: any): HTMLElement).style.display = 'none';
|
|
272
|
+
recipientParent.classList.remove('inboxsdk__thread_row_draft_label_replaced');
|
|
273
|
+
messageCountParent.classList.remove('inboxsdk__thread_row_draft_count_replaced');
|
|
274
|
+
if (!messageCountParent.querySelector('span:not(.inboxsdk__thread_row_custom_draft_count)')) {
|
|
275
|
+
messageCountParent.style.display = 'none';
|
|
351
276
|
}
|
|
352
|
-
}
|
|
277
|
+
}
|
|
353
278
|
};
|
|
354
|
-
|
|
355
|
-
labelMod.
|
|
356
|
-
|
|
357
|
-
labelMod.countEl.className =
|
|
358
|
-
'inboxsdk__thread_row_custom_draft_count';
|
|
359
|
-
|
|
360
|
-
recipientParent.classList.add(
|
|
361
|
-
'inboxsdk__thread_row_draft_label_replaced'
|
|
362
|
-
);
|
|
279
|
+
labelMod.draftEl.className = 'inboxsdk__thread_row_custom_draft_label';
|
|
280
|
+
labelMod.countEl.className = 'inboxsdk__thread_row_custom_draft_count';
|
|
281
|
+
recipientParent.classList.add('inboxsdk__thread_row_draft_label_replaced');
|
|
363
282
|
}
|
|
364
|
-
|
|
365
283
|
labelMod.draftEl.textContent = text;
|
|
366
|
-
|
|
367
284
|
if (recipientParent !== labelMod.draftEl.parentElement) {
|
|
368
285
|
recipientParent.appendChild(labelMod.draftEl);
|
|
369
286
|
}
|
|
370
|
-
|
|
371
|
-
const hasExistingCountEl = messageCountParent.querySelector(
|
|
372
|
-
'span:not(.inboxsdk__thread_row_custom_draft_count)'
|
|
373
|
-
);
|
|
374
|
-
|
|
287
|
+
const hasExistingCountEl = messageCountParent.querySelector('span:not(.inboxsdk__thread_row_custom_draft_count)');
|
|
375
288
|
if (count && count > 1) {
|
|
376
|
-
messageCountParent.classList.add(
|
|
377
|
-
|
|
378
|
-
);
|
|
379
|
-
((messageCountParent: any): HTMLElement).style.display = 'inline';
|
|
380
|
-
|
|
381
|
-
labelMod.countEl.innerHTML = hasExistingCountEl
|
|
382
|
-
? autoHtml`(${count})`
|
|
383
|
-
: autoHtml` (${count})`;
|
|
384
|
-
|
|
289
|
+
messageCountParent.classList.add('inboxsdk__thread_row_draft_count_replaced');
|
|
290
|
+
messageCountParent.style.display = 'inline';
|
|
291
|
+
labelMod.countEl.innerHTML = hasExistingCountEl ? (0, _autoHtml.default)`(${count})` : (0, _autoHtml.default)` (${count})`;
|
|
385
292
|
if (messageCountParent !== labelMod.countEl.parentElement) {
|
|
386
293
|
messageCountParent.appendChild(labelMod.countEl);
|
|
387
294
|
}
|
|
388
295
|
} else {
|
|
389
|
-
messageCountParent.classList.remove(
|
|
390
|
-
'inboxsdk__thread_row_draft_count_replaced'
|
|
391
|
-
);
|
|
296
|
+
messageCountParent.classList.remove('inboxsdk__thread_row_draft_count_replaced');
|
|
392
297
|
if (!hasExistingCountEl) {
|
|
393
|
-
|
|
298
|
+
messageCountParent.style.display = 'none';
|
|
394
299
|
}
|
|
395
300
|
labelMod.countEl.remove();
|
|
396
301
|
}
|
|
397
302
|
}
|
|
398
|
-
|
|
399
303
|
this._stopper.onEnd(() => {
|
|
400
304
|
if (labelMod) {
|
|
401
305
|
labelMod.remove();
|
|
@@ -403,11 +307,10 @@ class InboxThreadRowView {
|
|
|
403
307
|
});
|
|
404
308
|
});
|
|
405
309
|
}
|
|
406
|
-
|
|
407
310
|
destroy() {
|
|
408
311
|
this._isDestroyed = true;
|
|
409
312
|
this._eventStream.end();
|
|
410
313
|
}
|
|
411
314
|
}
|
|
412
|
-
|
|
413
|
-
|
|
315
|
+
var _default = (0, _ud.defn)(module, InboxThreadRowView);
|
|
316
|
+
exports.default = _default;
|